Skip to content

ci: add Claude PR review agent - #807

Merged
thomaspinder merged 2 commits into
mainfrom
ci/claude-pr-review
Oct 4, 2026
Merged

thomaspinder merged 2 commits into
mainfrom
ci/claude-pr-review

Conversation

@thomaspinder

Copy link
Copy Markdown
Collaborator

Summary

A PR comment that mentions @claude-pr-review runs a Claude reviewer agent on that PR. Text after the mention reaches the agent as extra instructions, for example @claude-pr-review focus on the kernel changes.

 .claude/
+└── agents/pr-reviewer.md      # review rules taken from AGENTS.md
 .github/workflows/
+└── claude-pr-review.yml       # issue_comment -> anthropics/claude-code-action
on PR comment
  if the comment mentions @claude-pr-review and the author is thomaspinder
    claude-code-action --agent pr-reviewer
      gh pr view, gh pr diff
      inline comment on each in-scope finding
      full review (P0/P1/P2 in-scope + out-of-scope follow-ups) in the tracking comment

The agent checks the AGENTS.md rules that ruff cannot: val() on every parameter read, no new paramax.unwrap(model) in objectives, jit/vmap/grad compatibility and dtype promotion, jaxtyping annotations, regression tests for bug fixes, warning-free tests, and py:percent notebooks.

Notes:

  • The action restores .claude/ from the PR's base branch before Claude starts. A PR cannot change the instructions of its own reviewer, and changes to the agent take effect after merge.
  • The run uses a Claude subscription through the CLAUDE_CODE_OAUTH_TOKEN secret. The first run needs the Claude GitHub App on this repo and that secret.
  • The workflow follows zizmor.yml conventions: permissions: {} at workflow level, actions pinned by SHA, persist-credentials: false.

Evidence

  • uv run --frozen --only-group dev zizmor --format sarif .github/workflows/claude-pr-review.yml: 0 results (the zizmor.yml gate).
  • Local agent load check:
    claude -p --agent pr-reviewer "quote the sentence that begins 'You review pull requests for'"
      -> "You review pull requests for GPJax."
    claude -p --agent no-such-agent ...
      -> "--agent 'no-such-agent' not found."   # a missing agent fails the run, not a silent generic review
    
  • Not yet run end to end on GitHub: that needs the App and the secret.

Merge Danger

Door: two-way

Delete the two files to revert.

Blast Radius: isolated

The workflow runs only on PR comments that mention @claude-pr-review and come from thomaspinder. No package code, test, docs or release workflow changes. Each run uses Claude subscription quota.

🤖 Generated with Claude Code

A PR comment that mentions @claude-pr-review runs the pr-reviewer agent
(.claude/agents/pr-reviewer.md) through anthropics/claude-code-action.
Only comments from thomaspinder trigger it, because the run is billed to
a personal Claude subscription.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added documentation Improvements or additions to documentation ci Continuous Integration size/m tests labels Oct 4, 2026
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown

📖 Docs preview: https://pr-807--endearing-crepe-c2d5fe.netlify.app

Smoke render — the expensive notebooks run with reduced budgets, so
figures are not publication fidelity. /render-mode.txt says smoke.

@thomaspinder
thomaspinder enabled auto-merge (squash) October 4, 2026 14:35
@thomaspinder
thomaspinder merged commit a883871 into main Oct 4, 2026
22 checks passed
@thomaspinder
thomaspinder deleted the ci/claude-pr-review branch October 4, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous Integration documentation Improvements or additions to documentation size/m tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant