Use when the user wants to execute a written implementation plan or implement directly from a spec — generates a task graph, recommends an execution model, and dispatches with quality overrides. Invoked standalone (/implement <path>) or via orchestrate (/orchestrate (/implement <plan>)).
Usage: /implement [path] [--model single|subagent|parallel] [--auto] [--run-id <id>]
Arguments: path Plan or spec file to implement. If omitted, uses the active orchestrate plan or spec from tmp/orchestrate-state.md --model MODEL Skip the execution model picker and dispatch directly: single = single-agent in current context subagent = subagent-per-task parallel = parallel helper agents (clear-context is interactive-only — use the picker) --auto Non-interactive dispatch: narrows to {single, parallel}. Excludes options [2] subagent-per-task and [3] clear-context. Skips refactor-unit pre-check. --run-id <id> Run-id threaded to dispatched sub-agents via override preamble. --help Show this help
Examples: /implement # use orchestrate hint file /implement docs/plans/2026-04-06-foo-plan.md # explicit plan /implement docs/specs/2026-04-06-bar.md # implement directly from spec /implement docs/plans/baz.md --model parallel # skip the picker </help-text>
Parse arguments: if --help is present, output ONLY the text inside <help-text> tags above verbatim and exit. If --model is present, validate its value against the set {single, subagent, parallel} — reject clear-context with the exact error from Edge Case 7 below. If is present, suppress the Step C spec recommendation prompt for this invocation only (see Step C). If is present, set auto mode active for this invocation. is incompatible with (Edge Case 7 already covers this). + is valid — overrides the auto algorithm's choice. If is present, store the run-id for threading to dispatched sub-agents.
--skip-plan-recommendation--auto--auto--model clear-context--auto--model--model--run-id <id>Execute a written implementation plan or implement directly from a spec. /implement owns plan/spec detection, task-graph construction, execution-model recommendation, the 4-option dispatch picker, and the refactor-unit branch. It is stateless with respect to tmp/orchestrate-state.md — it READS the hint file in Step A but NEVER writes it. Orchestrate is the sole writer of the hint file.
path argument was provided → use it. Go to Step A.5.tmp/orchestrate-state.md. If the plan: field is non-empty → use it. Go to Step A.5.tmp/orchestrate-state.md. If the spec: field is non-empty → use it. Go to Step A.5.No path argument and no active plan/spec in orchestrate hint file. Specify a path or run /orchestrate first.
File not found: <path> and exit (Edge Case 2). Exception: if path came from the hint file plan: field and the file does not exist, fall through to step 3 (hint file spec: field) before erroring (Edge Case 3).The order positional → plan → spec matters. When both plan: and spec: are populated (the normal case after /writing-plans ran on a spec), prefer the more-recently-written plan.
docs/superpowers/plans/** OR docs/plans/** → classify as plan, go to Step C.docs/superpowers/specs/** OR docs/specs/** → classify as spec, go to Step C.tmp/foo.md where location is ambiguous): grep the file for content markers.
## Phase, ## Task, ### Step## Architecture, ## Components, ## Data Flow### Step hit alone is insufficient.Cannot classify <path> as plan or spec. Location is ambiguous and no marker match. and exit.Location-first detection covers >95% of cases. The content fallback only fires for ad-hoc files in tmp/.
Proceed directly to Step D with the plan path.
Run the Spec Recommendation Algorithm. This is skip-by-default: most specs do not need a separate plan. Only recommend /writing-plans if at least one of three hard signals fires:
| Hard signal | Detection |
|---|---|
| Multi-component spec | Spec mentions ≥3 distinct files/modules to create or modify (scan ## Files Modified / Created tables or "Create:" bullets) |
| Cross-cutting concern | Spec mentions database migration AND code change AND test change in the same document |
| Explicit phase markers | Spec already contains ## Phase 1, ## Phase 2 (treat as proto-plan) |
If none of the signals fire → silently proceed to Step D treating the spec as the implementation source.
If at least one signal fires → print this prompt and await user input:
This spec has [signal description]. A plan would help you sequence the work.
[1] Recommended: write a plan first
/writing-plans <spec-path>
[2] Skip the plan, implement directly from the spec
/implement <spec-path> --skip-plan-recommendation
Pick one to proceed.
Then exit. Do not auto-dispatch either option.
--skip-plan-recommendation suppression: If the flag was passed on the current invocation, skip the hard-signal check entirely and proceed directly to Step D. The flag is a one-shot suppression; it is not persisted.
--auto Mode Pre-checkIf --auto is active:
--auto.Before building the task graph, perform this refactor-unit check (moved verbatim from the previous orchestrate/SKILL.md Step 5):
docs/monorepo-strategy/roadmap.md OR docs/layer-architecture/roadmap.md with unchecked items.** markers in the checkbox line, not the full rationale). The feature name is derived from:
-plan.md/.md suffix), ORfeature: field when /implement was invoked with no positional arg (i.e., via orchestrate)references/refactor-execution.md and execute directly following its Pre-flight → File Operations → Verification sequence.tmp/checklists/index.md if it exists, filter for rows where Phase is coding or both AND Recommended Skill contains refactor-to-monorepo or refactor-to-layers. Surface any matching entries to the user before beginning execution. Note: the refactor-to-layers filter branch currently returns empty (no checklist crystallization section) — do not warn on an empty result from that branch.--model flag handling: The --model flag is ignored on the refactor-unit path because refactor execution is inherently single-agent. If --model was explicitly passed, print warning: --model ignored for refactor-unit execution and continue.Load references/implementation-step.md (which transitively loads references/task-graph.md) and follow its logic:
references/task-graph.md).references/implementation-step.md Execution Model Recommendation section).--model flag was provided → short-circuit the picker, dispatch directly with that model. The preamble block in implementation-step.md Override Dispatch section is still prepended.
3.5. If --auto flag is active (and --model is NOT provided):
Use the narrowed 2-option algorithm:
IF parallelism_ratio >= 0.35 → dispatch option [4]: single-agent + 1 parallel helper
ELSE → dispatch option [1]: single-agent
Options [2] subagent-per-task and [3] clear-context are excluded.
Skip the picker presentation — dispatch directly.references/implementation-step.md:
[1] Single-agent <(recommended) if applicable>
[2] Subagent-per-task <(recommended) if applicable>
[3] Clear context + single-agent
[4] Single-agent + one parallel helper <(recommended) if applicable>
tmp/implement-exit-status.md with the following exact schema (plain key-value, one per line, NOT YAML frontmatter):
early_exit: clear_context
exit_reason: user picked option [3] at execution model picker
exit_time: <ISO-8601 timestamp>
plan_or_spec: <absolute path that /implement was invoked with>
early_exit is the required discriminator. Orchestrate matches on the literal value clear_context. The other three fields are informational.── Next ────────────────────────────────────────
/clear → /implement <path> --model single
────────────────────────────────────────────────
The --model single is explicit so that on re-entry after /clear, the picker is bypassed regardless of whether the user edits the command before pasting.references/implementation-step.md Override Dispatch section.When --model is not passed and the picker is not presented (e.g., /implement invoked standalone without arguments, no picker interaction occurs), the default execution model is single (single-agent in current context). Override explicitly with --model single|subagent|parallel.
When /implement is invoked via orchestrate (breadcrumb /orchestrate (/implement <plan>)), orchestrate resumes control after /implement returns. Orchestrate's post-/implement logic (defined in spec 04) runs auto-commit verification, writes step: 6 to the hint file, and emits the Step 5 → Step 6 breadcrumb — BUT ONLY on normal completion. Option [3] clear-context is an early exit before any implementation has run, and orchestrate must NOT run post-/implement logic in that case.
/implement signals early-exit to orchestrate via the marker file tmp/implement-exit-status.md described in Step D.5 above.
Marker file lifecycle (canonical definition — spec 04 references this section):
tmp/implement-exit-status.md (plain file, not YAML frontmatter)./implement ONLY, and ONLY on Option [3] clear-context exit./implement logic (spec 04 wires this in)./implement resume.--model single|subagent|parallel dispatch returning control after implementation — normal resume.refactor-execution.md completes — normal resume.early_exit: field is the sole load-bearing discriminator. Orchestrate MUST NOT ignore the marker because of unknown or missing informational fields.Only orchestrate writes the hint file. /implement is stateless with respect to tmp/orchestrate-state.md:
/implement is responsible for advancing the step: field after /implement returns.path arg and hint file populated — path arg wins (Step A.1).path arg points to a nonexistent file — Print File not found: <path> and exit.plan: field points to nonexistent file but spec: field is valid — Fall through to spec: (Step A.3). Do not error on plan-not-found if spec is available.## Phase 1 but only one phase — Hard signal triggers, recommendation prompt shows. (Refine the threshold later if this is too aggressive.)Plan contains no actionable tasks. Nothing to implement. and exit.--model parallel requested but plan has no parallelizable tasks — Print --model parallel requested but plan tasks have linear dependencies; falling back to subagent-per-task. and continue with subagent-per-task dispatch.--model clear-context passed — NOT a valid value. Reject with: --model clear-context is not supported; clear-context is dispatch-only. Omit --model and choose option [3] from the picker. and exit.--skip-plan-recommendation once per invocation; not persisted.tmp/ — Location detection ambiguous; content fallback decides. If still ambiguous, error per Step B.4./writing-plans mid-orchestrate, then /implement invoked standalone with no path — Hint file's plan: field has the freshly-written plan. Step A picks it up. Works./writing-plans <spec> first; /implement is not a hard gate.step: 5 after standalone /implement completes from the clear-context path — Expected. /implement is stateless. User re-invokes /orchestrate to resume; Fast-Path Detection advances to Step 6 automatically via commit detection.