Skip to content

Add Claude Code review skills - #5292

Open
pbrubeck wants to merge 3 commits into
pbrubeck/agents-md-prose-rulesfrom
pbrubeck/ai-review-skills
Open

Add Claude Code review skills#5292
pbrubeck wants to merge 3 commits into
pbrubeck/agents-md-prose-rulesfrom
pbrubeck/ai-review-skills

Conversation

@pbrubeck

Copy link
Copy Markdown
Contributor

Adds three Claude Code skills under .claude/skills/, following the equivalent setup in PETSc (.claude/skills/{review-mr,review-branch,review-mr-post}).

Skill Purpose
review-pr Review a GitHub PR against its own base; report to stdout
review-branch Review a local branch against origin/main or origin/release
review-brief Write a reviewer's brief for a mathematically heavy PR

AGENTS.md is the rubric — its Anti-Patterns section is already written to be applied at review time. The review procedure adds:

  • Firedrake-specific severity weighting. Parallel-correctness failures are CRITICAL: collective calls reachable on some ranks but not others (including via early return or a rank guard), rank-local decisions feeding code generation or cache keys, and star-forest/halo assumptions.
  • Stacked PRs are reviewed against their own base, never against main, so a parent's changes stay out of scope. A PR based on a feature branch without a base:main/base:release label is reported, since CI cannot resolve its base build.
  • Test coverage is a finding. A behaviour change with no test that fails without it, or a parallel-sensitive change with no @pytest.mark.parallel test, is reported rather than assumed covered.
  • A mandatory verification pass. Every finding at Style or above is re-checked against the cited code before being reported, and dropped if it does not survive. LOW findings are counted, not listed.
  • Constraints on mathematical findings. A claimed error must name the specific term, index, sign, or scaling and state what it should be; "I cannot verify this derivation" is not reportable as a finding.

review-brief addresses a different problem from bug-finding. A numerically heavy PR carries context that exists only in the author's head — which formulation was chosen and why, what it assumes, what must hold if it is right — and review stalls when that was never written down. The brief writes it down: it maps each step of the method onto file:line, lists the invariants that must hold, tabulates which tests pin them, and lists the claims that no test pins. It is barred from asserting that the mathematics is correct, and it interviews the author rather than inventing rationale.

None of the skills post to GitHub. Publishing a brief is a separate, explicit step, subject to the AI contribution policy.

No changes to Firedrake source, tests, or CI. No CI integration is proposed here — PETSc drives the equivalent from a manual .gitlab-ci.yml job over a model matrix, which would be a separate discussion.

AI was used to draft these files (Claude Code, Opus 5).

🤖 Generated with Claude Code

@pbrubeck
pbrubeck changed the base branch from release to pbrubeck/agents-md-prose-rules August 8, 2026 18:45
@pbrubeck
pbrubeck force-pushed the pbrubeck/ai-review-skills branch 5 times, most recently from eefabc6 to 9d0c081 Compare August 9, 2026 14:01
@pbrubeck
pbrubeck marked this pull request as ready for review August 9, 2026 14:04
pbrubeck and others added 3 commits August 9, 2026 17:37
Three skills under .claude/skills/, modelled on the equivalent setup in
PETSc (.claude/skills/review-mr, review-branch, review-mr-post):

* review-pr     -- review a GitHub PR, report to stdout
* review-branch -- review a local branch against origin/main or origin/release
* review-brief  -- write a reviewer's brief for a mathematically heavy PR

AGENTS.md is the rubric; its Anti-Patterns section is already written to be
applied at review time. The review procedure adds Firedrake-specific weighting
(parallel-correctness failures as CRITICAL, discretization branching, missing
parallel test coverage) and requires each finding to be re-verified against the
cited code before it is reported. Stacked PRs are reviewed against their own
base, never against main, so the parent's changes stay out of scope.

review-brief exists because finding bugs and making a change reviewable are
different problems. A numerically heavy PR carries context that exists only in
the author's head -- which formulation was chosen and why, what it assumes,
what must hold if it is right -- and review stalls when that was never written
down. The brief maps the mathematics onto the diff, lists the invariants, and
lists the claims that no test pins, so a specific test can be asked for without
re-deriving anything. It is barred from asserting that the mathematics is
correct, and it interviews the author rather than inventing rationale.

None of these post to GitHub. Publishing a brief is a separate, explicit step
subject to the AI contribution policy.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Split the sentences that stack clauses, and name the subject before the verb.
The skills tell a reader to write this way, so they have to read this way.

Rewrite the assumption lists as sentences, rather than as a parenthesis
inside a longer sentence.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@pbrubeck
pbrubeck force-pushed the pbrubeck/ai-review-skills branch from 9d0c081 to a19a1dd Compare August 9, 2026 16:37
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