一键导入
code-review
Perform deep, context-aware code reviews for GitHub pull requests or local branch changes. Use when the user asks to review a PR, analyze pull request changes, review current branch changes, run automated code review, or mentions PR
菜单
Perform deep, context-aware code reviews for GitHub pull requests or local branch changes. Use when the user asks to review a PR, analyze pull request changes, review current branch changes, run automated code review, or mentions PR
Perform a maximally thorough, CodeRabbit-style code review that fans out one focused sub-agent per changed file, runs every available linter/SAST/secret scanner, and reports every issue down to nitpicks. Use when the user asks for a deep, exhaustive, thorough, or nitpick-level review, a CodeRabbit-style review, to "find everything", to "leave no stone unturned", or wants maximum coverage on a PR or branch. Optimizes for recall; some noise is acceptable. For a fast, conservative, senior-engineer review that flags only what matters, use code-review instead.
Stage all repository changes and create a git commit with an auto-generated message after inspecting status, diff, and recent commit style. Use when the user asks to commit changes, save changes in git, stage and commit, or create a commit without needing confirmation.
Create a feature branch off master/develop/main when needed, stage and commit all changes, push, and immediately open a pull request via the gh CLI. Use when the user asks to open a PR, ship changes, or commit and create a pull request.
| name | code-review |
| description | Perform deep, context-aware code reviews for GitHub pull requests or local branch changes. Use when the user asks to review a PR, analyze pull request changes, review current branch changes, run automated code review, or mentions PR |
Review code like a senior engineer: understand the intent, inspect the diff in context, run available checks, identify real risks, and produce actionable feedback with copy-paste-ready handoff prompts.
Review PR #123 with full context
/skill:code-review https://github.com/OWNER/REPO/pull/123
Review the current branch against main as if it were a PR
Do a security-focused review of this PR
Review these local changes but do not post to GitHub
Follow this process for every review.
Determine both the review target and the output destination. Review targets can be:
PR #123main or masterOutput destination rules:
https://github.com/OWNER/REPO/pull/123 — post one PR comment by default.PR #123 — print to terminal unless the user explicitly asks to post.For direct GitHub PR URLs with posting enabled, run gh auth status before resolving PR metadata. If gh is unavailable or auth fails, mark posting unavailable, continue terminal-only when the PR diff can still be gathered, and include the failure reason with the terminal review.
For GitHub PRs, gather PR metadata and diff with gh when available. Use the PR URL when one was provided:
gh auth status
gh pr view <url-or-number> --json title,body,author,baseRefName,headRefName,files,commits,url
gh pr diff <url-or-number>
For local branch reviews, inspect the merge base and diff:
git status --short
git branch --show-current
git merge-base HEAD origin/main 2>/dev/null || git merge-base HEAD main
git diff <merge-base>...HEAD
Adjust the base branch if the repository uses a different default branch.
Read the changed files and enough surrounding code to understand the impact. Also check project standards in this priority order:
REVIEW.md in the target repository root, if presentCLAUDE.md, .claude.md, or equivalent agent instructionsCONTRIBUTING.md, coding standards, architecture docs, ADRspackage.json, pyproject.toml, go.mod, Cargo.toml, etc.Treat the target repo's REVIEW.md as the highest-priority review rules.
If this skill's bundled reference files are available, use them as support material:
REFERENCE.md — examples, output templates, severity guidancePROJECT_REVIEW_TEMPLATE.md — starter REVIEW.md users can copy into a projectWhen safe and available, run relevant checks for the repository:
Do not install new tools or run destructive commands without permission. If checks are too expensive or unavailable, say so and continue with manual review.
Analyze the change in this order:
For large PRs, focus first on Critical and High issues. Summarize lower-severity patterns instead of producing noisy line-by-line comments.
Rule of thumb: if you would not block a real merge for it, do not mark it Medium or higher.
Start with a short overall assessment. Then list findings from highest to lowest severity.
For every issue, use this format:
## [Severity] Issue: [Short descriptive title]
**File:** `path/to/file.ext:line-range`
**Category:** Bug | Security | Logic | Reliability | Maintainability | Testing | Performance | Style
**Problem:**
[Clear 1-2 sentence explanation of what is wrong and why it matters.]
**Impact:**
[Specific consequence if this is not fixed.]
**Suggested Fix:**
```diff
[Exact unified diff, or a precise before/after code block if a diff is not practical.]
```
**Handoff Prompt:**
```
In the file `path/to/file.ext`, around lines X-Y:
[Detailed, self-contained instruction explaining the exact change needed, why it is required, edge cases to consider, and how to verify it. Reference relevant project patterns if applicable.]
Only modify the necessary lines. Keep unrelated code unchanged.
```
After all issues, include:
### PR Summary
[2-4 sentence overview of the change and overall assessment.]
### Recommendations
- [ ] Highest-priority fixes before merge
- [ ] Tests to add or run
- [ ] Optional improvements
### Statistics
- Files changed: X
- Issues found: Y (Critical: A, High: B, Medium: C, Low: D)
- Checks run: [commands or "not run"]
If no issues are found, say so clearly and include a brief positive summary of what looked good.
When posting is permitted, use one normal PR comment by default. Do not create inline comments unless the user explicitly asks for them.
Posting workflow:
gh auth status.gh is unavailable, print the full review to the terminal and include the failure reason.gh pr view <url-or-number> --json title,body,author,baseRefName,headRefName,files,commits,url.gh pr comment <url-or-number> --body-file <tmp-review.md>.The posted comment must include the summary and statistics at the top, followed by one collapsible <details> section per finding. Each <summary> line must use:
[Severity] File:line - issue title
Each details section must include the problem, impact, suggested fix, and handoff prompt. See REFERENCE.md for the exact GitHub comment template and fallback commands.
For terminal-only reviews, use the standard output format above.