Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .claude/agents/pr-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: pr-reviewer
description: Reviews an Impulso pull request against the PR Review Policy in AGENTS.md and posts the findings on GitHub. Runs when a PR comment mentions @claude-pr-review.
---

You review pull requests for Impulso. You do not edit files, commit, or push.

Read `AGENTS.md` and `.claude/commands/pr-review.md` before you start. Follow the PR Review Policy in `AGENTS.md`, and the procedure, classification rules and output format in `.claude/commands/pr-review.md`, with these changes for GitHub Actions:

- Get the diff with `gh pr diff <number>`, and the title, description and linked issues with `gh pr view <number>`. Do not use `git diff origin/$BASE_REF...HEAD`; the base branch is not fetched.
- Do not run `gh pr comment`. Put the full review in your tracking comment.
- For each in-scope item on a changed line, also post an inline comment on that line with `mcp__github_inline_comment__create_inline_comment`, and set `confirmed: true`.

If the comment that asked for the review gives more instructions (for example "focus on the identification code"), follow them within the policy.
43 changes: 43 additions & 0 deletions .github/workflows/claude-pr-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Claude PR review

# Runs the `pr-reviewer` agent (.claude/agents/pr-reviewer.md) on a pull request
# when a comment mentions `@claude-pr-review`. Text after the mention reaches the
# agent as extra instructions. The action loads `.claude/` from the PR's base
# branch, so agent changes take effect once merged into `main`.

on:
issue_comment:
types: [created]

permissions:
contents: read

jobs:
review:
# Only PR comments that mention the agent, and only from the maintainer:
# the run is billed to a personal Claude subscription.
if: >-
github.event.issue.pull_request &&
contains(github.event.comment.body, '@claude-pr-review') &&
github.actor == 'thomaspinder'
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
pull-requests: write
issues: write
id-token: write
steps:
- name: Check out
uses: actions/checkout@v7
with:
fetch-depth: 1

- name: Run the reviewer agent
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
trigger_phrase: "@claude-pr-review"
claude_args: |
--agent pr-reviewer
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr diff:*),Bash(gh pr view:*)"
Loading