Review Code
Use this skill to review code (staged changes, a PR, or specific files) against project conventions.
Workflow
- •Determine the scope: diff (
git diff), staged (git diff --cached), PR (gh pr diff), or specific files - •Read every changed file in full (not just the diff) to understand context
- •Run the checklist below against each file, grouped by category
- •Report findings as a numbered list with file path, line number, severity, and fix
- •End with a summary: total issues by severity, and an overall verdict (PASS / NEEDS FIXES)
Severities
- •error -- will cause build failure, runtime bug, or test failure; must fix
- •warning -- convention violation or code smell; should fix
- •nit -- style preference or minor improvement; optional
Checklist
Imports (most common mistake source)
- • Backend files: every relative and
#/import ends with.js - • Frontend files: no
.jsextensions on any import - • Backend uses
#/alias (not./src/or../) - • Frontend uses
@/for own src,#/for backend type imports - • Type-only imports use
import type(verbatimModuleSyntax: true) - • No default exports (except framework-required:
App.tsx, config files)
TypeScript
- •
strictcompliance: noany, no non-null assertions without justification - • Zod v4 patterns:
z.uuidv7()notz.string().uuid() - • Zod validation errors typed as
z.core.$ZodIssue[]
Backend endpoints
- • Each endpoint is a
new Hono()sub-app, not a bare handler - • Validation uses
zValidatorfrom#/validator.js, not raw@hono/zod-validator - • Status codes use
StatusCodesenum fromhttp-status-codes, never raw numbers - • Error responses use helpers from
#/extensions.js(notFoundError, etc.) - • Route aggregator in
routes.tsuses.basePath()+.route('/', ...) - • New route registered in
apps/backend/src/app.ts
Database / Drizzle
- • Tables use
pgSchema('<feature>_schema').table(...), notpgTable() - • Primary keys use
uuidcolumn +v7()fromuuidpackage - • Table re-exported from
apps/backend/src/database/schemas.ts - • Zod schemas in
schemas.tsmirror Drizzle columns - • Migration generated if table changed (
npm run database:generate)
Frontend components
- • Data fetching uses
useSuspenseQuery, neveruseQuery - • Triple-layer wrapper present:
QueryErrorResetBoundary>ErrorBoundary>Suspense - • Forms use
Controller+zodResolver, neverregister() - • Form fields use
Field,FieldLabel,FieldErrorfrom@/components/ui/field - • Pages that fetch by ID use inner component pattern
- • Clerk
getToken()passed to every API call - • Pagination via URL search params, not component state
- • Toast notifications via
sonner(toast.success,toast.error) - • Routes registered in
routes.tsx - • Sidebar entry added in
AppSidebar.tsx - • Header title added in
AppHeader.tsx
Tests
- • Uses
node:test(describe,test,assert), not Jest/Vitest/Mocha - • Uses
testClient(app)fromhono/testing, not supertest or raw fetch - • DSL file has: factory functions, overloaded action functions, fluent assertions
- • Action functions are properly overloaded (success vs ProblemDocument)
- • Validation tests use data-driven
testCasesarray pattern - • All test imports use
.jsextension
Formatting and style
- • Prettier-compliant: single quotes, trailing commas, CRLF line endings
- • No unused imports or variables
- • Named exports only
Commit message (if reviewing a commit/PR)
- • Follows Conventional Commits:
<type>(<scope>): <subject> - • Valid scope:
backend,frontend, orrepo - • Subject in sentence-case or lower-case
Output format
code
## Code Review: <scope description> ### Errors (N) 1. `path/to/file.ts:42` -- <description and fix> ### Warnings (N) 1. `path/to/file.ts:15` -- <description and fix> ### Nits (N) 1. `path/to/file.ts:8` -- <description> ### Summary - Errors: N | Warnings: N | Nits: N - Verdict: **PASS** / **NEEDS FIXES**