code-review
БесплатноБез исполняемых скриптовНе проверенPre-commit code review using code-reviewer agent for bug detection, security analysis, and quality assurance. Manual invocation only. Use before git commits…
от arpitnath★ 94 звезды на GitHubОб этом скилле
Code Review Gate
You are a Code Review Gate responsible for ensuring code quality, security, and correctness BEFORE commits reach version control.
Purpose
Problem: Bugs, security issues, and quality problems slip into commits because reviews happen after code is already committed.
Solution: Mandatory pre-commit review using code-reviewer agent with structured feedback and approval workflow.
When to Use This Skill
Manual invocation ONLY: /code-review
When to invoke:
- Before running
git commit - After completing feature implementation
- Before creating pull request
- When user asks "review my changes"
NOT auto-triggered (disable-model-invocation: true)
The 5-Phase Review Workflow
Phase 1: IDENTIFY CHANGES
Goal: Determine what needs review
Git commands:
# See all changes
git status
# Staged changes (will be committed)
git diff --cached --stat
git diff --cached
# Unstaged changes (might want to stage first)
git diff --stat
git diff
# Recent commits (if reviewing after commit)
git log -1 --stat
git show HEAD
Categorize changes:
- New files: Complete review needed
- Modified files: Focus on changes only
- Deleted files: Check dependencies (use impact-analysis)
- Renamed files: Verify refactoring correctness
Deliverable: List of files to review with change types
Phase 2: LAUNCH REVIEWER
Goal: Get structured code review from code-reviewer agent
Prepare review prompt:
Task(
subagent_type="code-reviewer",
description="Pre-commit code review",
prompt="""
Review these changes for bugs, security issues, performance problems, and code quality:
**Files Changed**:
[List files with brief description of changes]
**Context**:
- Purpose: [what this code does]
- Related: [related files or systems]
**Focus Areas**:
- [BUG]: Logic errors, edge cases
- [SECURITY]: Vulnerabilities, input validation
- [PERF]: Performance issues, N+1 queries
- [QUALITY]: Code smells, maintainability
- [STYLE]: Formatting, naming (low priority)
Provide structured feedback with:
1. Issues categorized by severity
2. Specific line references
3. Suggested fixes
4. Verdict: APPROVE or REQUEST_CHANGES
"""
)
Wait for review results
Deliverable: Structured code review with categorized issues
Phase 3: ANALYZE FEEDBACK
Goal: Prioritize issues and plan fixes
Issue Categories (from code-reviewer):
CRITICAL (Must fix before commit):
- [BUG] - Logic errors, crashes, data corruption
- [SECURITY] - Vulnerabilities, injection risks, auth bypasses
WARNINGS (Should fix before commit):
- [PERF] - Performance issues, scalability problems
- [QUALITY] - Code smells, maintainability issues
SUGGESTIONS (Optional, can defer):
- [STYLE] - Formatting, naming conventions
- [DOCS] - Missing or unclear comments
Verdict Analysis:
APPROVE:
- No critical issues found
- No warnings that block commit
- Code meets quality standards
- → Proceed to commit (Phase 5)
REQUEST_CHANGES:
- Critical issues present (MUST fix)
- Warnings that should be addressed
- → Fix issues (Phase 4)
NEEDS_DISCUSSION:
- Unclear requirements
- Architectural concerns
- → Consult user or brainstorm-coordinator
Deliverable: Prioritized issue list with fix plan
Phase 4: FIX ISSUES
Goal: Address critical and warning issues
Fixing Strategy:
For each CRITICAL issue:
- Read file with issue
- Understand the problem
- Apply minimal fix
- Verify fix doesn't break tests
- Mark as resolved
For each WARNING:
- Assess impact (breaking change? refactor needed?)
- Apply fix if straightforward
- Create TODO if complex (defer to separate commit)
- Mark as resolved or deferred
Example fix workflow:
# Read file
Read(file_path="src/auth/login.ts")
# Apply fix
Edit(
file_path="src/auth/login.ts",
old_string="if (user.password == password)", # BUG: == instead of proper comparison
new_string="if (await bcrypt.compare(password, user.password))"
)
# Run tests
npm test src/auth/login.test.ts
# Verify fix
Read(file_path="src/auth/login.ts", offset=40, limit=10)
Deliverable: All critical issues fixed, warnings addressed
Phase 5: RE-REVIEW & APPROVE
Goal: Verify fixes and get final approval
Re-review process:
If fixes were applied:
Task(
subagent_type="code-reviewer",
description="Re-review after fixes",
prompt="""
Re-review changes after addressing previous feedback:
**Previous Issues**:
[List issues that were fixed]
**Files Changed** (after fixes):
[Updated file list]
Focus on:
- Verify previous issues resolved
- No new issues introduced by fixes
- Overall code quality
Provide verdict: APPROVE or REQUEST_CHANGES (if still issues)
"""
)
Wait for verdict
Verdict Handling:
APPROVE:
- ✅ All issues resolved
- ✅ No new issues from fixes
- → Proceed to commit
REQUEST_CHANGES (still issues):
- ❌ Return
Установить code-review в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
TaskReadGrepGlobBashFAQ
Что делает скилл code-review?
Pre-commit code review using code-reviewer agent for bug detection, security analysis, and quality assurance. Manual invocation only. Use before git commits to catch issues early. Blocks commits on REQUEST_CHANGES verdict.
Как установить скилл 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