Repository navigation
Add review checks and a skill for fresh-context reviews - #5
Merged
Merged
Conversation
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()`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack, 4 of 4. Based on #4 (
agents/3-skills). Merge after it.What it adds
review-changesskill 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..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.mjschecks oneCLAUDE.mdrule in code:format.tsuses only the Markdown parser.docs/agents.mdsays when to ask for a review or a release, and how to improve the system.Evidence
pnpm verify(tried: it passes in 11.6 s),export … from,import()and other@lezerpackages (each planted, each failed).