skills/code-review/SKILL.md
Code review checklists, PR review patterns, feedback techniques, and review automation. Use when user asks to "review this code", "code review checklist", "PR review template", "review best practices", "write review feedback", "review this PR", "how to give feedback on code", "PR too large", "split this PR", "review turnaround time", "automated code review", "CODEOWNERS", "pair review", "when to request changes", "code review tool", "review security", "design review", "performance review", "test coverage review", or any code review and feedback tasks.
npx skillsauth add 1mangesh1/dev-skills-collection code-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Checklists, patterns, feedback techniques, and automation for effective code reviews.
The praise sandwich is patronizing and everyone sees through it. Be direct and kind. Critique the code, not the person.
user is null on line 42" beats "handle errors better."[nit] Minor style issue, take or leave
[suggestion] Optional improvement idea
[question] Seeking understanding, not necessarily a change
[issue] Must be addressed before merge
[praise] Something done well worth calling out
[thought] Sharing context or perspective, no action needed
Instead of: "This is wrong"
Write: "This will fail when `items` is empty because `items[0]` returns undefined."
Instead of: "Why did you do it this way?"
Write: "Was there a performance reason for the manual loop? Array.filter would be more readable."
Instead of: "This is bad code"
Write: "This function handles validation, transformation, and persistence. Splitting would make each testable independently."
Small (< 200 lines changed) -> Review in 15-30 min. Ideal size.
Medium (200-400 lines) -> Review in 30-60 min. Acceptable.
Large (400-800 lines) -> Consider splitting.
Very large (> 800 lines) -> Should almost always be split.
Slow reviews kill velocity. Fast reviews compound into fast teams.
Automate what machines do better than humans. Save reviewers for logic and design.
name: PR Checks
on: [pull_request]
jobs:
lint-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run lint
- run: npm run typecheck
- run: npm test -- --coverage
import { danger, warn, fail } from 'danger';
if (danger.github.pr.additions + danger.github.pr.deletions > 500) {
warn('This PR is large. Consider splitting.');
}
if (!danger.github.pr.body || danger.github.pr.body.length < 20) {
fail('Please add a meaningful PR description.');
}
const sensitive = danger.git.modified_files.filter(f =>
f.includes('migration') || f.includes('.env') || f.includes('auth')
);
if (sensitive.length > 0) {
warn(`Sensitive files changed: ${sensitive.join(', ')}`);
}
Check against OWASP Top 10 patterns most likely to appear in application code.
// BAD: one query per iteration
for (const post of posts) {
post.author = await db.query('SELECT * FROM users WHERE id = $1', [post.author_id]);
}
// GOOD: batch
const authorIds = [...new Set(posts.map(p => p.author_id))];
const authors = await db.query('SELECT * FROM users WHERE id = ANY($1)', [authorIds]);
useMemo/useCallback for expensive computations or callback props.Migrations deserve extra scrutiny because they're hard to reverse in production.
CREATE INDEX CONCURRENTLY)?Nitpicking -- Commenting on formatting and cosmetics a linter should catch. If you're debating semicolons, add a linter rule.
Rubber-Stamping -- "LGTM" on a 500-line PR after 2 minutes. If you can't review properly, let someone else.
Bike-Shedding -- Long debates on trivial matters while ignoring real issues. Keep comments proportional to impact.
Gatekeeper Mentality -- Blocking PRs over personal style preferences not in the team's style guide. Enforce shared standards, not individual taste.
Drive-By Reviews -- One vague comment ("this seems off") then disappearing. Either review thoroughly or don't start.
- [ ] Requirements from the issue/spec are met
- [ ] Edge cases identified and handled
- [ ] Tests cover happy path and failure cases
- [ ] No security regressions (auth, input validation)
- [ ] Performance acceptable (no new N+1, no blocking calls)
- [ ] Documentation updated if public API changed
- [ ] Root cause identified (not just symptoms patched)
- [ ] Regression test added that fails without the fix
- [ ] Fix doesn't introduce new edge cases
- [ ] Related code checked for same class of bug
- [ ] Behavior unchanged (no functional changes mixed in)
- [ ] Existing tests pass without modification
- [ ] Code is measurably better (simpler, fewer dependencies, more testable)
- [ ] Performance characteristics unchanged or improved
- [ ] Changelog reviewed for breaking changes
- [ ] Major version bumps justified and tested
- [ ] Lock file changes are consistent (no unexpected additions)
- [ ] No new vulnerabilities introduced
- [ ] Bundle size impact acceptable
# .github/CODEOWNERS
* @org/platform-team
/src/components/ @org/frontend-team
/src/api/ @org/backend-team
/src/auth/ @org/security-team
/db/migrations/ @org/dba-team
/terraform/ @org/devops-team
/.github/workflows/ @org/devops-team
Best for: Complex architecture, unfamiliar codebases, onboarding, contentious designs.
Best for: Routine changes, well-understood domains, distributed teams.
The rule: If the PR shipped right now, would it cause harm? Request changes. If it works but could be better? Approve with comments. Trust the author to address optional feedback.
1. Read the PR description and linked issue
2. Understand context: what problem, why now?
3. Check PR size. If too large, ask to split before reviewing
4. Review test files first to understand expected behavior
5. Review main changes with the checklist for the PR type
6. Check correctness, security, performance, readability
7. Run locally if the change is complex or risky
8. Leave feedback using prefixed comments
9. Summarize with overall assessment and clear status
tools
Parallel execution with xargs, GNU parallel, and batch processing patterns. Use when user mentions "xargs", "parallel", "batch processing", "run in parallel", "parallel execution", "process list of files", "bulk operations", "concurrent commands", "map over files", or running commands on multiple inputs.
development
WebSocket implementation for real-time bidirectional communication. Use when user mentions "websocket", "ws://", "wss://", "real-time", "live updates", "chat application", "socket.io", "Server-Sent Events", "SSE", "push notifications", "live data", "streaming data", "bidirectional communication", "websocket server", "reconnection", or building real-time features.
tools
Frontend bundler configuration for Webpack and Vite. Use when user mentions "webpack", "vite", "bundler", "vite config", "webpack config", "code splitting", "tree shaking", "hot module replacement", "HMR", "build optimization", "bundle size", "chunk splitting", "loader", "plugin", "esbuild", "rollup", "dev server", or configuring JavaScript build tools.
tools
VS Code configuration, extensions, keybindings, and workspace optimization. Use when user mentions "vscode", "vs code", "vscode settings", "vscode extensions", "keybindings", "code editor", "workspace settings", "settings.json", "launch.json", "tasks.json", "vscode snippets", "devcontainer", "remote development", or customizing their VS Code setup.