From sdd
Execute the current sprint checklist. Builds each item according to spec references and acceptance criteria.
How this skill is triggered — by the user, by Claude, or both
Slash command
/sdd:buildThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Read `skills/sdd-guide/SKILL.md` for shared behavior before executing this command. Follow its tone, interaction rules, and guard rails throughout.
Read skills/sdd-guide/SKILL.md for shared behavior before executing this command. Follow its tone, interaction rules, and guard rails throughout.
Read skills/sdd-guide/references/context-loading.md for the loading rules that govern this command. /sdd:build uses surgical context loading — it loads per-item spec and PRD sections, never full documents.
Read skills/sdd-guide/references/living-documents.md for the update protocol. Build work may reveal new patterns that need to be captured in CLAUDE.md or AGENTS.md.
On startup, load the following in order:
skills/sdd-guide/SKILL.md (shared behavior)skills/sdd-guide/references/context-loading.mdskills/sdd-guide/references/living-documents.mdCLAUDE.md (project root) — always loaded in full, regardless of length. CLAUDE.md instructs reading AGENTS.md as part of its content; follow that instruction.docs/project-state.json — read currentSprint, buildMode, commandExplanationsShown, and lastCommanddocs/sprint-N.md where N is currentSprint from project-state.jsonDo not load the full docs/spec.md or full docs/prd.md at startup. Spec and PRD sections are loaded surgically per item during the build loop.
All prerequisites are checked before any work begins. If any check fails, stop immediately.
docs/project-state.json must exist and parse as valid JSON. If missing or invalid: "Run /sdd:scope first."currentSprint must be set in docs/project-state.json. If missing: "Run /sdd:sprint first."docs/sprint-N.md (where N = currentSprint) must exist. If missing: "Run /sdd:sprint first."### item heading whose Status line contains [ ]). If all items are checked: "Sprint complete. Run /sdd:iterate to add polish work or /sdd:reflect to review the sprint."Before doing any other work:
lastCommand to "/sdd:build" in docs/project-state.json.docs/open-concerns.md per sdd-guide open concerns protocol.Check docs/project-state.json for commandExplanationsShown.build.
If build has NOT been shown (or commandExplanationsShown does not exist):
Output the following as plain text. This is not a question — do not wait for acknowledgment. Output it and continue.
What /sdd:build does
Build executes your sprint checklist one item at a time. For each item, it loads only the specific spec section and PRD story referenced in the checklist — not the entire documents. This surgical loading keeps context focused on exactly what needs to be built.
Each item is built according to its spec reference and verified against its acceptance criteria. Tests are written when the testing strategy calls for them. After each item, the sprint checklist is updated and you review what was built before moving on.
If something breaks, we stop, assess, and fix it together before continuing. The sprint checklist is a living document — it adapts when plans meet reality.
After outputting, set commandExplanationsShown.build to true in docs/project-state.json.
If build HAS been shown: Skip the explanation entirely. Do not mention it.
Read buildMode from docs/project-state.json. Branch on its value:
buildMode is "step-by-step": follow the Step-by-Step Mode section below.buildMode is "autonomous": follow the Autonomous Mode section below.buildMode is missing or unrecognized: default to step-by-step mode and inform the user.Build mode is locked for the entire sprint. Do not offer to switch modes. If the user asks to switch, explain that build mode is set during /sdd:sprint and locked for the sprint's duration.
Read docs/open-concerns.md. Check for any concerns that are relevant to the current sprint or the next item to be built. Surface anything the user should be aware of before building begins.
Read the current sprint file (docs/sprint-N.md). Find the first ### item heading whose Status line contains [ ] (not started or incomplete).
If no unchecked items remain: "Sprint complete. Run /sdd:iterate to add polish work or /sdd:reflect to review the sprint." Stop.
Report to the user which item is next. Include the item title and a brief summary of what will be built.
From the unchecked item, extract:
spec.md > API Design > Authentication Endpointsprd.md > User Authentication > Login FlowLoad only the referenced section from docs/spec.md. Navigate to the exact heading path and extract that subsection. Do not load the full spec.
Load only the referenced story from docs/prd.md. Navigate to the exact epic and story and extract that section. Do not load the full PRD.
If either reference cannot be found (heading does not exist, file structure has changed):
Build the implementation described in the item's What to build field, guided by:
CLAUDE.md and AGENTS.md conventions — these define project-wide patterns and coding standards.Work through the implementation methodically. Follow the spec's architecture and patterns. Respect existing code conventions from CLAUDE.md.
Check the item's Verification field and the project's testing strategy (from the spec).
If the testing strategy calls for automated tests:
If manual verification is specified:
If both automated and manual verification apply: do both.
Present a summary to the user:
This is the user's opportunity to review before the item is marked complete. Wait for the user to confirm the item is acceptable. If the user identifies issues, address them before proceeding.
Once the user confirms, update the sprint file:
[ ] Not started to [x] Complete.If the build revealed new patterns, conventions, or architectural decisions that should apply to future work:
CLAUDE.md with Claude-specific conventions (coding patterns, file organization rules, testing conventions).AGENTS.md with agent-agnostic project context (architecture decisions, data flow patterns, API conventions).Follow the living-documents reference: show the user what changed and why. These updates are lightweight — only add what is genuinely new and project-wide. Do not add item-specific details that only matter for this one checklist item.
If no new patterns emerged, skip this step.
Update docs/open-concerns.md per sdd-guide protocol:
If no concerns changed, skip this step.
Append build notes to process-notes-sprint-N.md where N is the current sprint number.
Capture:
Tell the user:
"Item N is complete. Run /clear, then /sdd:build to continue with the next item."
This clears the context window of implementation details from the completed item, keeping the next build cycle focused. Do not automatically proceed to the next item in step-by-step mode.
Autonomous mode works through multiple checklist items sequentially, pausing at checkpoints for user review. It uses subagents to execute individual items.
Read docs/open-concerns.md. Surface anything the user should be aware of before the autonomous build begins.
Read the current sprint file and list all unchecked items (items whose Status line contains [ ]). Report the total count to the user and confirm they are ready to begin the autonomous build.
For each unchecked item, in sequence:
Extract the Spec ref and PRD ref from the item. Load only the referenced spec subsection and PRD story — not full documents. This is the same surgical loading as step-by-step mode.
Use the Agent tool to spawn a subagent for the item. Provide the subagent with:
CLAUDE.md and AGENTS.md for project conventions.The subagent builds the item, writes any tests called for by the verification field, and commits the work.
When the subagent finishes, note:
If the subagent reports a failure, follow the Error Handling protocol below — stop the autonomous build and work with the user before continuing.
Update the sprint file: change the item's Status from [ ] to [x] and check off its acceptance criteria.
If the subagent's work revealed new patterns or conventions, update the living documents per the living-documents reference. Show the user what changed.
After completing the item, check whether a user review checkpoint is due. Checkpoints occur every 3-4 items.
If this is a checkpoint:
If this is NOT a checkpoint: continue to the next item without pausing.
When all items are built (or the build is stopped due to errors):
docs/open-concerns.md with any new concerns from the build.process-notes-sprint-N.md.Tell the user: "Sprint build complete. Run /sdd:iterate to add polish work or /sdd:reflect to review the sprint."
In autonomous mode, do not write per-item process notes during the build. The subagents handle the work; the orchestrator keeps moving. Write a single summary to process-notes-sprint-N.md at the end (Step 4).
Build mode cannot be switched during a sprint. If the user asks to switch to step-by-step, explain that the mode was set during /sdd:sprint and is locked until the next sprint.
When /sdd:build is invoked after a /clear (which is the normal flow in step-by-step mode), reload context in this exact order:
docs/sprint-N.md) — find the next unchecked item.docs/open-concerns.md — check for anything relevant to the current item.docs/project-state.json — confirm build mode, sprint number, and last command.This order ensures: project conventions first, then the immediate task, then supporting context. Do not load the full spec or full PRD during re-entry.
After reloading, resume at Step 2 of the step-by-step flow (identify the next unchecked item). The startup sequence (state updates, first-run explanation) does not repeat on re-entry — the explanation was already shown and lastCommand is already set.
If something breaks during a build step — a test fails repeatedly, the implementation contradicts the spec, a dependency is missing, or the build produces unexpected results:
The sprint checklist adapts when plans meet reality. Revising it is not failure — it is the normal workflow when implementation reveals something the plan did not anticipate.
/clear and /sdd:build again. Never batch multiple items in step-by-step mode./sdd:sprint and cannot be changed until the next sprint./sdd:build in the project. Check commandExplanationsShown.build — do not show it on subsequent builds or sprints./sdd:build invocations are re-entries after /clear. The re-entry load order is optimized for this — follow it exactly.docs/open-concerns.md. Do not modify the spec or approved PRD stories without going through /sdd:refine.npx claudepluginhub zabuuq/sdd-plugin --plugin sddGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.