From 6d6bbf365e357b5ae4befc61d31320a6c6d67b71 Mon Sep 17 00:00:00 2001 From: Alan Locke Date: Fri, 17 Jul 2026 09:28:43 -0500 Subject: [PATCH 1/2] Run Claude review automatically on every PR Co-Authored-By: Claude Fable 5 --- .github/workflows/claude-review.yml | 75 +++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 .github/workflows/claude-review.yml diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml new file mode 100644 index 0000000..0deb47f --- /dev/null +++ b/.github/workflows/claude-review.yml @@ -0,0 +1,75 @@ +# Claude auto-review: runs on every non-draft PR when opened or marked ready +# for review; mention @claude in a PR comment to trigger a re-review. +# Requires the org-level ANTHROPIC_API_KEY secret. +name: Claude Code + +on: + pull_request: + types: [opened, ready_for_review] + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + +permissions: + contents: read + pull-requests: write + issues: write + actions: read + id-token: write + +jobs: + claude: + if: | + (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || + (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Acknowledge comment + # Only comment events carry github.event.comment; skip on pull_request + if: github.event_name != 'pull_request' + uses: actions/github-script@v7 + with: + script: | + if (context.eventName === 'pull_request_review_comment') { + await github.rest.reactions.createForPullRequestReviewComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: context.payload.comment.id, + content: 'eyes' + }); + } else { + await github.rest.reactions.createForIssueComment({ + owner: context.repo.owner, + repo: context.repo.repo, + comment_id: context.payload.comment.id, + content: 'eyes' + }); + } + - uses: anthropics/claude-code-action@v1 + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + prompt: | + Review this PR for the Pipeline CRM Ruby API client gem (a wrapper + around the Pipeline CRM API). Focus on: + - Bugs or logic errors + - Public API changes that would break existing gem consumers + (renamed methods, changed signatures or return shapes) + - Performance: HTTP calls inside loops, missing pagination when + iterating API collections + - Convention violations per this repo's CLAUDE.md, if present + - Test coverage for behavioral changes + + You have full repo access. Read any files you need to verify your findings. + Only flag issues introduced by this PR, not pre-existing patterns. + Be concise. If the code is sound, say so in 2-3 sentences — do not + manufacture findings. Reserve detailed comments for real issues. + track_progress: true + include_fix_links: true + claude_args: "--max-turns 12 --max-budget-usd 0.75" From 051a5bbf114445cc6f40321d1962efead7e62026 Mon Sep 17 00:00:00 2001 From: Alan Locke Date: Fri, 17 Jul 2026 09:56:55 -0500 Subject: [PATCH 2/2] Pin Sonnet as the review model (cost + reviewer-model diversity) Co-Authored-By: Claude Fable 5 --- .github/workflows/claude-review.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index 0deb47f..942d69c 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -72,4 +72,4 @@ jobs: manufacture findings. Reserve detailed comments for real issues. track_progress: true include_fix_links: true - claude_args: "--max-turns 12 --max-budget-usd 0.75" + claude_args: "--model claude-sonnet-5 --max-turns 12 --max-budget-usd 0.75"