shepherd
shepherd is a Claude Code plugin for running coding work through a controlled,
human-gated loop. /shepherd <task> separates product triage, request verification,
design, success criteria, implementation, review, tests, fulfillment, and create-PR
approval into durable files under .shepherd/.
The core principle: the orchestrator routes; subagents judge; files are the only
handoff. Every judgment — the claim ledger, the design, the success criteria, each
review, the fulfillment check — is a subagent writing one file with a narrow read set.
The orchestrator never authors a judgment file; it dispatches, shows you the results,
and records your feedback verbatim.
Three properties matter most:
- The design is shaped with you. After a cheap triage and an always-on fact check,
subagents draft a product-first design and independent success criteria. shepherd then
iterates with you in chat — one question at a time, each with a recommended answer,
product questions first. Your answers go verbatim into a feedback file and the
architect revises its own draft in a cheap revision pass. The design gate becomes a
quick confirmation of something you already shaped.
- Judgments are blind. The architect never sees the success criteria; the criteria
author never sees the proposed solution; reviewers get pasted design + criteria + diff
- tests plus read access to the repository itself — never the implementer's claims or
each other's findings. Blindness applies to judgments, never to ground truth.
- "Done" is checked, not claimed. Before the create-PR confirm, a fulfillment
subagent judges the diff and tests against the success criteria written before the
solution existed —
MET | NOT MET per criterion, with evidence.
Flow
The diagram above is the map; the block below is the same run as a quick text
reference, and the collapsible holds a Mermaid version for editing.
Mermaid flow diagram
flowchart TD
Start["/shepherd <task>"] --> Triage["Triage (orchestrator)<br/>PROCEED / DEFER / DECLINE"]
Triage -->|PROCEED| Verify["Verify (subagent, always)<br/>claim ledger"]
Triage -->|DEFER or DECLINE| Stop["Stop with recommendation"]
Verify -->|claims hold| Draft["Architect drafts 2-design.md<br/>then success criteria (blind)"]
Verify -->|stale / already fixed| Stop
Draft --> Iterate["Iterate with the human<br/>feedback file + revision passes"]
Iterate --> Gate{"Design gate<br/>approve design + criteria + panel"}
Gate -->|approved| Implement["Implement approved design"]
Gate -->|revise| Iterate
Implement --> Oracle["Run oracle commands"]
Oracle --> Reviewers["Run blind reviewers"]
Reviewers --> Clean{"Oracle green,<br/>all findings fixed?"}
Clean -->|no| Implement
Clean -->|yes| FinalReview["Final reviewers (if configured)"]
FinalReview -->|findings| Implement
FinalReview -->|clean| Fulfillment["Fulfillment check<br/>criteria vs reality"]
Fulfillment -->|NOT MET| Implement
Fulfillment -->|MET| CreatePrConfirm{"Create-PR confirm<br/>commit & open PR?"}
CreatePrConfirm -->|yes| Finish["Commit / push / PR"]
CreatePrConfirm -->|no| Hold["Wait"]
/shepherd <task>
triage (orchestrator product screen; no gate, stops only on DEFER/DECLINE)
verify (subagent, always) -> claim ledger; stops if the request is stale
architect + success criteria -> blind drafts
iterate with the human -> feedback file + revision passes
-> DESIGN GATE: approve design + criteria + panel
implement -> oracle -> blind reviewers -> final reviewers
(loop until every finding is fixed)
fulfillment (subagent) -> every criterion MET, or reopen / ask
create-PR confirm (plain chat) -> commit / PR
There are two human gates: the design gate before source edits and the create-PR
confirm before opening the PR. Triage is deliberately cheap and continues unless it
recommends DEFER or DECLINE.
At the design gate, shepherd writes _panel.json so each run gets the right reviewer
set for its risk: a small bug can use a small panel, while a core or public-contract
change can use the full roster. The panel also pins the model for each stage — every
auto is resolved to a concrete model by role and complexity tier and shown to you to
bump up or down before approving. Approval covers the design, the success criteria, and
the panel together.