From shepherd
Build features through a strict, hook-enforced, spec-driven, test-first workflow: design sketch → human approval → EARS requirements spec → human approval → failing tests committed red → implementation until green (red-green). Use whenever the user wants to build, add, or implement a feature, endpoint, or behavior change — including right after an implementation plan is approved — by offering this workflow via AskUserQuestion before writing code directly. This applies even in a fresh project with no .shepherd/ setup yet: the skill initializes setup itself on first run, so the absence of a .shepherd/ directory is NOT a reason to skip the offer. Also use on any mention of test-driven development (TDD), test-first, red-green, EARS, design sketch, requirements spec, or acceptance criteria; when a .shepherd/ directory is present; or when the user asks to set up, resume, or check the status of a shepherd feature.
How this skill is triggered — by the user, by Claude, or both
Slash command
/shepherd:spec-implementThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Drives one feature's full spec-implement lifecycle through a headless Python orchestrator
references/bootstrap_prompt.mdreferences/design_prompt.mdreferences/impl_prompt.mdreferences/playbook.mdreferences/requirements_prompt.mdreferences/testgen_prompt.mdreferences/verifier_coverage_prompt.mdreferences/verifier_triage_prompt.mdscripts/spec_implement.pyscripts/spec_implement_agent.pyscripts/spec_implement_bootstrap.pyscripts/spec_implement_contracts.pyscripts/spec_implement_fake_runner.pyscripts/spec_implement_git.pyscripts/spec_implement_hooks.pyscripts/spec_implement_loop0.pyscripts/spec_implement_loop1.pyscripts/spec_implement_loop2.pyscripts/spec_implement_loop3.pyscripts/spec_implement_scan.pyDrives one feature's full spec-implement lifecycle through a headless Python orchestrator
(spec_implement.py, built on the Claude Agent SDK) that runs four sequential loops:
spec-implement(<slug>): chore — add <framework>.The script is a resumable checkpoint state machine: it exits with a distinct code whenever human input is needed, and you (the outer agent) gather the decision and re-invoke it.
.shepherd/ folder.A fresh project with no .shepherd/ setup is not a reason to skip the
offer — the skill initializes setup itself (exit 22 → spec_implement.py init), so
setup is part of the workflow, not a precondition for it.
Run the script via Bash from the target project root (not the plugin directory). Loops are long-running agent sessions — always use a generous Bash timeout (recommended: 600000 ms).
python3 "${CLAUDE_PLUGIN_ROOT}/skills/spec-implement/scripts/spec_implement.py" <verb> ...
CLI grammar (pinned):
spec_implement.py init [--force]
spec_implement.py new <title...> [--task-stdin | --task-file PATH]
spec_implement.py run [--feature SLUG] [--force] [--decision approve|reject] [--feedback TEXT]
spec_implement.py status [--json]
--decision / --feedback on run:
--decision approve or --feedback "<corrections>" (design sketch)--decision approve or --feedback "<corrections>" (test framework)--decision approve or --feedback "<corrections>"--decision approve or --decision reject [--feedback "<why>"]--feedback "<answer>" (the implementer's question)--force overrides BRANCH_MISMATCH (21) only; never anything else.Brand-new task statement → pipe the full requirements via a heredoc:
python3 "${CLAUDE_PLUGIN_ROOT}/skills/spec-implement/scripts/spec_implement.py" new "<short title>" --task-stdin <<'EOF'
<full task statement: requirements, defaults, edge cases, acceptance criteria>
EOF
Note the slug it prints, then spec_implement.py run --feature <slug>. The task
statement is the design and spec agents' ONLY source of truth — they never
see this conversation. Carry over every concrete detail the user stated:
defaults (page sizes, limits, timeouts), edge cases, error behaviors,
acceptance criteria. Do not condense to a title; a detail dropped here is
invisible to every later loop. Prefer the heredoc; never write the statement
to a fixed-named file (those collide across concurrent agents).
If the heredoc delivers empty stdin (the Windows+WSL Bash-tool boundary
silently drops piped stdin), fall back to --task-file: Write the statement
to a unique scratch path under .shepherd/ (gitignored, dirty-tree-excepted),
then pass it — the engine reads and unlinks it:
python3 "${CLAUDE_PLUGIN_ROOT}/skills/spec-implement/scripts/spec_implement.py" new "<short title>" \
--task-file .shepherd/task-<short-title>.md
Existing feature slug → spec_implement.py run --feature <slug> directly.
Neither → bare spec_implement.py run and let branch convention or exit 20
resolve it.
Once the slug is known, thread --feature <slug> through every
subsequent invocation.
Before any run invocation, read
${CLAUDE_PLUGIN_ROOT}/skills/spec-implement/references/playbook.md — it carries the
full exit-code table (codes 0, 10, 11, 12, 13, 14, 15, 16, 20, 21, 22, 1) and the
per-code playbook. Branch on $? after every invocation and follow the
playbook exactly. Do not improvise responses to exit codes from memory.
On a fresh (e.g. marketplace) install the first invocation may fail with
missing required package(s) — nothing has installed the engine's Python deps
yet. The playbook's Dependency bootstrap covers this: install
claude-agent-sdk + pyyaml without sudo, then retry. Don't surface it as a
fatal error.
spec-implement(...). Commits like
spec-implement(<slug>): chore/red/green ... are made exclusively by the script; they
are audit artifacts of the spec-implement choreography..shepherd/features/*/.spec-implement/ by hand.
state.json, traceability.json, and reports/ are owned by the script.
Reading them is fine (and expected, to present reports to the human).AskUserQuestion
to collect approvals, corrections, and decisions, then re-invoke run with
--decision / --feedback.npx claudepluginhub dheerajgopi/claude-shepherd --plugin shepherdGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.