|
| 1 | +--- |
| 2 | +name: post-change-check |
| 3 | +description: Orchestrates the end-of-turn review after non-trivial edits to app/, components/, lib/, scripts/, or config files. Runs the docs-sync audit, invokes the code-review and quality-check skills on the diff, and flags anything still missing before the turn can close. |
| 4 | +--- |
| 5 | + |
| 6 | +# Post-change check — docs sync + code review + quality sweep |
| 7 | + |
| 8 | +Run this when a turn has made code changes and you're about to report done. It's the one stop that verifies **the work is coherent** (docs and code aligned) **and correct** (conventions followed). |
| 9 | + |
| 10 | +## When to run |
| 11 | + |
| 12 | +- Auto-invoke yourself when a turn edits any of: `app/**`, `components/**`, `lib/**`, `scripts/**`, `.claude/**`, `lefthook.yml`, `biome.json`, `package.json`, `tsconfig.json`, `next.config.ts`. |
| 13 | +- User can also invoke manually: `/post-change-check`. |
| 14 | +- **Skip** for pure typo fixes, comment tweaks, or changes entirely inside `tasks/` and `data/`. |
| 15 | + |
| 16 | +## How to run |
| 17 | + |
| 18 | +Work the four phases **in order**. Don't skip ahead — the docs phase often surfaces issues code review won't. |
| 19 | + |
| 20 | +### Phase 1 — Collect the diff |
| 21 | + |
| 22 | +1. `git status --short` — see what moved. |
| 23 | +2. `git diff --stat HEAD` — scope. |
| 24 | +3. `git diff HEAD -- app/ components/ lib/ scripts/` — the actual changes. |
| 25 | + |
| 26 | +Keep a mental list of: touched files, added/removed exports, new deps, new env vars, new routes. |
| 27 | + |
| 28 | +### Phase 2 — Docs sync audit |
| 29 | + |
| 30 | +For each category below, decide **yes / no / N/A**, then act on the yeses: |
| 31 | + |
| 32 | +- **`lib/changelog.ts` under the current release bucket** |
| 33 | + - Yes **only** if the change ships a user-facing capability (something a dashboard visitor, API caller, or maintainer of a listed repo can observe) **and** that capability maps to a `lib/roadmap.ts` entry or a `tasks/` file whose `Status` just flipped to `done`. |
| 34 | + - No for codebase hygiene (CI, linter, pre-commit, tests), contributor docs (CONTRIBUTING, PR templates), internal refactors, dep bumps, directory moves, or UI polish without a semantic change. |
| 35 | + - Action: append a one-line capability bullet (newest-first) **and** delete the matching item from `lib/roadmap.ts` — moved, not duplicated. |
| 36 | +- **`lib/roadmap.ts` integrity** |
| 37 | + - Every item must point to a real `tasks/X.Y.Z/NN-*.md` file — no dangling `taskFile` references. |
| 38 | + - Adding a roadmap entry requires adding its task file in the same PR. Don't split. |
| 39 | + - Released versions don't live on the roadmap; they move to `lib/changelog.ts` with a release label. |
| 40 | +- **`tasks/X.Y.Z/` files** |
| 41 | + - Yes if scope shifted, a task was partly/fully completed, or a new sub-task emerged. |
| 42 | + - Action: update the file's `**Status**:` header (`planned` / `in_progress` / `done`) and its "What shipped" section. |
| 43 | +- **`AGENTS.md`** |
| 44 | + - Yes if stack, directory layout, conventions, or I/O boundary changed. |
| 45 | + - Specifics: |
| 46 | + - Stack changes (Next.js / React / Tailwind / Bun / DB driver) → update the **Stack** bullets + cross-check with `README.md`'s Stack & rationale table. |
| 47 | + - New top-level folder → update the **Layout** tree. |
| 48 | + - New page in `app/` → mention in the **Layout** tree and link from the nav in `app/layout.tsx`. |
| 49 | + - New signal / model / host → ensure the matching "Adding a …" section in `AGENTS.md` is still accurate. |
| 50 | + - New convention or constraint → add a bullet under **Conventions**. |
| 51 | +- **`README.md`** |
| 52 | + - Yes if a product-facing behaviour, command, or screenshot changed. |
| 53 | + - Specifics: stack changes must match the `AGENTS.md` stack list; quickstart commands must actually work (`bun install`, `bun run prepare-hooks`, `bun run dev`, `bun run score <url>`); prior-art table updated if we've encountered new competitors since last sync. |
| 54 | +- **`CONTRIBUTING.md`** |
| 55 | + - Yes if the branch/commit/PR flow or review bar changed, or if the security-contact email moved. |
| 56 | +- **`.env.example`** |
| 57 | + - Yes if a new env var was introduced. |
| 58 | + - Action: document with a one-line comment above the line. |
| 59 | +- **`.claude/skills/*`** |
| 60 | + - Yes if a new agent workflow was added or an existing one changed. |
| 61 | + - Action: update or create a skill file. |
| 62 | + |
| 63 | +Report each as `✓ updated`, `✓ N/A — reason`, or `✗ missing — file:line where it should go`. |
| 64 | + |
| 65 | +### Phase 3 — Code review |
| 66 | + |
| 67 | +Invoke the `code-review` skill on the diff. Its checklist: |
| 68 | + |
| 69 | +- Tailwind-first (utilities > custom classes, `@theme` tokens > hex, no `@apply` in `globals.css`). |
| 70 | +- Constants / utils extracted when the rule-of-three is hit. |
| 71 | +- I/O boundary held — `lib/scoring/` stays pure, all SQL in `lib/db.ts`. |
| 72 | +- Server components default, client only when interactivity demands it. |
| 73 | +- Components presentational — no data fetching, no effects. |
| 74 | +- Phosphor icons only. |
| 75 | + |
| 76 | +Report findings in severity order: **Must fix** / **Should fix** / **Consider**. |
| 77 | + |
| 78 | +### Phase 4 — Quality sweep |
| 79 | + |
| 80 | +Invoke the `quality-check` skill on the diff. Four dimensions: |
| 81 | + |
| 82 | +- **Accessibility**: landmarks, aria, contrast, reduced-motion, keyboard reachability. |
| 83 | +- **Responsiveness**: 320 → 1080+, mobile nav, table overflow, line-length caps. |
| 84 | +- **Performance**: RSC default, `next/script` for third-party, bundle weight, prepared statements. |
| 85 | +- **Security**: parameterised SQL, no `dangerouslySetInnerHTML`, `rel="noopener"` on external links, clone safety. |
| 86 | + |
| 87 | +Report Pass / Fail / Needs manual check per dimension. |
| 88 | + |
| 89 | +## Output format |
| 90 | + |
| 91 | +Print a single consolidated report: |
| 92 | + |
| 93 | +``` |
| 94 | +Post-change check — <N> files touched |
| 95 | +
|
| 96 | +Docs sync |
| 97 | + ✓ lib/changelog.ts — bullet added |
| 98 | + ✓ N/A — README.md (no product-facing change) |
| 99 | + ✗ tasks/0.2.0/01-tests.md — status still "planned" but harness already committed; flip to in_progress |
| 100 | +
|
| 101 | +Code review |
| 102 | + Must fix: <none> | <file:line — why> |
| 103 | + Should fix: … |
| 104 | + Consider: … |
| 105 | +
|
| 106 | +Quality |
| 107 | + a11y: pass |
| 108 | + responsive: pass |
| 109 | + performance: pass — flagged `new-dep@1.2.3` at 73 KB gz, justify or swap |
| 110 | + security: pass |
| 111 | +
|
| 112 | +Next steps: <bullet list or "clean, ready to commit"> |
| 113 | +``` |
| 114 | + |
| 115 | +If every phase is clean, say so plainly in one line. Don't invent findings to look thorough. |
| 116 | + |
| 117 | +## What this skill does NOT do |
| 118 | + |
| 119 | +- It does not run tests, biome, or tsc — those are the pre-commit hook's job (`lefthook.yml`). |
| 120 | +- It does not push, commit, or open PRs. |
| 121 | +- It does not modify the codebase beyond the docs updates in Phase 2 (changelog / tasks / AGENTS / README). |
0 commit comments