Code Review Checklist

👤 harrylabsj 📦 v1.0.0 ⭐ 0.0 ⬇️ 538 下載
💻 開發程式設計 免費

📖 技能介紹


name: code-review-checklist description: 程式碼審查清單 - A comprehensive code review checklist and guidance tool. Use when user asks about 程式碼審查、程式碼檢查、PR review、程式碼質量, or wants to conduct or prepare for a code review. Provides systematic checklist items and best practices.

小蔥技能7w4.net有完整的技能分類。


Code Review Checklist (程式碼審查清單)

Overview

This skill provides a systematic approach to code reviews. It offers comprehensive checklist items across multiple dimensions of code quality, helps reviewers focus on high-impact areas, and guides developers in preparing code for review. Designed to make code reviews more efficient and thorough.

When to Use This Skill

  • Preparing code for pull request review
  • Conducting a code review as a reviewer
  • Self-reviewing own code before submission
  • Establishing code review standards for a team
  • Training new developers on review best practices
  • Auditing code quality in a codebase

What This Skill Provides

1. Predefined Checklists

Comprehensive checklist items organized by category: - Code correctness and logic - Code style and readability - Performance and efficiency - Security considerations - Error handling - Testing coverage - Documentation - Architecture and design patterns

2. Review Guidance

  • What to look for in each category
  • Red flags and common issues
  • Best practices specific to language/framework
  • Questions to ask the author

3. Review Workflow

  • Systematic approach to reviewing
  • Priority ordering of checks
  • Time allocation guidance
  • Documentation requirements

Checklist Categories

1. Correctness & Logic

  • [ ] Code produces expected output
  • [ ] Edge cases are handled
  • [ ] No off-by-one errors
  • [ ] Logic is sound and complete
  • [ ] No infinite loops or recursion issues
  • [ ] Proper use of data structures

2. Code Style & Readability

  • [ ] Follows project coding standards
  • [ ] Naming is clear and descriptive
  • [ ] Functions are appropriately sized
  • [ ] Code is not duplicated (DRY principle)
  • [ ] Complex logic has comments
  • [ ] Formatting is consistent

3. Performance & Efficiency

  • [ ] No unnecessary loops or iterations
  • [ ] Proper use of caching when applicable
  • [ ] Database queries are optimized
  • [ ] No memory leaks
  • [ ] Appropriate algorithmic complexity
  • [ ] Resources are properly released

4. Security

  • [ ] Input validation on all user inputs
  • [ ] No SQL injection vulnerabilities
  • [ ] No XSS vulnerabilities
  • [ ] Secrets not hardcoded
  • [ ] Proper authentication/authorization
  • [ ] Sensitive data properly protected
  • [ ] No security misconfigurations

5. Error Handling

  • [ ] Errors are caught and handled appropriately
  • [ ] Error messages are user-friendly
  • [ ] No empty catch blocks
  • [ ] Logging is appropriate
  • [ ] Graceful degradation where needed
  • [ ] No exposing internal error details

6. Testing

  • [ ] Unit tests exist for new code
  • [ ] Tests cover happy path and edge cases
  • [ ] Tests are maintainable
  • [ ] Mock usage is appropriate
  • [ ] Test coverage meets requirements
  • [ ] No flaky tests introduced

7. Documentation

  • [ ] Public APIs are documented
  • [ ] Complex logic has comments
  • [ ] README updated if needed
  • [ ] API changes are documented
  • [ ] Breaking changes are noted

8. Architecture & Design

  • [ ] Follows project architecture patterns
  • [ ] Single Responsibility Principle followed
  • [ ] Dependencies are properly injected
  • [ ] Coupling is minimized
  • [ ] Changes are localized appropriately
  • [ ] No tech debt introduced unnecessarily

Language-Specific Considerations

JavaScript/TypeScript

  • Proper async/await usage
  • TypeScript types are correct
  • No 'any' type abuse
  • ESLint rules followed

Python

  • PEP 8 compliance
  • Type hints where appropriate
  • Docstrings for public functions
  • No deprecated imports

Java

  • Null safety considerations
  • Resource management (try-with-resources)
  • Stream API usage
  • Concurrent access considerations

Go

  • Error handling conventions
  • Goroutine leak prevention
  • Context usage
  • Naming conventions

Review Workflow

Step 1: Context (2-3 min)

  • Read PR description and motivation
  • Understand what changed and why
  • Check related issues or docs

Step 2: Overview (3-5 min)

  • Scan changed files
  • Identify high-risk areas
  • Note files needing deep review

Step 3: Detailed Review (15-30 min)

  • Follow checklist by priority
  • Comment on issues found
  • Ask clarifying questions
  • Suggest improvements

Step 4: Summary (3-5 min)

  • Summarize findings
  • Categorize issues (Blocking/Suggestion/Question)
  • Approve or request changes

Usage Examples

As a Reviewer

"用程式碼審查清單檢查這個PR"
"幫我審查這個函式的邏輯"
"檢查這段程式碼有沒有安全問題"
"看看這個檔案有哪些可以改進的地方"

As a Developer

"幫我準備程式碼審查"
"自審查這份程式碼,有什麼遺漏?"
"檢查這段程式碼的測試覆蓋"
"這個程式碼符合專案規範嗎?"

For Team Standards

"生成一個程式碼審查檢查清單"
"我們團隊的程式碼審查標準是什麼?"
"前端程式碼審查有什麼特殊要求?"

Output Format

For each review, output:

## Code Review: [PR/Change Title]

### Summary
- Files changed: X
- Lines added/removed: +X/-X
- Risk level: [Low/Medium/High]

### Findings

#### 🔴 Blocking Issues
- [Issue description] - [File:Line] - [Suggestion]

#### 🟡 Suggestions
- [Suggestion] - [File:Line]

#### 🟢 Good Practices Noted
- [Positive observation]

### Checklist Status
- [x] Correctness
- [x] Style
- [ ] Security (needs work)
- [x] Performance

### Recommendation
[Approve / Request Changes / Discuss]

### Action Items
- [ ] Item 1
- [ ] Item 2

Integration with Development Workflow

This skill integrates with: - github — For reviewing PRs directly - coding-agent — For automated code quality checks - opencli — For running linters and formatters

Limitations

  • Cannot execute code to verify correctness
  • Cannot know full system context
  • Best practices may vary by project
  • Language-specific items may be incomplete for niche languages

Acceptance Criteria

  1. ✓ Provides comprehensive checklist coverage
  2. ✓ Can customize for different languages/frameworks
  3. ✓ Identifies common issues efficiently
  4. ✓ Helps categorize issue severity
  5. ✓ Provides actionable feedback
  6. ✓ Saves time in review process
  7. ✓ Helps developers learn and improve

📁 包含檔案 (4 個)

📄 SKILL.md 6.4 KB
📄 _meta.json 140 B
📄 handler.py 16.9 KB
📄 skill.json 493 B