From 8ab7cd394c2a8590a226d9cb0513315f27bce733 Mon Sep 17 00:00:00 2001 From: Chaitanya Kale Date: Tue, 6 Oct 2026 07:53:53 -0400 Subject: [PATCH 1/2] chore(ci): migrate PR review to the shared review harness (v2) Replace the standalone claude-code-action review workflow with the thin caller stub for the shared agent-first-standards PR review harness, pinned to @v2. Renamed to code-review.yml; job key stays `review`. Dropped: @claude comment triggers, --allowedTools, the CLAUDE_REVIEW_MODEL model-selection step, --max-turns 10, draft/comment `if:` conditions, id-token: write, and the inline prompt/diff assembly steps. Co-Authored-By: Claude Sonnet 5.5 --- .github/workflows/claude-code-review.yml | 95 ------------------------ .github/workflows/code-review.yml | 23 ++++++ 2 files changed, 23 insertions(+), 95 deletions(-) delete mode 100644 .github/workflows/claude-code-review.yml create mode 100644 .github/workflows/code-review.yml diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml deleted file mode 100644 index ffee3ee0..00000000 --- a/.github/workflows/claude-code-review.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: Claude Code Review - -on: - pull_request: - types: [opened, synchronize, ready_for_review, reopened] - issue_comment: - types: [created] - pull_request_review_comment: - types: [created] - pull_request_review: - types: [submitted] - -permissions: - contents: read - pull-requests: write - issues: read - id-token: write - -jobs: - review: - 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')) || - (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) - concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.issue.number || github.run_id }} - cancel-in-progress: true - runs-on: ubuntu-latest - steps: - - name: Resolve PR number - id: pr - run: | - if [ "${{ github.event_name }}" = "issue_comment" ]; then - echo "number=${{ github.event.issue.number }}" >> "$GITHUB_OUTPUT" - else - echo "number=${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT" - fi - - - name: Checkout repository - uses: actions/checkout@v4 - with: - ref: refs/pull/${{ steps.pr.outputs.number }}/head - fetch-depth: 0 - - - name: Fetch PR diff - env: - GH_TOKEN: ${{ github.token }} - run: | - gh pr diff "${{ steps.pr.outputs.number }}" > /tmp/pr-diff.patch - - - name: Build review prompt - id: prompt - run: | - DELIMITER="PROMPT_EOF_$(uuidgen)" - { - echo "REVIEW_PROMPT<<${DELIMITER}" - for f in CLAUDE.md AGENTS.md; do - if [ -f "$f" ]; then - cat "$f" - echo "" - fi - done - if [ -f ".claude/review-prompt.md" ]; then - cat .claude/review-prompt.md - fi - echo "${DELIMITER}" - } >> "$GITHUB_OUTPUT" - - - name: Resolve claude_args - id: args - run: | - ALLOWED_TOOLS='Read,Glob,Grep,mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr view:*)' - if [ -n "${{ vars.CLAUDE_REVIEW_MODEL }}" ]; then - echo "value=--model ${{ vars.CLAUDE_REVIEW_MODEL }} --max-turns 10 --allowedTools \"${ALLOWED_TOOLS}\"" >> "$GITHUB_OUTPUT" - else - echo "value=--max-turns 10 --allowedTools \"${ALLOWED_TOOLS}\"" >> "$GITHUB_OUTPUT" - fi - - - name: Claude Code Review - continue-on-error: true - uses: anthropics/claude-code-action@v1 - with: - anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} - prompt: | - You are reviewing PR #${{ steps.pr.outputs.number }}. - The full diff is in /tmp/pr-diff.patch — Read that file first. - Do NOT run gh pr diff or git diff to re-fetch it. - Use Read on source files if you need more context beyond the diff. - Post inline review comments and stop. - - Review this pull request using the following guidelines: - - ${{ steps.prompt.outputs.REVIEW_PROMPT }} - claude_args: "${{ steps.args.outputs.value }}" diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml new file mode 100644 index 00000000..31b49a29 --- /dev/null +++ b/.github/workflows/code-review.yml @@ -0,0 +1,23 @@ +name: Claude PR Review + +on: + pull_request: + types: [opened, synchronize, ready_for_review, reopened, closed] + +permissions: + actions: read + contents: read + pull-requests: write + issues: write + +jobs: + review: + uses: customink/agent-first-standards/.github/workflows/pr-review.yml@v2 + with: + verdict_policy: deterministic + secrets: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + CUSTOM_INK_CODE_REVIEW_APP_ID: ${{ secrets.CUSTOM_INK_CODE_REVIEW_APP_ID }} + CUSTOM_INK_CODE_REVIEW_PRIVATE_KEY: ${{ secrets.CUSTOM_INK_CODE_REVIEW_PRIVATE_KEY }} + NEW_RELIC_ACCOUNT_ID: ${{ secrets.NEW_RELIC_ACCOUNT_ID }} + NEW_RELIC_INSERT_KEY: ${{ secrets.NEW_RELIC_INSERT_KEY }} From a0f845c2bb2a37a3f1d20e59c7038845f7b1d787 Mon Sep 17 00:00:00 2001 From: Chaitanya Kale Date: Tue, 6 Oct 2026 07:53:58 -0400 Subject: [PATCH 2/2] chore(ci): drop reviewer-behavior paragraph from review prompt The shared harness base prompt already owns review behavior (when to comment, no summary-only comments), so the repo prompt keeps domain conventions only. Co-Authored-By: Claude Sonnet 5.5 --- .claude/review-prompt.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/.claude/review-prompt.md b/.claude/review-prompt.md index b1535a00..f235978a 100644 --- a/.claude/review-prompt.md +++ b/.claude/review-prompt.md @@ -4,9 +4,6 @@ You are reviewing pull requests for dm-core, the DataMapper ORM core library (CustomInk fork). Ruby gem using RSpec 1.x (legacy, NOT modern RSpec 3). Yardstick enforces 100% documentation coverage. -**Only comment when you have actionable feedback. Never post "looks good", -"no issues found", or summary-only comments.** - ## PR Format - PR title MUST start with a JIRA ticket reference: