---
metadata:
  author: "RJ Lindelof (https://rjl.dev/)"
  source: "https://techdebt.guru/multi-agent-code-review/"
  version: "1.0"
  updated: "2026-12-04"
  copyright: "(c) 2026 RJ Lindelof. Free to copy, adapt and share; no attribution needed."
---

# Stack pack template

A pack is a short file of known traps for one stack - the things your team has been bitten by,
written down so every lens checks for them. Keep one pack per stack in the skill's `packs/`
folder (`packs/typescript-node-api.md`, `packs/react-web.md`, `packs/python-django.md`...). The
orchestrator picks packs by detecting the stack (or from the profile's `stack:` list) and passes
their paths to every lens.

Rules for a good pack:
- Only traps that are specific to this stack or this codebase. "Write tests" is not a trap.
- Every line is checkable: a reviewer can look at code and say yes or no.
- When a trap came from a real incident, say so in a few words - lenses weigh those higher.
- Keep it under about 40 lines. Long packs get skimmed.

---

# Pack: <stack name>

<One or two lines: what this stack is in this repo and where it runs (for example "Node 22
TypeScript API, deployed as containers behind a load balancer; jobs run on a queue worker").>

## Correctness traps
- <for example: Dates are stored in UTC; any `new Date(string)` on a date-only string shifts a day
  for users west of UTC. Use the date helpers in src/lib/dates.ts.>
- <for example: The ORM's `findOne` returns null, not an exception; every caller must handle null.>
- <for example: `Array.prototype.sort()` without a comparator sorts numbers as strings.>

## Resilience traps
- <for example: Queue messages are delivered at least once; every handler must be idempotent
  (incident: duplicate refunds, March).>
- <for example: Outbound HTTP calls go through src/lib/http.ts, which sets a timeout; a bare fetch
  has none.>

## Security traps
- <for example: Every route under /api/admin must call requireRole('admin') before any work.>
- <for example: Raw SQL is only allowed through the tagged template in src/db/sql.ts.>

## Required steps
- <for example: A new environment variable is added to .env.example and to the deploy config in
  the same change.>
- <for example: A schema change ships with a migration and a rollback.>

## Tests
- <for example: API tests use the in-memory database helper; never a shared dev database.>
- <for example: Front-end tests run in one browser engine in CI; no live third-party calls.>
