# superpowers Background subagents and explicit workflow discipline for Pi. ## Activation ```bash pi -e ./extensions/superpowers/index.ts pi -e ./extensions/superpowers/index.ts --superpowers ``` `/superpowers` toggles strict upstream-style workflow discipline for the current session. `--superpowers` starts with that mode already enabled. Strict mode means future non-trivial coding turns must pick and follow the smallest applicable Superpowers workflow, then verify before claiming completion. Prompts/skills remain installed and manually callable when off. Off only disables automatic methodology pressure. No always-on activation unless you opt in. No hidden agents. ## Commands ```text /superpowers # toggle workflow discipline /superpowers on /superpowers off /superpowers run [args] [--share] /superpowers open /superpowers branch /superpowers return /superpowers abort /superpowers status [id] # workflow aliases → background workers /superpowers design # brainstorming /superpowers plan # writing-plans /superpowers execute # executing-plans /superpowers parallel # dispatching-parallel-agents /superpowers review # requesting-code-review /superpowers deslop # requesting-code-review, focused on slop /superpowers compress # requesting-code-review, focused on DRY/design compression /superpowers debug # systematic-debugging /superpowers git # using-git-worktrees /superpowers meta # writing-skills /superpowers verify # verification-before-completion # visual brainstorming companion /superpowers visual start /superpowers status /superpowers visual stop ``` ## Prompt frontmatter Agents are normal Pi prompt templates (`prompts/*.md`). Supported frontmatter: ```yaml description: Run a focused code review argument-hint: "" tools: [read, bash, grep, find, ls] extensions: ["*", "-superpowers"] thinking: medium model: provider/model accent: syntaxKeyword ``` | Field | Purpose | | --------------- | ------------------------------------------------------------------ | | `description` | Shown in autocomplete and status | | `argument-hint` | Autocomplete hint for arguments | | `tools` | Tool allowlist for the subagent | | `extensions` | Extension filter (`*` = all, `-name` = exclude) | | `thinking` | Thinking level: `off`, `minimal`, `low`, `medium`, `high`, `xhigh` | | `model` | Override model: `provider/id` | | `accent` | Theme color for footer/widget/status rendering (see below) | ### `accent` — workflow color Controls the visual identity of a worker in the footer, widget, and status output. Value is a `ThemeColor` name from Pi's theme system. The color resolves to whatever the active theme defines for that semantic role, so it adapts to light/dark themes automatically. **Recommended accents per workflow:** | Workflow | Accent | Visual feel | | -------------------------------- | ---------------- | ----------------------- | | `brainstorming` | `accent` | purple — creative | | `writing-plans` | `dim` | quiet — preparation | | `executing-plans` | `success` | green — building | | `test-driven-development` | `syntaxString` | green tint — test-first | | `systematic-debugging` | `warning` | yellow — caution | | `requesting-code-review` | `syntaxKeyword` | amber — critical eye | | `receiving-code-review` | `syntaxFunction` | blue — integration | | `verification-before-completion` | `toolTitle` | cyan — verification | | `dispatching-parallel-agents` | `syntaxVariable` | distinct — multi-agent | | `using-git-worktrees` | `muted` | gray — infrastructure | | `writing-skills` | `syntaxFunction` | blue — meta-work | **Full `ThemeColor` palette** (51 names, all valid for `accent`): ```text # Semantic roles — the useful ones for accent accent # primary brand color (purple in most themes) success # positive / done warning # caution / attention error # failure / blocker muted # secondary / quiet dim # lowest prominence text # default text color # Syntax highlighting — good for workflow identity syntaxKeyword # amber/orange — keywords, review, attention syntaxFunction # blue — functions, integration syntaxVariable # teal — variables, parallel syntaxString # green — strings, tests syntaxNumber # numeric literals syntaxType # type names syntaxOperator # operators syntaxPunctuation # brackets, commas syntaxComment # comments # Markdown rendering mdHeading # heading color mdLink # link color mdCode # inline code mdCodeBlock # code block text mdCodeBlockBorder # code block border mdListBullet # bullet points # Tool output toolTitle # tool name color (cyan-ish) toolOutput # tool result text toolDiffAdded # diff + lines toolDiffRemoved # diff - lines toolDiffContext # diff context lines # Thinking levels thinkingText # assistant thinking text thinkingOff # off state thinkingMinimal # minimal thinkingLow # low thinkingMedium # medium thinkingHigh # high thinkingXhigh # extra-high # Message types userMessageText # user message customMessageText # extension/custom message customMessageLabel # custom message label # Borders border # default border borderAccent # accent border borderMuted # muted border # Other bashMode # bash mode indicator selectedBg # (ThemeBg, not ThemeColor — for backgrounds) ``` Without an `accent` field, workers default to the extension's accent color (amber `syntaxKeyword` for review, etc.). ## Bundled workflows ```text /using-superpowers /brainstorming /writing-plans /executing-plans /dispatching-parallel-agents /subagent-driven-development /requesting-code-review /receiving-code-review /test-driven-development /systematic-debugging /verification-before-completion /using-git-worktrees /finishing-a-development-branch /writing-skills ``` `skills/*/SKILL.md` holds the methodology. `prompts/*.md` are normal Pi slash prompt wrappers with the full skill inlined — no runtime skill discovery needed. Same prompts work as background workers: ```text /superpowers run systematic-debugging flaky test /superpowers run requesting-code-review current diff ``` ## Worktree isolation By default, `/superpowers run` and workflow aliases create an isolated worktree/workspace for the subagent. This prevents filesystem collisions between concurrent tasks and keeps the parent working copy clean. | Repo type | Isolation mechanism | Path | | ----------------------- | ------------------- | --------------------- | | Git standard checkout | `git worktree add` | `.git/wt-` | | Git bare (co/wt layout) | `git worktree add` | `/` | | Jujutsu (jj) | `jj workspace add` | `.jj/workspaces/` | | No repo detected | in-place fallback | — | Use `--share` to run the subagent in the current working copy instead: ```text /superpowers run implement fix-bug --share ``` Isolation is skipped when: - `--share` is passed explicitly - No supported repo is detected - Worktree/workspace creation fails (falls back to in-place with a notice) On abort, isolated worktrees are cleaned up automatically. On successful completion, they are left for inspection — remove them manually or with `git worktree remove` / `jj workspace forget`. ## Status display The footer and widget use compact, scannable formatting: **Footer** (status bar): ```text on # strict mode active on 1↑ # 1 worker running on eye # visual brainstorming active 1↑ # worker running, strict mode off ``` **Widget** (above editor, when workers run): ```text 2 workers running ▶ sp-5 review 12s · 5 tools ▶ sp-6 debug 1m3s · 8 tools ``` **Status icons:** ```text ▶ running ✓ done ⊘ aborted ✗ error ⤴ branched ``` **Agent short names:** ```text review fix design plan exec debug verify tdd parallel git skill finish sp sub ``` `/superpowers status` lists all tasks. `/superpowers status ` shows full details. ## State Runtime state lives in the platform state dir, per project: ```text Linux: ${XDG_STATE_HOME:-~/.local/state}/pi/superpowers// macOS: ~/Library/Application Support/pi/superpowers// Windows: %LOCALAPPDATA%\\pi\\superpowers\\\\ ``` Contents: ```text tasks.json # all tasks (running, done, aborted, error, branched) runs.jsonl # append-only audit log: one JSON line per completed task sessions/ # subagent session files visual/ # visual brainstorming state (ephemeral) ``` Stale tasks (orphaned when the parent Pi session dies) are reaped on next session start. Project/VCS state is only written by workflows that intentionally create docs/specs, e.g. `docs/superpowers/specs/...`. ## Architecture ```text run = background SDK agent open = inspect checkpoint/log branch = stop/promote into ctx.newSession({ parentSession }) return = ctx.switchSession(parent) ``` No Pi subprocesses. Uses Pi SDK sessions/resource loading directly. No Pi subprocesses. Uses Pi SDK sessions/resource loading directly.