Code Review
Use this skill to inspect code for correctness, maintainability, and higher-order risks before changes move forward.
Workflow
- Understand the context and purpose of the code
- Check for correctness and logic errors
- Evaluate code structure and organization
- Look for potential performance issues
- Check for security vulnerabilities
- Verify error handling is appropriate
- Assess readability and maintainability
Examples
Code quality feedback:
// Before: Nested callbacks
fetchUser(id, (user) => {
fetchPosts(user.id, (posts) => {
render(posts);
});
});
// Suggestion: Use async/await
const user = await fetchUser(id);
const posts = await fetchPosts(user.id);
render(posts);
Security feedback:
// Issue: SQL injection vulnerability
const query = `SELECT * FROM users WHERE id = ${userId}`;
// Fix: Use parameterized query
const query = 'SELECT * FROM users WHERE id = ?';
db.query(query, [userId]);
Quality Bar
- Focus on the most impactful issues first
- Explain why something is a problem
- Provide concrete suggestions for improvement
- Consider the developer's experience level
- Balance thoroughness with pragmatism
- Praise good patterns when you see them
Resource Strategy
- Add
scripts/only when the task is fragile, repetitive, or benefits from deterministic execution. - Add
references/only when details are too large or too variant-specific to keep inSKILL.md. - Add
assets/only for files that will be consumed in the final output. - Keep extra docs out of the skill folder; prefer
SKILL.mdplus only the resources that materially help.