code-review
БесплатноБез исполняемых скриптовНе проверенPre-PR code review with multi-agent parallel analysis. Use when user says 'code review', 'review this code', 'review my changes', 'check for bugs', or before…
от steveclarke★ 37 звёзд на GitHubОб этом скилле
Code Review
Breadth-first pre-PR code review using 5 parallel review agents, each with a
different lens. Confidence-scored, false-positive-filtered, with auto-fix for
mechanical issues. Complements /adversarial-review (depth-first iterative
loop) — this skill catches what any single reviewer would miss across multiple
dimensions in one pass.
Input Modes
Parse $ARGUMENTS to determine what to review:
- No args: review uncommitted changes — run
git diffandgit diff --cached - File/dir paths: review specific files — read them directly
--prflag: review the full branch diff against the base branch
If the diff is empty, tell the user there's nothing to review and stop.
Step 1: Detect Base Branch
Determine the base branch for diffing:
- Try
gh pr view --json baseRefName -q .baseRefName(if a PR already exists) - Try
git remote show origin | grep 'HEAD branch'for the repo default - Fall back to
main, thenmaster
Store the result — you'll use it for the branch diff.
Step 2: Gather Context
The diff
Based on input mode:
- No args:
git diff+git diff --cached - File paths: read the files directly
--pr:git diff {base_branch}...HEAD
Also generate a change summary — list of files changed, insertions/deletions, and a one-line description of what the changeset does. Use a haiku Agent for this:
Agent(model: "haiku", description: "Summarize changeset")
Prompt: "Here is a git diff. Return: (1) list of files changed with +/- line counts, (2) a one-sentence summary of what this changeset does. Be concise.\n\n{diff}"
CLAUDE.md files
Use a haiku Agent to find relevant CLAUDE.md files:
Agent(model: "haiku", description: "Find CLAUDE.md files")
Prompt: "Find all CLAUDE.md files relevant to this review. Check: (1) the project root, (2) any directories containing modified files. Return the file paths and their contents. Modified files: {file_list}"
The agent should use Read and Glob to find and read the files.
Step 3: Dispatch 5 Review Agents (Parallel)
Launch all 5 agents simultaneously using the Agent tool with model: "sonnet".
Give each agent the diff, the change summary, and the CLAUDE.md contents.
Each agent returns a list of findings. Each finding must include:
- File and line number/range
- Issue description
- Category (which lens found it)
- Severity — one of:
mechanical(auto-fixable) orjudgment(needs user input)
Agent 1: CLAUDE.md Compliance
Agent(model: "sonnet", description: "CLAUDE.md compliance review")
Prompt:
"Review this diff for compliance with the project's CLAUDE.md conventions.
CLAUDE.md contents:
{claude_md_contents}
Diff:
{diff}
Check:
- Naming conventions, file organization, architectural patterns
- Explicitly stated rules and preferences
- Style and formatting requirements
Only flag violations of rules that are EXPLICITLY stated in the CLAUDE.md.
Do not flag general best practices unless the CLAUDE.md specifically requires them.
For each finding, quote the specific CLAUDE.md rule being violated.
Return findings as a JSON array:
[{\"file\": \"path\", \"line\": N, \"issue\": \"description\", \"claude_md_rule\": \"quoted rule\", \"category\": \"claude-md\", \"severity\": \"mechanical|judgment\"}]
If no violations found, return an empty array: []"
Agent 2: Bug Scan
Agent(model: "sonnet", description: "Bug and security scan")
Prompt:
"Do a shallow bug scan of this diff. Focus on the CHANGES ONLY — not pre-existing code.
Diff:
{diff}
Scan for:
- Security issues: injection, auth bypass, data exposure, XSS, CSRF (OWASP top 10)
- Correctness: logic errors, off-by-one, null/nil handling, type mismatches
- Race conditions: concurrent access, shared mutable state, missing locks
- Data safety: destructive operations without confirmation, missing validations
- Missing LLM output validation (if applicable)
Ignore:
- Issues a linter/typechecker/compiler would catch
- Pre-existing issues on lines not modified in this diff
- Style preferences and nitpicks
Return findings as a JSON array:
[{\"file\": \"path\", \"line\": N, \"issue\": \"description\", \"category\": \"bug\", \"severity\": \"mechanical|judgment\"}]
If no bugs found, return an empty array: []"
Agent 3: Git Blame / History Context
Agent(model: "sonnet", description: "Git history context review")
Prompt:
"Review this diff in the context of git history. For each modified file, run
git blame and git log to understand what changed recently and why.
Diff:
{diff}
Changed files: {file_list}
Check for:
- Reverting recent intentional changes without explanation
- Modifying code that has a comment explaining why it's written that way
- Breaking patterns established by recent commits
- Removing code that was added recently for a specific reason (check commit messages)
Use Bash to run: git blame {file}, git log --oneline -10 {file}, git log -1 --format='%s%n%b'
Установить code-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл code-review?
Pre-PR code review with multi-agent parallel analysis. Use when user says 'code review', 'review this code', 'review my changes', 'check for bugs', or before creating a PR.
Как установить скилл code-review?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл code-review запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic