code-review
npx machina-cli add skill dceoy/ai-coding-agent-skills/code-review --openclawCode Review Skill
Provide thorough, multi-agent code review for pull requests with high-confidence issue detection.
When to Use
- Reviewing a pull request before merge.
- Checking code changes for bugs and AGENTS.md/CLAUDE.md compliance.
- Validating that changes align with historical context and existing code comments.
Agent Compatibility
This skill is tool-agnostic and can be executed by Claude Code, OpenAI Codex CLI, GitHub Copilot CLI, or Gemini CLI.
When posting the PR comment, replace <agent-name> in the output template with the active agent name.
Inputs
- Pull request URL or number (required).
- Repository context with AGENTS.md/CLAUDE.md files.
If the pull request is not specified, ask for it before proceeding.
Workflow
-
Eligibility Check (fast agent): Verify the PR is eligible for review:
- Not closed
- Not a draft
- Not automated or trivially simple
- No prior code review from this tool
-
Gather AGENTS.md/CLAUDE.md Files (fast agent): Collect paths to relevant guideline files:
- Root AGENTS.md or CLAUDE.md (if exists)
- AGENTS.md/CLAUDE.md files in directories modified by the PR
-
Summarize Changes (fast agent): View the PR and return a summary of the change.
-
Parallel Code Review (5 default agents): Each agent reviews independently and returns issues with reasons:
- Agent 1: Audit changes for AGENTS.md/CLAUDE.md compliance
- Agent 2: Shallow scan for obvious bugs (focus on large issues, avoid nitpicks)
- Agent 3: Review git blame and history for context-aware bug detection
- Agent 4: Check previous PRs touching these files for relevant comments
- Agent 5: Verify changes comply with guidance in code comments
-
Score Issues (fast agents, parallel): For each issue found, score confidence (0-100):
- 0: False positive, doesn't stand up to scrutiny
- 25: Might be real, couldn't verify, stylistic without AGENTS.md/CLAUDE.md backing
- 50: Verified real but may be a nitpick or rare
- 75: Double-checked, very likely real, important impact or AGENTS.md/CLAUDE.md-mentioned
- 100: Absolutely certain, will happen frequently, evidence confirms
-
Filter Issues: Keep only issues with score >= 80.
-
Re-check Eligibility (fast agent): Confirm PR is still eligible for review.
-
Post Comment: Use
gh pr commentto post results to the PR.
False Positive Guidelines
Exclude these from reported issues:
- Pre-existing issues (not introduced by the PR)
- Apparent bugs that aren't actually bugs
- Pedantic nitpicks a senior engineer wouldn't flag
- Issues caught by linters, typecheckers, or compilers
- General code quality issues unless required in AGENTS.md/CLAUDE.md
- AGENTS.md/CLAUDE.md issues explicitly silenced in code
- Intentional functionality changes related to the broader change
- Real issues on lines not modified by the PR
Output Format
When Issues Found
### Code review
Found N issues:
1. <brief description> (AGENTS.md/CLAUDE.md says "<relevant quote>")
<link to file and line with full sha1 + line range>
2. <brief description> (some/other/AGENTS.md says "<...>")
<link to file and line with full sha1 + line range>
Generated with <agent-name>
<sub>- If this code review was useful, please react with thumbs up. Otherwise, react with thumbs down.</sub>
When No Issues Found
### Code review
No issues found. Checked for bugs and AGENTS.md/CLAUDE.md compliance.
Generated with <agent-name>
Link Format Requirements
When linking to code:
- Use full git SHA (not
$(git rev-parse HEAD)) - Format:
https://github.com/owner/repo/blob/<full-sha>/path/file.ext#L<start>-L<end> - Include at least 1 line of context before and after
- Repo name must match the PR's repository
Constraints
- Do not run builds, typechecks, or tests (CI handles these).
- Use
ghCLI for all GitHub interactions. - Create a todo list before starting.
- Cite and link every reported issue.
- Keep output brief, avoid emojis in comments.
Outputs
- Comment posted to the pull request with review results.
Source
git clone https://github.com/dceoy/ai-coding-agent-skills/blob/main/skills/code-review/SKILL.mdView on GitHub Overview
Provides thorough, multi-agent code review for pull requests. It detects bugs, enforces AGENTS.md/CLAUDE.md compliance, and verifies changes align with historical context and existing comments. The workflow is tool-agnostic and compatible with Claude Code, OpenAI Codex CLI, GitHub Copilot CLI, or Gemini CLI.
How This Skill Works
First, it performs an eligibility check to ensure the PR is open, not a draft, and not previously reviewed by this tool. Then it gathers AGENTS.md/CLAUDE.md files from the repo root and modified directories, summarizes the changes, and runs five parallel agents to review for compliance, bugs, historical context, related comments, and code guidance. Finally, it scores each issue (0–100), filters to high-confidence findings (>=80), re-checks eligibility, and posts results back to the PR using gh pr comment.
When to Use It
- Review a pull request before merging to production.
- Check code changes for bugs and AGENTS.md/CLAUDE.md compliance.
- Validate that changes align with historical context and existing code comments.
- Audit PRs in tool-agnostic environments (Claude Code, Codex CLI, Gemini CLI, Copilot CLI).
- Identify high-risk issues by leveraging multiple reviewer perspectives.
Quick Start
- Step 1: Provide the PR URL or number and ensure AGENTS.md/CLAUDE.md files are accessible.
- Step 2: Invoke the code-review skill targeting the PR with a tool-agnostic CLI.
- Step 3: Review the Code review results and post the summary to the PR using gh pr comment.
Best Practices
- Ensure the PR URL/number and repository context with AGENTS.md/CLAUDE.md are available before starting.
- Let fast agents run eligibility and file gathering before deep review.
- Rely on the 5 parallel agents for diverse checks and prioritize high-confidence issues.
- Cross-check findings with git blame/history for context.
- Be mindful of false positives and verify AGENTS.md/CLAUDE.md backing before reporting.
Example Use Cases
- PR #427 in repo alpha: audit for AGENTS.md/CLAUDE.md compliance and historical context.
- Bug fix PR in core module: perform shallow bug scan and verify against prior comments.
- Refactor PR touching AGENTS.md files: ensure guidelines remain satisfied.
- Chore PR with multiple paths: summarize changes and run multi-agent check to avoid noisy comments.
- Cross-language PR: verify AGENTS.md across directories and language-specific guidelines.