{"data":{"slug":"discovered-b3004af5008ff9e8f820dde5357224765c03d3f4b0177fce","title":"Review Spec","summary":"Review a spec or plan change on the current branch of the GitLab Artifact Registry (`docs\/specs\/`, `docs\/plans\/`, `docs\/adr\/`) before human review. The deliverable is a terminal report identifying issues such as contradictions, missing acceptance criteria, and other defects.","url":"https:\/\/skillshunter.net\/skills\/discovered-b3004af5008ff9e8f820dde5357224765c03d3f4b0177fce","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-b3004af5008ff9e8f820dde5357224765c03d3f4b0177fce","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-b3004af5008ff9e8f820dde5357224765c03d3f4b0177fce.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-b3004af5008ff9e8f820dde5357224765c03d3f4b0177fce\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Validate every citation under `~\/.claude\/skills\/review-branch\/references\/protocol.md` before proceeding. Ensure the current branch is correctly set up and that the MR iid (if provided) corresponds to the source branch.","instructions":"---\nname: review-spec\ndescription: >\n  Review a spec or plan change on the current branch of the GitLab\n  Artifact Registry (`docs\/specs\/`, `docs\/plans\/`, `docs\/adr\/`) before\n  human review.\n  Reads the whole amended spec rather than the hunks, and checks what\n  human reviewers kept finding: clauses the edit contradicts, normative\n  rules with no acceptance criterion, bounds with no number or wrong\n  arithmetic, cross-references that do not say what is claimed,\n  present-tense claims about `main` that the code disproves, enum\n  vocabulary that drifts between metrics, events, and error rows,\n  data-model rows that break `docs\/dev\/database.md`, a named client's\n  default run that the flow refuses, background jobs with no stated\n  behavior in each parent lifecycle state, caps with no exit, sibling\n  format specs that moved on `main` since the base, plan Files lists\n  and counts that the step branch disproves, Status rows and handoffs\n  recorded on one side only, an ADR that carries detail its README\n  sends elsewhere, states an unchecked claim about outside software, or\n  promises isolation a lower role can defeat, unchanged text elsewhere\n  in the tree that the edit makes false, and an MR description whose\n  \"What changed\" list no longer matches the diff. Read-only on GitLab\n  until the operator says \"go\": it lists which findings to post on\n  another author's MR and posts them, and approves, only on that word. Use for \"review this spec\", \"review the plan MR\",\n  \"review the ADR\", \"self-review before I request review\" on a\n  docs(specs), docs(plans), or docs(adr) branch. Go changes go to\n  `\/review-branch`.\nargument-hint: \"[base] [--mr <iid>] [--description] [--delta <sha>]\"\n---\n\n# Spec and plan review\n\nA spec is the source of truth an implementer builds from, and a plan is\nthe record a step author sizes their MR from. A defect in either is\nbuilt into code before anyone notices. Review the document as the\nimplementer will read it: whole, at HEAD, against the tree it describes.\n\n## Rules\n\n- **Read-only on GitLab,** except for the writes the `go` line names (see\n  Post recommendation), and only when the operator says `go` in the\n  current turn. Otherwise `glab mr view`, `glab issue view`, and `glab\n  api` GETs only: never post, reply, react, approve, or edit an MR or\n  issue. The output is a report in the terminal.\n- **Validate every citation** under\n  `~\/.claude\/skills\/review-branch\/references\/protocol.md`, which also\n  sets the severity bar and the findings format. Read it first.\n- **A spec defect blocks** when an implementer who follows the text\n  builds behavior in one of the classes in the repo's\n  `docs\/dev\/agentic-development.md#what-blocks-a-merge`. Wording that\n  misleads without changing what gets built is an OBSERVATION. Report\n  both: the point of this review is that the human round finds nothing.\n- **A fix removes before it adds.** Every text a report proposes takes\n  the cheapest form that ends the finding: cut the claim, point at its\n  source (\"the flag cache's lifetime\", \"the run's own timeout\"), or\n  describe the behavior without naming another document's step, MR, or\n  section. A proposed fix adds a number, a step or MR number, or a\n  section name only when this document is the one that sets the value.\n  Each such addition is a second copy that goes false when its source\n  changes, and the next round flags it. Check every proposed fix against\n  S1 to S4 before writing it, reading S1 over the whole plan too: a fix\n  that states a rule the rest of the document contradicts (\"whichever\n  lands first builds it\" against \"Step 0 owns it\") is a new defect. A fix\n  that adds a claim the document can't verify alone is replaced by one\n  that removes the claim.\n- **Report what a human round would raise.** A finding that a human\n  reviewer reading the diff would not raise goes under Held back, one\n  line each, not under Findings. Three kinds qualify: a conflict that\n  exists only if another unmerged MR lands first, text no step builds on\n  yet, and wording that misleads without changing what gets built. List\n  at most five OBSERVATIONs; count the rest under Held back.\n- **Trust nothing written down.** A count, a file list, a status, or a\n  \"today\" claim is re-derived from the tree, the step branch, or the\n  cited document. The diff's own justification is not evidence.\n- **Turns are the cost**, as in `\/review-branch`: batch independent\n  reads into one turn, read a file once, stop at the turn budget.\n\n## Files\n\n| File | Read by |\n|---|---|\n| `~\/.claude\/skills\/review-branch\/references\/protocol.md` | every lens |\n| `~\/.claude\/skills\/review-spec\/references\/checks.md` | every lens; the parent for check D |\n| `~\/.claude\/skills\/review-branch\/references\/judge.md` | the finding-check subagent |\n\n## Setup (parent, no ultrathink)\n\n### 1. Arguments and base\n\n`<base>` is the positional argument, or `origin\/main` after\n`git fetch -q origin main`. A positional argument that is a bare integer\nor `!<iid>` is an MR iid, not a base: treat it as `--mr <iid>` with\n`<base>` = `origin\/main`. When the current branch isn't that MR's source\nbranch, review the MR head in a throwaway worktree: fetch\n`refs\/merge-requests\/<iid>\/head` as in step 3, run\n`git worktree add --detach <scratch>\/wt-<iid> origin\/mr\/<iid>`, use it as\n`<repo_root>` for every command and lens, and remove it before the\nreport. `<base>` is what \"main\" means in every\ncheck but S10: a claim about `main` is checked at `<base>`, never at a\nlater ref. S10 reads `origin\/main` on purpose, to catch drift since\n`<base>`. `--mr <iid>` names the branch's MR when `glab mr view` cannot find\nit from the current branch. `--description` runs check D only (Setup\nsteps 2 and 4, then check D, then the report): use it after each push.\n`--delta <sha>` reviews the fixes after a full review, where `<sha>` is\nthe head that review covered. Use it for every round after the first: a\nfull re-review re-reads text the last round passed, and re-raises threads\nthe fixes already closed. Run a full review again only for a new base. Step 2 adds\n`git diff -U0 <sha>..HEAD -- docs\/specs docs\/plans`, and the bundle\ncarries it as `FIX HUNKS`. Each lens runs all of its checks on every\nFIX HUNKS line as new text, not only the check that raised the earlier\nfinding, and still reads the whole document, because a fix changes the\nclauses around it. An author's answer to a finding is the likeliest\nplace for the next one. A finding still has to sit on a FIX HUNKS line\nor on a clause one of them made false; text the earlier review read and\npassed is not raised again. The report's check D covers only what the\ndelta changed.\n\n### 2. Context, one Bash call\n\n```bash\ngit log --oneline <base>..HEAD\ngit diff --name-status <base>...HEAD\ngit diff -U0 <base>...HEAD -- docs\/specs docs\/plans docs\/adr\ngit rev-parse <base> HEAD\n```\n\nClassify each changed file:\n\n| Kind | Path |\n|---|---|\n| `spec` | `docs\/specs\/**\/S*.md` |\n| `plan` | `docs\/plans\/*.md` except `README.md` and `TEMPLATE.md` |\n| `adr` | `docs\/adr\/[0-9]*.md` |\n| `index` | `docs\/specs\/README.md`, `docs\/plans\/README.md` |\n| `other` | anything else |\n\nNo `spec`, `plan`, or `adr` file: abort with `review-spec: no spec,\nplan, or ADR change between <base> and HEAD; use \/review-branch`. An `other` file\nthat is Go or config is named in the report as out of scope for this\nskill.\n\nFor each changed spec, record its layout: `older` when it has a\n`## Acceptance Criteria` heading, `live` otherwise (the current\n`docs\/specs\/TEMPLATE.md`, which has none). For each changed plan,\nrecord `older` when it has a Status table or per-step **Files** lists,\n`live` otherwise (the current `docs\/plans\/TEMPLATE.md` bans file lists\nand counts).\n\n### 3. Step MRs (plan changes only)\n\nCollect every `!<iid>` in the changed plan hunks and in the MR\ndescription. For each, one batched turn:\n\n```bash\nglab mr view <iid> --output json | jq '{iid,state,title,source_branch,target_branch,sha,merge_commit_sha,squash_commit_sha,description}'\ngit fetch -q origin \"+refs\/merge-requests\/<iid>\/head:refs\/remotes\/origin\/mr\/<iid>\"\n```\n\nThe step's diff is `git diff <base>...origin\/mr\/<iid>` for an open MR,\nand the merged commit against its first parent for a merged one. Keep\neach step MR's description: check P2 reads its merge-order lines.\n\n### 4. The MR\n\n`glab mr view [<iid>] --output json` for the title and description.\nNo MR yet: check D reviews the branch's commit subjects as the future\ntitle and records \"no description\".\n\nKeep `.author.username` from that JSON, and read `glab api user` for the\nreviewer's own username: the Post recommendation prints only for another\nauthor's MR. With an MR, also read its unresolved threads (GETs only):\n\n```bash\npython3 ~\/.claude\/skills\/glab-read\/scripts\/glab-read.py threads <iid> --unresolved --max 1500\n```\n\n### 5. Bundle\n\n```bash\nBUNDLE=\/tmp\/review-spec-$(git rev-parse --abbrev-ref HEAD | tr \/ -)-$(date +%s).md\n```\n\nOne heredoc: base and head SHAs, repo root, the changed-file table\nwith kinds and layouts, the `-U0` diff from step 2, the MR title and\ndescription, the step MR table from step 3 (iid, state, diff range),\nthe unresolved threads from step 4, and nothing else. No file contents:\nevery lens reads from disk. The `blind` lens gets a second bundle with\nonly the SHAs, repo root, changed-file table, and `-U0` diff (plus\n`FIX HUNKS` under `--delta`).\n\n## Lenses\n\n| Lens | Runs when | Checks | Reads |\n|---|---|---|---|\n| `internal` | a spec changed | S1, S2, S3, S6, S9 | each changed spec whole, at HEAD, then the dependency source an S3 bound check names |\n| `external` | a spec changed | S4, S5, S7, S8, S10, F | each changed spec section whole (the `##` section around each hunk), then the targets the checks name |\n| `plan` | a plan changed | S2, S3, P1, P2, P3, S4, S5, F | each changed plan step whole, the plan's Status table and `## Dependencies` (or Depends-on fields), then the targets the checks name, including the dependency source an S3 bound check names |\n| `adr` | an ADR changed | A, S1, S4, S5, F | each changed ADR whole, at HEAD, `docs\/adr\/README.md` at `<base>`, then the specs and open MRs the ADR names or that cite it |\n| `blind` | a spec changed | X | each changed spec whole, then the source its changed sections name; no description, threads, plan, or earlier report |\n\nThe parent runs check D itself. The `blind` lens takes its own bundle and\nprompt (Blind lens, below).\n\nLaunch the lenses that apply as parallel `Agent` subagents, each with\n`model: \"opus\"`, and this prompt (fill `<lens>`, `<checks>`, `<reads>`, `<bundle>`, `<repo_root>`):\n\n```plaintext\nYou are reviewing a spec or plan change in the GitLab Artifact\nRegistry repository at <repo_root>, before human review. Use ultrathink\nfor the review work. You are read-only: do not edit files, and on\nGitLab run only glab GET commands (mr view, issue view, api GET).\nNever post anything.\n\nTurn 1, in parallel:\n1. ~\/.claude\/skills\/review-branch\/references\/protocol.md: citation\n   rules, severity bar, the exact findings format.\n2. ~\/.claude\/skills\/review-spec\/references\/checks.md: run only\n   checks <checks>; the rest of the file is context.\n3. <bundle>: base and head SHAs, the changed files, the -U0 diff, the\n   MR description, step MRs.\n\nTurn 2, in parallel: <reads>. A spec larger than the Read limit is\nread in consecutive ranges in this one turn, never sampled.\n\n\"main\" means the base SHA in the bundle. Check a claim about main\nwith git show <base>:<path> and git grep <pattern> <base>, never\nagainst origin\/main or a later ref (check S10 alone reads origin\/main,\nas its text says). Read the document under review at\nHEAD.\n\nFix text: a Fix you propose cuts the claim, points at its source, or\ndescribes the behavior. It adds a number, a step or MR number, or a\nsection name of another document only when this document sets that\nvalue. Check each Fix against S1 to S4 before you write it, S1 over\nthe whole document: grep the Fix's subject and confirm no other passage\nsays otherwise.\n\nEach check gives a phase in your reply. Batch: when a turn reads or\ngreps, it does everything you already know you need. Budget: 40 tool\nturns. At 34, stop, verify every citation you hold in one batched\nturn, and write the findings. A check you could not finish is\n`skipped (turn budget)`, never silently thin.\n```\n\nIf a lens's reply does not match the protocol format, re-prompt once\nwith \"Return findings in the exact format specified in protocol.md.\"\nA second failure marks its checks `unreviewed (subagent failed)`.\n\n## Blind lens\n\nA review that has read the author's reasoning tends to agree with it.\nLaunch `blind` in the same message as the other lenses, as a general-purpose\nsubagent with `model: \"opus\"`, and this prompt (fill `<blind_bundle>`, `<repo_root>`):\n\n```plaintext\nYou are an implementer about to build from a spec in the GitLab Artifact\nRegistry repository at <repo_root>. You are read-only: edit nothing and\ndo not use glab.\n\nTurn 1, in parallel: ~\/.claude\/skills\/review-branch\/references\/protocol.md\n(citation rules and the findings format) and <blind_bundle>.\n\nTurn 2, in parallel: each changed spec whole at HEAD, then the source, at\nHEAD, of every type, function, and config key the changed sections name.\n\nFollow the changed sections literally, as code. Name exactly one input or\nstate where doing what the text says fails, stalls, or contradicts another\nclause or the code it cites. Give the spec line, the code line, and the\ntext that would fix it, in the protocol's findings format under check X.\nIf you conclude there is none, say which clause you checked last and how.\nDo not read docs\/plans\/, the MR, any review thread, or any review report.\nBudget: 25 tool turns. At 20, stop and write the finding.\n```\n\n## Synthesis (parent, ultrathink)\n\n1. Collect findings and assign IDs (B1\u2026, W1\u2026, O1\u2026, D1\u2026). Merge two\n   findings on the same passage with the same cause; keep both when the\n   cause is the same and the passages differ, linked with `Related:`.\n   Drop nothing silently.\n2. Re-open the cited line of every BLOCKING and WARNING at HEAD (or at\n   `<base>` for a claim about main) in one batched turn. A `blind` finding\n   the cited lines do not support is dropped, with one line of why under\n   Held.\n3. Finding check. The lens that raised a finding also graded it, and\n   you've read its reasoning, so a fresh subagent verifies it instead,\n   without seeing the severity. Skip this step when another skill\n   invoked this one (that skill checks the findings it takes), or when\n   no BLOCKING, DECISION, or WARNING finding is left. Launch one `Agent`\n   subagent, not a fork, with `model: \"opus\"`, and this prompt:\n\n   ```plaintext\n   Read ~\/.claude\/skills\/review-branch\/references\/judge.md and follow it.\n   Repo root: <repo_root>. Base SHA: <base SHA>.\n\n   Findings:\n   <for each BLOCKING, DECISION, and WARNING finding:\n   ID | path:line | What | Evidence>\n   ```\n\n   Pass only those fields: no severity, no check, no Fix, no ship path.\n   Apply every line as returned. `holds` at a different severity, up or\n   down, moves the finding to its new list with the next ID there,\n   carrying **Regraded from:** with the old ID and the judge's reason; a\n   new WARNING gets the judge's ship path. `refuted` moves it to Held\n   back with the judge's reason. `can't tell` keeps it as it was, with\n   **Unverified:** and what the judge couldn't check. When the reply\n   doesn't match judge.md's output, re-prompt once; if it fails again,\n   keep every finding as it was and add \"Finding check did not run.\"\n   under the verdict line.\n4. Triage. Move each finding a human round would not raise (Rules) to\n   Held back, one line each, and keep at most five OBSERVATIONs. Re-check\n   each remaining Fix against the \"removes before it adds\" rule and\n   rewrite one that fails it. A WARNING with no ship path (the protocol\n   requires one) becomes an OBSERVATION, or gets its path.\n5. Verdict: any BLOCKING \u2192 **BLOCK**; any check `unreviewed` or a\n   check S1\u2013S5 or P1 `skipped (turn budget)` \u2192 **REQUEST CHANGES**;\n   otherwise **APPROVE**. A WARNING carries a ship path by the protocol's\n   definition (\"the MR can ship\"), so it doesn't change the verdict: the\n   report lists it under an APPROVE.\n\n## Output\n\n```plaintext\n## Spec review: <branch> -> <base short SHA>\n\n**Changed:** <spec and plan files, with layout> | **Out of scope:** <other files, or none>\n**Lenses:** internal, external, plan, blind (whichever ran)\n\n### Verdict\nAPPROVE \/ REQUEST CHANGES \/ BLOCK\n<One sentence naming the findings that drove it.>\n\n### Findings\n**Tally:** N BLOCKING, N WARNING, N OBSERVATION, N DECISION\n\n**[B1] <title>**\n- **Check:** <ID and name>\n- **Location:** `path:line` (HEAD) or `path:line @ <base short SHA>`\n- **What:** <the defect, quoting the text>\n- **Evidence:** <what the tree, step branch, or cited document says, with its citation>\n- **Fix:** <replacement text where it is short>\n- **Regraded from:** <old ID>: <judge's reason> (only when the finding check moved it)\n- **Unverified:** <what the judge couldn't check> (only on a `can't tell`)\n\n### Checks\n| Check | Verdict | B | W | O | D |\n|---|---|---|---|---|---|\n\n### Examined \/ Held \/ Not verified\n<per lens, from its GROUP SUMMARY block>\n\n### Held back\n<one line per finding triage moved out of Findings, or \"none\">\n\n### Post recommendation\n**Post** (<N> units from <M> findings)\n1. [W1 + O3] `path:line`: <one clause on what the comment asks for>\n2. [B1] `path:line`: <...>\n\n**Elsewhere:** [W4] MR description line | follow-up issue: <one clause>\n**Skip:** [O1] <reason, one clause> | [O2] <...>\n\n**Next:** `\/review-spec <iid or base> --delta <head short SHA>` after the\nfixes, never a full re-review.\n\nSay \"go\" to: post the Post list, post the Elsewhere list, approve.\n```\n\nThe Post recommendation answers \"which findings go on the MR?\" for a\nreviewer, so print it only when an MR iid is known and its author isn't\nthe glab user. Otherwise omit it: the author fixes the branch. It posts\nnothing by itself, and Held back stays where it is. When another skill\ninvoked this one (review-branch does, for a branch that changes specs), omit\nthe `go` line and the `Next` line too: that skill takes the findings and\nowns the handover.\n\n**Save the report.** Unless another skill invoked this one, and with a known\nMR iid, write the report to\n`~\/projects\/notes\/mr-reviews\/mr-<iid>-review-spec.md`, and a `--delta` run to\n`mr-<iid>-review-spec-delta.md`. Put\n`## Spec review: !<iid> <MR title>: <branch> -> <base short SHA>` on the first\nline: `\/address-reviewer-inputs` and `\/review-retro` count a report only when\nthe MR title in its heading matches. When the directory doesn't exist, skip\nthe write and say so; don't create it. With no known iid, as before the MR is\nopened, write nothing.\n\n**Combine by location.** Findings on the same passage and about the same\nedit become one unit, whatever their severities: keep the highest\nseverity, cite every ID, and write one ask that covers each point.\nFindings on different passages stay separate, even with one root cause\n(`Related:` carries that).\n\n**Pick what to post.**\n\n- Post every BLOCKING and DECISION unit.\n- Post a WARNING unit when its ship path is a thread or a note to the\n  author. A WARNING whose ship path is an MR description line or a\n  follow-up issue goes under Elsewhere.\n- Post an OBSERVATION unit only when the author can act on it in this MR\n  and it would change what they do. Merged into a posted unit, it rides\n  along. Alone, and cosmetic or already covered by a posted unit, it is\n  skipped.\n- Skip a finding an open thread already raises, and cite the thread.\n\n**Word each ask from the finding's Fix**, which already passed the\nremoves-before-adds rule. Don't add a number, a step or MR number, or a\nsection name the Fix left out. Write about the text, not the person: no\n\"you\" and no \"the author\".\n\nOmit an empty line (`Elsewhere`, `Skip`). With no findings, write\n\"Nothing to post.\" and leave the `go` line off unless the verdict is APPROVE.\n\nBuild the `go` line from the parts that apply, in this order, and name only\nthose: \"post the Post list\" (when it has units), \"post the Elsewhere list\"\n(when that line exists), and \"approve\" (only when the verdict is APPROVE;\nnever on REQUEST CHANGES or BLOCK). With no known MR iid, or an MR the glab\nuser authored, there is no Post recommendation and no `go` line. Draft no\nother MR notes and write no summary.\n\n`go`, said in the current turn, is the operator's instruction for exactly the\nsteps the line named, and for nothing else. Run them in order and stop at the\nfirst failure without approving:\n\n1. Post each Post unit as one comment at its location, worded from the\n   finding's Fix. An inline position must be an added line in the diff; a\n   unit about unchanged text anchors at the nearest added line.\n2. Post the Elsewhere list as one top-level note with `--resolvable=false`,\n   one bullet per item, worded from the Fix and marked non-blocking. A\n   \"follow-up issue\" item is a suggestion in that note; `go` never creates an\n   issue and never edits the MR description.\n3. `glab mr approve <iid> --sha <reviewed HEAD>`, so a push after the review\n   isn't approved. Read the approvals back to confirm.\n\nHeld back, Skip, and every finding the lines above leave out stay unposted.\nWithout `go`, post nothing: the operator posts from the list, and the author\nfixes the branch.\n","use_cases":["Identify contradictions in spec changes","Check for missing acceptance criteria in plan documents","Validate cross-references in ADR files","Ensure consistency between spec and code in `main`"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/gitlab.com\/radbatnag\/claude-skills\/-\/blob\/05b55872e4e98b79bc052be748b3abd6dccbabe6\/skills\/review-spec\/SKILL.md","source_commit":"05b55872e4e98b79bc052be748b3abd6dccbabe6","license":null,"version":null,"listing_approved_at":"2026-11-28","created_at":"2026-11-28T08:00:20.000000Z","updated_at":"2026-11-28T18:37:52.000000Z","seo_title":"Review Spec - Automated Review of GitLab Artifact Registry Documents","seo_description":"Automatically review spec, plan, and ADR changes in GitLab Artifact Registry for contradictions, missing criteria, and other defects before human review.","seo_keywords":["spec review","plan document validation","ADR check","GitLab Artifact Registry","automated document review"]}}