Org Skills

The full back-end review checklist

Supporting material for backend-code-review. Agents load it on demand; it ships inside the skill folder.

RawSource

Verified 2026-09 against https://cheatsheetseries.owasp.org/, https://www.rfc-editor.org/rfc/rfc9457.html and https://owasp.org/API-Security/editions/2023/en/0x11-t10/.

Work the areas in the order the skill body lists them. Report only what you find; a section with nothing in it needs no line in the output.

1. Correctness

  • Edge cases: empty collection, null, zero, negative, maximum value, duplicate input, Unicode (including combining characters and emoji in length checks), very large payloads.
  • Concurrency
    • Check-then-act across requests (if not exists then insert) → unique constraint, INSERT … ON CONFLICT, or a lock. Two requests will interleave; the test suite will not show it.
    • Read-modify-write → optimistic concurrency with a version column, or SELECT … FOR UPDATE.
    • Shared mutable state in a singleton, static field or module-level object is a race by default.
  • Time: stored and compared in UTC, converted at the edge; an injectable clock rather than DateTime.UtcNow/Date.now() so it is testable; date arithmetic through a date library, never + 86_400, which is wrong across a DST boundary.
  • Money: a decimal type or integer minor units, always with a currency; an explicit rounding mode; never a float or double. 0.1 + 0.2 is a production incident in a billing system.
  • Error handling: specific exception types, no empty catch, no swallowed failure that returns success. A catch that logs and continues needs a comment explaining why continuing is correct.

2. Transactions and idempotency

  • The transaction boundary wraps the whole invariant — not each statement, and not the whole request.
  • No HTTP call, queue publish or file write inside a database transaction. It holds locks for the duration of a network call you do not control.
  • A state change plus a published event needs a transactional outbox, not two independent writes (messaging-patterns).
  • Every consumer, webhook receiver, retried job and retryable POST tolerates a duplicate: a dedupe key, an upsert, or an idempotency-key table.
  • Acknowledge after the effect commits, not before.

3. Security

  • Injection: parameterised queries only. No string-built SQL, shell command, LDAP filter, path or template expression containing user input. An allow-list beats an escape function.
  • Authorization on every path: each new endpoint, handler, GraphQL resolver, admin route and message handler declares its policy. Object-level checks prevent IDOR — scope every lookup by the caller's tenant or ownership, and return 404 rather than 403 so existence does not leak.
  • Mass assignment: reject unknown fields on DTOs that can set roles, prices, statuses or ids.
  • SSRF: a user-supplied URL fetched server-side needs a scheme and host allow-list, and must block private and link-local ranges after DNS resolution — checking the hostname before resolving is bypassed by a record pointing at 169.254.169.254.
  • Deserialization: no polymorphic or type-carrying deserialization of untrusted data (BinaryFormatter, Java native serialization, pickle, YAML load).
  • Secrets: from a secret store or the environment, never in code, config files, fixtures or logs. A secret in a migration or a test fixture is still a leaked secret and needs rotation, not deletion.
  • Crypto: vetted libraries only; passwords with Argon2, bcrypt or scrypt; constant-time comparison for signatures and tokens.
  • Output: no personal data, token or stack trace in a log or in a response to a client.

4. Personal data

  • A new column or event field holding personal data: is it needed, and is it in the data inventory?
  • Is there a deletion path? A "delete my account" request must reach this new table, this cache, this event log and this backup policy — a field added today with no deletion path is a compliance debt nobody will find later.
  • Retention: does anything expire this row, or does it live forever by default?
  • Logs and analytics: personal data must not be in them, including in a URL path that gets logged.

5. Data and migrations

  • Expand / contract, always: add a nullable column or new table → deploy code that writes both → backfill → switch reads → drop the old one in a later release. Never rename or drop in the same deploy that stops using it — the previous version is still running during a rolling deploy.
  • Large tables: no blocking ALTER; CREATE INDEX CONCURRENTLY on Postgres, online DDL elsewhere; backfills in throttled batches; an explicit lock timeout so a migration fails fast instead of queueing every write behind it.
  • New query patterns have supporting indexes; new foreign keys are indexed; unique constraints actually enforce the business rule the code assumes.
  • Migrations are forward-only and re-runnable, or have a tested down path. Details: database-migrations.

6. API and message contracts

  • Breaking without a version: removing or renaming a field, changing a type or format, making an optional field required, tightening validation, changing a status code, a default, or pagination semantics.
  • Errors use the service's standard shape (RFC 9457 problem+json here), with no internals leaked.
  • List endpoints paginate with a server-enforced maximum page size.
  • Event and message schemas evolve additively; consumers ignore unknown fields. Full rules: api-design, messaging-patterns.

7. Resilience

  • A timeout on every outbound call — connect and total. Many client libraries default to infinite, which turns one slow dependency into your outage.
  • Retries only for idempotent operations, with exponential backoff and jitter, capped, and not stacked at several layers (a client retrying three times inside a handler retrying three times is nine calls to a service that is already struggling).
  • A circuit breaker or bulkhead around a dependency that fails often on a hot path; graceful degradation where a non-critical dependency is down.
  • Queue consumers: bounded concurrency, a dead-letter path, and a visibility timeout or lock duration longer than the slowest handler — otherwise the message is redelivered while it is still being processed.

8. Performance

  • N+1: a query inside a loop, a lazy-loaded relation touched during serialisation, or a GraphQL resolver without a data loader.
  • Unbounded queries: no LIMIT, a whole table loaded into memory, an export with no streaming.
  • Blocking I/O on an async path: .Result/.Wait() in .NET, *Sync calls in Node.
  • Caches: does the key include the tenant or user where it should? Is there a TTL and an invalidation path? Is there stampede protection on a hot key?
  • Allocation in hot loops, a regex compiled per call, an unbounded in-memory collection.

Name the symptom and hand the depth to dotnet-performance or nodejs-performance.

9. Observability

  • Structured logs at the right level, one per failure rather than one per retry layer.
  • A correlation or request id that flows through logs, outbound calls and published messages.
  • Metrics for new behaviour: rate, errors, duration. A new dependency with no metric is invisible during the incident it causes.
  • W3C traceparent propagated across HTTP and message headers (service-operability).

10. Tests

  • A test that fails without the change. Ask for it when the change is a bug fix.
  • Assertions on outcomes, not on which mocks were called.
  • Integration tests against a real database or broker for queries, migrations and transactions.
  • The failure paths that this change introduces: timeout, 5xx, duplicate message, concurrent update.
  • Open the tests the description claims exist. An assertion-free test that passes either way is worse than no test, because it buys confidence it has not earned.

11. Dependencies and supply chain

  • A new dependency: maintained, licence compatible (flag GPL and AGPL in a proprietary service), no known advisories, and not a duplicate of something already present.
  • The lockfile is committed and the build installs from it (npm ci, dotnet restore --locked-mode).
  • Audit runs in CI: npm audit signatures for provenance, NuGetAudit for .NET.
  • A version bump in a lockfile-only diff still deserves a look at what changed, especially for anything that touches crypto, parsing or serialisation.

12. Operability and rollout

  • Config validated at start-up; nothing environment-specific hardcoded.
  • Dockerfile: non-root user, no secrets in layers, a pinned base image, exec-form CMD so the process receives SIGTERM.
  • Health probes distinguish liveness from readiness (service-operability).
  • Risky behaviour behind a feature flag, with a stated rollout (canary or percentage) and rollback.
  • Can the previous version run against the new schema and the new message format? If not, the deploy cannot be rolled back, and that is a [blocker] regardless of how good the code is.

13. Serverless specifics

  • Cold start: a heavy dependency graph or a large package in the request path.
  • Concurrency limits, and a database pooler in front — each instance opens its own pool.
  • The handler is idempotent: every serverless platform retries.
  • No in-process background work after the response; the instance may be frozen immediately.
  • No reliance on in-memory state between invocations, including caches and counters.