| name | review-changes |
|---|---|
| description | Review recent git changes for code smells, readability, maintainability, performance, and security issues |
| argument-hint | [optional: base branch or commit ref, defaults to main] |
Analyze the recent git changes and identify up to 5 constructive improvement suggestions related to code smells, readability, maintainability, performance, and security.
Run git diff $ARGUMENTS...HEAD to get the full diff of changes. If no argument is provided, default to main...HEAD.
Also run git log main...HEAD --oneline to understand the scope of changes.
For each file in the diff, read the full file (not just the diff) to understand the full context of the changes.
Exclude this files:
Review the diff and full file context with the following lenses:
Code smells
- Duplicated logic that could be extracted
- Long functions or deeply nested conditionals
- Magic numbers or unexplained literals
- Dead code or unused variables/imports
Readability
- Unclear variable or function names
- Missing context where logic is non-obvious
- Inconsistent naming conventions with the rest of the codebase
Maintainability
- Hard-coded values that should be configurable
- Tight coupling between modules
- Missing or inadequate error handling for failure cases that could realistically occur
Performance
- Unnecessary re-computation inside loops
- N+1 query patterns or missing database indexes (if applicable)
- Blocking operations that could be parallelized
Security
- User input used without validation or sanitization
- Secrets or credentials that could be accidentally exposed
- Missing authorization checks on new endpoints or actions
- SQL injection, XSS, or other OWASP Top 10 risks
Do not list issues that are clearly handled in the code already. Focus only on genuine gaps.
List up to 5 suggestions. For each:
- Title: short label for the issue
- Location: file and approximate line reference
- Explanation: what the issue is and why it matters
- Suggestion: a brief, concrete recommendation
If no issues are found, reply: "There are no errors."
Conclude with a one-paragraph summary stating whether notable opportunities exist to improve code quality, or whether the code generally follows sound design principles.
- Diff and changed files have been read in full
- Up to 5 actionable suggestions provided (or "There are no errors.")
- Each suggestion includes location, explanation, and recommendation
- Summary paragraph provided