code-review-practices
БесплатноБез исполняемых скриптовНе проверенProvides practical guidance for conducting thorough code reviews that identify issues early, promote knowledge sharing, and deliver constructive feedback…
от armanzeroeight★ 30 звёзд на GitHubОб этом скилле
Code Review Practices
This skill provides guidance for conducting effective, constructive code reviews that improve code quality and team collaboration.
Review Mindset
Goals of code review:
- Catch bugs and issues early
- Share knowledge across the team
- Maintain code quality standards
- Improve code maintainability
- Foster learning and growth
Not goals:
- Assert dominance or superiority
- Enforce personal preferences
- Block progress unnecessarily
- Nitpick without value
What to Review
1. Correctness
Does the code work as intended?
- Logic is sound
- Edge cases are handled
- Error conditions are managed
- Requirements are met
2. Design and Architecture
Does it fit the system?
- Follows existing patterns
- Appropriate abstractions
- Reasonable complexity
- Scalable approach
3. Readability
Can others understand it?
- Clear naming
- Logical organization
- Appropriate comments
- Consistent style
4. Testing
Is it adequately tested?
- Tests exist for new code
- Edge cases covered
- Tests are maintainable
- Integration points tested
5. Security
Are there security concerns?
- Input validation
- Authentication/authorization
- Sensitive data handling
- Known vulnerabilities
6. Performance
Will it perform well?
- No obvious bottlenecks
- Efficient algorithms
- Resource usage reasonable
- Scalability considered
Review Process
1. Understand Context
Before reviewing code:
- Read PR description and linked issues
- Understand the problem being solved
- Check CI/CD results
- Note any special considerations
2. Review at Appropriate Level
High-level first:
- Overall approach
- Architecture decisions
- Major design choices
Then details:
- Implementation specifics
- Edge cases
- Code style
3. Provide Actionable Feedback
Good feedback:
- Specific and clear
- Explains the "why"
- Suggests solutions
- Prioritizes issues
Example:
Consider using a Set instead of an array here for O(1) lookups.
With the current implementation, the nested loop creates O(n²)
complexity which could be problematic with large datasets.
4. Use Review Comments Effectively
Types of comments:
Blocking (must fix):
- "This will cause a race condition when..."
- "Security issue: User input is not sanitized..."
- "This breaks the API contract by..."
Non-blocking (suggestions):
- "Consider: This could be simplified by..."
- "Nit: Variable name could be more descriptive"
- "Question: Why did you choose X over Y?"
Positive:
- "Nice solution! This is much cleaner than..."
- "Great test coverage on the edge cases"
- "I learned something new from this approach"
5. Distinguish Preferences from Problems
Problems (objective):
- Bugs and logic errors
- Security vulnerabilities
- Performance issues
- Breaking changes
Preferences (subjective):
- Code style choices
- Naming preferences
- Organization approaches
- Minor optimizations
Rule: Block on problems, discuss preferences.
Communication Guidelines
Be Constructive
Instead of:
- "This is wrong"
- "Why would you do it this way?"
- "This code is terrible"
Say:
- "This could cause X issue because..."
- "Have you considered Y approach? It might..."
- "This could be improved by..."
Explain Your Reasoning
Weak comment:
This should be refactored.
Strong comment:
Consider extracting this logic into a separate method.
It's used in three places and would be easier to test
and maintain as a standalone function.
Ask Questions
Use questions to understand and guide:
- "What happens if X is null here?"
- "Could this be simplified using Y?"
- "Have you considered the case where...?"
Acknowledge Good Work
Don't only point out problems:
- "Clever use of X to solve Y"
- "Great test coverage"
- "This is much cleaner than the old approach"
- "Nice documentation"
Be Humble
You might be wrong:
- "I might be missing something, but..."
- "Could you explain why...?"
- "I'm not familiar with X, but..."
Common Review Patterns
Code Smells to Watch For
Long methods/functions:
- Hard to understand
- Difficult to test
- Multiple responsibilities
Duplicated code:
- Maintenance burden
- Inconsistent behavior
- Missed bug fixes
Complex conditionals:
- Hard to reason about
- Error-prone
- Difficult to test
Large classes:
- Too many responsibilities
- Hard to maintain
- Tight coupling
Magic numbers/strings:
- Unclear meaning
- Hard to change
- Error-prone
Security Red Flags
- Hardcoded credentials or secrets
- SQL injection vulnerabilities
- XSS vulnerabilities
- Missing input validation
- Insecure data storage
- Weak authentication
- Missing authorization checks
Performance Concerns
- N+1 query problems
- Inefficient algorithms (O(n²) when O(n) possible)
- Memory leaks
- Unnecessary database calls
- Large data structures in memory
- Blocking operations in async code
Установить code-review-practices в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл code-review-practices?
Provides practical guidance for conducting thorough code reviews that identify issues early, promote knowledge sharing, and deliver constructive feedback. This skill should be used when reviewing pull requests, establishing team review standards, or mentoring developers on effective review practices.
Как установить скилл code-review-practices?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл code-review-practices запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic