Code Reviewer Skill
Review code changes for quality, security, and performance. Provide structured, actionable feedback.
Activation Triggers
- "review this code" and similar explicit requests
- Before PR creation
- Re-checking a diff that answers earlier review findings
Routine branch review belongs to the built-in /code-review. Do not run after ordinary edits.
Review Areas
- Correctness: Logic, bugs, edge cases, boundary values
- Quality: Language idioms, DRY, early return, duplication, structured params (TS: RORO)
- Type Safety: Type annotations, null/undefined, off-by-one
- Performance: Unnecessary allocations, parallelization opportunities, data structure choice
- Security: Input validation, SQLi/XSS, secrets handling
- Testing: Coverage for new code paths, edge case tests
- Project Compliance: CLAUDE.md standards, consistency with existing patterns
- Root-cause adequacy (when the diff responds to a prior finding): does the fix address the violated invariant, or only its symptom?
Workflow
- Context:
git diff to understand changes, check project CLAUDE.md, identify related tests
- Analysis: Review against above areas. Run project lint/type-check commands for errors
- Test Verification: Check coverage and test quality
- Feedback: Report using the format below
- Re-review: when the diff answers earlier findings, verify each one is closed by a root-cause fix. Passing tests are not evidence — a relaxed test passes too
Symptom-Only Fixes
The catalogue of symptom-only patterns lives in ~/.claude/CLAUDE.md(行動規範 > 問題解決・デバッグ). Read it and check the diff against that list rather than a copy kept here.
A finding is not closed by silencing its symptom. Two checks specific to re-review:
- The fix touches one call path when the invariant is enforced in several. Ask for the count of the other sites — the rules require it to be stated before the fix
- Ask what invariant was broken. If the answer is only "the test failed" or "the linter complained", the root cause is not established
Re-raise the original finding rather than closing it, and check the other paths that enforce the same invariant.
Output Format
- Critical Issues (must fix): Bugs, vulnerabilities, breaking changes → file:line + fix suggestion
- Important Suggestions (should address): Performance, maintainability
- Minor Improvements (nice to have): Style, documentation
- Positive Highlights: Good implementations
- Next Steps: Prioritized recommended actions
Template details: templates/review-report.md
Decision Criteria
- Correctness > cleverness. CLAUDE.md standards > general best practices
- Provide specific, actionable feedback (file:line + code examples)
- Investigate why unusual approaches pass tests before flagging them
- A symptom-only fix is a Critical Issue, even when the reported symptom is gone
1---2name: code-reviewer3description: Reviews a diff against this user's standards, above all whether a fix addresses the violated invariant or only silences its symptom. Use when the user asks for a review, before creating a PR, or when re-checking a diff that answers earlier review findings. Do not use after ordinary edits, and do not use for routine branch review — the built-in /code-review covers that.4---56# Code Reviewer Skill78Review code changes for quality, security, and performance. Provide structured, actionable feedback.910## Activation Triggers1112- "review this code" and similar explicit requests13- Before PR creation14- Re-checking a diff that answers earlier review findings1516Routine branch review belongs to the built-in `/code-review`. Do not run after ordinary edits.1718## Review Areas19201. **Correctness**: Logic, bugs, edge cases, boundary values212. **Quality**: Language idioms, DRY, early return, duplication, structured params (TS: RORO)223. **Type Safety**: Type annotations, null/undefined, off-by-one234. **Performance**: Unnecessary allocations, parallelization opportunities, data structure choice245. **Security**: Input validation, SQLi/XSS, secrets handling256. **Testing**: Coverage for new code paths, edge case tests267. **Project Compliance**: CLAUDE.md standards, consistency with existing patterns278. **Root-cause adequacy** (when the diff responds to a prior finding): does the fix address the violated invariant, or only its symptom?2829## Workflow30311. **Context**: `git diff` to understand changes, check project CLAUDE.md, identify related tests322. **Analysis**: Review against above areas. Run project lint/type-check commands for errors333. **Test Verification**: Check coverage and test quality344. **Feedback**: Report using the format below355. **Re-review**: when the diff answers earlier findings, verify each one is closed by a root-cause fix. Passing tests are not evidence — a relaxed test passes too3637## Symptom-Only Fixes3839The catalogue of symptom-only patterns lives in `~/.claude/CLAUDE.md`(行動規範 > 問題解決・デバッグ). Read it and check the diff against that list rather than a copy kept here.4041A finding is not closed by silencing its symptom. Two checks specific to re-review:4243- The fix touches one call path when the invariant is enforced in several. Ask for the count of the other sites — the rules require it to be stated before the fix44- Ask what invariant was broken. If the answer is only "the test failed" or "the linter complained", the root cause is not established4546Re-raise the original finding rather than closing it, and check the other paths that enforce the same invariant.4748## Output Format49501. **Critical Issues** (must fix): Bugs, vulnerabilities, breaking changes → file:line + fix suggestion512. **Important Suggestions** (should address): Performance, maintainability523. **Minor Improvements** (nice to have): Style, documentation534. **Positive Highlights**: Good implementations545. **Next Steps**: Prioritized recommended actions5556Template details: `templates/review-report.md`5758## Decision Criteria5960- Correctness > cleverness. CLAUDE.md standards > general best practices61- Provide specific, actionable feedback (file:line + code examples)62- Investigate why unusual approaches pass tests before flagging them63- A symptom-only fix is a Critical Issue, even when the reported symptom is gone