Implement
Claude Code plugin: skills, commands, and tooling for SpecScore-driven specification authoring (specstudio:ideate, specstudio:specify, …)
npx -y skills add specscore/specstudio-skills --skill implementAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Turns an approved SpecScore Plan into focused, AC-traceable source-code changes by dispatching one subagent per task in parallel batches computed from the Plan's **Depends-On:** dependency graph. Fires the `implementation.pre_commit` / `implementation.pre_push` reviewer gates at its checkpoints, so per-batch approval is gate-config-driven (a `type: human` reviewer is the human checkpoint; a `auto-approve` gate commits autonomously). Applies publication policy at approved implementation milestones; provides a Verifies: commit-message trailer template. Also accepts a Feature directly (no Plan) or an Idea directly (no Feature or Plan) for single-pass conversational implementation. Trigger: "implement", "/implement", "implement this plan", "specstudio:implement", or event `plan.approved`.
SKILL.md
49.8 KB, ~11.6k tokens by cl100k_base, as published. Nobody here has run it
Implement
Turn an approved SpecScore Plan, Feature, or Idea into AC-traceable source-code changes. Plan-sourced mode uses parallel subagent dispatch; each commit is gated by the implementation.pre_commit reviewer gate and each push by implementation.pre_push, so per-batch approval is gate-config-driven rather than a hardcoded step (a type: human reviewer is the human checkpoint; a auto-approve/deterministic-only gate releases autonomously). Feature-sourced and Idea-sourced modes operate as a single-pass conversation. After the commit gate releases, the skill applies the shared publication policy at the implementation milestone; downstream verification still requires the relevant Feature or implementation commits to exist in git history.
Hard Gate
<HARD-GATE> Do NOT invoke `specstudio:verify`, `writing-plans`, `frontend-design`, `mcp-builder`, or ANY downstream skill until ALL FIVE conditions hold for **every batch** produced in the current invocation: 1. Every subagent in the batch returned a terminal status (`DONE`, `DONE_WITH_CONCERNS`, or `BLOCKED` with user decision); no subagent is still `NEEDS_CONTEXT`. 2. The consolidated staged diff for the batch is lint-clean (`specscore spec lint` exits zero against the project, including any Plan-file changes staged in stub mode). 3. The conflict-detection check has passed (no line-overlap between sibling subagents' staged diffs) OR the user has explicitly approved a manual conflict-resolution path. 4. The batch's `implementation.pre_commit` gate released (`Approved`) before the commit. Approval is **gate-config-driven**, not hardcoded: a `auto-approve`/`deterministic`-only gate releases autonomously (no human prompt); a gate with a `type: human` reviewer stops for that human before committing. On `Issues Found` the commit is blocked and the gate's findings are surfaced. 5. Publication policy for the approved implementation milestone has been resolved, disclosed, and applied; and when a push/promote is attempted, its `implementation.pre_push` gate released (`Approved`) first. If the allowed actions did not create a commit, the user has committed the approved set manually before the next batch or downstream verification. The skill MUST NOT advance to the next batch while the working tree still has the prior batch staged but uncommitted.The only skill invoked after specstudio:implement is specstudio:verify (or — while verify is unshipped — a hand-back to the user with that recommendation).
</HARD-GATE>
When to Use
- Plan-sourced: An approved Plan at
spec/plans/<slug>.mdis ready for implementation (**Status:**isApprovedorExecuting). - Plan-sourced: The event
plan.approvedhas fired and the user has confirmed they want to implement. - Plan-sourced: The user wants to resume an in-flight Plan after a prior
implementsession (Plan Status:Executing). - Feature-sourced: A Feature at
spec/features/<slug>/README.mdhas**Status:** ∈ {Approved, Implementing, Stable}and no Plan exists for it. The user wants to implement directly against the Feature's ACs without writing a Plan first. - Idea-sourced: An Idea at
spec/ideas/<slug>.mdhas**Status:** Approvedand no Feature or Plan exists for it. The user wants to implement directly against the Idea's Recommended Direction without writing a Feature or Plan first.
Refuse and redirect when:
- The Plan's
**Status:**isDraft,In Review, orImplemented→ tell the user to runspecstudio:plan(or that there's nothing to implement). - The Plan's
**Source Feature:**has regressed toDraftorIn Review→ stop, surface the spec drift, recommend re-approving the Feature viaspecstudio:specifyor reverting. - The Feature's
**Status:**isDraftorIn Review→ tell the user to runspecstudio:specifyfirst. - The Idea's
**Status:**isDraftorIn Review→ tell the user to runspecstudio:ideatefirst. - The user asks the skill to commit or push before the consolidated diff is lint-clean and conflict-checked and its gate has released → refuse; the commit is available only after the
implementation.pre_commitgate releases, and the push only after theimplementation.pre_pushgate releases (and publication-policy branch-safety passes).
Pre-Flight
- Input resolution. Resolve the input to one of three entry modes, checked in priority order:
- (a) Plan-sourced.
spec/plans/<slug>.mdwith**Status:** ∈ {Approved, Executing}. Proceed with full batch-dispatch workflow. - (b) Feature-sourced.
spec/features/<slug>/README.mdwith**Status:** ∈ {Approved, Implementing, Stable}and no Plan exists for this Feature. Proceed in single-pass mode (see Entry Modes below). - (c) Idea-sourced.
spec/ideas/<slug>.mdwith**Status:** Approvedand no Feature or Plan exists for this Idea. Proceed in single-pass mode (see Entry Modes below). Refuse if no artifact matches or Status is outside the accepted set for its type.
- (a) Plan-sourced.
- Source-Feature validity. Read the Plan's
**Source Feature:**. Confirm the referenced Feature is atspec/features/<feature-slug>/README.mdwith**Status:** ∈ {Approved, Implementing, Stable}. On regression to Draft/In Review, stop and surface the drift. Additionally confirm the Feature exists at git HEAD viagit cat-file -e HEAD:spec/features/<feature-slug>/README.md. If the Feature exists only in the working tree (uncommitted), refuse to dispatch and instruct the user to commit it first — theVerifies:trailer must reference a Feature that exists in git history. - Parse the Plan. Use
specscoreCLI's Plan parser (do not re-implement). Surface: per-task**Verifies:**,**Status:**,**Depends-On:**, body (prose forfull, placeholder<!-- implement: pending -->forstub). Parse failures stop the skill with the CLI's lint-rule citation. - Git-log cross-check. Run
git log --grep='^Verifies:'on the current branch. For each task: if Plan says**Status:** completebut no commit references the task's ACs, surface the divergence as a warning. If Plan says**Status:** planningbut a commit DOES reference its ACs, offer to update the Status (with user confirmation) before dispatching. Git log is authoritative; Plan Status is the at-a-glance signal. - Compute next batch. Topological reduction of the dependency graph: batch = tasks where all
**Depends-On:**predecessors are**Status:** completeAND own**Status:** planning. As these tasks become batch-eligible they transitionplanning → queued. Exclude tasks already inqueued,in_progress,complete, orblockedstatus. - Pre-existing-Plan catch-up. If the Plan pre-dates the plan-Feature revision (no
**Status:**fields), initialize: scan git log forVerifies:trailers; mark matched-AC taskscomplete, restplanning. Save these initializations as a Plan-file edit that will land in the first batch's staging.
Entry Modes
Plan-sourced (default)
The skill resolves a Plan, parses its tasks and dependency graph, dispatches subagents in batches, and gates each batch's commit on the implementation.pre_commit reviewer gate (and each push on implementation.pre_push) — so whether a human is asked per batch is gate config, not hardcoded. Verifies: trailers reference Feature AC IDs (e.g., Verifies: <feature-slug>#ac:<ac-slug>). Per-task Status writes track progress on the Plan file. The full Checklist below applies.
Feature-sourced (single-pass)
No Plan exists. The skill resolves a Feature directly. Instead of batch dispatch, the skill operates as a single-pass conversation: the user describes the change, the skill implements and stages it. There are no subagents, no batch dispatch, no task-status writes, no stub/full posture distinction.
- Pre-flight: Step 1(b) resolves the Feature. Step 2 validates the Feature's Status. Steps 3–6 (Plan parsing, git-log cross-check, batch computation, catch-up) are skipped.
- Implementation: The skill implements the user's described change conversationally, staging via
git add. - Verifies: trailer: Uses Feature AC IDs:
Verifies: <feature-slug>#ac:<ac-slug>, ...listing every AC addressed by the staged change. - Lint and self-review:
specscore spec lintstill runs against staged changes. - Commit/push gates: The consolidated staged diff is gated by
implementation.pre_commitbefore commit andimplementation.pre_pushbefore push, evaluated via the reviewer-gates loader + runner (same as Plan-sourced steps 13–14). Atype: humanreviewer on the gate is the human-approval checkpoint; aauto-approve/deterministic-only gate releases autonomously. - Promotion: On completion, hand off to
specstudio:verify(or hand-back if unshipped), same as Plan-sourced.
Idea-sourced (single-pass)
No Feature or Plan exists. The skill resolves an Idea directly. Same single-pass conversation model as Feature-sourced, with two differences:
- Source of truth: The Idea's
## Recommended Directionsection (instead of Feature ACs). - Verifies: trailer: Uses
Verifies: idea:<slug>(instead of Feature AC IDs).
All other single-pass behavior (no subagents, no batch dispatch, no task-status writes, lint, the implementation.pre_commit/pre_push gates, publication milestone) is identical to Feature-sourced.
Cross-Repo Master-Plan Execution
When the supplied Plan is a master plan — sourced **Source:** idea:<slug> with tasks that carry **Sub-Plan:** <plan-ref> delegation refs (and no **Verifies:**) — implement acts as the outer coordinator over per-repo sub-plans. It does not reimplement intra-repo execution; each sub-plan runs through the ordinary single-repo flow. This implements skills/implement's master-plan-detection, subplan-dispatch-via-existing-engine, cross-repo-ordering-honored, cross-repo-ref-resolution-at-execution, and integration-and-tests-phase REQs.
- Detect. Recognize a master plan by its shape (idea source +
**Sub-Plan:**tasks). Treat each master task as a delegation, not as source code to edit. - Order. Compute the cross-sub-plan order from the master's task
**Depends-On:**graph. A sub-plan whose master task depends on another MUST NOT start until that predecessor sub-plan reaches terminal success — this is how the CLI/bootstrap sub-plan is forced to land first. - Resolve. Resolve each
**Sub-Plan:** <repo-slug>:<plan-slug>reference to a sibling repo at execution time (the sibling-repo detection used by destination resolution). On an unresolvable reference, surface it to the user and halt that branch — never silently skip it. - Dispatch. Run the referenced sub-plan via the ordinary per-sub-plan
implementflow (batch computation, subagent dispatch, conflict detection, per-batch user-approval gate) inside the sub-plan's own repo. Do not bypass or duplicate that engine. - Integrate. After all sub-plans reach terminal success, run the master's final integration-and-tests task (last in
**Depends-On:**) — the cross-repo build/test that proves the repos work together. The master plan is incomplete until it passes; its failure surfaces as a blocked task like any other.
Checklist (per invocation)
Create a task for each and complete in order:
- Pre-flight (steps above).
- If no executable batch (all tasks complete or blocked) → re-run
specscore spec lint --fixso the Plan's execution-band**Status:**is derived from the task-status rollup, then transition tospecstudio:verify(or hand-back), stop. - Dispatch the batch. For each task in the next executable batch (cap at 5 concurrent — see Max-Parallel below), dispatch one subagent via the Agent tool with
subagent_type: general-purpose. Construct an isolated prompt per posture (see Subagent Contract below). When the batch has > 5 tasks, queue the rest; dispatch each queued task as a slot frees. - Stage Status writes.
- 4a. Task Status. As each subagent is dispatched, transition that task's
**Status:** queued → in_progresson the Plan file. Stage viagit add. (Infullmode this is the only Plan-file change; instubmode it will be joined by the post-return writeback.) - 4b. Plan body-metadata Status (lint-derived, not hand-set). The Plan's execution-band
**Status:**(Executing/Blocked/Implemented/Failed) is derived byspecscore spec lint --fixfrom the rollup of task statuses (the SpecScore status-vocabularyplan-executing-deriveddivergence). The skill MUST NOT hand-write the band. Once the first task is markedin_progress(4a) and lint runs (step 9), the band is derived toExecutingautomatically; staging the task-status edit is sufficient.
- 4a. Task Status. As each subagent is dispatched, transition that task's
- Wait for terminal returns. Each subagent returns one of
DONE/DONE_WITH_CONCERNS/NEEDS_CONTEXT/BLOCKED.NEEDS_CONTEXT→ re-dispatch that specific subagent with augmented context (sibling subagents unaffected).BLOCKED→ surface the cited cause to the user, do NOT silently retry. - Update Status fields.
DONE/DONE_WITH_CONCERNS→**Status:** complete.BLOCKED(with user decision to defer) →**Status:** blocked. Stage all Plan-file edits. - Stub-mode writeback (only when
**Mode:** stub). For eachDONE/DONE_WITH_CONCERNStask, replace the placeholder body<!-- implement: pending -->with the subagent's SHA-free 1–2 sentence "what landed" summary. Stage viagit addas part of the same staging set as the code changes. - Conflict detection. Run
git diff --staged. Detect line-overlap between sibling subagents' changes on the same file. On conflict: surface to user with file paths and line ranges; offer three resolutions (rewrite Plan with explicit**Depends-On:**, manualgit restore --staged+ re-run, abort). On user choice of rewrite-Plan or abort: unstage all batch changes, revert Statuses, stop. - Lint. Run
specscore spec lint. On failure (typically Plan-file edits the skill produced), runspecscore spec lint --fixexactly once, re-lint. On persistent failure: unstage Plan-file changes (git restore --staged spec/plans/<slug>.md), surface violations with rule IDs, stop the batch. - Inline self-review. Scan staged Plan-file changes for: (a) Status transitions violating the state machine (e.g.,
complete → in_progresswithout user action), (b) writeback bodies still containing placeholder tokens (<!-- implement: pending -->,TBD,TODO), (c) Status values outside the canonical lifecycle set. Findings stop the batch. - Emit
implement.batch-started(already done on step 3 — confirm payload was emitted: Plan slug, batch number, task numbers, dispatched count). - Present consolidated diff. User-facing message contains: per-task status summary (including any
DONE_WITH_CONCERNSconcerns orBLOCKEDreports), the staged diff (or per-file summary if very large), and the proposed commit-message template with mandatoryVerifies:trailer listing every AC ID covered by successful tasks (DONE / DONE_WITH_CONCERNS only; BLOCKED tasks' ACs NOT included). This consolidated diff is the artifact theimplementation.pre_commitgate (step 13) reviews; when that gate includes atype: humanreviewer the message also carries the explicit approval instruction the human responds to (when the gate isauto-approve/deterministic-only, no approval prompt is needed). Also state that publication policy will be resolved at the checkpoint and may leave the change unstaged, stage it, commit it, or commit and push it. implementation.pre_commitgate (before the commit). Approval is gate-config-driven — the skill carries no hardcoded per-batch user-approval step. Fire theimplementation.pre_commitgate-point event (events.md, multi-fire — once per commit) and evaluategates.implementation.pre_commit: load + validate the gate's reviewer list via reviewer-gates/loader.md (event keyimplementation.pre_commit), then run it via reviewer-gates/runner.md. The consolidated staged diff is the artifact under review; atype: humanreviewer, if configured, reviews that diff and the runner uses this skill's existing approval-phrase recognizer (approve/approved/accept/accepted/lgtmor semantic equivalents →Approved; a vague positive likelooks good/ship it/🚀→ ask one explicit confirmation question, never silently advance; an explicit change request →Issues Found). Proceed to step 14 only when the gate releases (Approved). OnIssues Found: block the commit, surface the gate'sBlockerfindings to the user, and do not advance. With aauto-approve/deterministic-only gate (notype: human) the gate releases autonomously and the commit happens with no human prompt; with atype: humanreviewer the skill stops for that human before committing. Becauseimplementation.pre_commitis multi-fire, each commit is an independent gate evaluation (a fresh first-pass run per the runner's per-occurrence contract). The boundary at which commits are produced (per-task / per-batch / per-plan) is resolved per theautonomy:namespace — see Commit Cadence and theautonomy:Namespace — not here.- Publication checkpoint. Build the approved manifest from subagent-touched code paths, Plan status/writeback paths, single-pass edits, and any CLI-reported touched paths. Resolve and disclose publication-policy.md for milestone
implement.batch-approvedin Plan-sourced mode orimplement.single-pass-approvedin Feature/Idea-sourced mode. If the allowed actions includecommit, commit only after the unrelated-index check and verify the newHEADcontains the requiredVerifies:trailer. If actions do not includecommit, refuse to advance until the user commits the approved set manually with the trailer. If actions includepush: first fire theimplementation.pre_pushgate-point event (events.md) and evaluategates.implementation.pre_pushvia reviewer-gates/loader.md (event keyimplementation.pre_push) + reviewer-gates/runner.md; the push proceeds only when that gate releases (Approved), and onIssues Foundthe push is blocked and the gate's findings surfaced. When that gate includes atype: humanreviewer, present a cumulative review as the reviewer's context (see Cumulative Review at the Push Gate) — the full set of commits accumulated during the run, not merely the final commit. Thepre_pushgate complements publication-policy push branch-safety — it does not replace it: branch-safety is a non-negotiable floor that runs on every push (see Push Safety Floor). Do not amend, squash, sign, or include non-manifest changes unless the user explicitly broadens the manifest. - Emit
implement.batch-completed. Payload: Plan slug, batch number, task numbers, commit SHA when one exists (fromgit rev-parse HEADafter the user commit or policy-created commit),Verifies:AC IDs covered, andpublication_result. - Emit
plan.updated. Apply publication policy forplan.updatedonly to any Plan-file changes not already included in the batch milestone, then emit withpublication_result. Payload'schanged_sectionslists every task slug whose Status or body changed in this batch.change_summaryfactual, ≤2 sentences. - Loop back to step 2. Compute next batch; if none, transition.
- Final transition. When all tasks
**Status:** complete: re-runspecscore spec lint --fixso the Plan's execution-band**Status:**is derived toImplementedfrom the all-complete task rollup (the skill does not hand-write the band — see 4b), emitplan.updated, hand off tospecstudio:verify(or, ifverifyis unshipped, recommend the user run their project's test/Rehearse suite manually). - Throughout — watch for sidekick ideas. When an out-of-scope improvement surfaces (e.g., a Feature change, a refactoring opportunity), invoke
specstudio:sidekickwith a one-liner, acknowledge in one line, and return to the current checklist step. Do not derail.
Subagent Contract
Each subagent is dispatched with an isolated prompt — it MUST NOT inherit the parent session's context. Construct the prompt freshly per posture.
Full posture (**Mode:** full)
Subagent prompt contains, in this order:
- Task identification.
### Task N: <task-name>. - AC list. The task's
**Verifies:**AC IDs. - AC full text. For each referenced AC, the complete
Given / When / Thentext quoted verbatim from the source Feature atspec/features/<feature-slug>/README.md. - Authored task body. The 1–3 sentence prose from the Plan task body, verbatim.
- Commit-message trailer convention.
Verifies: <feature-slug>#ac:<ac-slug>, ...listing every AC ID from this task's**Verifies:**. - Discipline pointer. For tasks involving behavior change: the TDD pointer — reference
agent-skills:test-driven-developmentorsuperpowers:test-driven-developmentwhen available; otherwise an in-skill TDD instruction (write failing test → minimal fix → refactor). For tasks with no testable surface (pure-documentation edits, file renames, deletions, formatting-only changes): substitute the AC-verification adapter clause — "re-read the artifact after editing and confirm each predicate in the AC'sThenclause directly." The adapter preserves the verification discipline while honoring the actual task shape. - Return-shape contract. One of
DONE/DONE_WITH_CONCERNS/NEEDS_CONTEXT/BLOCKED, with required fields per status. - Stage-only instruction. "Stage your changes with
git add. Do NOT rungit commit. The parent skill aggregates the approved batch and handles the commit gate."
Stub posture (**Mode:** stub)
Subagent prompt contains items 1, 2, 3, 5, 6, 7, 8 from full posture (item 4 — authored body — does NOT apply because there isn't one), plus:
a. Plan-level approach. The Plan's ## Approach section verbatim (the planner's higher-level decomposition strategy).
b. Predecessor summaries. For each task in **Depends-On:**, a brief summary of what that predecessor delivered (extracted from the predecessor's Verifies: commit trailer + the predecessor task's now-journaled body, if available).
c. Inference-and-summary instruction. "Infer your implementation approach from the source Feature's ACs and the Plan's Approach. After staging your changes, return a SHA-free 1–2 sentence 'what landed' summary describing your implementation choices. This summary will become the canonical body of the task via the writeback step. Do NOT reference a commit SHA — no SHA exists yet at writeback time; SHA linkage lives in the implement.batch-completed event payload."
Status protocol (both postures, adopted from SDD)
| Status | Meaning | Parent skill behavior |
|---|---|---|
DONE | Task complete, changes staged, no concerns | Keep staged; mark Plan **Status:** complete; include in batch commit |
DONE_WITH_CONCERNS | Task complete + staged, but subagent flagged observations (e.g., "this file is getting large") | Keep staged; mark Plan **Status:** complete; surface concerns to user in consolidated diff |
NEEDS_CONTEXT | Subagent needs information not provided | Re-dispatch this subagent with augmented context; siblings unaffected; Plan Status stays in_progress |
BLOCKED | Subagent cannot complete the task as specified (cites specific cause) | Surface to user with full report; offer revise-Feature / mark-blocked / abort; do NOT silently retry |
Max Parallel
Cap concurrent subagents at 5 per batch in MVP. When the next executable batch has > 5 tasks, dispatch the first 5 and queue the rest; dispatch each queued task as a concurrent slot frees. The cap may become configurable per project via specscore.yaml in a future revision — MVP hardcodes 5.
Commit Cadence and the autonomy: Namespace
implement execution knobs live under a top-level autonomy: key in specscore.yaml, keyed by skill name (MVP: autonomy.implement). This is a concern distinct from gates: — gates: declares who approves each event; autonomy: declares execution knobs. Workflow-step names (e.g., implement:) MUST NOT appear as top-level config keys; the knobs are reached only via autonomy.implement.*.
commit_cadence
autonomy.implement.commit_cadence selects the boundary at which the skill commits:
| Value | Boundary |
|---|---|
task | one commit per task |
batch | one commit per integrated batch (default when unset) |
plan | one commit at run end |
Resolution follows the publication-policy scope ladder (run → session → project → user), narrower overriding broader. When unset at every scope, the cadence is batch. Example: autonomy.implement.commit_cadence: task at project scope with no narrower (run/session) override resolves to task → one commit per task.
commit_cadence: plan is allowed, but the skill MUST warn that it defers all commits to run end, weakening per-batch revert granularity (a failure late in the run cannot be reverted batch-by-batch). No additional guard mechanism is provided in MVP — the warning is the safeguard.
Cadence drives pre_commit firing
The resolved cadence determines how many commits a run produces, and implementation.pre_commit fires once per commit (per task, per batch, or once for the plan) — each firing an independent gate evaluation per the runner's multi-fire semantics. So a batch-cadence run that produces three batch commits fires implementation.pre_commit three times, once before each commit. The gate-evaluation mechanics live in Checklist step 13; this section owns only where the commit boundaries fall.
Conflict Detection and Rollback
Detection: line-overlap only (post-batch). Run git diff --staged after all subagents return terminal statuses. Two subagents are in conflict when their staged changes touch the same file at overlapping line ranges. Semantic conflicts (two subagents implementing the same Feature differently in different files) are explicitly out of MVP scope.
Rollback: atomic. On detected conflict:
- Surface to user: offending task numbers, file path, overlapping line range.
- Offer three resolutions: (a) rewrite Plan with explicit
**Depends-On:**that serializes the conflicting tasks, (b) manualgit restore --staged <path>+ re-run, (c) abort and investigate. - On (a) or (c): unstage ALL batch changes (
git restore --stagedper touched file), revert each task's**Status:** in_progress → planning(or →blockedif conflict implies a missing dependency), stop.
Mixed terminal statuses are NOT conflicts. A batch where 3 subagents are DONE and 2 are BLOCKED is a partial success: present the 3 DONE subagents' diff, run it through the implementation.pre_commit gate, and commit on release, mark the 2 BLOCKED tasks **Status:** blocked (with cited causes), advance. Atomic-rollback semantics apply only to line-overlap conflicts, not to mixed-terminal batches. (A BLOCKED subagent is also an anomaly-halt trigger — see Anomaly Halts and Re-arm.)
Anomaly Halts and Re-arm
Some failures are execution-state anomalies, not gate verdicts — a reviewer does not "approve" a merge conflict or a BLOCKED task. Regardless of gate configuration — including a fully autonomous (auto-approve) pre_commit gate — implement MUST halt the run on any of:
- (a) a sibling integration/merge conflict (the line-overlap conflict of Conflict Detection and Rollback);
- (b) a BLOCKED subagent;
- (c) a lint failure that
specscore spec lint --fixdid not resolve in its single pass; - (d) source-Feature drift (the Plan's source Feature regressed below
Approved).
These halts are not subject to the gate verdict — an autonomous gate does not suppress them.
On an anomaly-halt, implement MUST stop, name the specific cause, perform no auto-resolution, and not advance:
| Anomaly | Surfaced cause |
|---|---|
| sibling conflict | the conflicting task numbers, file paths, and overlapping line range |
| BLOCKED subagent | the BLOCKED task and its cited reason |
| unresolved lint | the remaining lint violations (with rule IDs) |
| source-Feature drift | the drifted Feature and its current status |
Explicit re-arm
After the user addresses the cause, implement MUST NOT auto-resume when the anomaly clears. It resumes autonomous execution only after the user issues an explicit re-arm signal — the lowercase standalone token continue (recognized in the same style as the approval phrases).
A re-arm re-enables autonomy for the remainder of the current implement run only. A subsequent run starts from the resolved autonomy: / gates: config — never from a prior run's re-armed state.
Detached / Background Execution
When implement is launched as a detached background session (per Feature: Detached Background Plan Implementation — a claude --bg process started from the plan-approval checkpoint, running in its own worktree), it follows an autonomous progress contract that maximizes forward progress instead of stopping at the first obstacle:
- Maximize progress. Complete every task the run can. (
#ac:continues-past-a-blocker) - Defer blocked tasks — do not abort. A task the run cannot complete (needs a human decision, missing information, an unresolved test failure, or a permission it lacks) is marked
**Status:** blockedand skipped; the run continues with other unblocked tasks. Only the blocked task's own dependents are blocked. In this mode a deferrable blocked task is not a run-level anomaly-halt — this overrides theBLOCKED-subagent halt of Anomaly Halts and Re-arm for background runs. (#ac:continues-past-a-blocker) - Approval-requiring actions last. Schedule any action that will need human approval after all independently-completable work, so a pause does not stall work that could proceed. (
#ac:approval-work-deferred-last) - Pause — never improvise — when only blockers remain. When no unblocked task is left, the run pauses and waits for input. It MUST NOT abort and MUST NOT improvise a decision that requires a human. (
#ac:pause-on-remaining-blockers) - Blocker surface (v1): the live session only. Blockers are resolved by attaching to the paused session (
claude attach <id>). The run is not required to produce aBLOCKED.mdor any other durable blocker artifact. (#ac:no-blocked-artifact-required)
The integrity anomaly-halts still apply unchanged even in background mode — a sibling integration conflict, a lint failure unresolved after the single --fix pass, and source-Feature drift all still halt the whole run. Only the deferrable "unfinishable task" case is relaxed here.
Staging, Publication Policy, and Commit-Message Template
Subagents stage their own changes so the parent can aggregate and review a consolidated diff. The parent skill applies publication-policy.md only after the consolidated diff has passed conflict detection, lint, self-review, and the implementation.pre_commit gate's release (step 13). Policy does not persist as an implement-specific override; durable preferences are saved only through specscore publication set.
Policy-created commits
When the resolved policy allows commit, the skill MAY run git commit using the proposed template unless the user supplies an exact commit message. The commit MUST include the required Verifies: trailer for the successful tasks in the batch or single-pass change. Before committing, compare the approved manifest to the staged index and stop on unrelated staged paths per the shared protocol. The skill MUST verify the commit succeeded and that git rev-parse HEAD changed before emitting implement.batch-completed.
The override MUST NOT:
- Bypass the
implementation.pre_commitgate (commit only after it releasesApproved). - Commit before conflict detection, lint, and inline self-review pass.
- Commit unrelated staged or unstaged files.
- Amend, squash, sign, or otherwise rewrite history unless the user leaves
implementand explicitly requests that separate git operation. - Push before the
implementation.pre_pushgate releases, or without branch-policy approval and an upstream branch. - Allow subagents to commit; subagents always stage only.
Commit-message template (provided every batch / single-pass)
Plan-sourced and Feature-sourced:
<short summary describing what was implemented>
<optional longer body the user may edit>
Verifies: <feature-slug>#ac:<ac-slug>, <feature-slug>#ac:<ac-slug>, ...
Idea-sourced:
<short summary describing what was implemented>
<optional longer body the user may edit>
Verifies: idea:<slug>
Trailer rules:
- Keyword is exactly
Verifies:(case-sensitive, Conventional Commits trailer convention). - Follows the body, separated by a blank line.
- Plan-sourced: Lists every AC ID covered by successful tasks in the batch (DONE / DONE_WITH_CONCERNS only). BLOCKED tasks' ACs are NOT in the trailer. AC IDs deduplicated, ordered by task number then AC slug.
- Feature-sourced: Lists every AC ID addressed by the staged change.
- Idea-sourced: Uses
idea:<slug>referencing the source Idea. - May be a single comma-separated line OR multiple
Verifies:lines — both valid.
The skill MUST NOT enforce the user's actual commit message format (that's the user's call). But the suggested template always includes the trailer.
Per-Task Status Writes
| When | Transition | Apply in postures |
|---|---|---|
Task's **Depends-On:** predecessors all complete (becomes batch-eligible) | planning → queued | both |
| Subagent dispatched | queued → in_progress | both |
Subagent returns DONE or DONE_WITH_CONCERNS | in_progress → complete | both |
Subagent returns BLOCKED (user defers) | in_progress → blocked | both |
User manually resolves a blocked task | (user edit) blocked → planning | both |
The canonical task-status lifecycle is planning → queued → in_progress → complete, with blocked/failed/aborted as the other available terminal/interrupt outcomes. The full vocabulary is {planning, queued, in_progress, blocked, complete, failed, aborted}.
**Status:** writes apply identically to full and stub Plans. The body-writeback exclusion in full mode is specifically about task bodies, not about Status.
Stub-Posture Body Writeback (Bundled)
When **Mode:** stub and a subagent returns DONE / DONE_WITH_CONCERNS:
- Replace the task's placeholder body
<!-- implement: pending -->with the subagent's SHA-free 1–2 sentence "what landed" summary. - Stage the Plan-file change via
git addas part of the same staging set as the subagent's code changes. - The user reviews one consolidated
git diff --stagedcontaining both code and Plan-file edits. - The approved publication checkpoint commits both atomically when policy allows
commit; otherwise the user commits both atomically with the suggested template before the skill advances.
No two-phase commit. No placeholder SHAs to reconcile. No separate "approve the journal entry" step.
When **Mode:** full: NO body writeback. Task bodies were authored at plan time and remain unchanged by implement. Only **Status:** is written.
Lint and Self-Review
After every batch's staging phase, before presenting the consolidated diff to the user:
-
Lint. Run
specscore spec lint. On failure: runspecscore spec lint --fixexactly once, re-lint. If still failing: unstage Plan-file changes (git restore --staged spec/plans/<slug>.md), surface remaining violations with rule IDs, stop the batch. The skill MUST NOT loop--fix. -
Inline self-review. Scan staged Plan-file changes for:
- State-machine-violating Status transitions (e.g.,
complete → in_progresswithout explicit user action). - Writeback bodies still containing placeholder tokens (
<!-- implement: pending -->,TBD,TODO). - Status values outside the canonical lifecycle set
{planning, queued, in_progress, blocked, complete, failed, aborted}.
- State-machine-violating Status transitions (e.g.,
Findings stop the batch and prompt the user — never auto-fix beyond the one --fix pass above.
No Code-Review Subagent
Deliberate departure from superpowers:subagent-driven-development. That skill dispatches a spec-compliance reviewer AND a code-quality reviewer per task. implement does neither in MVP.
- The
implementation.pre_commit/implementation.pre_pushreviewer gates on the consolidated batch diff ARE the quality gatesimplementenforces. What sits in each gate (atype: humancheckpoint, an automateddeterministiccheck, or an auto-approvingauto-approve) is project config, not hardcoded here. - Code-quality and architecture review are the responsibility of
specstudio:reviewdownstream. - Spec-compliance review for the Feature spec is owned by
specstudio:specify's reviewer subagent, notimplement.
This keeps implement focused on dispatch + staging + firing the gate-point events, and avoids triple-gating inside the loop. The implement-specific reviewer subagents this section forgoes are distinct from the configured implementation.pre_commit/pre_push gate reviewers, which implement fires but does not itself author.
Cumulative Review at the Push Gate
When implement fires implementation.pre_push and that gate includes a type: human reviewer, that human is the single human checkpoint of an autonomous run. implement MUST present a cumulative review as the reviewer's context — the full set of commits accumulated during the run, not merely the final commit:
- Default (small change): the run's commits plus their consolidated diff, when the change is within ~150 changed lines and ~10 files.
- Large change: when either bound is exceeded (more than ~150 changed lines OR more than ~10 files), switch to a per-commit summary — one entry per commit (subject +
Verifies:AC IDs + file/line counts) — instead of the full consolidated diff.
This threshold keeps the human's review context bounded; the cumulative set (commits, not just the tip) is presented either way.
Push Safety Floor
Every promote/push MUST route through change-publication-policy push branch-safety, which denies main/master/release/* by default. Autonomy MUST NOT weaken or bypass this floor: a publication-policy-denied branch is refused regardless of autonomy: / gates: settings. A type: deterministic branch-safety reviewer configured on implementation.pre_push complements the publication-policy check (it can add project-specific refusals) — it is not a substitute for it. Both run on every push.
Promotion Boundary
The next skill is specstudio:verify, and only specstudio:verify.
Transition
When all tasks reach **Status:** complete (no more eligible batches AND no planning/queued/blocked tasks):
- Re-run
specscore spec lint --fixso the Plan's execution-band**Status:**is derived toImplementedfrom the all-complete task rollup. The skill does not hand-write the band (see Checklist step 4b). - Add CLI-reported
touched_pathsto the final checkpoint manifest. - Re-run lint.
- Apply publication policy for
plan.updated, preserving manifest and branch safety. - Emit
plan.updatedwith the status-transitionchange_summaryandpublication_result. - Transition to
specstudio:verify. Ifverifyis unshipped, hand back to the user with:
"Plan implemented. The
specstudio:verifyskill is not yet shipped — run your project's test or Rehearse suite manually against the source Feature's ACs. Every commit references the satisfied AC IDs in itsVerifies:trailer for traceability."
The skill MUST NOT invoke ideate, specify, plan, frontend-design, mcp-builder, or any other skill on transition.
Posture Immutability
The skill respects the Plan's **Mode:** as user-declared at plan time and MUST NOT switch postures mid-flight. No --switch-mode flag, no automatic re-classification. A user who needs the other posture for an in-flight Plan creates a successor Plan with **Supersedes:** (the plan Feature's REQ:revise-vs-supersede handles this).
Tone
The skill MUST NOT yes-machine weak Plans or silently retry blocked subagents. When the skill detects Status-vs-git-log divergence, a BLOCKED subagent return, a sibling-diff conflict, or source-Feature drift, it MUST say so with concrete evidence (commit SHA absence, AC slug, file:line, etc.) and propose the alternative. The acceptance bar is honest disagreement, not performative agreement.
Verification
- Pre-flight checks passed: input resolved to Plan (Status ∈ {Approved, Executing}), Feature (Status ∈ {Approved, Implementing, Stable}), or Idea (Status: Approved)
- Git-log cross-check ran; any Status-vs-git-log divergences were surfaced to the user before dispatch
- Every batch dispatched ≤5 parallel subagents; queued tasks were dispatched as slots freed
- Every subagent returned a terminal status (DONE / DONE_WITH_CONCERNS / BLOCKED) or was re-dispatched on NEEDS_CONTEXT
- Conflict detection ran post-batch; conflicts surfaced and resolved per the three resolution paths
- Consolidated batch diff presented with: per-task status summary, staged diff (or summary),
Verifies:trailer template covering only successful tasks' AC IDs -
implementation.pre_commitfired before each commit and released (Approved) before committing; onIssues Foundthe commit was blocked and findings surfaced. Approval was gate-config-driven (aauto-approve/deterministic-only gate committed with no human prompt; atype: humanreviewer stopped for that human) — no hardcoded per-batch user-approval step ran -
implementation.pre_pushfired before any push/promote and released (Approved) before pushing; onIssues Foundthe push was blocked and findings surfaced - Publication policy was resolved and disclosed at each approved implementation milestone, and push branch-safety still ran (the
pre_pushgate complements it, does not replace it) - Commit cadence was resolved from
autonomy.implement.commit_cadence(defaultbatch) across the scope ladder;pre_commitfired once per commit the cadence produced;commit_cadence: planemitted the revert-granularity warning - Autonomy config lived under the top-level
autonomy:key (no workflow-step name as a top-level config key) - On any anomaly (sibling conflict / BLOCKED subagent / unresolved-after-
--fixlint / source-Feature drift) the run halted regardless of gate config, surfaced the specific cause, and performed no auto-resolution - After an anomaly-halt, autonomous execution resumed only on an explicit
continuere-arm, scoped to the current run - At a
pre_pushgate with atype: humanreviewer, the cumulative set of run commits (consolidated diff, or per-commit summary when large) was presented — not just the final commit - Approved staged set was committed before the next batch dispatched, either by the user or by policy-created commit after the
implementation.pre_commitgate released - Plan
**Status:**field updated correctly per the state machine (no out-of-vocabulary tokens; no auto-fix violating the canonical lifecycle set{planning, queued, in_progress, blocked, complete, failed, aborted}) - In
stubmode: every successful task's placeholder body replaced with a SHA-free 1–2 sentence summary; bundled with code in one staging set - In
fullmode: NO task body modified by the skill (only Status writes) -
specscore spec lintpasses after every batch (auto-recovery via--fixattempted at most once on initial failure) - All emitted events (
implement.batch-started,implement.batch-completed,plan.updated) carrychanged_sections,previous_revision, a factualchange_summarywhere applicable, andpublication_resultafter publication checkpoints - On Plan completion: execution-band
**Status:**derived toImplementedbyspecscore spec lint --fix(not hand-written); transition tospecstudio:verify(or hand-back); no other skill invoked - In Feature-sourced mode: no subagent dispatch, no task-status writes,
Verifies:trailer uses Feature AC IDs - In Idea-sourced mode: no subagent dispatch, no task-status writes,
Verifies:trailer usesidea:<slug>
Red Flags
- Running
git commitbefore theimplementation.pre_commitgate releases (Approved) and an allowed publication action exists - Running
git pushbefore theimplementation.pre_pushgate releases (Approved) - Carrying a hardcoded, unconditional per-batch user-approval step (an always-required approval phrase) instead of letting
gates.implementation.pre_commit's reviewers decide — the per-batch human checkpoint exists iff atype: humanreviewer is configured on that gate - Prompting a human to approve a commit when
gates.implementation.pre_commithas onlyauto-approve/deterministicreviewers (autonomous commit, no prompt) - Running
git commitorgit pushbefore publication policy is resolved and disclosed for the approved milestone - Letting the
pre_pushgate substitute for publication-policy push branch-safety (they are complementary — branch-safety still runs) - Letting publication policy bypass the
implementation.pre_commitgate or commit unrelated staged paths - Auto-resuming after an anomaly-halt without an explicit
continuere-arm, or carrying a re-armed state into a later run - Committing at a boundary other than the resolved
commit_cadence, or omitting thecommit_cadence: planrevert-granularity warning - Presenting only the final commit (not the cumulative run set) to a
type: humanreviewer at thepre_pushgate - Placing autonomy knobs under a workflow-step top-level key (e.g.,
implement:) instead ofautonomy.implement.* - Auto-advancing past a
BLOCKEDsubagent without surfacing to the user - Silently retrying a
BLOCKEDtask without user resolution - Introducing an out-of-vocabulary
**Status:**token (anything outside{planning, queued, in_progress, blocked, complete, failed, aborted}) - Writeback body that references a commit SHA (the SHA doesn't exist at writeback time; linkage lives in the event payload)
- Body writeback applied to a
full-mode Plan (writeback is stub-only) - Atomic rollback applied to a mixed-terminal batch (rollback is for conflicts only)
- Dispatching the next batch while the prior batch's stage is uncommitted and publication policy did not create the required commit
- Dispatching a code-quality reviewer subagent inside the loop (deferred to
specstudio:review) - Auto-switching the Plan's
**Mode:**(posture is one-way; user creates a successor Plan) - Looping
specscore spec lint --fixmore than once - Speculating about user intent in
change_summary("User chose...", "Important changes...") instead of factual ("Tasks 3, 5 transitioned to complete; task 5 body journaled.") - Using batch dispatch or task-status writes in Feature-sourced or Idea-sourced mode (single-pass only)
- Using
Verifies: idea:<slug>when a Feature exists (use Feature AC IDs instead) - Using Feature AC IDs when only an Idea exists (use
Verifies: idea:<slug>instead)
References
- Feature: Implement Skill — the SpecScore Feature this skill implements.
- Feature: Plan Skill — the upstream Feature whose
**Depends-On:**,**Status:**,**Mode:**schema this skill consumes. - philosophy.md — shared tenets.
- path-conventions.md —
spec/vsdocs/rules. - publication-policy.md — checkpoint resolution, manifest safety, first-run preference prompt, and publication disclosure.
- reviewer-gates/loader.md — load + validate the
gates.implementation.pre_commit/gates.implementation.pre_pushreviewer list fromspecscore.yaml. - reviewer-gates/runner.md — evaluate a loaded gate (serial dispatch, grade/verdict,
ApprovedvsIssues Found, per-occurrence multi-fire for the gate-point events). - events.md — event payloads emitted by this skill, including the
implementation.pre_commit/implementation.pre_pushgate-point events. - sidekick-capture.md — sidekick-idea handling during the skill's flow.
- PRINCIPLES.md — repo-level principles (user-attention economy, batched questions, parallel work while user is idle).
superpowers:subagent-driven-development— adopted four-status protocol; two deliberate departures documented above (publication-policy checkpoints after batch approval; no code-quality reviewer subagent).superpowers:dispatching-parallel-agents— parallel-fanout pattern adapted to per-batch user gate.
What ships with it: 1 file
2.9 KB alongside SKILL.md
- README.md2.9 KB