Self Review
Verify an Artifact Registry step MR before marking it ready. Checks claims in the MR description against code, tests, and documents, and evaluates downsides, readings, non-goals, and unchanged behavior. Runs two blind subagents and records a verdict on each finding. Read-only. Run in a fresh session from the step's worktree, with the Draft MR open, after the second /validate-step.
Editor's Note
Run in a fresh session, from the step's worktree, with the Draft MR open, after the second /validate-step. Ensure the MR is open and the code at HEAD matches the description. Use `--no-description` to skip the description check and focus on code changes.
When to Use It
- Verify an Artifact Registry step MR before marking it ready
- Check claims in the MR description against code, tests, and documents
- Evaluate downsides, readings, non-goals, and unchanged behavior
- Run two blind subagents and record a verdict on each finding
SKILL.md
SkillsHunter provides this listing for informational purposes only. Review the skill’s source, license, and required permissions before use. You are responsible for deciding whether to install or run it. Terms of Use
Self-review
/review-branch reviews the code and /validate-step the branch's fit to
the plan. This pass reviews what a human reviewer reads first, the MR
description, and asks the questions tooling cannot answer. Its aim is a
human round that finds only nits.
Do not run it in the session that wrote the code or the description.
Read-only contract
Report findings and paste-ready description text. Never edit code, never commit or push, never post to GitLab. The operator applies the changes.
Evidence stays in the report. A finding's Evidence field cites sources so
the operator can verify it: third-party file:line, commit hashes, URLs.
Paste-ready text, and any fix a finding proposes for a committed document,
states the behavior as a fact in the target's own terms with no source
citation, and obeys that document's writing rules (for a spec, the
spec-author rule "Findings are research input, not spec content": citations
go in References, nowhere else). Whoever applies a finding follows the
same rule.
Modes
With no flag the pass runs everything below. /run-step splits it in two,
because the MR description is scratch until the code has settled and the
code is the authority:
--no-description: skip Part A and never read the description. Parts B and C, the Resolve step, and/review-specrun as usual. The report drops its Description section. Use it in every round that can move the head.--description-only: run Part A and nothing else, with no subagents and no/review-spec. The code, tests, and documents atHEADdecide: a claim they contradict is a defect in the description, so its fix is paste-ready description text, never a code finding. The verdict is NOT READY only when a claim is false. The report holds only the Description section. Use it once, after the last code change.--delta <sha>: for a re-run after a fix, with--no-description.<sha>is the head a previous run read, and that run may have ended NOT READY. Parts B and C readgit diff <sha>...HEADinstead of the whole diff. Q1 has a row only for each spec statement the delta's files touch. Q2 and Q3 apply to the delta. Part C runs subagent A, plus C, D, or E when the delta itself adds what they cover; B is skipped, because Q1's delta rows already answer it. Each subagent gets the spec statements the delta's Q1 rows name, not the whole spec, and the delta diff. Then read the previous report:~/projects/notes/mr-reviews/mr-<iid>-self-review-delta.mdwhen it is newer thanmr-<iid>-self-review.md, else the latter. Re-verify each previous BLOCKING finding atHEADfirst: one that still holds stays BLOCKING under its ID. Then sweep the siblings of every BLOCKING finding, and of each WARNING finding whose files the delta touches, across the whole tree, not only the delta: the same cause on an adjacent axis, site, or caller, which a fix to one site leaves open. The sweep gets 12 tool turns; siblings not reached are listed asunswept. Judge each sibling like any other finding. The previous report stays withheld from the subagents. The report lists every previous BLOCKING and WARNING finding that still holds, so the next delta can read it as the previous report.
1. Resolve
- Base: the
baseargument, elseorigin/mainaftergit fetch -q origin main. - Worktree and branch:
git rev-parse --show-toplevelandgit branch --show-current. Stop onmain. - MR:
--mr <iid>, elseglab mr view --output json. Stop with "open the Draft MR first" when there is none. Stop with "push first" when the MR'sshais notHEAD: the description must describe the pushed code. - Kind:
git diff --name-only <base>...HEAD. When every changed file is underdocs/specs/ordocs/plans/, stop withself-review: only specs and plans changed; use /review-spec, which also checks the MR description.This pass checks code against a plan step, which a spec-only MR doesn't have. - Plan and step: the arguments, else the branch name
<user>/<plan-slug>-step-<id>, else the title marker(<token> plan: <step>/<total>). Resolve againstdocs/plans/at base. - Spec: the spec the plan's
## Summarycites.
State the resolved values before reading code.
2. Gather, then dispatch Part C
In one turn: git diff <base>...HEAD, git log --oneline <base>..HEAD, the
MR description, the step's plan entry (Depends on, Delivers, Acceptance),
the spec sections the step's Delivers names, and the ADRs the description's
ADRs item names. Then launch Part C's two subagents, so they run while you
work through Parts A and B.
When a changed file is under docs/specs/ or docs/plans/ and another
changed file is not, also run /review-spec <base> --mr <iid> in the
parent, in the same turn as the Part C launch. It runs in the parent
because it launches its own lens subagents, which a subagent can't do.
Its check D overlaps Part A: merge findings on the same passage and cause,
and keep Part A's verdict. Its fix text is paste-ready text for a
committed document, so the read-only contract's citation rule applies to
it.
Part A: the description's claims
Skipped under --no-description.
Split the description into claims: every sentence that states a fact about
the code, the tests, the tree, another document, or what was run. That
includes the Summary, every Checklist answer, and any coverage, rationale,
or non-goals section. For each claim, find what backs it at HEAD: a test,
a file:line, a command whose result the description reports, or a
document you opened.
| Verdict | Meaning | Severity |
|---|---|---|
| backed | the backing exists and says what the claim says | — |
| unbacked | nothing you can open supports it | WARNING |
| false | the code, a test, or the document contradicts it | BLOCKING |
Check these kinds of claim hardest, because reviewers do:
- Numbers. Line, file, call, step, and row counts, re-derived at
HEAD. - Closed sets. "Only", "every", "none", "both", "the three". List the members from the code. A missing member makes the claim false. A set that no test pins is unbacked. A test that pins a source-of-truth set (proto fields, an enum, a registry) with a hand-typed list pins nothing: a member added later passes every loop over the list. It must compare against the source.
- Evidence level. "Ran it" says what was run, against what. A claim that implies a live run, a real client, or a repeat count the description does not report is false.
- Other documents. "The spec needs no edit", "S12 already lists it":
open the document at
HEADand check. - Main. "Today", "already", "nothing calls it": check at base.
- Other MRs. A claim about another MR's state ("!4236 adds the
job", "after !4284 merges"): read that MR's state with
glab, then open the file the claim names atHEAD. A claim the tree already contradicts is false: the job the description waits for may be there. The same goes for a stack note that names a parent that has merged.
Then check what the description should say and does not. Each gap is a WARNING, with a paste-ready line:
- Downsides. What the diff costs, changes for a caller, or leaves
out: a behavior change for callers the description does not name, a
metric or record that misses a case, a retry that repeats work. Take
candidates from the diff and from Parts B and C.
A Downside that defers something the plan or a
docs/dev/rule requires (a test target's CI job, a registry entry) is a gap, not a disclosure. Mark it unbacked unless a tracked issue or an open MR owns the deferral, and check that item's state. - Unchanged behavior. For each changed error mapping or branch, what stays as before, named, with the test that pins it.
- Readings. Where a spec clause admits two readings and the code picks one, the description names the reading it took. For each pair of keys that bound or populate one quantity (a default list and a cap on it), it also says which wins when they disagree. A spec that is silent on the pair is the reason to say so, not an answer.
- Non-goals. Adjacent work a reviewer will ask about, each with the step or issue that owns it.
- Kept promises. In a stack, read the resolved threads on the parent
and sibling MRs with
/glab-read. For each author reply that promises work here or later ("moved to", "will add", "in the next part"), checkHEADfor it. An unkept promise is a WARNING: paste-ready is the comment or test, or a description line saying it moved.
Part B: spec, domain, architecture
Q1. Spec compliance. One row per behavior statement in the spec
sections the step's Delivers names (Interfaces, Data, Flows, Failure,
limits and recovery, Security), plus the step's Delivers and Acceptance
lines. Each row names the file:line that satisfies it and the test that
pins it, or says UNSATISFIED (BLOCKING) or UNPINNED (WARNING). Keep one
statement per row. A test name is not satisfaction: name the code.
A test that exists is not yet an adequate one. For each row you would mark
pinned, name the nearest wrong implementation: the cheapest one that applies
the rule too broadly, too narrowly, or in a shared helper, and still passes
every listed test. Name the listed case that fails it. With none, the row is
UNPINNED. A rule of the form "fails on X" needs a case for the nearest
not-X that must pass: a 3xx that fails needs the 409 that passes. Run
this on every fix the report proposes before it goes into paste-ready text;
a fix that adds a failing case is the usual source of a missing complement.
In a changed SQL statement, every COALESCE, CASE, NULLIF, and fallback
arm is such a candidate: delete the arm and name the test that fails. An arm
no test reaches makes the row UNPINNED.
Where a row's value names an identifier of another domain (an
architecture, a suite, a path component, a package name), that domain's
grammar is part of the row, even in a section Delivers doesn't name. Open
the grammar in the spec, list what it refuses (empty, case, length,
separators, .., duplicates), and check the code refuses each where the
value is read. A grammar the code leaves unenforced is BLOCKING; name the
cheapest input that passes the code and breaks the grammar.
Q2. Domain and protocol correctness. Does the change handle the
format, protocol, or schema semantics correctly? For a migration, compare
the DDL with the governing ADR column by column, constraint by
constraint, and referential action by referential action, and name every
difference, including the deliberate ones. For each NO ACTION or
RESTRICT foreign key, check that the referencing column leads a
non-partial index.
Where the diff serves a named client (apt, dput-ng, curl, a release
tool), run the client's default invocation and default output through the
code, not the documented example. Each file or request it sends is
accepted, discarded, or refused, and a refusal on the first one stops the
client. A default run that publishes nothing is BLOCKING. Check every
claim the code or comments make about the client against its manual or
source.
Check every comment or code path that asserts how a dependency encodes, rounds, normalises, or stores a value (pgx time or numeric, JSON, a hash) the same way: open the dependency's source at the pinned version, and try the value half a unit past the resolution (500 ns on a microsecond column).
For every transaction the diff adds, list the rows and tables it locks, in
order. List every other writer on base that locks any of them, and compare
the orders. A comment that says "cannot deadlock" or "free of deadlock" is a
closed-set claim: check it against every other lock taker, not only the
sibling the comment names. An opposite order is a WARNING, or BLOCKING when
no retry absorbs the 40P01.
Where the diff adds or changes a size, count, allocation, or time bound on input the system reads from a registry or client, "bounds the total" is a closed-set claim. Open the dependency's source at the pinned version, list every allocation and loop site the input drives, and name the cheapest input that passes every stated guard, with the bytes allocated per byte read. When the MR's history shows a reviewer closing one amplification axis (many blocks), sweep its siblings (per chunk, per state reset, per header). An axis the guard leaves open is BLOCKING.
Where the diff takes units from a shared gate, pool, or semaphore
(admission units, connection or worker slots), open the gate's Acquire
at HEAD for its wait and refusal rules, then name what the caller already
holds when it asks. A caller that holds units while it waits for more is
hold-and-wait: say, at the gate's floor, its default, and the largest
request the code allows, whether the request proceeds, parks, or refuses
at once. Hold-and-wait with no single up-front acquire and no non-waiting
refusal is BLOCKING. Ask the same of every line the author added to
answer a review comment.
Where the diff adds a background job, a cap, or a TTL, or a commit or store
method that the plan says a job, a retry, or a timed-out run will call, run
the lifecycle, check-then-act, and accumulation checks of /review-spec S9
against the code: each parent state the job meets (namespace suspended,
blocked, shredded; repository deleted or purging) and what it does there;
each read made before the transaction opens and what the commit re-reads
under lock; what frees a full cap; and what refreshes a TTL, so that one
principal's activity can't hold every row forever (BLOCKING when it blocks
that principal for good). For each column the commit reads under lock, say
whether a later run can overwrite it between this run's start and its
commit, and whether the write uses the run's own value or the row's current
one.
Q3. Architecture fit and blast radius. Does the approach fit the
plan's ## Approach and the surrounding code? What breaks in production
if it is wrong, and who notices first?
When the new committer, store, or handler has sibling formats, also compare its input and result types, and the effects it must report (a size delta, a counter), field by field against each sibling's. Name every sibling that diverges. The plan's "effects ride with the code that causes them" rule puts the probe where the effect happens.
Two test checks that no review phase owns:
- Dropped subtests. When the step mirrors a sibling package, or adds
a section or file beside siblings (
internal/config/<format>.gonext to the other formats' files), diff the new suite against each sibling's for cases that are missing. Compare behavior, not test names: read what each sibling's rule does and check the new code does the same. Name the sibling file, and name every sibling that diverges from the rest, so the report shows whether the gap is in the new code or in the odd one out. - Over-asserting tests. The reverse: a test of a document or file that asserts prose, markdown layout, or exact wording beyond what its siblings assert is a WARNING. The siblings compare a document with a code fact (every key, every metric), not with its sentences.
- Enumerated columns. Every value of a
kind,format, orvisibilitycolumn gets a positive-hit test, not one value and negatives.
Part C: blind adversarial review
A self-review fails by agreeing with its own reasoning. Subagents with a
clean context break that. Give each one the spec text and the diff only.
Withhold the MR description, the plan's Approach, the step's Acceptance
lines, every earlier review report, and any justification the operator
wrote. Name what you withheld in the report. Subagent A also gets the other
writers of any row the diff locks, as file:line with no rationale.
Dispatch A and B in one message, with subagent_type="general-purpose". Add
C to the same message when the diff adds or changes a bound on untrusted
input, D when it takes units from a shared gate, pool, or semaphore, and E
when it adds a background job, a cap, or a TTL, or a method the plan says a
job calls.
A, pre-mortem:
First, run `cd <absolute-worktree-path>`.
This change shipped to GitLab.com and caused a production incident six
months later. Write the incident review.
What it changes: <one factual sentence, no rationale>.
Spec sections it must satisfy: <quoted spec text>.
Diff: <the full diff>.
Rank the candidate causes by likelihood. For each, name the file:line
that carries it and the first symptom an on-call engineer would see. Skip
causes that need a second, unrelated defect. Do not suggest fixes. Read
only the files the diff touches and these other writers of the rows it
locks: <file:line list>. Do not read docs/plans/, the MR, or any review
report.
B, forced failure:
First, run `cd <absolute-worktree-path>`.
Spec sections: <quoted spec text>.
Diff: <the full diff>.
Name exactly one behavior these spec sections state that this diff fails
to deliver, with the file:line that falls short and what a correct
implementation would do instead. If you conclude it delivers all of
them, say which statement you checked last and how. Answer only that. Do
not read docs/plans/, the MR, or any review report.
C, attacker against the guard (only when the diff adds or changes an input bound):
First, run `cd <absolute-worktree-path>`.
Guard text: <quoted guard text, no rationale>.
Dependency: <module> <version>. Read its source at that version.
Write the input that passes every stated guard and makes the dependency
allocate or compute the most. Give its size in bytes, what it allocates or
computes, and the arithmetic, citing the dependency file:line of each
allocation or loop site. Do not run it. Do not read docs/plans/, the MR, or
any review report.
D, hold-and-wait (only when the diff takes units from a shared gate):
First, run `cd <absolute-worktree-path>`.
Spec sections: <quoted spec text>.
Gate: <the type and its Acquire, with file:line>.
Diff: <the full diff>.
List every place the diff acquires from the gate. For each, name what the
caller already holds when it asks and whether it asks for all it needs at
once. Then take the smallest gate size and the largest request the spec
allows, and say what a caller holding one unit does when the free units
are fewer than it asks for: proceed, park, or refuse at once. Name the
input that makes every holder wait for units no holder can release, and
what parks behind it. Do not run it. Do not read docs/plans/, the MR, or
any review report.
E, lifecycle and races (only when the diff adds a background job, a cap, or a TTL, or a method the plan says a job calls):
First, run `cd <absolute-worktree-path>`.
Spec sections: <quoted spec text>.
Diff: <the full diff>.
For each background job, writer, or method a job will call that the diff
adds, say what it does when its
namespace is suspended, limit-blocked, disabled, blocked, or shredded, and
when its repository is deleted or being purged, citing file:line. For each
value read before a transaction opens, name the writer that can change it
before the commit, including a second request of the same principal, and
say what the commit re-reads. For each column the commit reads under lock,
say whether a later run can overwrite it before this run commits, and whether
the write uses this run's value or the row's current one. For each cap or TTL, name what frees a slot
and what refreshes the clock. Answer with the one case that ends worst. Do
not run it. Do not read docs/plans/, the MR, or any review report.
Judge every finding they return. Confirmed: verify it in the code and
cite the file:line. Rejected: one sentence with the evidence that
refutes it. Never relay a finding unjudged, and never predict a subagent
that has not returned.
Report
## Self-review: !<iid> <title>
Run: model <your model ID>, effort <the level the operator gave, else unknown>, skills <short HEAD SHA of the repo ~/.claude/skills/self-review links into>
### Verdict
READY / NOT READY: <the findings that drove it>
### Description
<N> claims, <n> backed. Each claim that is not backed:
| Claim | Verdict | Evidence |
Paste-ready text: Downsides, Unchanged behavior, Readings, Non-goals.
### Spec compliance (Q1)
| Statement | Code | Test | Nearest wrong implementation | Verdict |
### Findings
BLOCKING, WARNING, OBSERVATION, most severe first: Q2, Q3, the test
checks, Part C's confirmed findings, and `/review-spec`'s findings with
their check IDs.
### Part C
Confirmed: <ids>. Rejected, with reasons: <list>. Withheld: <list>.
Any BLOCKING means NOT READY. Write the report to
~/projects/notes/mr-reviews/mr-<iid>-self-review.md (the directory
exists), and give the operator the path. A --delta run writes
mr-<iid>-self-review-delta.md and a --description-only run
mr-<iid>-self-review-description.md, so neither overwrites the full report.
A later delta reads the newer of the full and delta reports.
Report findings
After writing the file, call ReportFindings once with the findings, so the
host UI renders them as a list. The file keeps its sections, with Description
and Q1 as tables. Don't also print the findings as text in your reply: give
the verdict line and the path.
Report these, most severe first:
- every BLOCKING, WARNING, and OBSERVATION from Q2, Q3, the test checks,
Part C's confirmed findings, and
/review-spec; - each unbacked (WARNING) or false (BLOCKING) description claim, and each Part A gap, which is a WARNING;
- a Q1 row only when it's
UNSATISFIED(BLOCKING) orUNPINNED(WARNING).
Backed claims, satisfied rows, and rejected Part C findings stay in the file.
Fill each finding like this:
fileandline: the repo-relative path and line. A description finding usesMR descriptionand noline.summary: one sentence naming the defect.short_summary: the claim alone, 60 characters or fewer.category: a kebab-case slug, one ofdescription-claim,description-gap,spec-compliance,domain-correctness,architecture,test-adequacy,adversarial, or the/review-speccheck ID (review-spec-s2).failure_scenario: the concrete input or state and the wrong result. For a description finding, what a reviewer would rely on and what the code or document says instead. Paste-ready text stays in the file.verdict:CONFIRMEDwhen you verified it in the code atHEADand cite thefile:line,PLAUSIBLEotherwise.
Pass level only when the operator named an effort level. With no findings,
pass []. The tool takes at most 32 findings: report the 32 most severe, and
say in the file how many were left out.
Modes: --no-description drops the description findings, and
--description-only reports only those. --delta reports the delta's new
findings plus each previous BLOCKING and WARNING finding that still holds,
each with Still holds: opening its summary.
Next: a code fix means /review-branch --delta <sha> before this pass
runs again, with --delta <sha> too. A description-only fix needs neither. Then the full local
suite, /db-review-prep when the diff adds or changes a migration or a query, and mark the MR ready.
The next db-review-prep run comes after human review, not during it.
View original Markdown
---
name: self-review
description: >
Last pass on an Artifact Registry step MR before it is marked ready.
Checks every claim in the MR description against the code, tests, and
documents it names, and asks for the Downsides, Readings, Non-goals, and
unchanged behavior a reviewer would otherwise raise. Answers spec
compliance clause by clause, domain correctness, and architecture fit.
Runs two blind subagents, a pre-mortem and a forced named failure, and
records a verdict on each finding. Read-only. Run in a fresh session,
from the step's worktree, with the Draft MR open, after the second
/validate-step.
argument-hint: "[--mr <iid>] [plan path] [step id] [base] [--no-description | --description-only] [--delta <sha>]"
disable-model-invocation: true
---
# Self-review
`/review-branch` reviews the code and `/validate-step` the branch's fit to
the plan. This pass reviews what a human reviewer reads first, the MR
description, and asks the questions tooling cannot answer. Its aim is a
human round that finds only nits.
Do not run it in the session that wrote the code or the description.
## Read-only contract
Report findings and paste-ready description text. Never edit code, never
commit or push, never post to GitLab. The operator applies the changes.
Evidence stays in the report. A finding's Evidence field cites sources so
the operator can verify it: third-party `file:line`, commit hashes, URLs.
Paste-ready text, and any fix a finding proposes for a committed document,
states the behavior as a fact in the target's own terms with no source
citation, and obeys that document's writing rules (for a spec, the
spec-author rule "Findings are research input, not spec content": citations
go in `References`, nowhere else). Whoever applies a finding follows the
same rule.
## Modes
With no flag the pass runs everything below. `/run-step` splits it in two,
because the MR description is scratch until the code has settled and the
code is the authority:
- `--no-description`: skip Part A and never read the description. Parts B
and C, the Resolve step, and `/review-spec` run as usual. The report
drops its Description section. Use it in every round that can move the
head.
- `--description-only`: run Part A and nothing else, with no subagents and
no `/review-spec`. The code, tests, and documents at `HEAD` decide: a
claim they contradict is a defect in the description, so its fix is
paste-ready description text, never a code finding. The verdict is NOT
READY only when a claim is false. The report holds only the Description
section. Use it once, after the last code change.
- `--delta <sha>`: for a re-run after a fix, with `--no-description`.
`<sha>` is the head a previous run read, and that run may have ended NOT
READY. Parts B and C read `git diff <sha>...HEAD` instead of the whole
diff. Q1 has a row only for each spec statement the delta's files touch.
Q2 and Q3 apply to the delta. Part C runs subagent A, plus C, D, or E when
the delta itself adds what they cover; B is skipped, because Q1's delta
rows already answer it. Each subagent gets the spec statements the delta's
Q1 rows name, not the whole spec, and the delta diff. Then read the
previous report: `~/projects/notes/mr-reviews/mr-<iid>-self-review-delta.md`
when it is newer than `mr-<iid>-self-review.md`, else the latter.
Re-verify each previous BLOCKING finding at `HEAD` first: one that still
holds stays BLOCKING under its ID. Then sweep the siblings of every
BLOCKING finding, and of each WARNING finding whose files the delta
touches, across the whole tree, not only the delta: the same cause on an
adjacent axis, site, or caller, which a fix to one site leaves open. The
sweep gets 12 tool turns; siblings not reached are listed as `unswept`.
Judge each sibling like any other finding. The previous report stays
withheld from the subagents. The report lists every previous BLOCKING and
WARNING finding that still holds, so the next delta can read it as the
previous report.
## 1. Resolve
- **Base:** the `base` argument, else `origin/main` after
`git fetch -q origin main`.
- **Worktree and branch:** `git rev-parse --show-toplevel` and
`git branch --show-current`. Stop on `main`.
- **MR:** `--mr <iid>`, else `glab mr view --output json`. Stop with "open
the Draft MR first" when there is none. Stop with "push first" when the
MR's `sha` is not `HEAD`: the description must describe the pushed code.
- **Kind:** `git diff --name-only <base>...HEAD`. When every changed file
is under `docs/specs/` or `docs/plans/`, stop with `self-review: only
specs and plans changed; use /review-spec, which also checks the MR
description.` This pass checks code against a plan step, which a
spec-only MR doesn't have.
- **Plan and step:** the arguments, else the branch name
`<user>/<plan-slug>-step-<id>`, else the title marker
`(<token> plan: <step>/<total>)`. Resolve against `docs/plans/` at base.
- **Spec:** the spec the plan's `## Summary` cites.
State the resolved values before reading code.
## 2. Gather, then dispatch Part C
In one turn: `git diff <base>...HEAD`, `git log --oneline <base>..HEAD`, the
MR description, the step's plan entry (Depends on, Delivers, Acceptance),
the spec sections the step's Delivers names, and the ADRs the description's
ADRs item names. Then launch Part C's two subagents, so they run while you
work through Parts A and B.
When a changed file is under `docs/specs/` or `docs/plans/` and another
changed file is not, also run `/review-spec <base> --mr <iid>` in the
parent, in the same turn as the Part C launch. It runs in the parent
because it launches its own lens subagents, which a subagent can't do.
Its check D overlaps Part A: merge findings on the same passage and cause,
and keep Part A's verdict. Its fix text is paste-ready text for a
committed document, so the read-only contract's citation rule applies to
it.
## Part A: the description's claims
Skipped under `--no-description`.
Split the description into claims: every sentence that states a fact about
the code, the tests, the tree, another document, or what was run. That
includes the Summary, every Checklist answer, and any coverage, rationale,
or non-goals section. For each claim, find what backs it at `HEAD`: a test,
a `file:line`, a command whose result the description reports, or a
document you opened.
| Verdict | Meaning | Severity |
|---|---|---|
| backed | the backing exists and says what the claim says | — |
| unbacked | nothing you can open supports it | WARNING |
| false | the code, a test, or the document contradicts it | BLOCKING |
Check these kinds of claim hardest, because reviewers do:
1. **Numbers.** Line, file, call, step, and row counts, re-derived at
`HEAD`.
2. **Closed sets.** "Only", "every", "none", "both", "the three". List the
members from the code. A missing member makes the claim false. A set
that no test pins is unbacked. A test that pins a source-of-truth set
(proto fields, an enum, a registry) with a hand-typed list pins nothing:
a member added later passes every loop over the list. It must compare
against the source.
3. **Evidence level.** "Ran it" says what was run, against what. A claim
that implies a live run, a real client, or a repeat count the
description does not report is false.
4. **Other documents.** "The spec needs no edit", "S12 already lists it":
open the document at `HEAD` and check.
5. **Main.** "Today", "already", "nothing calls it": check at base.
6. **Other MRs.** A claim about another MR's state ("!4236 adds the
job", "after !4284 merges"): read that MR's state with `glab`, then
open the file the claim names at `HEAD`. A claim the tree already
contradicts is false: the job the description waits for may be
there. The same goes for a stack note that names a parent that has
merged.
Then check what the description should say and does not. Each gap is a
WARNING, with a paste-ready line:
- **Downsides.** What the diff costs, changes for a caller, or leaves
out: a behavior change for callers the description does not name, a
metric or record that misses a case, a retry that repeats work. Take
candidates from the diff and from Parts B and C.
A Downside that defers something the plan or a `docs/dev/` rule
requires (a test target's CI job, a registry entry) is a gap, not a
disclosure. Mark it unbacked unless a tracked issue or an open MR
owns the deferral, and check that item's state.
- **Unchanged behavior.** For each changed error mapping or branch, what
stays as before, named, with the test that pins it.
- **Readings.** Where a spec clause admits two readings and the code
picks one, the description names the reading it took. For each pair of
keys that bound or populate one quantity (a default list and a cap on
it), it also says which wins when they disagree. A spec that is silent
on the pair is the reason to say so, not an answer.
- **Non-goals.** Adjacent work a reviewer will ask about, each with the
step or issue that owns it.
- **Kept promises.** In a stack, read the resolved threads on the parent
and sibling MRs with `/glab-read`. For each author reply that promises
work here or later ("moved to", "will add", "in the next part"), check
`HEAD` for it. An unkept promise is a WARNING: paste-ready is the comment
or test, or a description line saying it moved.
## Part B: spec, domain, architecture
**Q1. Spec compliance.** One row per behavior statement in the spec
sections the step's Delivers names (Interfaces, Data, Flows, Failure,
limits and recovery, Security), plus the step's Delivers and Acceptance
lines. Each row names the `file:line` that satisfies it and the test that
pins it, or says `UNSATISFIED` (BLOCKING) or `UNPINNED` (WARNING). Keep one
statement per row. A test name is not satisfaction: name the code.
A test that exists is not yet an adequate one. For each row you would mark
pinned, name the nearest wrong implementation: the cheapest one that applies
the rule too broadly, too narrowly, or in a shared helper, and still passes
every listed test. Name the listed case that fails it. With none, the row is
`UNPINNED`. A rule of the form "fails on X" needs a case for the nearest
not-X that must pass: a `3xx` that fails needs the `409` that passes. Run
this on every fix the report proposes before it goes into paste-ready text;
a fix that adds a failing case is the usual source of a missing complement.
In a changed SQL statement, every `COALESCE`, `CASE`, `NULLIF`, and fallback
arm is such a candidate: delete the arm and name the test that fails. An arm
no test reaches makes the row `UNPINNED`.
Where a row's value names an identifier of another domain (an
architecture, a suite, a path component, a package name), that domain's
grammar is part of the row, even in a section Delivers doesn't name. Open
the grammar in the spec, list what it refuses (empty, case, length,
separators, `..`, duplicates), and check the code refuses each where the
value is read. A grammar the code leaves unenforced is BLOCKING; name the
cheapest input that passes the code and breaks the grammar.
**Q2. Domain and protocol correctness.** Does the change handle the
format, protocol, or schema semantics correctly? For a migration, compare
the DDL with the governing ADR column by column, constraint by
constraint, and referential action by referential action, and name every
difference, including the deliberate ones. For each `NO ACTION` or
`RESTRICT` foreign key, check that the referencing column leads a
non-partial index.
Where the diff serves a named client (`apt`, `dput-ng`, `curl`, a release
tool), run the client's default invocation and default output through the
code, not the documented example. Each file or request it sends is
accepted, discarded, or refused, and a refusal on the first one stops the
client. A default run that publishes nothing is BLOCKING. Check every
claim the code or comments make about the client against its manual or
source.
Check every comment or code path that asserts how a dependency encodes,
rounds, normalises, or stores a value (pgx time or numeric, JSON, a hash)
the same way: open the dependency's source at the pinned version, and try
the value half a unit past the resolution (500 ns on a microsecond column).
For every transaction the diff adds, list the rows and tables it locks, in
order. List every other writer on base that locks any of them, and compare
the orders. A comment that says "cannot deadlock" or "free of deadlock" is a
closed-set claim: check it against every other lock taker, not only the
sibling the comment names. An opposite order is a WARNING, or BLOCKING when
no retry absorbs the `40P01`.
Where the diff adds or changes a size, count, allocation, or time bound on
input the system reads from a registry or client, "bounds the total" is a
closed-set claim. Open the dependency's source at the pinned version, list
every allocation and loop site the input drives, and name the cheapest input
that passes every stated guard, with the bytes allocated per byte read. When
the MR's history shows a reviewer closing one amplification axis (many
blocks), sweep its siblings (per chunk, per state reset, per header). An
axis the guard leaves open is BLOCKING.
Where the diff takes units from a shared gate, pool, or semaphore
(admission units, connection or worker slots), open the gate's `Acquire`
at HEAD for its wait and refusal rules, then name what the caller already
holds when it asks. A caller that holds units while it waits for more is
hold-and-wait: say, at the gate's floor, its default, and the largest
request the code allows, whether the request proceeds, parks, or refuses
at once. Hold-and-wait with no single up-front acquire and no non-waiting
refusal is BLOCKING. Ask the same of every line the author added to
answer a review comment.
Where the diff adds a background job, a cap, or a TTL, or a commit or store
method that the plan says a job, a retry, or a timed-out run will call, run
the lifecycle, check-then-act, and accumulation checks of `/review-spec` S9
against the code: each parent state the job meets (namespace suspended,
blocked, shredded; repository deleted or purging) and what it does there;
each read made before the transaction opens and what the commit re-reads
under lock; what frees a full cap; and what refreshes a TTL, so that one
principal's activity can't hold every row forever (BLOCKING when it blocks
that principal for good). For each column the commit reads under lock, say
whether a later run can overwrite it between this run's start and its
commit, and whether the write uses the run's own value or the row's current
one.
**Q3. Architecture fit and blast radius.** Does the approach fit the
plan's `## Approach` and the surrounding code? What breaks in production
if it is wrong, and who notices first?
When the new committer, store, or handler has sibling formats, also compare
its input and result types, and the effects it must report (a size delta, a
counter), field by field against each sibling's. Name every sibling that
diverges. The plan's "effects ride with the code that causes them" rule puts
the probe where the effect happens.
Two test checks that no review phase owns:
- **Dropped subtests.** When the step mirrors a sibling package, or adds
a section or file beside siblings (`internal/config/<format>.go` next
to the other formats' files), diff the new suite against each sibling's
for cases that are missing. Compare behavior, not test names: read what
each sibling's rule does and check the new code does the same. Name the
sibling file, and name every sibling that diverges from the rest, so the
report shows whether the gap is in the new code or in the odd one out.
- **Over-asserting tests.** The reverse: a test of a document or file
that asserts prose, markdown layout, or exact wording beyond what its
siblings assert is a WARNING. The siblings compare a document with a
code fact (every key, every metric), not with its sentences.
- **Enumerated columns.** Every value of a `kind`, `format`, or
`visibility` column gets a positive-hit test, not one value and
negatives.
## Part C: blind adversarial review
A self-review fails by agreeing with its own reasoning. Subagents with a
clean context break that. Give each one the spec text and the diff only.
Withhold the MR description, the plan's Approach, the step's Acceptance
lines, every earlier review report, and any justification the operator
wrote. Name what you withheld in the report. Subagent A also gets the other
writers of any row the diff locks, as `file:line` with no rationale.
Dispatch A and B in one message, with `subagent_type="general-purpose"`. Add
C to the same message when the diff adds or changes a bound on untrusted
input, D when it takes units from a shared gate, pool, or semaphore, and E
when it adds a background job, a cap, or a TTL, or a method the plan says a
job calls.
**A, pre-mortem:**
```text
First, run `cd <absolute-worktree-path>`.
This change shipped to GitLab.com and caused a production incident six
months later. Write the incident review.
What it changes: <one factual sentence, no rationale>.
Spec sections it must satisfy: <quoted spec text>.
Diff: <the full diff>.
Rank the candidate causes by likelihood. For each, name the file:line
that carries it and the first symptom an on-call engineer would see. Skip
causes that need a second, unrelated defect. Do not suggest fixes. Read
only the files the diff touches and these other writers of the rows it
locks: <file:line list>. Do not read docs/plans/, the MR, or any review
report.
```
**B, forced failure:**
```text
First, run `cd <absolute-worktree-path>`.
Spec sections: <quoted spec text>.
Diff: <the full diff>.
Name exactly one behavior these spec sections state that this diff fails
to deliver, with the file:line that falls short and what a correct
implementation would do instead. If you conclude it delivers all of
them, say which statement you checked last and how. Answer only that. Do
not read docs/plans/, the MR, or any review report.
```
**C, attacker against the guard** (only when the diff adds or changes an
input bound):
```text
First, run `cd <absolute-worktree-path>`.
Guard text: <quoted guard text, no rationale>.
Dependency: <module> <version>. Read its source at that version.
Write the input that passes every stated guard and makes the dependency
allocate or compute the most. Give its size in bytes, what it allocates or
computes, and the arithmetic, citing the dependency file:line of each
allocation or loop site. Do not run it. Do not read docs/plans/, the MR, or
any review report.
```
**D, hold-and-wait** (only when the diff takes units from a shared gate):
```text
First, run `cd <absolute-worktree-path>`.
Spec sections: <quoted spec text>.
Gate: <the type and its Acquire, with file:line>.
Diff: <the full diff>.
List every place the diff acquires from the gate. For each, name what the
caller already holds when it asks and whether it asks for all it needs at
once. Then take the smallest gate size and the largest request the spec
allows, and say what a caller holding one unit does when the free units
are fewer than it asks for: proceed, park, or refuse at once. Name the
input that makes every holder wait for units no holder can release, and
what parks behind it. Do not run it. Do not read docs/plans/, the MR, or
any review report.
```
**E, lifecycle and races** (only when the diff adds a background job, a cap,
or a TTL, or a method the plan says a job calls):
```text
First, run `cd <absolute-worktree-path>`.
Spec sections: <quoted spec text>.
Diff: <the full diff>.
For each background job, writer, or method a job will call that the diff
adds, say what it does when its
namespace is suspended, limit-blocked, disabled, blocked, or shredded, and
when its repository is deleted or being purged, citing file:line. For each
value read before a transaction opens, name the writer that can change it
before the commit, including a second request of the same principal, and
say what the commit re-reads. For each column the commit reads under lock,
say whether a later run can overwrite it before this run commits, and whether
the write uses this run's value or the row's current one. For each cap or TTL, name what frees a slot
and what refreshes the clock. Answer with the one case that ends worst. Do
not run it. Do not read docs/plans/, the MR, or any review report.
```
Judge every finding they return. **Confirmed**: verify it in the code and
cite the `file:line`. **Rejected**: one sentence with the evidence that
refutes it. Never relay a finding unjudged, and never predict a subagent
that has not returned.
## Report
```plaintext
## Self-review: !<iid> <title>
Run: model <your model ID>, effort <the level the operator gave, else unknown>, skills <short HEAD SHA of the repo ~/.claude/skills/self-review links into>
### Verdict
READY / NOT READY: <the findings that drove it>
### Description
<N> claims, <n> backed. Each claim that is not backed:
| Claim | Verdict | Evidence |
Paste-ready text: Downsides, Unchanged behavior, Readings, Non-goals.
### Spec compliance (Q1)
| Statement | Code | Test | Nearest wrong implementation | Verdict |
### Findings
BLOCKING, WARNING, OBSERVATION, most severe first: Q2, Q3, the test
checks, Part C's confirmed findings, and `/review-spec`'s findings with
their check IDs.
### Part C
Confirmed: <ids>. Rejected, with reasons: <list>. Withheld: <list>.
```
Any BLOCKING means NOT READY. Write the report to
`~/projects/notes/mr-reviews/mr-<iid>-self-review.md` (the directory
exists), and give the operator the path. A `--delta` run writes
`mr-<iid>-self-review-delta.md` and a `--description-only` run
`mr-<iid>-self-review-description.md`, so neither overwrites the full report.
A later delta reads the newer of the full and delta reports.
## Report findings
After writing the file, call `ReportFindings` once with the findings, so the
host UI renders them as a list. The file keeps its sections, with Description
and Q1 as tables. Don't also print the findings as text in your reply: give
the verdict line and the path.
Report these, most severe first:
- every BLOCKING, WARNING, and OBSERVATION from Q2, Q3, the test checks,
Part C's confirmed findings, and `/review-spec`;
- each unbacked (WARNING) or false (BLOCKING) description claim, and each
Part A gap, which is a WARNING;
- a Q1 row only when it's `UNSATISFIED` (BLOCKING) or `UNPINNED` (WARNING).
Backed claims, satisfied rows, and rejected Part C findings stay in the file.
Fill each finding like this:
- `file` and `line`: the repo-relative path and line. A description finding
uses `MR description` and no `line`.
- `summary`: one sentence naming the defect. `short_summary`: the claim
alone, 60 characters or fewer.
- `category`: a kebab-case slug, one of `description-claim`,
`description-gap`, `spec-compliance`, `domain-correctness`, `architecture`,
`test-adequacy`, `adversarial`, or the `/review-spec` check ID
(`review-spec-s2`).
- `failure_scenario`: the concrete input or state and the wrong result. For a
description finding, what a reviewer would rely on and what the code or
document says instead. Paste-ready text stays in the file.
- `verdict`: `CONFIRMED` when you verified it in the code at `HEAD` and cite
the `file:line`, `PLAUSIBLE` otherwise.
Pass `level` only when the operator named an effort level. With no findings,
pass `[]`. The tool takes at most 32 findings: report the 32 most severe, and
say in the file how many were left out.
Modes: `--no-description` drops the description findings, and
`--description-only` reports only those. `--delta` reports the delta's new
findings plus each previous BLOCKING and WARNING finding that still holds,
each with `Still holds:` opening its `summary`.
Next: a code fix means `/review-branch --delta <sha>` before this pass
runs again, with `--delta <sha>` too. A description-only fix needs neither. Then the full local
suite, `/db-review-prep` when the diff adds or changes a migration or a query, and mark the MR ready.
The next db-review-prep run comes after human review, not during it.
Community Reviews & Field Notes
Tried this skill on your own project? Share the model you used and the results you got.