sdd-implement
Skill0 starsChanged 8 months agoMITView on GitHub
Executes the next incomplete story from prd.json using TDD with fresh context per task. Integrates with the Ralph stop hook for autonomous looping, or can be invoked manually one story at a time. Use after /sdd-plan to start building.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- sivaprasadreddy/sdd-skillstheir own version, first seen Apr 27, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- sivaprasadreddy/sdd-skills★ 32same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- sdd-adrSkill
- sdd-initSkill
- sdd-iterateSkill
- sdd-monitorSkill
- sdd-planSkill
- sdd-reviewSkill
- sdd-runSkill
- sdd-specSkill
- sdd-standupSkill
- sdd-statusSkill
- sdd-triageSkill
- sdd-ux-validateSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
27 rules. About 0 are common, 12 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
When N > 1, the implement phase delegates to the sdd-supervisor agent, which fans out up to N stories in isolated worktrees.
- Distinctive: line 21
If omitted, picks the highest-priority incomplete story from the runnable frontier (serial, N=1).
- Very specific: line 28
If none found, suggest running /sdd-plan first.
- Very specific: line 30
If $ARGUMENTS specifies a story ID, use that
- Distinctive: line 33
If no actionable stories remain, report completion and exit
- Very specific: line 52
Parallel dispatch (--parallel N, N > 1): When the --parallel N flag is set with N > 1, skip the single-story selection and dispatch flow …
- Very specific: line 71
Read bindingGate from the story (default: "code" if absent).
- Distinctive: line 90
Write a failing test that captures the acceptance criteria
- Distinctive: line 91
Write minimal code to make the test pass
- Very specific: line 115
Only one marker file per workspace — the file is .sdd/spec-lock (no versioning, no nesting).
- Very specific: line 117
If the operator aborts mid-implementation (e.g., CTRL-C, session restart), the marker may be left behind.
- Distinctive: line 122
After the implementer completes, check:
- Very specific: line 127
If the project warrants it (complex logic, security-sensitive), optionally invoke the sdd-evaluator agent to adversarially review the …
- Very specific: line 136
Check whether the implementer is the sole author of those gating tests.
- Distinctive: line 139
If independently-authored outcome-assertions exist (committed prior to or by a different agent than the implementer), those are the gating …
- Distinctive: line 151
If any check returned non-zero exit:
- Distinctive: line 152
Do NOT mark the story done.
- Distinctive: line 155
If all checks return zero exit, mark the story done as today.
- Very specific: line 162
Update prd.json: set passes: true for this story, increment attempts
- Distinctive: line 163
Commit all changes with conventional commit message and required trailers:
- Very specific: line 171
Update context/impl/impl-{domain}.md with learnings
- Very specific: line 175
If attempts >= maxAttempts: set notes to explain the failure, flag as escalated
- Distinctive: line 177
Do NOT commit broken code
- Distinctive: line 182
If the Ralph stop hook is active, it will automatically inject the next story prompt
- Very specific: line 183
If running manually, suggest: "Run /sdd-implement again for the next story"
- Very specific: line 187
When the Stop hook (hooks/scripts/ralph-stop-hook.sh) is active, this skill runs automatically in a loop:
- Very specific: line 202
No modifications to context/specs/ (immutable during implementation)
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
SDD Implement
Execute the next story from prd.json with fresh context and TDD.
Arguments
$ARGUMENTS — optional story ID (e.g., "STORY-3") to implement a specific story, or flags:
--parallel N— run up to N stories concurrently on the runnable frontier (default: 1, serial). When N > 1, the implement phase delegates to thesdd-supervisoragent, which fans out up to N stories in isolated worktrees. The supervisor computes the runnable frontier — stories whosedependencies[]are allphase: "done"— and dispatches only those stories. Stories with unsatisfied dependencies are not actionable and are skipped until their deps close. Serial behavior (N=1) is unchanged from v1.1.
If omitted, picks the highest-priority incomplete story from the runnable frontier (serial, N=1).
Process
1. Locate and read prd.json
- Find
*.prd.jsoninspec/active/. If multiple exist, ask user which one. - If none found, suggest running
/sdd-planfirst. - Parse the file and identify the target story:
- If
$ARGUMENTSspecifies a story ID, use that - Otherwise, find the highest-priority story where the story is not done and
attempts < maxAttempts - Phase-first read (v1.1+): a story is "done" when
phase == "done". Legacy PRDs without aphasefield fall back topasses == true. Never readpassesalone to determine done status on PRDs that carry aphasefield. - If no actionable stories remain, report completion and exit
- If
2. Load fresh context (critical pattern)
Load ONLY the context needed for this one story. Do NOT read unrelated specs or stories. This prevents context contamination across tasks.
Read these files:
- The spec file at the path in
prd.json.specPath— but only the sections matching this story'sspecRequirementsIDs - The plan file at
context/plans/plan-{slug}.md— but only the section for this story - The implementation tracking at
context/impl/impl-{domain}.mdif it exists — for learnings from previous iterations progress.txt— last 20 lines only, for recent context
Do NOT read:
- Other stories' code or implementation details
- Unrelated specs
- The full plan (only this story's section)
3. Delegate to sdd-implementer agent (serial) or sdd-supervisor (parallel)
Parallel dispatch (--parallel N, N > 1): When the --parallel N flag is set with N > 1, skip
the single-story selection and dispatch flow below. Instead, invoke the sdd-supervisor agent with:
- The PRD file path
- The
--parallel Nvalue as the concurrency cap (overrides the PRD'smaxConcurrencyfor this run) - The
same_family_warningcomputed before dispatch
The supervisor reads the PRD, computes the runnable frontier (stories whose dependencies[] are all
phase: "done" and attempts < maxAttempts), and fans out up to min(N, maxConcurrency) stories
into isolated worktrees. After the supervisor batch completes, update prd.json and progress.txt as
described in step 5. Then return — the stop hook (if active) will re-invoke for the next frontier.
Serial dispatch (N=1, default): proceed with the single-story path below.
First, compute the iteration phase from the story. Let N = story.attempts + 1 (the upcoming try, 1-indexed) and M = story.maxAttempts (default 3):
N == 1→ EXPLOREN == M→ ESCALATE- otherwise → REFINE
Read bindingGate from the story (default: "code" if absent). Route as follows:
"code"→ TDD pipeline + sdd-evaluator only. The story closes when all code-gate tests pass and sdd-evaluator issues a PASS verdict. No UX gate invoked."ux"→ sdd-ux-validate only. The story closes when the ux-validator manifest reports all assertions passing (pass or fail_expected). No TDD pipeline required for story close."mixed"→ both gates required. The story does not close until the TDD pipeline passes AND sdd-ux-validate issues a passing manifest. Either gate failing alone is insufficient for story close.
Then extract the target repo root from the PRD: read repoRoot at the top level. If present, it's an absolute filesystem path; include it verbatim in the implementer prompt as "cd here before any Write/Edit; all story writes paths resolve relative to this directory." If absent and the story's writes paths contain a sibling-repo-looking prefix (e.g., <repo-name>/src/...), STOP and report "PRD missing repoRoot — implementer cannot disambiguate writes target" rather than proceeding. The prd.json schema documents this field; see also context/decisions/sdd-reporoot-convention-2026-04-22.md for the incident that motivated it.
Invoke the sdd-implementer agent via the Task tool with a focused prompt containing:
- The story block from prd.json (id, title, acceptanceCriteria, specRequirements)
- The relevant spec requirements (Given/When/Then criteria)
- The relevant plan section (files to create/modify, complexity budget)
- The
repoRootpath (from the PRD, if set) with the instruction tocdthere before any Write/Edit - Quality gate commands (from
AGENTS.md,templates/quality-gates.yml, or auto-detected) - An iteration-phase directive — include exactly one of these, substituting
NandM:- EXPLORE (
N=1):"Attempt 1 of M. First try — consider multiple approaches before committing to one. Err broader here; later attempts can narrow." - REFINE (middle):
"Attempt N of M. A previous attempt did not pass gates. Read context/impl/impl-{domain}.md and the last 20 lines of progress.txt for what was tried — narrow toward the path that got furthest. Fix what broke; do not restart from scratch." - ESCALATE (
N=M):"FINAL attempt (N of M). Make the smallest possible change that could pass gates. Do not start a new approach. If no clear path is visible, STOP and report what is blocking — flag the story for escalation by writing to notes rather than committing speculative code."
- EXPLORE (
The implementer works in the current worktree. It implements using TDD:
- Write a failing test that captures the acceptance criteria
- Write minimal code to make the test pass
- Refactor if needed (without changing behavior)
- Run quality gates
3b. Spec lock lifecycle
The spec-immutability hook (hooks/scripts/prevent-spec-edit.py) gates on the .sdd/spec-lock marker file. This skill owns the lifecycle of that marker.
On first story dispatch (when N == 1 and the feature is starting): write .sdd/spec-lock with the feature slug (or PRD project name) as its contents. This signals that /sdd-implement is active and specs must not be edited mid-flight.
# Example: write the marker when starting a feature
mkdir -p .sdd
echo "plugin-v1.1" > .sdd/spec-lockOn phase-complete (all stories are passes: true OR all remaining stories have attempts >= maxAttempts and are escalated): remove .sdd/spec-lock.
# Example: remove the marker when the feature is done
rm -f .sdd/spec-lockInvariants:
- Only one marker file per workspace — the file is
.sdd/spec-lock(no versioning, no nesting). - Contents are the feature slug for human readability; the hook only checks presence, not contents.
- If the operator aborts mid-implementation (e.g., CTRL-C, session restart), the marker may be left behind. Remove it manually to re-enable spec editing:
rm .sdd/spec-lock. - The marker is specific to
/sdd-implement. Other skills (/sdd-spec,/sdd-plan,/sdd-iterate) do not write or remove it.
4. Evaluate results
After the implementer completes, check:
- Did quality gates pass? (Run them yourself to verify — don't trust self-reporting)
- Were all acceptance criteria addressed?
- Is the implementation within the complexity budget?
If the project warrants it (complex logic, security-sensitive), optionally invoke the sdd-evaluator agent to adversarially review the implementation against the spec. Cap at 2 evaluate-fix cycles.
Author–Verifier Independence at story close (C2 / Article 14)
The gating contract for story close is the plan-time outcome-assertion set (authored at /sdd-plan time, per §2.9, by an agent that is not the implementer). The implementer's own TDD tests are scaffolding only — they drive the TDD sequence but do NOT by themselves constitute the gating contract for story closure.
Before marking a story done, verify:
- Identify the gating test(s) — the outcome-assertions from
prd.json assertions[]that this story covers (viacovered_byorassertion_ids). - Check whether the implementer is the sole author of those gating tests. If the gating tests were committed in the implementer's own
test:commit and no independently-authored assertion file pre-exists:- Reject story close. Emit:
"Story cannot close — gating test not independently authored. The outcome-assertion set must be authored at plan time by a non-implementer agent. The implementer's TDD scaffolding tests do not satisfy the gating contract." - The story remains open; escalate to the operator to supply an independently-authored assertion set.
- Reject story close. Emit:
- If independently-authored outcome-assertions exist (committed prior to or by a different agent than the implementer), those are the gating contract. The implementer's own TDD tests still run and must pass, but story close requires the independently-authored gate.
This rule implements Article 14 (Author–Verifier Independence) at the story-close gate: the runner/grader of the gating test must not be the sole author of it.
Story-close checks (W1.5 / goose retry.checks lift)
At story close, before marking the story done:
- For each command in
story.checks(if any): a. Run the command in the project root. b. Capture exit code and last 200 chars of combined stdout/stderr. c. Append tostory.checks_resultas{cmd, exit_code, output_snippet}. - If any check returned non-zero exit:
- Do NOT mark the story done.
- Emit:
"Story cannot close — checks failed: [cmd_1: exit_X, cmd_2: exit_Y]. Fix the underlying issue or remove the check from the story (operator decision) and re-attempt close." - Story remains open until all checks pass or the failing check is removed.
- If all checks return zero exit, mark the story done as today.
Stories without checks (or with checks: []) skip this step entirely — zero regression vs. pre-W1.5 behavior. Programmatic harness enforcement (running checks outside the agent loop) is deferred; until then this is operator-enforced via skill discipline.
5. Update state
If gates pass:
- Update prd.json: set
passes: truefor this story, incrementattempts - Commit all changes with conventional commit message and required trailers:
feat: {story title} Spec-Ref: {specPath} Attempt: {attempt number} - Append to
progress.txt:[{timestamp}] Completed {story_id}: {title} (attempt {N}) - Update
context/impl/impl-{domain}.mdwith learnings
If gates fail:
- Increment
attemptsin prd.json - If
attempts >= maxAttempts: setnotesto explain the failure, flag as escalated - Append to
progress.txt:[{timestamp}] Failed {story_id}: {title} (attempt {N}) — {reason} - Do NOT commit broken code
6. Report and continue
- Report what was accomplished (or what failed and why)
- If the Ralph stop hook is active, it will automatically inject the next story prompt
- If running manually, suggest: "Run
/sdd-implementagain for the next story"
Ralph Loop Integration
When the Stop hook (hooks/scripts/ralph-stop-hook.sh) is active, this skill runs automatically in a loop:
- Claude implements a story and tries to exit
- The stop hook detects incomplete stories in prd.json
- The hook blocks the exit and injects the next story prompt
- Claude implements the next story
- Repeat until all stories pass or are escalated
To activate the stop hook, install the plugin. To deactivate, remove or rename spec/active/*.prd.json.
Output contract
- One story implemented per invocation (never multiple)
- prd.json updated (passes/attempts)
- Git commit with Spec-Ref and Attempt trailers (only if gates pass)
- progress.txt updated
- No modifications to context/specs/ (immutable during implementation)
- Stories declaring a
checksarray have all checks pass before close (non-zero exit blocks) andstory.checks_resultrecords each command's outcome.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

