| name | review |
| description | Code review skill covering security, correctness, type safety, and maintainability for any software project |
Code Review Skill
Review code changes following enterprise-grade engineering standards. The checklists, comment templates, and command patterns here apply to any software project regardless of stack (examples use TypeScript / Node / React; the discipline is stack-agnostic).
Review Process
- Understand the change - Read the PR description and commits
- Check for issues - Security, bugs, performance, maintainability
- Verify patterns - Ensure code follows project conventions
- Test coverage - Check if tests cover the changes
- Provide feedback - Clear, actionable comments
Review Checklist by Area
Security (CRITICAL)
TypeScript/JavaScript
React/Frontend
Backend/API
[CUSTOMIZE: additional language/runtime]
Add a section here for each additional language or runtime your project uses (Go, Python, Java, etc.). For each, list:
Database
Comment Templates
Request Change
**Issue:** [Brief description]
[Explanation of the problem]
**Suggestion:**
```suggestion
// Fixed code here
### Ask Question
Question: [Your question]
[Context or reason for asking]
### Approve with Note
Note: [Observation]
[Minor suggestion or future consideration - not blocking]
### Security Concern
Security: [Issue description]
[Explanation of risk]
Required fix:
[How to fix it]
---
## Common Issues to Flag
### Security
```typescript
// BAD: SQL injection risk
const query = `SELECT * FROM users WHERE id = '${userId}'`;
// GOOD: Parameterized query (using your ORM)
const user = await db.user.findUnique({ where: { id: userId } });
Error Handling
try {
await doSomething();
} catch (e) {
}
try {
await doSomething();
} catch (error) {
logger.error({ error }, 'Failed to do something');
throw error;
}
Type Safety
const data: any = response.data;
interface UserResponse {
id: string;
name: string;
}
const data: UserResponse = response.data;
React Performance
<Button onClick={() => handleClick(item.id)}>Click</Button>
const handleItemClick = useCallback((id: string) => {
handleClick(id);
}, [handleClick]);
Async State
const { data } = useQuery(...);
return <div>{data.name}</div>;
const { data, isLoading, isError } = useQuery(...);
if (isLoading) return <Skeleton />;
if (isError) return <ErrorState />;
return <div>{data.name}</div>;
Review Commands
Get PR Diff
gh pr diff <number>
gh pr diff <number> -- path/to/file.ts
gh pr view <number>
Checkout PR Locally
gh pr checkout <number>
npm test
npm run build
Add Review Comments
gh pr review <number>
gh pr review <number> --approve -b "LGTM!"
gh pr review <number> --request-changes -b "Please address the security concern."
gh pr review <number> --comment -b "A few suggestions..."
Review Response Format
## Review Summary
**Status:** [Approve / Request Changes / Comment]
### What I Reviewed
- [List of files/features reviewed]
### Findings
#### Critical (Must Fix)
- [ ] [Issue 1 with file:line reference]
- [ ] [Issue 2 with file:line reference]
#### Important (Should Fix)
- [ ] [Issue with explanation]
#### Minor (Consider)
- [ ] [Suggestion or optimization]
### What Looks Good
- [Positive feedback on well-done aspects]
### Questions
- [Any questions about the implementation]
Apply to: $ARGUMENTS