| name | description | license | metadata | ||||
|---|---|---|---|---|---|---|---|
code-review |
Reviews code changes for functionality, architecture, code quality, testing, security, style, performance, and maintainability. Use when reviewing PRs or checking code quality. |
Apache-2.0 |
|
When reviewing code, follow these steps:
-
Automated Pre-Check:
- Do Continuous Integration (CI) pipelines pass?
- Does the code compile?
- Do automated tests pass?
- Do linters show any problems?
- Do static analysis tools show any problems?
-
Functionality:
- Does the code fulfill established requirements?
-
Architectural Evaluation:
- Scan and assess the overarching structure.
- Does it adhere to structural paradigms?
- Does it make appropriate use of established design patterns?
- Does it have high cohesion and low coupling?
-
Line-by-Line Inspection:
- Review the logic, syntax, and resource management.
- Does it strictly adhere to RAII (Resource Acquisition Is Initialization) for memory and resource handling?
- Does it optimize time and space complexity?
- Does it implement thread safety, avoiding race conditions, and deadlocks in concurrent execution?
- Are error conditions handled?
-
Test Verification:
- Examine the accompanying unit and integration tests for coverage, edge cases, and validity.
- Do tests evaluate expected paths and failure modes?
-
Security:
- Are external inputs sanitized to prevent injection vulnerabilities?
- Are buffers safely handled to prevent overflows or undefined behavior?
-
Style:
- Does it follow established conventions?
-
Performance:
- Are there obvious inefficiencies?
-
Maintainability:
- Are variable and function names self-documenting?
- Is cyclomatic complexity minimized?
- Is there code duplication?
- Be specific about what needs to change
- Explain why, not just what
- Suggest alternatives when possible
- Write your report in a file named "code-review-report.md"