Add Claude PR reviewer command and CI workflow#2379
Open
MarceloRGonc wants to merge 3 commits into
Open
Conversation
- Add .claude/commands/review-code.md with multi-phase review process (gather context, analyze through OpenOps-specific lenses, validate with confidence scoring, preview, and post inline comments) - Update .github/workflows/pr-reviewer.yml to run Claude Code Action with the review prompt, GitHub App auth, and failure notifications Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a Claude Code–driven PR review command plus a manually triggered GitHub Actions workflow to run it and post results back to the PR.
Changes:
- Extends
.github/workflows/pr-reviewer.ymlto accept a model input, obtain a GitHub App token, render the review prompt, runanthropics/claude-code-action, and comment on failures. - Adds
.claude/commands/review-code.md, a multi-phase review procedure/prompt tailored to the OpenOps repo and review conventions.
Blocking
actions/create-github-app-tokenis configured withclient-idinstead of the repo’s establishedapp-idinput key, which will break token generation and the workflow run.- Prompt rendering only substitutes
$ARGUMENTS, leaving{PR_NUMBER}placeholders literal in CI (likely degrading or breaking the command instructions). - PR number validation claims “positive integer” but currently permits
0.
Non-blocking
- Security hardening: CI grants the agent
Bash+Writetools while secrets are present, increasing prompt-injection blast radius; consider tightening allowed tools and/or gating with an environment approval.
Merge recommendation
Do not merge
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/pr-reviewer.yml |
Implements the dispatchable CI workflow to run Claude Code Action against a PR and post results. |
.claude/commands/review-code.md |
Adds the structured multi-phase review “command” content used as the action prompt. |
| id: app_token | ||
| uses: actions/create-github-app-token@v3.2.0 | ||
| with: | ||
| client-id: ${{ vars.AGENT_GITHUB_APP_ID }} |
Comment on lines
+72
to
+74
| claude_args: >- | ||
| --allowedTools "Bash,Read,Write,Agent,mcp__github__pull_request_read,mcp__github__pull_request_review_write,mcp__github__add_comment_to_pending_review,mcp__github__add_reply_to_pull_request_comment,mcp__github__add_issue_comment" | ||
| --model "${{ inputs.model }}" |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Adds an automated PR review system using Claude Code Action:
.claude/commands/review-code.md— Multi-phase review command that:.github/workflows/pr-reviewer.yml— CI workflow that:Testing
Part of CI-202