Code Review Skill
This skill performs automated self-review of code changes before committing to ensure code quality and catch potential issues.
Purpose
Ensure code changes meet quality standards before commit by performing automated checks and analysis.
When to Use
- Before final commit of any code changes
- After implementing fixes (GREEN phase of TDD)
- When preparing PR for human review
Checks Performed
1. Code Style & Patterns
- Code follows project-specific patterns and conventions
- Consistent naming conventions (camelCase, snake_case, etc.)
- Proper import organization
- No unused imports or variables
2. Static Analysis
- No linting errors (
eslint, flake8, biome, etc.)
- No type errors (
mypy, tsc, etc.)
- No security vulnerabilities (basic patterns)
3. Test Coverage
- All modified code has corresponding tests
- New functionality includes test cases
- Edge cases are considered
4. Code Quality
- No hardcoded secrets or sensitive data
- Proper error handling
- No console.log/print statements in production code
- Functions are reasonably sized
5. Documentation
- Public functions have docstrings/comments
- Complex logic is documented
- README updated if needed
Process
Identify Changed Files
- Compare against the base branch
- List all modified, added, deleted files
Run Project Linters
- Execute project-specific lint commands
- Report any errors or warnings
Type Check (if applicable)
- Run TypeScript/mypy/other type checkers
- Report type errors
Security Scan
- Check for hardcoded secrets
- Check for common security anti-patterns
Generate Report
- List all issues found
- Categorize by severity (error, warning, info)
Output Format
{
"status": "pass|fail",
"files_reviewed": 5,
"issues": [
{
"file": "src/auth.ts",
"line": 45,
"severity": "error",
"category": "linting",
"message": "Missing semicolon"
}
],
"summary": {
"errors": 0,
"warnings": 2,
"info": 1
},
"recommendation": "Ready to commit" | "Fix errors before committing"
}
Important
- NEVER skip this review step
- If any errors are found, they MUST be fixed before commit
- Warnings should be addressed if time permits
- If review cannot be completed, report the blocker
1---2name: code-review3description: Self-review code changes before commit to ensure quality4---56# Code Review Skill78This skill performs automated self-review of code changes before committing to ensure code quality and catch potential issues.910## Purpose1112Ensure code changes meet quality standards before commit by performing automated checks and analysis.1314## When to Use1516- Before final commit of any code changes17- After implementing fixes (GREEN phase of TDD)18- When preparing PR for human review1920## Checks Performed2122### 1. Code Style & Patterns23- Code follows project-specific patterns and conventions24- Consistent naming conventions (camelCase, snake_case, etc.)25- Proper import organization26- No unused imports or variables2728### 2. Static Analysis29- No linting errors (`eslint`, `flake8`, `biome`, etc.)30- No type errors (`mypy`, `tsc`, etc.)31- No security vulnerabilities (basic patterns)3233### 3. Test Coverage34- All modified code has corresponding tests35- New functionality includes test cases36- Edge cases are considered3738### 4. Code Quality39- No hardcoded secrets or sensitive data40- Proper error handling41- No console.log/print statements in production code42- Functions are reasonably sized4344### 5. Documentation45- Public functions have docstrings/comments46- Complex logic is documented47- README updated if needed4849## Process50511. **Identify Changed Files**52 - Compare against the base branch53 - List all modified, added, deleted files54552. **Run Project Linters**56 - Execute project-specific lint commands57 - Report any errors or warnings58593. **Type Check** (if applicable)60 - Run TypeScript/mypy/other type checkers61 - Report type errors62634. **Security Scan**64 - Check for hardcoded secrets65 - Check for common security anti-patterns66675. **Generate Report**68 - List all issues found69 - Categorize by severity (error, warning, info)7071## Output Format7273```json74{75 "status": "pass|fail",76 "files_reviewed": 5,77 "issues": [78 {79 "file": "src/auth.ts",80 "line": 45,81 "severity": "error",82 "category": "linting",83 "message": "Missing semicolon"84 }85 ],86 "summary": {87 "errors": 0,88 "warnings": 2,89 "info": 190 },91 "recommendation": "Ready to commit" | "Fix errors before committing"92}93```9495## Important9697- NEVER skip this review step98- If any errors are found, they MUST be fixed before commit99- Warnings should be addressed if time permits100- If review cannot be completed, report the blocker