/canon-review:canon-reviewfrom canon-review
Use when the user says "canon review" (alone or in a sentence), or asks to "review the fleet's commits against the canon", "did anything drift from the motto", or to review fleet commits since a date or sha. On demand and run locally: it judges every fleet commit since the last review TOWARD / NEUTRAL / AWAY per § Motto handle (kattakath/nix-config's claude/CLAUDE.md, read live) with diff evidence, runs the leak gates including the client literals, and renders a deterministic ok/problem state plus a stable body for issue-keeper. Read-only except one report dispatch.
Ships in canon-review. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
"canon review" starts it. It runs here, locally, so the client-literal gate runs too.
Read-only, always. Never push, comment, open an issue or edit a file in any fleet repo. The one write is the report dispatch in step 4. The workflow it starts runs issue-keeper, which is the only thing that touches an issue.
<scripts> means this skill's scripts/ directory (${CLAUDE_PLUGIN_ROOT}/skills/canon-review/scripts).$OUT is a fresh directory (OUT=$(mktemp -d)).git, curl, jq and python3; gh for step 4 only. The scripts clone the
public fleet repos themselves.bash <scripts>/inputs.sh "$OUT" # or: --since 2026-11-01T00:00:00Z | --since <sha>
bash <scripts>/scan.sh "$OUT" # leak gates over the same window
No window start known (no successful report yet, or the API unreadable): inputs.sh exits 3. Ask the user where to start: a date, or a sha from which to review on (inclusive).
Tell the user the size before reading: $OUT/window.json has commits and
changed_lines.
--since. The measured cost is about 4 minutes and
~320k tokens for 48 commits and ~7,000 diff lines.$OUT/motto.md is the rubric. It is § Motto of nix-config's claude/CLAUDE.md, read now
from main. Judge against that text, its handle table and bullets. Never against a summary
of it, including any wording here.
$OUT/commits.json lists each fleet repo, cloned blob-less into $OUT/work/<owner>_<repo>,
with its default-branch commits in the window. The list itself comes from nix-config's
.claude/skills/fleet-doctor/fleet-repos.txt.
$OUT/window.json records the start. By default that's the last successful
canon-review-report.yml run in kattakath/.github, minus 2 h. The report is dispatched at a
review's end, so the overlap catches commits pushed while it ran.
$OUT/gates.json holds the mechanical leak gates:
PATH, else a pinned release verified by sha256 (the resolver
ci-land shares).$CI_LAND_LITERALS, else
~/.config/ci-land/literals), which this Mac has. skipped means that list wasn't
reachable here, so say so; on the operator's Mac it is a setup gap to fix.Read every commit. Judging from subjects is a failure, not a shortcut. Dump them first, one file per repo:
bash <scripts>/dump.sh "$OUT" # writes $OUT/rev/<owner>_<repo>.txt
Each === <repo>@<sha> section holds the message, --stat, and the diff capped at 400 lines,
marked [truncated: 400 of N lines; cut mid-file: F; not shown: G, H] when it is cut, so you know
which files went unread. Read each repo's file in full, in chunks if
it's large, and judge every section. For a truncated commit, judge what you read and say
(truncated) in its evidence.
render.py enforces coverage. Every repo@sha in commits.json needs at least one finding:
a verdict whose evidence names a file or hunk you read. A NEUTRAL counts. A commit with no
finding makes render refuse, so nothing is dispatched and the report goes late on its
heartbeat, which alerts. A skipped review is loud, never a clean day.
For every handle in motto.md that a commit touches, give a verdict:
| Verdict | Means |
|---|---|
TOWARD | the commit applies the handle's rule, its stricter part included |
NEUTRAL | the handle doesn't bear on it |
AWAY | the commit breaks the rule. Needs a one-line fix |
@@ … @@ function_name). The diff gives hunk offsets, not file lines, so don't invent
a path:line. A verdict you can't point at is not a finding.CONFIRMED: someone can re-check it at HEAD in one step. Examples: a grep
that shows both copies of a drifted fact, an exact mismatch between two numbers, a file the
revert left behind.PLAUSIBLE, including judgement calls ("this claim is stronger than its
evidence"). A PLAUSIBLE finding is listed but never opens the issue.handle must be a row label of motto.md's table, spelled as there: render.py --motto
refuses any other.CONFIRMED when the diff you read
shows it, PLAUSIBLE when it's a judgement you couldn't check. Neither changes the state; the
field only keeps the record honest.references/exceptions.md next to motto.md. It lists
patterns the operator has ruled intended, for example a security contact in SECURITY.md. A
commit that matches one is not an AWAY on the handle it names. New exceptions go there, on
the operator's decision, never into a prompt.rev/ file maps the
12-character prefixes to full shas, and render rejects a sha that commits.json doesn't list.Hunt for these specifically. Each is an AWAY once confirmed:
"kind": "leftover" for these;errexit hole, a silent no-op,
a check that measures nothing;Flag a departure from the written rule, not from your taste. The operator's design choices are his.
Write $OUT/findings.json:
{
"schema": "canon-review/findings@1",
"gates": { "gitleaks": "clean", "literals": "skipped" },
"findings": [
{ "repo": "kattakath/skills", "sha": "<full sha>", "handle": "one source",
"verdict": "AWAY", "confidence": "CONFIRMED", "severity": "high",
"evidence": "plugins/x/README.md:12 restates the fleet list",
"fix": "link to fleet-repos.txt instead" }
]
}
gates is $OUT/gates.json verbatim.handle is spelled exactly as in motto.md.NEUTRAL finding, whose evidence says what the diff did ("evidence": "plugin.json:4 version bump only").severity is high | medium | low (default medium); kind is leftover or absent.Then render. It's deterministic, and no model takes part:
python3 -I <scripts>/render.py "$OUT/findings.json" --gates "$OUT/gates.json" \
--commits "$OUT/commits.json" --motto "$OUT/motto.md" --out "$OUT/body.md" | head -1
Its first line is the state (state=ok or state=problem).
--gates makes scan.sh's own file the gates, whatever was copied into findings.json.
--commits refuses a finding on a repo@sha that inputs.sh didn't list, and any listed commit
left without a verdict.
--motto refuses a handle that isn't a row of the rubric's table.
problem means a CONFIRMED AWAY, or a leak gate that found something or didn't run.
The body is stable: no timestamps, no run ids, no counts, sorted and keyed by repo@sha plus handle. So issue-keeper's dedupe holds while nothing changed.
It's capped at 60,000 characters, because GitHub caps a dispatch's inputs at 65,535. The lowest-ranked findings drop first, with a count of how many.
An invalid findings file exits 1 and renders nothing.
Show the user the state and the body first. Then report, as one script, so nothing in between can edit the body or overrule the state. The report also records the review: the next run's window starts from this report's run, so skipping it makes the next review start too early.
bash <scripts>/report.sh "$OUT" # --dry-run prints the plan and sends nothing
report.sh renders the findings again (with --gates and --commits). It dispatches
kattakath/.github's canon-review-report.yml only when render finished with a state of exactly
ok or problem:
dispatches endpoint, not gh workflow run. It works from any session;
gh workflow run resolves the branch through GraphQL, which some Claude Code environments
block ("HTTP 403: GitHub GraphQL is not available from Claude Code sessions", measured in a
cloud session, 2026-11-28).state and body. The scheduler heartbeat is retired, and the
workflow refuses an input it doesn't declare (422).references/exceptions.md (opens in a new tab)scripts/dump.sh (opens in a new tab)scripts/gitleaks-resolve.sh (opens in a new tab)scripts/inputs.sh (opens in a new tab)scripts/render.py (opens in a new tab)scripts/report.sh (opens in a new tab)scripts/scan.sh (opens in a new tab)scripts/window.py (opens in a new tab)tests/fixtures/away.expected (opens in a new tab)tests/fixtures/away.json (opens in a new tab)tests/fixtures/clean.expected (opens in a new tab)tests/fixtures/clean.json (opens in a new tab)tests/run.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub kattakath/skills --plugin canon-review