Templates
Node or Bun API
For Node and Bun services. Access control comes first, and env vars are checked because they break deploys.
- Kind: Code review
- Category: By project type
- Added to new projects: No
Checklists, in order
- Correctness: Logic errors, missing awaits, off-by-one, empty and null cases, races.
- Access control: Whether each new route or handler checks who may call it, including who owns the IDs it takes, tenant isolation and roles.
- Security: Secrets, injection, unchecked input, weaker auth, unsafe workflow changes.
- What else it can break: Callers, exports and configs elsewhere in the repo that the change didn't update.
- Database migrations: Migrations that lock tables, lose data or break the running version, and hand-written ones where the repo generates them.
- Schema and migration in step: A schema file changed with no migration in the same pull request, or a migration with no schema change.
- Failure handling: Timeouts on network calls, retries only on work that is safe to repeat, cleanup on error and partial writes.
- Performance: N+1 queries, awaits in loops, unbounded queries or lists and slow work in hot paths and renders.
- Personal data and logs: Personal data, tokens or payment data sent to logs, analytics, error reports or URLs.
- Logs and metrics: New failure paths nobody would see, noisy logs in hot paths and lost trace or request IDs.
- Config and env vars: New env vars or config keys missing from the example env file, the docs or the config schema.
- Tests: Changed behaviour without a test, or a test that can never fail.
- Dependencies: Added, removed and upgraded packages, major bumps, packages in the wrong dependency list and packages nothing imports.
- Known vulnerabilities: Added or changed package versions with a published security advisory.
- Secrets: Keys, tokens and private keys in added lines.
Last updated on