-
[OPIK-4595] [DOCS] Add /review-github-pr slash command (#5407)
发布于
2026-02-26 09:15:51 +00:00 - [OPIK-4595] [DOCS] Add /review-github-pr slash command
Add a new slash command for AI-assisted PR code review that posts
inline comments and suggestions on GitHub PRs. Complementary to
the existing /address-github-pr-comments command — this generates
review feedback while that one responds to it.Key design decisions:
- gh CLI is the only hard requirement (GitHub MCP optional)
- User must approve findings before any comments are posted
- Never submits formal review approval (human-in-the-loop)
- AI watermark on all posted comments
- Domain-aware review using Opik-specific rules
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
- Revision 2: Add severity emojis to review comment format
Add distinct emojis per severity level for instant visual scanning:
- 🚫 blocker, 💡 suggestion, 🧹 nit, ❓ question
Also expand examples to show all four severity types.
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
- Revision 3: Add deduplication for repeated runs
Fetch existing /review-github-pr comments before analysis and
skip findings that match an already-posted comment on the same
file+line. Safe to run multiple times on the same PR.Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
- Revision 4: Add PR summary comment with positive observations
The review now posts a general PR-level summary comment after inline
findings, highlighting what the PR does well and giving an honest
overall assessment. Summary is shown to the user for approval before
posting, same as inline comments.Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
- Revision 5: Fix dedup key for multi-line comments and add secret sanitization
- Dedup key now uses path + start_line + line (was path + line only)
- Added sensitive file flagging (.env, .pem, .key, credentials.*)
- Added secret sanitization step before posting comments
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
- Revision 6: Fix address-github-pr-comments to include AI-posted review comments
The command was incorrectly skipping review comments posted via
/review-github-pr from the same GitHub account. Now explicitly includes
comments with AI markers as external review feedback, only skipping them
if they already have a threaded "Fixed" or "Skipping" reply.Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
- Revision 7: Use batched review API for single-notification posting
Step 7 now submits all inline comments as a single batched review via
POST /pulls/{pr}/reviews with event COMMENT. This sends one notification
instead of N. Falls back to individual posting if the batch fails.Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com
Co-authored-by: Claude Opus 4.6 noreply@anthropic.com
下载附件