Comprehensive code review for security, performance, and maintainability. Activates when asked to "review code", "check this code", "audit", "find bugs", "security review", or when reviewing PRs or diffs.
Comprehensive code review for pull requests using parallel agents. Reviews for CLAUDE.md compliance, bugs, historical context, previous PR comments, and code comment guidance.
code-review, pr-review, security, bugs, claude-md, agents
gh) for PR interactionpr_number (string) (optional): Pull request number to reviewconfidence_threshold (number) (optional): Minimum confidence to report (default: 80)Check if the PR:
If any condition is true, do not proceed.
Find all relevant CLAUDE.md files:
View the pull request and return a summary of the change.
Launch 5 agents in parallel to independently code review:
| Agent | Focus Area | |-------|------------| | #1 | CLAUDE.md compliance audit | | #2 | Shallow bug scan (focus on changes, avoid false positives) | | #3 | Git blame and history context for bugs | | #4 | Previous PRs and comments that may apply | | #5 | Code comments compliance in modified files |
Each agent returns a list of issues with reasons (CLAUDE.md adherence, bug, historical context, etc.)
For each issue found, launch a Haiku agent to score confidence:
| Score | Meaning | |-------|---------| | 0 | Not confident - false positive or pre-existing issue | | 25 | Somewhat confident - might be real, couldn't verify | | 50 | Moderately confident - real but minor/nitpick | | 75 | Highly confident - verified real issue, important | | 100 | Absolutely certain - confirmed, will happen frequently |
For CLAUDE.md issues, agents must verify the instruction actually exists.
### Code review
Found 3 issues:
1. (CLAUDE.md says "<...>")
2. (some/other/CLAUDE.md says "<...>")
3. (bug due to <reason>)
Generated with [Claude Code](https://claude.ai/code)
_- If this code review was useful, please react with thumbs up. Otherwise, react with thumbs down._
### Code review
No issues found. Checked for bugs and CLAUDE.md compliance.
Generated with [Claude Code](https://claude.ai/code)
When linking to code, use this format:
https://github.com/owner/repo/blob/FULL_SHA/path/file.ts#L10-L15
Requirements:
# after file nameL[start]-L[end]steps:
- name: eligibility_check
agent: haiku
description: Check if PR is eligible for review
- name: claudemd_discovery
agent: haiku
description: Find all relevant CLAUDE.md files
- name: pr_summary
agent: haiku
description: Get PR summary
- name: parallel_review
agents: 5x sonnet
parallel: true
description: Independent code review from multiple angles
- name: confidence_scoring
agents: N x haiku
parallel: true
description: Score each issue for confidence
- name: filter_and_comment
description: Filter low-confidence, re-verify eligibility, post comment
// Review a specific PR
gateway_execute_skill({
name: "code-review",
inputs: {
pr_number: "123"
}
})
// Review with lower threshold
gateway_execute_skill({
name: "code-review",
inputs: {
pr_number: "123",
confidence_threshold: 70
}
})
// Code Review Skill - Anthropic Official
const pr_number = inputs.pr_number;
const confidence_threshold = inputs.confidence_threshold || 80;
console.log(`# Code Review: PR #${pr_number || 'current'}
## Review Process
### Phase 1: Eligibility Check
Launch Haiku agent to verify:
- [ ] PR is not closed
- [ ] PR is not a draft
- [ ] PR needs review (not automated/trivial)
- [ ] No existing code review from earlier
### Phase 2: CLAUDE.md Discovery
Launch Haiku agent to find:
- Root CLAUDE.md file
- CLAUDE.md files in modified directories
### Phase 3: PR Summary
Launch Haiku agent to summarize the change.
### Phase 4: Parallel Review (5 Agents)
| Agent | Focus | Status |
|-------|-------|--------|
| #1 | CLAUDE.md compliance | Pending |
| #2 | Bug scan (changes only) | Pending |
| #3 | Git blame/history context | Pending |
| #4 | Previous PR comments | Pending |
| #5 | Code comments compliance | Pending |
### Phase 5: Confidence Scoring
For each issue:
- 0: False positive / pre-existing
- 25: Might be real, couldn't verify
- 50: Real but minor
- 75: Verified, important
- 100: Certain, will happen frequently
### Phase 6: Results
Filter threshold: ${confidence_threshold}
Only issues with confidence >= ${confidence_threshold} will be reported.
## Commands
\`\`\`bash
# View PR
gh pr view ${pr_number || 'CURRENT'}
# Get diff
gh pr diff ${pr_number || 'CURRENT'}
# Post comment
gh pr comment ${pr_number || 'CURRENT'} --body "..."
\`\`\`
---
Begin by checking PR eligibility with a Haiku agent.
`);
See references/languages.md for language-specific review patterns.
Created: Mon Dec 22 2025 10:35:19 GMT+0800 (Singapore Standard Time) Updated: Sun Dec 29 2025 (Anthropic Official Version)
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer