sdd-review
Skill0 starsChanged 8 months agoMITView on GitHub
Reviews implemented code against spec acceptance criteria, checks traceability, and flags backpropagation candidates. Invokes the sdd-evaluator agent for adversarial review. Use after /sdd-implement completes, before shipping, or when reviewing a PR.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- felipefontoura/pi-sdd-kittheir own version, first seen May 15, 2026
- sivaprasadreddy/sdd-skillstheir own version, first seen Apr 27, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- felipefontoura/pi-sdd-kit★ 34same name
- 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-implementSkill
- sdd-initSkill
- sdd-iterateSkill
- sdd-monitorSkill
- sdd-planSkill
- 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
24 rules. About 0 are common, 9 are distinctive, and 15 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
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 23
Use --auto when invoking from Mission Runner, CI, or any non-interactive context.
- Very specific: line 29
If PR number: get diff via gh pr diff
- Very specific: line 31
If commit range: git diff {range}
- Very specific: line 32
If story ID: find commits with matching Spec-Ref trailer
- Very specific: line 33
If omitted: git diff since last commit with Attempt: trailer
- Very specific: line 37
Read prd.json to find which stories are covered by the changes
- Distinctive: line 38
Read the relevant spec files (only the requirements referenced by those stories)
- Very specific: line 39
Read the constitution (${CLAUDE_PLUGIN_ROOT}/constitution.md)
- Very specific: line 40
Read accepted ADRs whose affects_specs intersects this scope (use sdd_query_adrs MCP tool when available.
- Distinctive: line 44
Before invoking the evaluator, run a premortem prompt over the diff: "It is 30 days from now.
- Distinctive: line 63
Test that exercises it (file:line)
- Distinctive: line 71
Do any of the premortem failure modes apply to this diff?
- Very specific: line 74
Do all commits have Spec-Ref: trailers?
- Very specific: line 81
If an ADR is contradicted, REQUEST_CHANGES with a recommendation: either supersede the ADR or revise the implementation.
- Distinctive: line 84
No injection vulnerabilities (SQL, command, XSS)
- Distinctive: line 85
No hardcoded secrets or credentials
- Distinctive: line 90
If so, flag as backpropagation candidates
- Very specific: line 101
If the evaluator's verdict is APPROVE, optionally invoke the sdd-skeptic agent for an independent second opinion.
- Very specific: line 145
Interactive mode (default): if reviewing a PR, ask: "Post this review as a PR comment?" If approved, post via gh pr comment.
- Very specific: line 147
Autonomous mode (
--auto): do NOT prompt. Write the §6 structured markdown to stdout for log capture, then write a JSON sidecar to: - Distinctive: line 153
Create parent directories as needed.
- Very specific: line 215
If verdict is request_changes or needs_work, the Mission Runner can route into /sdd-iterate (using backprop_candidates[].suggested_command) …
- Distinctive: line 223
Read-only analysis (no code modifications beyond the autonomous-mode sidecar)
- Very specific: line 225
Every spec requirement carries a {user-story, AC, test, code-line} quad — missing pieces block APPROVE.
≈ “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 Review
Spec-compliance code review with traceability verification.
Arguments
$ARGUMENTS — optional: a PR number, branch name, commit range, or story ID. If omitted, reviews all changes since the last Ralph run.
--auto — optional flag. Skips the §7 "Post this review as a PR comment?" interactive prompt and instead emits a structured JSON sidecar that the Mission Runner can consume. Default: omitted (human-driven). See "Modes" below.
Modes
This skill runs in two modes that share §1–§6 (scope detection, spec context, premortem, evaluator invocation, optional skeptic, structured markdown output) and diverge at §7:
- Interactive (default) — at §7, ask the operator "Post this review as a PR comment?"; if yes, post via
gh pr comment. The structured markdown from §6 is the primary output. - Autonomous (
--auto) — at §7, skip the prompt entirely. Write the §6 structured markdown to stdout AND a machine-readable JSON sidecar to<repoRoot>/.sdd/review-runs/STORY-{N}/review-{ts}.jsonwhereSTORY-{N}is the story ID inferred from the scope (orunscopedif no story ID is identifiable) and{ts}is a UTC ISO-8601 timestamp safe for filenames (YYYYMMDDTHHMMSSZ). Mission Runner reads this sidecar to drive next-step routing without parsing markdown. No PR comment is posted in autonomous mode.
Use --auto when invoking from Mission Runner, CI, or any non-interactive context. Default behavior is unchanged for human-driven /sdd-review.
Process
1. Determine review scope
- If PR number: get diff via
gh pr diff - If branch:
git diff main...{branch} - If commit range:
git diff {range} - If story ID: find commits with matching
Spec-Reftrailer - If omitted:
git diffsince last commit withAttempt:trailer
2. Load spec context
- Read prd.json to find which stories are covered by the changes
- Read the relevant spec files (only the requirements referenced by those stories)
- Read the constitution (
${CLAUDE_PLUGIN_ROOT}/constitution.md) - Read accepted ADRs whose
affects_specsintersects this scope (usesdd_query_adrsMCP tool when available; fall back to scanningcontext/decisions/)
3. Premortem (prospective hindsight)
Before invoking the evaluator, run a premortem prompt over the diff: "It is 30 days from now. This change has caused an incident in production. What was the failure mode? Walk through the most plausible cause."
Klein/Mitchell-Kamen research shows prospective hindsight identifies failure causes ~30% better than baseline. Capture the top 3 plausible failures; the evaluator will explicitly check the diff against each.
4. Invoke sdd-evaluator agent
Delegate to sdd-evaluator with:
- The diff
- The spec acceptance criteria (Given/When/Then)
- The story acceptance criteria from prd.json
- Accepted ADRs whose
affects_specscovers this story - The premortem-identified failure modes
The evaluator checks:
Spec Compliance — {user-story, AC, test, code-line} quad per requirement (mandatory):
For each acceptance criterion, the evaluator MUST produce a quad:
- User-story: the user story this requirement serves (from its
Serves:field or the parent story title) - AC text (verbatim from spec)
- Test that exercises it (file:line)
- Code line(s) that satisfy it (file:line)
The user-story anchor is mandatory. A missing user-story anchor blocks APPROVE with REQUEST_CHANGES — missing the story anchor is treated the same as a missing test or code-line. A missing element in any part of the quad = REQUEST_CHANGES.
Spec Compliance — semantic check:
- Does the implementation truly satisfy Given/When/Then, or does it just pass the test?
- Could any edge case violate a criterion?
- Do any of the premortem failure modes apply to this diff?
Traceability:
- Do all commits have
Spec-Ref:trailers? - For two-commit pattern: does each story have BOTH a
test:andfeat:commit, withtest:precedingfeat:? - Are there orphan changes (files not linked to any spec)?
- Does git log match prd.json story list?
ADR conformance:
- Does the implementation respect every accepted ADR whose
affects_specscovers this scope? - If an ADR is contradicted, REQUEST_CHANGES with a recommendation: either supersede the ADR or revise the implementation.
Security (per constitution):
- No injection vulnerabilities (SQL, command, XSS)
- No hardcoded secrets or credentials
- Auth/authz checks present where needed
Backpropagation Signals:
- Are any commits manual fixes (
fix:prefix withoutAttempt:trailer)? - If so, flag as backpropagation candidates
- Auto-suggest running
/sdd-iterateon them (don't silently flag).
Verification record evidence (per Phase 2.2 of spec-plugin-v1.md). When the diff touches a spec referenced by a backprop entry in context/impl/backprop-log.json, surface that entry's verification status in the review evidence. Read the log dual-shape:
- New entries (post-§2.2) carry a structured
verificationobject (command,artifact_path,production_entrypoint,calibration_lineage,wiring_audit_pass,auditor,notes). Cite the relevant fields directly as review evidence. - Legacy entries (pre-§2.2) have only the
verified_via_ralphboolean and noverificationrecord (orverification: nullpost-migration). Surface the boolean and flag the entry aslegacy pre-§2.2 — no structured evidence available. Do NOT treat a legacyverified_via_ralph: trueas equivalent to a current verification record; it predates the structured-evidence requirement and the cross-family wiring-audit gate.
The dual-shape read stays open until v1.x decides on verified_via_ralph removal timing (open question in spec-plugin-v1.md).
5. Optional adversarial round (Skeptic)
If the evaluator's verdict is APPROVE, optionally invoke the sdd-skeptic agent for an independent second opinion. Different system prompt, no shared context with the evaluator. The skeptic's only job: find what the evaluator missed.
This is the "diversity of attack" pattern — different prompt = different blind spots. Recommended for: high-risk diffs (touching auth, data layer, money), large diffs (>200 LOC), or any diff where the evaluator's verdict feels glib.
6. Structured output
## SDD Review
### Premortem failure modes considered:
1. {failure mode 1} — addressed | unaddressed
2. {failure mode 2} — ...
3. {failure mode 3} — ...
### Spec Compliance: {N}/{total} requirements verified
- SPEC-{slug}-001: PASS | FAIL | UNTESTED
- User-story: {story title or ID this requirement serves}
- AC: "{verbatim from spec}"
- Test: {file:line}
- Code: {file:line}
- SPEC-{slug}-002: ...
### Traceability: COMPLETE | GAPS
- Commits with Spec-Ref: {N}/{total}
- Two-commit pattern (test before impl): {N}/{stories} stories
- Orphan changes: {list or "none"}
### ADR conformance: PASS | VIOLATIONS
- {ADR-NNN}: respected | contradicted ({explanation})
### Security: PASS | ISSUES
- {issue description if any}
### Backpropagation Candidates: {N}
- {commit hash}: {why it's a candidate} → suggest `/sdd-iterate {hash}`
### Skeptic findings (if run): {list or "none"}
### Verdict: APPROVE | REQUEST_CHANGES
{One sentence summary}7. Post to PR or emit sidecar (mode-dependent)
Interactive mode (default): if reviewing a PR, ask: "Post this review as a PR comment?" If approved, post via gh pr comment.
Autonomous mode (--auto): do NOT prompt. Write the §6 structured markdown to stdout for log capture, then write a JSON sidecar to:
<repoRoot>/.sdd/review-runs/STORY-{N}/review-{ts}.jsonCreate parent directories as needed. The sidecar shape:
{
"schema_version": 1,
"scope": "STORY-3 | PR#42 | branch/foo | <range>",
"story_id": "STORY-3 | null",
"verdict": "approve | request_changes | needs_work",
"timestamp_utc": "2026-05-15T18:42:31Z",
"premortem_failure_modes": [
{ "summary": "string", "addressed": true }
],
"spec_compliance": {
"verified": 0,
"total": 0,
"findings": [
{
"requirement_id": "SPEC-foo-001",
"status": "pass | fail | untested",
"ac_text": "verbatim from spec",
"test_ref": "path/to/test.py:42",
"code_ref": "path/to/impl.py:88",
"notes": "string"
}
]
},
"traceability": {
"status": "complete | gaps",
"spec_ref_commits": { "present": 0, "total": 0 },
"two_commit_pattern_stories": { "present": 0, "total": 0 },
"orphan_changes": ["path/to/file"]
},
"adr_conformance": [
{ "adr_id": "ADR-001", "status": "respected | contradicted", "notes": "string" }
],
"security": { "status": "pass | issues", "issues": ["string"] },
"backprop_candidates": [
{ "commit_hash": "abc123", "reason": "string", "suggested_command": "/sdd-iterate abc123" }
],
"skeptic_findings": ["string"],
"recommended_actions": [
{ "kind": "fix | spec_amend | iterate | none", "target": "string", "rationale": "string" }
],
"verdict_summary": "one-sentence summary"
}verdict values map from the §6 markdown verdict: APPROVE → approve, REQUEST_CHANGES → request_changes. Use needs_work when the evaluator returned APPROVE but the skeptic flagged blocking issues.
Worked example for Mission Runner consumers:
# Mission Runner invokes /sdd-review on a story it just shipped:
claude --print "/sdd-review STORY-3 --auto"
# Reads the resulting sidecar, branches on verdict:
cat .sdd/review-runs/STORY-3/review-20260515T184231Z.json \
| jq -r '.verdict, (.recommended_actions[] | .kind)'
# approve
# noneIf verdict is request_changes or needs_work, the Mission Runner can route into /sdd-iterate (using backprop_candidates[].suggested_command) or surface recommended_actions to the operator.
8. Log to progress
Append to progress.txt: [{timestamp}] [PASS|FAIL] Review: {scope} — {verdict} (both modes).
Output contract
- Read-only analysis (no code modifications beyond the autonomous-mode sidecar)
- Premortem run before evaluator invocation
- Every spec requirement carries a
{user-story, AC, test, code-line}quad — missing pieces block APPROVE; missing user-story anchor is treated the same as a missing test or code-line (REQUEST_CHANGES) - ADR conformance checked
- Two-commit pattern verified per story
- Backpropagation candidates surfaced WITH a suggested
/sdd-iteratecommand - progress.txt updated
- In
--automode: structured JSON sidecar written to<repoRoot>/.sdd/review-runs/STORY-{N}/review-{ts}.jsonand no interactive PR-comment prompt
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.

