/claude-dev-kit:sprint [--parallel N] [--max-iterations N]from claude-dev-kit
Autonomously implements, reviews, and ships all issues from issues.md with dynamic issue management. Uses git worktrees for isolated changes and checkpoint verification.
Ships in claude-dev-kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Kit root: ${CLAUDE_PLUGIN_ROOT}
scripts/ dir): prefix every kit script command with it, e.g.
bash <kit-root>/scripts/checkpoint.sh …. Absolute paths also work from worktrees.${…} placeholder above → standalone layout: run commands as written.Run these checks silently at the start. Use results to adapt behavior:
[ -f issues.md ] — if true, this project uses the sprint system. Respect issue numbering and STATUS.md.[ -f docs/sprint_state.md ] — if true and Status shows running, a sprint is active. Be aware of parallel work in worktrees.[ -f docs/prd_digest.md ] — if true, read it for quick project context before starting.gh auth status before any GitHub operation.Every phase has a checkpoint. Run the verification command and check the exit code.
ADVISORY: line (advisory gate): report the gap, self-correct, continue.
Standard prefix:bash scripts/checkpoint.sh
Append --skill <name> --phase <phase> --issue <ID> for the specific check.
checkpoint.sh resolves the main repo root internally, so the command stays
a single prefix-matchable form (safe to allowlist as Bash(bash scripts/checkpoint.sh *)).
Pipeline skills operate in git worktrees to isolate changes from main.
WT="$(bash scripts/wt_setup.sh <branch>)" — creates the
worktree via scripts/worktree.sh create and writes .claude-kit/freeze-dir.txt
inside it in a single step.bash scripts/worktree.sh rootbash scripts/wt_cleanup.sh <branch> — cd's to main root
inside a subshell, then removes the worktree (never leaves CWD dangling).
All file operations happen inside $WT/. Shared files live on main only.Shared files (issues.md, STATUS.md, CHANGELOG.md) are managed on main only.
Always use registry_edit.sh for concurrent-safe writes — it resolves the
main repo root internally and delegates to flock_edit.sh:
bash scripts/registry_edit.sh issues.md -- bash -c '<update command>'
Never commit these files to feature branches.
--parallel N limit for concurrent subagent tasks.docs/sprint_state.md.registry_edit.sh for any shared file writes (issues.md, STATUS.md).Status: waiting, Reason: <failure-type> in sprint_state.md.issues.md must exist with at least one issue in backlog status.gh auth status must succeed.--parallel N: Max parallel issues (default: 3)--max-iterations N: Max loop iterations (default: 20)$ARGUMENTS for --parallel N and --max-iterations N:
--parallel is present, validate N is an integer between 1 and 10. If invalid, stop with: "Invalid --parallel value: must be an integer between 1 and 10."--max-iterations is present, validate N is an integer between 1 and 100. If invalid, stop with: "Invalid --max-iterations value: must be an integer between 1 and 100."Every issue MUST pass through all three phases in order. No exceptions.
implemented or reviewed) are retried via standalone REVIEW or SHIP actions.implemented or reviewed status. Clear the pipeline first.Pipeline priority order (enforced by scripts/sprint_queue.py — do NOT override):
reviewed status (highest priority)implemented statusbacklog issuesViolation = sprint failure: If at sprint end, ANY issue has Status=implemented or Status=reviewed (not shipped), the sprint is considered incomplete. Report these as unfinished pipeline items.
Validate pre-conditions:
issues.md — if no backlog issues, report "nothing to sprint" and stop.gh auth status — if fails, stop and instruct user to authenticate.Check for existing sprint state:
docs/sprint_state.md exists with Status=running, ask user: resume or start fresh?templates/sprint_state.md.## Meta block, replace the
- Roster-Watermark: ISSUE-NNN placeholder with ISSUE-<the highest ISSUE-NNN you just wrote into the Issue Progress table> — the max rostered ID at sprint start. Never
update it again for the life of the sprint: its whole purpose is to record the boundary the
roster had when the sprint was scoped. Leaving the placeholder in place is not fatal but is
announced as a rejection in every reason (see Discovered-issue visibility below).Gather context (read once, reuse across iterations): Read all context files via parallel Read tool calls in a single message. Do NOT read them sequentially.
issues.md — full contentdocs/sprint_state.md — current statedocs/architecture.md — if existsdocs/data_model.md — if existsdocs/prd_digest.md — if exists (use as quick PRD context instead of full PRD)Sprint loop (iteration = 0; repeat while iteration < max-iterations):
a) Read fresh state: Re-read docs/sprint_state.md and issues.md every iteration.
b-c) Compute next action (deterministic — do NOT override):
Run the pipeline queue script:
python3 scripts/sprint_queue.py next-action --sprint-state docs/sprint_state.md --issues issues.md --max-parallel {MAX_PARALLEL}
STOP the sprint and report the error if the script exits with non-zero and no JSON output, or if step 4f's validate exits 3. A non-zero exit with no JSON indicates a parsing failure or circular dependency; exit 3 means the sprint has lost its scope boundary (step 4f) — that exit DOES print JSON, so "no JSON output" alone never catches it. Either way, do NOT proceed.
Parse the JSON output. The result always contains action, targets, and reason. When
issues.md holds backlog issues that are not yet in the Issue Progress table, it also
carries unrostered (the IDs the queue auto-considered, ascending) and — when action = DONE —
stranded (that same list, repeated under a warning because a DONE means none of them ran).
See Discovered-issue visibility below. With no such issues the output is unchanged from
before, and the exit code is unchanged either way: a stranded DONE still exits 1 and still
reports action: "DONE", so the stranded key is the only signal you get.
stranded list, do NOT report a clean sprint: carry those IDs into the step 6 report as registered-but-unrun issues. Then go to step 5.reason. Increment attempt counts for stuck issues in sprint_state.md. If attempts ≥ 3, escalate. Otherwise continue to next iteration.unrostered has no Issue Progress row yet — see the unrostered-target note in step 4d.IMPORTANT: Do NOT manually compute queues or override the script's action choice. The script enforces strict priority ordering (FINALIZE > SHIP > REVIEW > PIPELINE) to prevent phase skipping. FINALIZE is a crash-recovery action (ISSUE-052): the queue detected a reviewed issue whose PR is already merged (a ship-phase interruption between the merge and the smoke checkpoint), so only smoke + registry remain — it must NOT be re-shipped/re-merged.
For reference, the script computes these queues internally:
ship_ready= issues where Phase =reviewedreview_ready= issues where Phase =implementedpipeline_ready= issues inbacklogwhere Manual ≠ true AND all Depends-On are resolvedin_flight= issues where Phase ∈ {implementing,reviewing,shipping}
Discovered-issue visibility: the queue's roster is the docs/sprint_state.md Issue
Progress table. Issues registered in issues.md with Status: backlog and Manual ≠ true
but with no row in that table — typically filed mid-sprint by /review triage or
planner — are auto-considered, so work discovered during a sprint is no longer invisible
to the queue. Current bounds:
## Meta as Roster-Watermark at
sprint start (step 2) qualify. Because that boundary is fixed for the sprint, visibility is
monotonic: an issue reported once keeps being reported until it is shipped or dropped,
and the order in which you roster discovered issues no longer matters.Roster-Watermark field is absent, malformed, duplicated, outside ## Meta, or
above the highest ID on the Board, the queue falls back to re-deriving the boundary as the
highest ISSUE-NNN currently in the table and names that fallback in reason
([roster-watermark: rejected (…) — fell back …] or [roster-watermark: absent …]). Under
the fallback the boundary moves as the roster grows, so a lower-ID sibling can drop out of
the report — fix the field rather than working around it.reason — [roster-watermark: pinned at ISSUE-NNN — X of Y Board backlog issue(s) are above it] when a pin was accepted, a
rejected/absent fallback note otherwise. An accepted pin at or above the Board's
highest ID empties unrostered legitimately, so without this line a boundary that had
silenced the whole control would look exactly like a healthy sprint with nothing to report.
The X of Y count is the counter-evidence: 0 of 0 is a genuinely finished sprint, while
0 of 12 means the pin is suppressing everything — check it. If you see no
roster-watermark note at all, the field is absent — treat that as the pre-pin behaviour
below, not as a clean bill of health.Roster-Watermark field is present (accepted or rejected; a mangled pin still closes
the gate). They then appear in unrostered (and in stranded on a DONE) but are never
targeted, so a sprint scoped on older debt cannot auto-drive newer out-of-scope work
through implement → review → merge. reason says how many were withheld. Export
KIT_SPRINT_DISPATCH_ABOVE_WATERMARK=1 (also true/yes/on) to dispatch them instead;
when set, the knob's name appears in reason so a deliberately widened sprint is
distinguishable from a runaway one. Anything else — including unset, 0, and false —
leaves dispatch off.next-action is unchanged: with NO Roster-Watermark line it keeps the
pre-ISSUE-069 behaviour byte-identically — above-boundary Board issues are
auto-targeted and driven through implement → review → merge, announced as
[roster-watermark: absent …]. That backward compatibility is deliberate (an in-flight
pre-pin sprint must not change behaviour mid-flight). What changed is downstream: step
4f now refuses a running sprint whose boundary is absent or rejected (valid
false, exit 3), so a field dropped by a 4d rewrite cannot survive to the next dispatch
decision. The arming check reads Status: running anywhere in the document, so a
renamed, re-levelled, mis-cased, indented, duplicated or fence-wrapped ## Meta heading
does not disarm it. Residuals that remain, stated so you can recognise them rather than
discover them: the running vocabulary is the literal running (keep Status to
running | paused | completed — an off-template value such as in progress reads as
not-running, so 4f does not fire); invoking next-action by hand without running 4f
gets no refusal; and an issues.md Depends-On cycle makes next-action return STUCK
before it parses the boundary, so its own [roster-watermark: …] note is suppressed (the
4f validate leg is unaffected and still refuses). Keep checking for the
[roster-watermark: absent …] note whenever a run targets something you did not scope.ISSUE-NNN row, or
the boundary is pinned.issues.md
Status is done, drop, or dropped. Rostered rows keep table-only dependency resolution.Status is matched exactly: an annotated value such as backlog (blocked — do not dispatch) is not admitted, and done (sign-off pending) does not resolve a dependency.
This fails closed by design — keep the bare keyword in the field and put qualifiers in the
issue body.d) Invoke team-lead agent via Task tool with this exact prompt structure:
You are the team-lead agent. Execute the {action} phase for these issues.
## Phase: {PIPELINE | SHIP | REVIEW | FINALIZE}
## Target Issues
{For each target: full issue spec from issues.md — ID, title, AC, all fields}
## Current Sprint State
{Full content of docs/sprint_state.md}
## Max Parallel: {N}
## Project Context
{Content of architecture.md, data_model.md, review lessons (native memory), prd_digest.md}
Execute this phase, update docs/sprint_state.md with results, then STOP.
Do NOT loop.
Preserve ## Meta verbatim: require the team-lead to copy the ## Meta block —
including Roster-Watermark — unchanged when it rewrites docs/sprint_state.md, editing only
Iteration and Status. Every phase executor rewrites that file, and a dropped
Roster-Watermark reverts the sprint to the old re-derived boundary and re-opens
autonomous dispatch of above-boundary work (the absent state is the one state the dispatch
gate does not close — see Discovered-issue visibility above). The revert is announced as
[roster-watermark: absent …], not silent, but it is a real widening of autonomous scope:
treat the ## Meta block as copy-only.
The loss is now detected, not merely discouraged: step 4f's validate runs AFTER this
rewrite and BEFORE the next iteration's next-action, so a field dropped here is refused
(roster_boundary.state = absent, exit 3) before anything is dispatched on it — as
long as you actually run 4f. Fix the ## Meta block rather than continuing the loop.
Unrostered targets: for any target that appeared in unrostered, say so in the prompt and
require the team-lead to add its Issue Progress row when it records progress. The queue
synthesizes those rows in memory only; step 4f's validate reports a target with no row as
stuck even after a successful phase, and the Attempts counter has no durable home until the
row exists.
Phase meanings:
implemented status (recovery only).reviewed status (recovery only).reviewed issue whose PR is already merged. Route it to the team-lead ship executor — its merge step is idempotent (python3 scripts/sprint_queue.py ship-merge-decision --pr <n> returns skip), so it skips the already-done merge and completes only the post-merge smoke checkpoint + registry finalization. Never re-merge. Validate in step 4f with --action FINALIZE (expected end phase shipped).e) After team-lead returns:
docs/sprint_state.md to confirm phase transitions happened=== Iteration {N} complete: {action} phase for {count} issues ===f) Validate phase transition (deterministic — do NOT skip):
Run the validation script:
python3 scripts/sprint_queue.py validate --sprint-state docs/sprint_state.md --issues issues.md --action {ACTION} --targets {COMMA_SEPARATED_TARGETS}
Parse the JSON output:
valid = true: all targets transitioned successfully (or stopped at a phase with logged error). Continue loop.valid = false: log the errors array in sprint_state.md. The stuck list shows which issues failed to transition — they will be retried in the next iteration via REVIEW or SHIP action.Roster boundary check (this step is where a dropped boundary is caught — it runs AFTER
the team-lead's rewrite in 4d and BEFORE the next iteration's next-action):
roster_boundary is always present in the output. Its state is one of accepted,
absent, rejected, or not-running (not-running = ## Meta does not say
Status: running, so no boundary is load-bearing and nothing is checked).state: "absent" or state: "rejected" on a running sprint → valid is false and the
exit code is 3. The sprint has lost its scope boundary: do not dispatch another
iteration. Restore - Roster-Watermark: ISSUE-<max rostered ID at sprint start> inside
## Meta (for rejected, the parser's reason is in roster_boundary.detail — fix that
instead of re-adding a second line), then re-run 4f.stuck is unaffected by this check, so no
target is retried because of it. Do not read a boundary refusal as a phase failure.--issues issues.md is what gives this leg the same Board-range check next-action uses;
without it, a boundary above the highest ID on the Board is not detected here. A missing or
unreadable path degrades the same way rather than failing, so it says so on stderr
(Warning: --issues not supplied or unreadable …) — if you see that line, the verdict you
just read was computed without the Board-range rule; fix the path and re-run 4f.Continue loop from step 4a — unless step 4f exited 3 (boundary refused): STOP and report.
Pipeline completion gate (before exiting):
docs/sprint_state.mdimplemented or reviewed (not shipped)Report sprint results to user:
stranded IDs from the final next-action output: in issues.md backlog, never rostered, and not dispatchable (usually an unresolved Depends-On)Team-lead uses this table to determine which agent(s) to dispatch per issue:
| Issue characteristic | Agent(s) | Skill reference |
|---|---|---|
| General backend/logic | developer | skills/implement/SKILL.md |
| UI/frontend (web) | uiux-developer | skills/implement/SKILL.md + UI context |
| UI/frontend (mobile) | mobile-uiux-developer | skills/implement/SKILL.md + mobile context |
| Infrastructure/CI/CD | (run the devops skill) | skills/devops/SKILL.md |
| Bug fix | (run the diagnose skill) | skills/diagnose/SKILL.md |
| Refactoring | (run the refactor skill) | skills/refactor/SKILL.md |
| DB migration | (run the migrate skill) | skills/migrate/SKILL.md |
| Architecture change needed | architect → data-modeler → developer | sequential |
| Any completed implementation | reviewer | skills/review/SKILL.md |
| UI implementation completed | reviewer + ui-reviewer | skills/review/SKILL.md |
| Reviewed and approved | (ship steps) | skills/ship/SKILL.md |
How to determine: Read the issue's title, Track field, and Implementation Notes. Keywords like "UI", "screen", "component" → UI agent. "Dockerfile", "CI", "deploy" → the devops skill. "migrate", "schema change" → migrator.
Each issue progresses through these phases in docs/sprint_state.md:
backlog → implementing → implemented → reviewing → reviewed → shipping → shipped
Phase meanings:
implementing: implement in progressimplemented: implement done, checkpoint passed — MUST review nextreviewing: review in progressreviewed: review approved — MUST ship nextshipping: ship in progressshipped: PR merged, smoke test passed — doneThe team-lead reads these phases to enforce pipeline ordering:
implemented → team-lead MUST review before implementing new issuesreviewed → team-lead MUST ship before reviewing or implementing/sprint to resume.waiting with escalation reason and skip it. Report at sprint end.docs/sprint_state.md to reset sprint state.What SKILL.md sets; muted values are Claude Code's defaults
23 skills in this plugin
/bizanalysisAnalyzes and critiques business viability. Use after /brainstorm and before /prd./brainstormExplores ideas and defines problems through free-form conversation. Use before /prd when direction is unclear./carefulActivates destructive command warnings for the current session. Use when working in sensitive environments./desktop-uiuxEstablishes a desktop design philosophy based on kickoff outputs, and generates a desktop design system/wireframes/Electron prototype. Recommended flow — /prd → /kickoff → /desktop-uiuxnpx claudepluginhub pillip/claude-dev-kit --plugin claude-dev-kitOther plugins' skills for the same job