/sdd:implfrom sdd
Execute the active feature's approved task plan one task at a time - dispatch subagent implementers and reviewers, run the bounded fix loop, verify completion with fresh evidence, and stop after every task for the user's review.
Ships in sdd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You run INLINE in the main conversation. You never implement or review code
yourself: all execution goes to subagents dispatched via the Agent tool
(general-purpose type; the subagent's role is defined by the prompt-template
files in this skill's templates/ directory). You own the loop, the beans
state, the workspace files, and every interaction with the user.
Division of labor:
Bash use is limited to read-only git (git diff, git status, git log,
git merge-base), the beans CLI, the plugin's
bin/ helpers (sdd-gate, sdd-verdict, sdd-phase, and sdd-next
are read-only; sdd-promote is the sole write helper — strictly
beans update <id> -s todo), and file operations.
Paths and ids, never contents. Dispatch prompts carry file paths,
path patterns, and bean ids, never file contents. Subagents read
files, run beans show on the ids, and Glob-expand patterns
themselves.
Resolve plugin variables before dispatch. ${CLAUDE_SKILL_DIR} and
${CLAUDE_PLUGIN_ROOT} expand in your context only; subagent prompts are
plain text. Always pass resolved absolute paths to templates and protocols.
Model policy is pinned, never the agent's choice. Set the model
parameter in every Agent dispatch exactly as follows:
| Dispatch | Model |
|---|---|
| Implementer - initial dispatch and fix rounds 1-3 | sonnet |
| Implementer - fix rounds 4-5, and the retry after a RESOLVED debug | opus |
| Implementer - feature-finish remediation rounds | sonnet |
| Debugger | opus |
| Task-reviewer, scoped re-review, code-reviewer, validate-impl | opus |
Subagents never ask the user directly. Any question a subagent raises arrives as a status contract; you decide whether it is answerable from the repo/spec files or must go to the user via AskUserQuestion.
beans is the only tracker. Never flip checkboxes or write progress,
approval, or blocked state into documents. The task beans ARE the
plan (spec Revision 4 - no plan document exists), and the bean GRAPH
is the sequence: statuses and blockedByIds edges, never checklists
or step lists inside a bean body - a task that needs steps gets child
beans from /sdd:spec-tasks, not a - [ ] list the next agent must
scan for. The global beans guide's checkbox convention does NOT apply
to sdd task beans: never flip unchecked/checked box markers in ANY
body, even a legacy brief that carries them - a leaf's progress is
its status plus appended ## Report/## Notes lines; a brief with a
step checklist is legacy debt: finish the whole leaf or surface it
for decomposition, never tick steps off. Execution state lives in
beans and workspace files only. Lifecycle follows the global beans
guide.
Single active feature. Exactly one feature is active at any time (spec 5.5). You never accept a feature argument; you resolve the feature from beans.
Workspace is append-only. Never rewrite or delete
.sdd/specs/<feature>/workspace/ artifacts; append new rounds and
sections.
The task bean is the lifecycle record; verdicts dual-write
(spec 8.1, Revision 7). Task-bean bodies carry the append-only
sections ## Brief, ## Report, ## Notes, ## Validation,
## Parking lot — append beneath a section, never rewrite or
reorder it. Every 8.1 verdict/outcome/status you record on a bean
ALSO sets its lowercase-hyphen mirror tag on that same bean, and a
new round that flips a verdict removes the old tag of the family in
the same call
(beans update <id> --remove-tag <old> --tag <new>; plain --tag
when no tag of that family is set):
| Contract line (writer) | Mirror tags |
|---|---|
implementer STATUS: DONE / DONE_WITH_CONCERNS | status-done / status-done-with-concerns |
review + re-review VERDICT: APPROVED / REJECTED | verdict-approved / verdict-rejected |
debugger OUTCOME: RESOLVED / UNRESOLVED | outcome-resolved / outcome-unresolved |
verification STATUS: VERIFIED / NOT_VERIFIED / MANUAL_VERIFY_REQUIRED | verification-verified / verification-not-verified / verification-manual-verify-required |
validate-impl DECISION: GO / NO_GO / MANUAL_VERIFY_REQUIRED (recorded on the epic bean) | decision-go / decision-no-go / decision-manual-verify-required |
BLOCKED and NEEDS_CONTEXT get no tag — transient control
states, not records. Phase beans carry validated (Revision 6,
already wired). You are the single tag writer: subagents never set
tags. The implementer's ONE bean write is its --body-append of
## Report / ## Notes (its role prompt's carve-out); reviewer and
debugger subagents are read-only, and you record their outcomes.
The loop is sequential — one task at a time — so plain appends are
safe; any path that could write a bean in parallel with another
writer must guard every append with --if-match (etag from
beans show <id> --etag-only).
Run this at the start of EVERY cycle, including after a user "continue". Never trust session memory of prior cycles - state is re-derived from beans each time.
Run the mechanical helpers first (both read-only):
${CLAUDE_PLUGIN_ROOT}/bin/sdd-phase impl # the full impl gate
${CLAUDE_PLUGIN_ROOT}/bin/sdd-next # the next actionable task
sdd-phase impl nonzero -> STOP: its one-line stderr names the failed
gate and the fixing /sdd:<name> command. The inline procedure below
is the canonical fallback and explains what the gate checked.sdd-next prints ROLLUP: lines first: complete each pending major
container (beans update <id> -s completed with a one-line
## Summary of Changes - a major is done exactly when all its leaves
are), then re-run sdd-next. Its NEXT: line is the task for this
cycle (an in-progress leaf wins - interrupted runs resume; otherwise
the lowest number among unblocked leaves). FINISHED -> Feature
finish. A drafts or stuck diagnosis -> STOP and report as the message
says (drafts point to the /sdd:spec-tasks approve gate).The items below are the inline procedure the helpers wrap - step through them when a helper is unavailable or its failure needs adjudication:
Resolve the active feature: query beans for epic beans with status
in-progress (e.g. beans list --json -t epic -s in-progress).
.sdd/specs/ has no unambiguous match, stop
and ask the user which directory the feature lives in./sdd:spec-init (spec already shaped) or /sdd:discovery
(nothing shaped yet)./sdd:impl.Phase-gate check: query the epic's children once -
beans query --json '{ bean(id: "<epic-id>") { children { id title status tags blockedByIds body } } }'
(the resolved relation blockedBy is broken in beans v0.4.2 - always
read blockedByIds) - and reuse the result for the task queue below.
Identify the phase beans by exact title plus the phase tag:
Phase — requirements, Phase — design, Phase — tasks.
Gate: ALL THREE phase beans must exist and be
completed-completedIS the approval record (spec Revision 5).
(${CLAUDE_PLUGIN_ROOT}/bin/sdd-gate <epic-id> wraps this whole
check - phases + freshness + queue readiness - as a read-only script;
the inline procedure stays canonical.)
/sdd:spec-init (a heal run with the
same feature name creates missing phase beans idempotently).completed -> stop naming its command:
/sdd:spec-requirements, /sdd:spec-design, or /sdd:spec-tasks
respectively.Freshness gate (spec Revision 6) - on top of completed, the
requirements and design phase beans must carry the validated tag
(read from the children query's tags), and the LATEST line of
the form Doc-hash: <sha256> in each one's ## Validation body
section (read from the query's body) must equal the CURRENT hash
of the document it validated - validation rounds append, so only
the last Doc-hash: counts; an earlier round's line never wins.
The tasks phase bean carries neither - validation is scoped to
requirements and design only. Recompute both hashes yourself:
shasum -a 256 .sdd/specs/<feature>/requirements.md vs the
Doc-hash: on Phase — requirementsshasum -a 256 .sdd/specs/<feature>/design.md vs the
Doc-hash: on Phase — design(The recorded hash was computed at the GO moment, after the validator's fixes; any later edit - committed or not - changes the current one.)
Doc-hash: line absent, on requirements
or design -> the phase closed without its validation record:
stale. STOP - never proceed past it, never re-validate silently.
Present the four-part format - 1. Per plan: completed
requirement/design phases carry validated and a Doc-hash:
line. 2. Actual: <bean> is missing <the tag | the Doc-hash line>. 3. Why it matters: the approval's validation evidence
does not exist. 4. Options: re-run the phase's command to revise
and re-validate / stop - naming /sdd:spec-requirements or
/sdd:spec-design./sdd:spec-requirements for requirements.md,
/sdd:spec-design for design.md). Staleness is mechanical and
the decision is the user's: you never re-validate, never
overwrite a Doc-hash:, and never continue past a stale gate.Resolve the task queue: the epic's task TREE - the children query
returns the majors (feature-type containers), any flat undecomposed
tasks, and the phase beans; query each major's children for the
leaves. Work happens on LEAVES only; a major is never executed and
completes by rollup when all its leaves are completed/scrapped. A
leaf is unblocked when none of its blocked-by beans - and none of
its ancestors' blocked-by beans - is incomplete (todo, draft, or
in-progress; completed and scrapped blockers do not block). A leaf
is actionable when it has status todo or in-progress, is
unblocked, and its body carries no unresolved ## Blocker note (the
blocked-task encoding written by Step 6; a note is unresolved until
the task completes or the user explicitly clears it). Task beans with
status draft are NEVER auto-selected - draft means
generated-not-approved (spec Revision 5); the /sdd:spec-tasks
approve gate promotes them to todo.
Select the task:
in-progress leaf
wins over a todo leaf with the same number (interrupted run resumes
there). If a task would be selected but for an unresolved ## Blocker
note, do NOT auto-select it: report the task and its recorded root
cause, then ask via AskUserQuestion - retry the blocked task now /
skip it for this run (select the next actionable task; the note
re-surfaces it on the next invocation) / stop.[task-id] argument (e.g. 3.2): map the plan-style id to the task
bean by matching the task number in the bean's title or body, then that
task, provided it belongs to the active feature and is not completed or
scrapped; if it is effectively blocked, stop and report the blocking
beans.Terminal checks:
/sdd:spec-tasks.## Blocker notes the user declined to retry) -> stop and
report the stuck tasks with their blockers; the user must resolve them
(or change the plan) before impl can proceed.git status --porcelain and note any
pre-existing uncommitted changes. This baseline lets review packages
exclude unrelated user work and lets you tell pre-existing changes from
task changes.beans update <task-id> -s in-progress.## Brief body section IS the brief (spec Revisions 4+7); the
subagent reads the bean itself. You resolve:
full working tree when no boundary is
declared or the boundary cannot be translated confidently.## Notes sections carry the one-liners past
implementers appended. None completed yet -> omit the learnings
line from the dispatch.Read ${CLAUDE_SKILL_DIR}/templates/implementer-prompt.md, resolve it to an
absolute path, and dispatch:
Agent(
description: "Implement task <N>",
subagent_type: general-purpose,
model: sonnet,
prompt: (paths and ids only)
Role prompt: <abs-path>/skills/impl/templates/implementer-prompt.md
(read it first and follow it exactly)
Task bean: <task-bean-id> (run `beans show <task-bean-id>` - its
## Brief section IS the task brief; per your role
prompt, append your ## Report and any ## Notes
one-liners to this bean before returning)
Spec files: .sdd/specs/<feature>/requirements.md,
.sdd/specs/<feature>/design.md
Steering: .claude/rules/ of this project (only when present)
Code scope: <boundary path patterns, or repo root>
Code analysis: apply the `lsp-code-analysis` skill (LSP first, Grep/Glob fallback)
Validation: <task-relevant command subset>
Learnings: <completed task bean ids, if any> (their ## Notes
sections carry the one-liners - read before you start)
Return exactly the ## Status Report block your role prompt defines.
)
Parse the implementer's final message for the exact block:
## Status Report
- STATUS: <DONE | DONE_WITH_CONCERNS | BLOCKED | NEEDS_CONTEXT>
Parse discipline: only the exact ## Status Report block and its - STATUS:
line count. If the block is missing, ambiguous, or replaced with prose, resume
the agent once (SendMessage) requesting the exact structured block only. Never
infer status from surrounding prose. The report must list the files touched
this round (field shape defined by the role prompt).
| STATUS | Action |
|---|---|
DONE | Hold the contract in context; go to Step 4. |
DONE_WITH_CONCERNS | Same as DONE, plus hold the concerns: they surface at the STOP in the four-part format; the implementer's ## Report records them and Step 8 appends anything further. Review still runs - concerns do not bypass it. |
BLOCKED | Go to Step 6 (debug protocol). |
NEEDS_CONTEXT | The report states exactly what is missing. If it is trivially answerable from repo or spec files, answer it yourself and resume the implementer (SendMessage) with the answer. Otherwise formulate an AskUserQuestion for the user, then resume the implementer with their answer. Context rounds do not count against the fix-loop budget - but if the implementer repeats NEEDS_CONTEXT with no new specifics after being answered, treat it as BLOCKED. |
On DONE or DONE_WITH_CONCERNS, two bean duties are yours before
Step 4 (Hard rule 9): confirm the task bean now carries the
implementer's ## Report (beans show <task-id>; if the section is
absent, resume the implementer once requesting the append - the append
precedes the contract by its role prompt), and set the status mirror
tag for the parsed STATUS (status-done /
status-done-with-concerns, removing a prior round's tag of the
family in the same call).
workspace/review-package-<N>.md (append a new
# Round <K> section per review round; never rewrite earlier rounds):
_Requirements: metadata, scope, baseline note), the findings
under remediation (rounds 2+), the scoped diffstat and diff
(git diff -- <paths>), and full contents of untracked in-scope files
(from git status --porcelain).git diff and git status are the only git calls used here; the
working tree vs HEAD is always the task's complete change set.${CLAUDE_SKILL_DIR}/templates/task-reviewer-prompt.md, resolve paths, and
dispatch:Agent(
description: "Review task <N>",
subagent_type: general-purpose,
model: opus,
prompt: (paths and ids only)
Role prompt: <abs-path>/skills/impl/templates/task-reviewer-prompt.md
Review protocol: <abs-path>/skills/review/SKILL.md (apply it to this task)
Package: .sdd/specs/<feature>/workspace/review-package-<N>.md
Spec files: .sdd/specs/<feature>/requirements.md, design.md
Code analysis: apply the `lsp-code-analysis` skill for code claims (LSP first, Grep/Glob fallback)
Task bean: <task-bean-id> (its ## Brief carries the task text and
requirement IDs - verify against it independently;
the implementer's contract is not evidence)
Return exactly the ## Review Verdict block your role prompt defines.
)
## Review Verdict
- VERDICT: <APPROVED | REJECTED>
Same parse discipline as Step 3 (exact block and - VERDICT: line only).
REJECTED findings must be marked blocking or minor.
Record the round on the task bean (every review round - first
review and each re-review): ONE line appended under ## Validation:
- VERDICT: <APPROVED | REJECTED> - <date>, review round <K>, package: workspace/review-package-<N>.md
(the package pointer rides the round line; <K> counts review cycles,
<N> is the task's package file), plus the verdict mirror tag per
Hard rule 9 (verdict-approved / verdict-rejected, old family tag
removed in the same call).
## Parking lot in the
task bean (the parking lot, surfaced at feature finish).One counter per review cycle; it resets only when the task closes (APPROVED + verified), not on intermediate verdicts.
model: opus - full dispatch data from Step 2 plus the blocking findings
and a short summary of prior rounds (paths, not transcripts).DONE/DONE_WITH_CONCERNS,
apply the Step 3 bean duties (confirm its ## Report addendum landed;
flip the status mirror tag if the round's STATUS differs), append a
# Round <K> scoped section to the review package covering the
files changed this round only, then dispatch a scoped re-review (read
${CLAUDE_SKILL_DIR}/templates/re-review-prompt.md, resolve, dispatch with
model: opus, package + findings paths, plus the code-analysis
instruction - apply the lsp-code-analysis skill). Parse the same
## Review Verdict block and record the round on the task bean per
Step 4 (## Validation line + package pointer + verdict mirror
tag); park the re-review's PARKING_LOT one-liners under
## Parking lot.Adjudication: if the implementer substantively disputes the same finding two rounds in a row and you cannot settle it from the spec, stop burning rounds - escalate to the user with the four-part format and an AskUserQuestion (enforce the finding / accept the dispute / plan change / abort).
Entered when: the implementer returns BLOCKED, a NEEDS_CONTEXT loop
degenerates, or the fix loop exhausts five rounds.
${CLAUDE_SKILL_DIR}/templates/debugger-prompt.md, resolve, dispatch:Agent(
description: "Debug task <N> failure",
subagent_type: general-purpose,
model: opus,
prompt: (paths and ids only)
Role prompt: <abs-path>/skills/impl/templates/debugger-prompt.md
Debug protocol: <abs-path>/skills/debug/SKILL.md (apply it)
Failure summary: <one-line symptom>
Task bean: <task-bean-id> (its ## Brief section says what was
being built)
Review evidence: .sdd/specs/<feature>/workspace/review-package-<N>.md
(if built; on a first-round BLOCKED no package exists
yet - the debugger relies on the working tree)
Working tree: inspect read-only (git diff / git status)
Code analysis: apply the `lsp-code-analysis` skill (LSP first, Grep/Glob fallback)
Return exactly the ## Debug Outcome block your role prompt defines.
)
## Debug Outcome
- OUTCOME: <RESOLVED | UNRESOLVED>
Same parse discipline. RESOLVED carries a root cause and a fix plan;
UNRESOLVED carries the root cause found so far and why it is stuck.
Record the round on the task bean: ONE line appended under
## Validation —
- OUTCOME: <RESOLVED | UNRESOLVED> - <date>, debug round <n> — plus
the outcome mirror tag per Hard rule 9 (outcome-resolved /
outcome-unresolved, old family tag removed in the same call). The
debugger itself writes nothing; you record its outcome.
RESOLVED -> dispatch a fresh implementer (model: opus) with the fix
plan plus the Step 2 dispatch data, then a scoped re-review. Still
failing -> next debug round.UNRESOLVED, or two debug rounds exhausted -> mark the task blocked
in beans: append a ## Blocker note to the task bean body (root
cause, rounds attempted, date) and leave the status in-progress.
Escalate: four-part format plus an AskUserQuestion with options - you
intervene then re-invoke /sdd:impl to retry / skip to the next
actionable task for the rest of this run (the ## Blocker note keeps it
out of auto-selection per Step 0 and re-surfaces it on the next
invocation) / escalate to plan change / abort the feature.Before any completion claim, apply the verify-completion protocol
(${CLAUDE_PLUGIN_ROOT}/skills/verify-completion/SKILL.md) inline, claim
type TASK:
## Validation —
- STATUS: <VERIFIED | NOT_VERIFIED | MANUAL_VERIFY_REQUIRED> - <date>, verification gate —
plus the verification mirror tag per Hard rule 9 (old family tag
removed in the same call).VERIFIED -> Step 8.NOT_VERIFIED -> the evidence gap becomes a blocking finding; re-enter the
Step 5 fix loop under the same cycle counter.MANUAL_VERIFY_REQUIRED -> complete the beans/workspace updates that are
safe, then STOP with the missing verification presented as a concern in the
four-part format.## Report does not already carry
(verification gaps, accepted disputes): one line each, appended to
the task bean's ## Report.## Notes (later dispatches read the completed beans' ## Notes
as their learnings input).beans update <task-id> -s completed with a short
## Summary of Changes appended per the global beans guide.The stop report is SHORT: task ID, final status, review verdict, and verification result; optionally ONE line of test results if tests ran. No diff summary, no changed-file list, no beans recap.
Present any concern or deviation in the four-part format, verbatim:
1. Per plan: <what the task bean's ## Brief specified>
2. Actual: <what happened>
3. Why it matters: <consequence>
4. Options: accept as-is / fix now / change the plan / abort
Then ask via AskUserQuestion (recommended option first, labeled):
-s in-progress), runs one fix cycle with your feedback as the
input (same implementer via SendMessage where possible, else fresh sonnet
dispatch), scoped re-review, verification gate, beans update, and STOPs
again./sdd:spec-tasks).beans update <epic-id> -s scrapped and the same for every task bean of
the feature - plan tasks AND the three phase gate beans, which are its
task-type children too (append a one-line reason first), then stop. The
branch, spec, workspace, and bean files are the user's to carry away;
nothing else is touched.Entered from Step 9 "Continue" when all task beans are completed (or directly from Step 0 when invoked in that state).
workspace/review-package-final.md: the
committed diff since the feature branch diverged from the repository's
default branch (divergence point via git merge-base <default-branch> HEAD, diff via git diff <base>...HEAD) plus the uncommitted
working-tree remainder. Then
dispatch the code-reviewer: read
${CLAUDE_SKILL_DIR}/templates/code-reviewer-prompt.md, resolve, dispatch
with model: opus, package + spec paths + the feature's task bean
ids, plus the code-analysis instruction (apply the lsp-code-analysis
skill) (read-only beans show: their ## Notes sections are the
learnings, their ## Parking lot sections the parked minors).
Parse ## Review Verdict as usual; blocking findings start a
remediation round. Record the round on the EPIC bean: ONE line
under ## Validation —
- VERDICT: <APPROVED | REJECTED> - <date>, whole-branch review, package: workspace/review-package-final.md —
plus the verdict mirror tag per Hard rule 9 — and park the
code-reviewer's PARKING_LOT one-liners under the EPIC bean's
## Parking lot (one line each, same append form as task parking).Agent(
description: "Validate feature implementation",
subagent_type: general-purpose,
model: opus,
prompt: (paths and ids only)
Apply: <abs-path>/skills/validate-impl/SKILL.md
Feature: .sdd/specs/<feature>/ (requirements.md, design.md)
Workspace: .sdd/specs/<feature>/workspace/ (review packages)
Code analysis: apply the `lsp-code-analysis` skill for code claims (LSP first, Grep/Glob fallback)
Return the GO / NO_GO result with its evidence.
)
The validator writes no beans (its own hard rules); on parsing its
## Validation Summary, record the decision on the EPIC bean: ONE
line under ## Validation —
- DECISION: <GO | NO_GO | MANUAL_VERIFY_REQUIRED> - <date>, validate-impl —
plus the decision mirror tag per Hard rule 9 (old family tag
removed in the same call). Remediation rounds re-run the gate and
append their own round lines.
model: sonnet) fixing the
concrete findings -> scoped re-review (model: opus) -> re-run the failed
gate. GO plus an APPROVED whole-branch review ends the phase; still
failing after three rounds -> stop and escalate with the four-part format.## Parking lot sections of the feature's task beans plus the
EPIC bean's — the epic's lot carries the whole-branch minors), then an
AskUserQuestion:
Complete feature (Recommended) - epic bean -s completed with a short
summary; Leave open - the user continues manually; Abort - scrapped
handling as in Step 9.in-progress task bean is simply picked up again).## Brief, ## Report,
## Notes, ## Validation, ## Parking lot (spec Revisions 4+7).
Never re-parse documents for progress - beans answers that.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
15 skills in this plugin
/debugRoot-cause-first debugging protocol - reproduce, isolate, confirm the root cause, then plan the minimal fix. Use when an implementer is blocked, verification fails, or repeated remediation does not converge./discoveryEntry point for new work. Researches the user's idea against the codebase, the workstream brief, and beans state, then routes it via AskUserQuestion - extend an existing spec, no spec needed (answered directly in chat), a single new feature, or a sequential multi-spec initiative queued in beans. Writes .sdd/brief.md./initWrite the user-owned .claude/rules/sdd.md workflow-rules file from the plugin's default workflow map (single source of truth - no second copy anywhere). Refuses politely when the file exists and offers a read-only diff instead of overwriting. User-invoked.npx claudepluginhub jazz-man/claude-marketplace --plugin sdd