From spec-lean
Phase 4 of the SDD cycle. Use when the user invokes /spec-lean:ship <feature> to review, commit, push, PR, and merge. Performs an SDD-aware pre-commit code review of the local diff (BLOCK/CAUTION/GO verdict) — checking story deviations against US-N IDs in spec-status.md, runtime-artifact leaks, and the standard security / data-loss / concurrency issues. Only on GO does it dispatch commit-commands:commit (no remote) or commit-commands:commit-push-pr (with remote), then runs the marketplace /code-review on the PR diff as a second pass before asking for explicit merge permission.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spec-lean:ship <feature-name><feature-name>This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are running Phase 4 of the SDD cycle for feature **$1**. Inputs: pending changes + `docs/specs/$1/spec.md` + `docs/specs/$1/spec-status.md`.
You are running Phase 4 of the SDD cycle for feature $1. Inputs: pending changes + docs/specs/$1/spec.md + docs/specs/$1/spec-status.md.
Validation passed? Read docs/specs/$1/spec-status.md. Every US-N should have status done. If anything is in-progress / blocked / not-started, stop and tell the user to run /spec-lean:validate $1 first.
Git initialized and there are pending changes? If no pending changes, stop with: "Nothing to ship — no pending changes."
Git remote configured? Run git remote -v. If there is no remote, ask via AskUserQuestion:
No git remote is configured. Choose:
- (a, recommended for solo / sample projects) Commit locally only — skip push, PR, PR-review, and merge.
- (b) Configure a remote first (tell me the URL), then proceed with the full ship flow.
- (c) Cancel.
On (a): proceed through Step 1 and Step 2 only, then stop after the local commit and report the commit SHA. Skip Steps 3–5.
On (b): run git remote add origin <url>, then continue through all five steps.
On (c): stop.
Stage all pending changes if not already staged (git add -A). Then perform a thorough review against the staged set and end with one of three verdicts: BLOCK / CAUTION / GO.
Run git diff --cached --stat and git diff --cached. If the staged set is empty, tell the user — don't fabricate a review.
For each changed file under ~1000 lines, read the whole file. Diffs alone hide breakage:
For larger files, read 50–100 lines around each hunk.
Open docs/specs/$1/spec.md and docs/specs/$1/spec-status.md. Build two mental sets:
done in spec-status.md. The implementation should match.If the project has them, run them and include any failures:
ruff, eslint, golangci-lint, etc.)mypy, tsc --noEmit).If running checks would take more than a minute or two, ask first.
Focus your attention top-down. If there are critical issues, do NOT drown them in low-severity nits.
rm / DROP / DELETE, races that can corrupt state..gitignore — data files, build outputs, __pycache__, node_modules, .env, IDE configs, lockfile noise. Check the spec's Section 4 for the named runtime data file (e.g. data.json) — if it's in the staged set, that's a BLOCK; tell the user to add it to .gitignore and re-stage.US-N marked done in spec-status.md. Quote the file:line and ask which story it serves; if none, ask whether to add a story or remove the code.US-N Done-when says stderr should contain "X is required", but the implementation prints "validation error". Validation will fail or pass for the wrong reason.print(), console.log, debugger, pdb.set_trace(), // TODO: remove markers in production paths.If the diff has any critical or high issues, omit the low-severity section entirely. Signal beats noise.
path/to/file.ext:LINE plus a short snippet so the user can navigate.## Code Review — $1
**Scope:** staged changes (N files)
**Spec context:** `docs/specs/$1/spec.md` (US-IDs: <list>) — status: <N done / N in-progress / N blocked>
**Summary:** <X critical, Y high, Z medium, W low>
### Critical
- **path/to/file.ext:LINE** — <one-line problem>
Why: <one or two sentences>
Suggested fix: <concrete change>
### High
- ...
### Medium
- ...
### Low
- ... (omit if any critical / high present)
---
**Verdict: BLOCK / CAUTION / GO**
<one-sentence justification>
/spec-lean:ship $1. Stop.n.If the user chose option (a) in pre-check #3 (no remote), invoke the commit-commands:commit skill via the Skill tool (commit locally), report the commit SHA, and stop.
Otherwise, invoke the commit-commands:commit-push-pr skill. Capture the resulting PR URL.
Invoke the /code-review slash command from the code-review@claude-plugins-official plugin against the PR. It runs a multi-agent review (CLAUDE.md adherence, bug scan, git history, prior-PR context, code-comment compliance) and posts findings as PR comments.
Wait for the review to complete. Read the resulting comments from the PR via gh pr view <PR#> --comments.
Summarise the verdict to the user:
Use AskUserQuestion:
Local review: GO. PR review: [summary]. PR: [URL]. Merge now? (y / n)
y → merge the PR via gh pr merge. Pick the merge style the project uses (squash / merge / rebase) — if uncertain, ask.n → leave the PR open and output: "PR is open at [URL] — merge when you're ready."If merged, output:
Shipped. Spec
$1is complete. Status saved indocs/specs/$1/spec-status.md.
npx claudepluginhub akhiranandha/custom-claude-plugins --plugin spec-leanGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.