|
| 1 | +--- |
| 2 | +description: Quiz the author on the current diff's design before committing — a comprehension gate to prevent shipping code nobody understands |
| 3 | +--- |
| 4 | + |
| 5 | +Gate a commit on the author demonstrating they understand the change. The point is to stop |
| 6 | +"ok-looking" AI-generated code — and creeping architectural complexity — from landing when |
| 7 | +the author can't actually explain it. This is a teaching gate, not a rubber stamp. |
| 8 | + |
| 9 | +## 1. Read the diff |
| 10 | + |
| 11 | +`git diff` and `git diff --staged`. Understand what actually changed. |
| 12 | + |
| 13 | +## 2. Decide if a quiz is warranted |
| 14 | + |
| 15 | +**Skip (say so and proceed straight to committing)** when the diff is only: Markdown/docs, |
| 16 | +config, formatting/lint-only churn, version bumps, lockfiles, or generated files. |
| 17 | + |
| 18 | +**Quiz** when the diff introduces or changes real logic: new abstractions/components, |
| 19 | +control flow, data flow, state, public API/props, cross-package wiring, or anything with a |
| 20 | +non-obvious "why". Scale the number of questions to the change: ~2 for a small focused diff, |
| 21 | +up to ~5 for a large or architectural one. |
| 22 | + |
| 23 | +Before writing questions, pick the 2-3 spots with the most hidden complexity or highest |
| 24 | +"AI-slop risk" — clever one-liners, non-obvious control flow, React effect/memo dependency |
| 25 | +arrays and referential stability, error/edge handling — and make at least one question target |
| 26 | +each. Don't spend the quiz on the parts that were easy to write. |
| 27 | + |
| 28 | +## 3. Ask — one or two questions at a time, in plain chat |
| 29 | + |
| 30 | +Target the **decisions embedded in the code**, never syntax or trivia. Good angles: |
| 31 | + |
| 32 | +- **Why this way?** — why this approach over the obvious alternative; what trade-off was made. |
| 33 | +- **Blast radius** — what else depends on this; what breaks if it changes; who calls it. |
| 34 | +- **Data/control flow** — where does this get invoked from, and what happens next. |
| 35 | +- **Edge cases** — what inputs/states does it handle (or deliberately not), and why. |
| 36 | +- **Integration** — how it fits the monorepo: cross-package deps, theme/tokens, i18n, v1/v2. |
| 37 | + |
| 38 | +Rules: |
| 39 | + |
| 40 | +- Ask questions **you (Claude) already know the answer to from the diff** — so you can grade. |
| 41 | +- Before asking, note to yourself the specific points a complete answer must hit — the answer |
| 42 | + key straight from the diff. Grade the reply against that key, not against how confident or |
| 43 | + fluent it sounds. |
| 44 | +- **Never reveal the answer in the question**, and don't hand the author hints before they try. |
| 45 | +- Ask in the author's own words territory — "explain…", "why…", "what would happen if…". |
| 46 | + |
| 47 | +## 4. Grade honestly |
| 48 | + |
| 49 | +The gate is worthless if you rubber-stamp. Hold a real bar, but grade the _understanding_, |
| 50 | +not the phrasing: |
| 51 | + |
| 52 | +- **All parts, not most.** If a question has multiple parts, it passes only when _every_ part |
| 53 | + is answered. Right on one part and silent/vague on another is **partial** → probe the missing |
| 54 | + part before moving on. Don't average. |
| 55 | +- **Correct & shows understanding** → acknowledge briefly, move on. |
| 56 | +- **Coherent alternative that's actually right** (author knows something you didn't, or framed |
| 57 | + it differently) → accept it. The goal is demonstrated understanding, not matching your words. |
| 58 | +- **Vague / partial** → probe once more on the gap. |
| 59 | +- **Wrong, or "I don't know"** → **teach**: explain the decision clearly with `file:line` |
| 60 | + references, then ask a _fresh_ question on the same concept. Loop until the author can |
| 61 | + explain it back in their own words. Don't move on until they can. |
| 62 | + |
| 63 | +## 5. Pass |
| 64 | + |
| 65 | +When the author has demonstrated understanding of every key decision, give a one-line summary |
| 66 | +of what they showed they understand, then proceed to commit (follow `/commit`). If the author |
| 67 | +wrote the code themselves and breezes through, that's a pass — the gate is aimed at code they |
| 68 | +haven't internalized, not at making them jump through hoops. |
0 commit comments