Skip to content

Add review checks and a skill for fresh-context reviews - #5

Merged
gnapse merged 5 commits into
mainfrom
agents/4-review
Oct 26, 2026
Merged

gnapse merged 5 commits into
mainfrom
agents/4-review

Conversation

@gnapse

@gnapse gnapse commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Stack, 4 of 4. Based on #4 (agents/3-skills). Merge after it.

What it adds

  • The review-changes skill runs when you say a change is ready. It briefs fresh subagents with the task in your words, what done means and the decisions made, never the author's opinion.
    • A task review always runs.
    • A blast-radius review runs for code or config others rely on.
    • A code review runs for each check that fits the change.
    • Reviewers work in their own git worktree. Each finding is fixed, dismissed with evidence, or left open for you.
  • Six checks in .agents/checks/, each saying what to report and what is fine: tests, the editor's design, the file format, the app boundary, privacy, words.
  • scripts/rules.test.mjs checks one CLAUDE.md rule in code: format.ts uses only the Markdown parser.
  • docs/agents.md says when to ask for a review or a release, and how to improve the system.

Evidence

  • This slice was reviewed with its own skill: one task review and two check reviews. Their findings are fixed, among them:
    • a worktree recipe for reviewers that now runs pnpm verify (tried: it passes in 11.6 s),
    • a rule test that now also catches export … from, import() and other @lezer packages (each planted, each failed).
  • The skill loaded first thing in headless sessions from "Review this…" and "Ready to release…".

cargo fmt --check failed on 8 spots in ai.rs and lib.rs. This commit
only reformats them, so the next one can add the check to
pnpm verify.
pnpm verify runs every check: both TypeScript projects, vitest, the
web build, and cargo fmt, clippy, and tests. It takes about 5 seconds
warm. It records a hash of the tree in .git/undertext/ only when
every check passes and no file changed during the run, so a later
hook can tell whether a change was verified. A docs-only change
needs no run. A change to CI files alone is never recorded.

- CLAUDE.md says what done means and to run pnpm verify.
- .github/workflows/verify.yml runs it on macOS for pushes to main
  and pull requests. The actions are pinned by commit.
- docs/agents.md says what is checked, what is only asked, and the
  known limits.
- scripts/verify.test.mjs runs copies of the scripts in throwaway
  repositories.
- .gitignore now covers .claude/settings.local.json. Claude Code
  writes it, and a change to it would void a pass.
Two Claude Code hooks in .claude/settings.json run scripts/guard.mjs.
When a turn starts, it records a hash of every file. When Claude
stops, it compares: if the turn changed code (not only docs) that
pnpm verify hasn't passed, it sends Claude back once, naming the
files. The second stop goes through, so Claude can stop on purpose
and say what is not verified. Turns that changed nothing, changed
only docs, or undid their edits pass. Any error lets the turn
through with a message.

The same file has ask rules for git push, gh pr merge, and
--no-verify, so Claude Code asks before it pushes or merges, also in
auto mode.

- The guard relies on its own record for "once", not on
  stop_hook_active, which any Stop hook sets.
- Records live in the shared git folder, one per session, with the
  checkout the turn started in.
- scripts/guard.test.mjs runs copies of the guard in throwaway
  repositories. The helpers moved from verify.test.mjs to
  test-repo.mjs; no test changed.
- Proven in headless Claude Code sessions: an unverified edit was
  sent back once, and push and merge were refused even when allowed.
Five skills in .claude/skills/ give each kind of work its first step
and its proof: verify, fix-bug, build-feature, refactor, and learn.
CLAUDE.md tells Claude to use them without being asked, and its new
Tests section holds the test rules. A fresh reviewer applied those
rules to all 98 existing tests; the wording now accepts the good
cases it flagged at first.

- scripts/docs.test.mjs checks that the instructions name and link
  only files that exist, with their exact case, name only pnpm
  commands that exist, and that each skill says when to use it.
- CLAUDE.md, README.md, docs/agents.md, and .claude/ now count as
  code, not docs, so pnpm verify and the gate run that test when they
  change. Three tooling tests now use another file as their docs
  example.
- docs/agents.md says what each skill is for, and what to say when
  asking for a bug fix, a feature, or a refactor.
- .claude/launch.json, the browser preview config, is committed.
- Each skill loaded on its own in headless Claude Code sessions, from
  plain requests such as "Fix it" or "Add a shortcut".
The review-changes skill runs when the owner says a change is ready.
It briefs fresh subagents with the task in the owner's words, what
done means, and the decisions made, never the author's opinion. A
task review always runs; a blast-radius review runs for code or
config others rely on; a code review runs per check. Each finding is
fixed, dismissed with evidence, or left open for the owner.
Reviewers work in their own git worktree with the change copied in.

- .agents/checks/ has six checks, each saying what to report and
  what is fine: tests, the editor's design, the file format, the app
  boundary, privacy, and words. CLAUDE.md points to them.
- scripts/rules.test.mjs checks one rule in code: format.ts uses only
  the Markdown parser.
- The learn skill now knows review checks, after tests and script
  checks.
- docs/agents.md says when to ask for a review or a release, what each
  check covers, and how to improve the system.
- Reviewed with the skill itself: a task review and two check
  reviews. Their findings are fixed, including a worktree recipe that
  now runs pnpm verify, and a rule test that now also catches
  `export ... from` and `import()`.
@gnapse gnapse closed this Oct 26, 2026
@gnapse gnapse reopened this Oct 26, 2026
@gnapse
gnapse changed the base branch from agents/3-skills to main October 26, 2026 13:47
@gnapse
gnapse merged commit bb65595 into main Oct 26, 2026
1 check passed
@gnapse
gnapse deleted the agents/4-review branch October 26, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant