code-review
Review code changes like a careful software engineer before merge, deployment, client demo, pull request, or handover. Use when Codex needs to inspect diffs or changed files after features, bug fixes,
SKILL.mdskills/code-review/SKILL.md
GitHubCode Review
Use this skill when code needs a quality gate rather than more implementation.
Core Rule
Inspect the actual diff or changed files before approving. Prioritize correctness, security, authorization, data integrity, user-visible behavior, and missing tests over style opinions.
Workflow
- Understand review context:
- intended feature/fix/refactor, changed files, affected user flow, affected roles, frontend/backend/database/DevOps scope, production data impact, and security sensitivity
- Inspect the diff or changed files:
- added, modified, deleted, renamed, config, dependency, migration, test, and documentation files
- Check requirement alignment:
- requested behavior, acceptance criteria, missing behavior, unrelated behavior, unintended behavior changes, complete user journey, and documented assumptions
- Check correctness:
- conditions, calculations, data mapping, paths, methods, field names, status transitions, dates, nulls, async behavior, imports, returns, races, loops, and filters
- Check API contract consistency:
- method, path, params, body, response shape, status codes, error format, auth headers, permissions, pagination/filtering, and date/time format
- Check validation:
- required fields, types, lengths, formats, enums, numeric ranges, file restrictions, status rules, duplicates, backend validation, and frontend validation
- Check authentication and authorization:
- auth required, user loading, role checks, ownership, shop/branch/tenant scope, privileged actions, guessed IDs, and backend enforcement
- Check security:
- secrets, logs, password/token exposure, SQL injection, raw SQL, file uploads, CORS, CSRF, redirects, sensitive errors, excessive API data, private data exposure, and unsafe dependencies
- Check data integrity:
- constraints, null handling, defaults, duplicates, status lifecycle, soft/hard delete, audit trail, transactions, partial failure, migration safety, and backfill needs
- Check error handling:
- validation, not found, unauthorized, forbidden, network, external API, database, empty state, frontend display, fallback messages, and logging
- Check frontend behavior when applicable:
- loading, error, empty, success, forms, duplicate submit prevention, state refresh, cache invalidation, navigation, responsive behavior, accessibility, design consistency, and permission visibility
- Check backend architecture when applicable:
- routes, controllers, services, repositories, schemas, error response patterns, auth middleware, transactions, logging, response consistency, tests, and docs
- Check database and migration risk when applicable.
- Check performance:
- repeated calls, missing pagination, N+1 queries, indexes, payload size, re-renders, heavy components, unbounded loops, large bundle additions, and slow build/test changes
- Check maintainability:
- naming, function size, component boundaries, duplication, project patterns, unnecessary abstraction, complexity, unrelated refactors, comments, and business logic flow
- Check tests and documentation:
- coverage for success, validation, permissions, edge cases, regressions, commands run, failures, README/API/env/deployment/handover updates
- Categorize findings by severity.
- Provide approval status:
- Approved, Approved with comments, Changes requested, or Blocked
- Summarize findings first, with file/location, risk, and recommended fix.
Read references/code-review-checklist.md for detailed review categories, severity definitions, approval status rules, and the final report format.
Non-Negotiable Rules
- Do not approve changes without inspecting the actual diff or files.
- Do not focus only on style while ignoring correctness.
- Do not ignore security-sensitive areas.
- Do not ignore backend authorization.
- Do not ignore data ownership and tenant/shop scoping.
- Do not ignore validation.
- Do not ignore error states.
- Do not ignore test coverage for risky changes.
- Do not suggest unrelated rewrites unless necessary.
- Do not over-review harmless style details.
- Do not claim tests passed unless they were actually run.
- Do not hide uncertainty.
- Separate blocking issues from optional improvements.
- Keep feedback specific, actionable, and respectful.
Output Contract
When using this skill, provide:
- Findings first, ordered by severity.
- Review scope.
- Overall assessment and approval status.
- Critical, high, medium, low, and optional findings as applicable.
- Requirement coverage.
- Security and permission review.
- Data and API review.
- Frontend/backend/database review as applicable.
- Test review and commands/results.
- Recommended next steps.