chore: add sprint skill + self-review gate to the dev loop

- CLAUDE.md dev loop: after opening the PR, wait for CI green, then
  self-review the diff (/code-review) before saying it's ready; never
  claim ready before CI-green + self-review; still never self-merge.
- .claude/skills/sprint: thin per-project skill so "start sprint N" /
  "groom sprint N" / "continue the sprint" deterministically runs the
  groom -> per-issue dev-loop -> retro flow, enforcing the guardrails
  (plan is source of truth, groom-first, CI-green + self-review before
  ready, human merges). Composes with the superpowers skills.
- docs/sprints/README.md: fold the CI-green + self-review gate into the
  per-sprint Definition of Done.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Randa 2026-07-01 17:19:35 +04:00
parent b47deb86d5
commit 5500c111d9
3 changed files with 55 additions and 1 deletions

View file

@ -0,0 +1,50 @@
---
name: sprint
description: Use when the user says "start sprint N", "groom sprint N", "continue the sprint", or "/sprint" for the digger project — grooms a sprint just-in-time, then runs the per-issue dev loop (worktree → TDD → PR → CI green → self-review → stop for the human to approve+merge), keeping the plan and Forgejo issues reconciled. Encodes digger's working agreement; composes with the superpowers skills rather than replacing them.
---
# digger sprint runner
A thin orchestrator for delivering one sprint of the digger v1 plan. It does **not** invent rules — it sequences the existing ones and enforces the guardrails so nothing gets skipped across a long, context-heavy sprint. The authorities it points at:
- `CLAUDE.md` — the working agreement (worktrees, TDD, never self-merge).
- `docs/superpowers/plans/2026-07-01-digger-v1-plan.md` — the **source of truth** for scope.
- `docs/sprints/README.md` + `docs/sprints/sprint-<n>-*.md` — the grooming convention and each sprint's groom doc.
- Forgejo (via the Forgejo MCP, repo `forgejo_admin/digger`) — issues + milestones.
- superpowers skills — `test-driven-development`, `using-git-worktrees`, `requesting-code-review`, `executing-plans` / `subagent-driven-development`, `verification-before-completion`.
## Non-negotiables (never skip)
- **Never self-merge, never mark ready early.** A PR is "ready" only after **CI is green AND a self-review pass is done**. The human approves and merges.
- **Plan is the source of truth.** Any issue add/change/remove is reflected back into the plan doc in the same breath.
- **Groom only the sprint about to start**, from plan + current repo state + the previous sprint's retro.
## Phase 1 — Groom
1. Read the sprint's section of the plan, the previous sprint's retro (if any), and the current repo state.
2. Write or refresh `docs/sprints/sprint-<n>-<slug>.md` from the template in `docs/sprints/README.md` (demoable slice, issues-in-scope + PR sequence, adjustments vs plan, risks, DoD).
3. If grooming changes scope, flow it back: **groom doc → plan doc → Forgejo issues** (create/edit via MCP).
4. **Show the groom doc to the human and wait for a go-ahead** before writing any code.
## Phase 2 — Per-issue dev loop
For each issue in the groom's PR sequence (respect `Depends on`; split large issues into multiple PRs):
1. **Pick the issue** (Forgejo MCP); confirm it's unblocked.
2. **Worktree + branch** off latest `main``../digger.worktrees/<issue>-<slug>`, branch `<type>/<issue>-<slug>` (use superpowers:using-git-worktrees).
3. **TDD** — red → green → refactor (superpowers:test-driven-development). Keep the change scoped to the issue.
4. **Open the PR**`Closes #N`, small and self-contained.
5. **Wait for CI to go green** (Linux unit + integration; Windows unit where relevant). Do not proceed while red.
6. **Self-review** the diff (`/code-review` or superpowers:requesting-code-review). Fix blocking findings; if you push fixes, **re-confirm CI is green**.
7. **Only now say it's ready** — present the PR + evidence (green CI, self-review summary) and **stop for the human to approve + merge**. Never self-merge.
8. **After merge** — remove the worktree + delete the branch; reconcile the plan doc + Forgejo issue/milestone status; tick the issue in the groom doc.
## Phase 3 — Close the sprint
- When every in-scope issue is merged and the demoable slice runs, fill the **Retro** in the groom doc.
- Reconcile the plan doc + `v1` milestone with what actually shipped.
- The retro is the primary input to the next sprint's grooming.
## If the user just says "continue" / "next issue"
Resume Phase 2 at the next unblocked issue in the current groom doc. If no groom doc exists for the active sprint, do Phase 1 first.

View file

@ -19,7 +19,10 @@ Authoritative spec — read before planning or any architectural decision:
the repo), branched as `<type>/<issue>-<slug>` (feat|fix|chore|docs|refactor|test) off the
latest main. Never work on main. Remove the worktree and delete the branch after merge.
- Dev loop: pick a Forgejo issue (via the Forgejo MCP) → worktree + branch → tests-first →
PR (Closes #N) → review + green CI → **I approve and merge. Never self-merge.**
PR (Closes #N) → **wait for CI to go green → self-review my own diff** (via `/code-review`
or superpowers:requesting-code-review; fix blocking findings — if I push fixes, re-confirm
CI is green) → **only then say it's ready** → **I approve and merge. Never self-merge.**
Never claim a PR is ready before CI is green and the self-review pass is done.
- Prefer **small, functional PRs.** I review PRs myself, so keep each one small,
self-contained, and independently green — that makes review much easier. If an
issue/task is large, **split it into multiple PRs** (one issue may span several);

View file

@ -34,6 +34,7 @@ must already be reflected in the plan doc + the Forgejo issue.>
- …
## Definition of done
- Every in-scope issue: PR opened → **CI green → self-review pass done → human approved + merged** (never self-merged, never called ready before CI-green + self-review).
- All in-scope issues merged; CI green (incl. the relevant tiers); the demoable slice runs.
- Plan doc + milestone reconciled with what actually shipped.