/lich-skills:spec-driven-dev-v2from lich-skills
Orchestrates multi-session, multi-task development with a Project → Sprint → Task hierarchy, isolated worktrees, review round-loops, and governance-as-code. Use for long-running agents (4+ hours, 8+ tasks) driven by /loop or similar orchestrators.
Ships in lich-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
v1 assumed one agent shipping one feature in one session. v2 assumes an orchestrator (or a human) driving the agent across many sessions — possibly for days — and keeps work correct the entire time.
v2 adds:
Use v2 if any of:
/critic, Agent subagent_type=critic, etc.) reviews each task/loop, autoresearch:ship, goal-driven) drives iterationFor one-session features, use spec-driven-dev (v1) — v2 is overhead for them.
context/
dev/
projects-001-<slug>/ # one project = one RFC
RFC.md # the contract: what & why
PLAN.md # sprint list + dependency graph
STATE.json # {current_sprint, status}
sprints-001-<slug>/ # one sprint = one checkpoint
SPRINT.md # goal, scope, exit criteria
TASKS.md # task status tracker
REVIEWS.md # review round log
STATE.json # {current_task, current_round, next_action}
tasks/
TK-001-<slug>.md # one task = one worktree
TK-002-<slug>.md
reviews/
RV-001-round1.md # round 1 for TK-001
RV-001-round2.md # after modify, round 2
RV-001-round3.md # …until verdict=approve
sprints-002-<slug>/
…
artifact-registry/
rules/
RULE-001-<slug>.md # captured pattern → lint rule
scripts/
governance-check.sh # boundary + state validator
task-lint.sh # mechanical task gate
All state is on disk. No in-memory plan. This is the contract with the
orchestrator: it can read STATE.json, pick up where the last session left
off, and advance one step.
Planner and Builder may be the same model. Reviewer must be a fresh subagent with no access to Builder's conversation — that is what makes review work.
Goal. Produce the RFC and sprint plan. No code.
RFC.md from templates/project/RFC.md — restate request, list
assumptions, define measurable success, set Always/Ask/Never boundaries.PLAN.md from templates/project/PLAN.md — decompose into sprints.
Each sprint must have a shippable checkpoint (even if behind a flag).STATE.json with current_sprint: "sprints-001-<slug>".Exit criteria.
Goal. Expand one sprint into atomic, independently-reviewable tasks.
SPRINT.md from templates/sprint/SPRINT.md — goal, scope, exit
criteria, what's deferred.tasks/TK-NNN-<slug>.md per task, from templates/task/TASK.md.TASKS.md from templates/sprint/TASKS.md — flat status table.scripts/task-lint.sh <sprint-dir> — every task must pass:
rollback: lineSTATE.json with current_task: "TK-001", current_round: 0.Exit criteria.
task-lint.sh exits 0Every task runs in a fresh git worktree (or branch on a clean tree). This is non-negotiable — it is what makes review and rollback possible.
Steps.
STATE.json, picks current_task.git worktree add ../wt-TK-NNN -b tk-NNN-<slug>.verify: command. If red, fix. Do not claim done on red.TASKS.md: status built, link commit range.STATE.json: next_action: "review", current_round: 1.Scope discipline. Touch only files listed in the task. If you need a file that isn't listed, stop, update the task spec, get re-approval. "While I'm here" refactors are a phase violation.
Exit criteria (per task).
tk-NNN-<slug> branch, tree greenTASKS.md + STATE.json updatedReview is a state machine, not a one-shot.
built ──▶ round1 ──┬──▶ approve ──▶ merged
│
└──▶ request_changes ──▶ modify ──▶ roundN+1
A task may not advance to merged until a review with verdict: approve
exists. Every round creates its own reviews/RV-NNN-roundN.md.
Each round:
templates/review/REVIEW.md "Context Pack" section. This is the brief the
reviewer subagent will see. It includes:
git diff <base>..HEAD scoped to declared filesgit log --oneline on the branch[unresolved])Agent subagent_type=critic)
with the Context Pack as its only input.RV-NNN-roundN.md using the 5-axis template. Verdict is
one of: approve / approve_with_nits / request_changes / reject.REVIEWS.md.approve or approve_with_nits: mark task merged in TASKS.md, merge
branch, advance STATE.json.Critical: and (required) finding in
new commits on the same branch. Set current_round += 1. Go to 1.Round budget. If current_round > 5, escalate to human — the task is
either mis-specified or too large. Do not grind past round 5 silently.
Context Pack is the skill. A reasoning-blind reviewer with bad context rubber-stamps. The only leverage you have is the pack.
After every task in the sprint is merged:
scripts/governance-check.sh — must exit 0 (boundary rules, unresolved
findings, orphan branches, stale STATE).STATE.json to status: closed.STATE.json to current_sprint: sprints-NNN+1.spec-driven-dev v1 SHIP phase for
rollout, feature flags, monitoring, and rollback.Boundary rules (e.g. "L2 may call L1 and L0, L0 must not call L2") must be enforced by script, not prose. The skill ships two runners:
scripts/task-lint.sh — validates task-file frontmatter, sizing, verify
command presence. Run at sprint open and in CI.scripts/governance-check.sh — project-wide invariants: every merged task
has an approved review, every sprint STATE is consistent, every
artifact-registry/rules/RULE-*.md that is marked enforcement: lint has a
matching lint rule file.Add project-specific checks as the project grows. New rule discovered in review? It goes through the artifact-registry.
When a reviewer finds a pattern that should apply to all future tasks (not just this one), capture it:
context/artifact-registry/rules/RULE-NNN-<slug>.md from
templates/artifact-registry/RULE.md.enforcement:
doc — humans follow it (weakest)review_checklist — added to templates/review/REVIEW.mdlint — automated rule (eslint, custom script, ast-grep, etc.)lint, also land the lint rule in the same commit as the RULE file.governance-check.sh verifies that every enforcement: lint rule has a
concrete implementation pointer.Rules that stay at doc for more than 2 sprints should graduate or be
deleted. Dormant rules rot.
Any STATE.json file is the single source of truth for "what's next". An
orchestrator's turn looks like:
1. Read project STATE.json → current_sprint
2. Read sprint STATE.json → current_task, current_round, next_action
3. Dispatch:
- next_action=build → spawn Builder in worktree for current_task
- next_action=review → construct Context Pack, spawn Reviewer
- next_action=modify → Builder addresses unresolved findings
- next_action=merge → merge branch, advance STATE
- next_action=close_sprint → run governance-check, advance project STATE
4. Exit. Next loop iteration re-reads STATE.
STATE.json schemas are in templates/project/STATE.json and
templates/sprint/STATE.json. Keep them small. Do not put history in them —
history lives in TASKS.md and REVIEWS.md.
round1 only — real tasks take 2–4 roundscurrent_round > 5 with no human in the loopRULE.md with enforcement: lint but no lint rule in the repoAny of these → governance-check.sh should fail. If it doesn't, add the check.
templates/project/RFC.md — project contracttemplates/project/PLAN.md — sprint decompositiontemplates/project/STATE.json — project-level orchestrator statetemplates/sprint/SPRINT.md — sprint goal + exit criteriatemplates/sprint/TASKS.md — task status tabletemplates/sprint/REVIEWS.md — round logtemplates/sprint/STATE.json — sprint-level orchestrator statetemplates/task/TASK.md — one task spectemplates/review/REVIEW.md — 5-axis review with Context Packtemplates/artifact-registry/RULE.md — captured rulescripts/task-lint.sh — mechanical task gatescripts/governance-check.sh — project-wide invariant checkerv1's five-axis review, rationalization tables, and scope discipline are unchanged and assumed. v2 wraps them in structure that survives multi-day, multi-session execution. If a v2 project collapses back to one session with one sprint and one task, it should read like v1 with extra files — that is acceptable; the overhead is the insurance.
scripts/governance-check.sh (opens in a new tab)scripts/task-lint.sh (opens in a new tab)templates/artifact-registry/RULE.md (opens in a new tab)templates/project/PLAN.md (opens in a new tab)templates/project/RFC.md (opens in a new tab)templates/project/STATE.json (opens in a new tab)templates/review/REVIEW.md (opens in a new tab)templates/sprint/REVIEWS.md (opens in a new tab)templates/sprint/SPRINT.md (opens in a new tab)templates/sprint/STATE.json (opens in a new tab)templates/sprint/TASKS.md (opens in a new tab)templates/task/TASK.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
12 skills in this plugin
/build-until-passUse when a build, typecheck, lint, or test command is failing and you want the agent to drive it to green on its own — run the check, read the errors, apply the smallest fix, re-run, repeat until exit code 0. Stops the human from being the while-loop (run → read error → fix one line → run again) and stops the agent from bulldozing huge speculative rewrites between checks./debug-hypothesisUse when debugging any non-trivial bug — wrong output, crash, flaky test, performance regression, or "it works locally but not in CI." Forces a scientific-method loop (Observe → Hypothesize → Experiment → Conclude) so the agent stops guessing and starts reasoning. Prevents the/frontend-designnpx claudepluginhub lichamnesia/lich-skills --plugin lich-skillsOther plugins' skills for the same job