Your first task
Four common shapes of work and the path each one takes.
Adding a field to an existing feature
Section titled “Adding a field to an existing feature”- Add the column in
packages/db/src/schema.tswithwebSchema.table(). bun run db:generate, read the generated SQL, thenbun run db:migrate:beta.- Widen the Zod input in the tRPC procedure in
packages/core/src/server/trpc/routers/<router>.ts. - Set
updatedAtin the update path. - Surface it in the page or component in
apps/web/src. bun run lint && bun run typecheck.
A new feature domain
Section titled “A new feature domain”New domain means a new tRPC router in
packages/core/src/server/trpc/routers/, registered in the root router. It
follows a fixed shape — Zod schemas, procedure types, logAudit on every
mutation, Sentry capture. The trpc-router skill scaffolds it.
If mobile needs the same domain, add a /v1 route in apps/api/src/v1/routes/
that calls the router through createCaller. Never re-implement the rule.
A new admin page
Section titled “A new admin page”- Router and procedures first (above).
- Page under
apps/web/src/app/(main)/admin/<area>/page.tsx. - Register the path in
PAGE_ACCESSinpackages/core/src/lib/rbac.ts— a 403 on a new admin page is almost always this step being skipped. - Add the nav entry in
AdminLayoutClient.tsx. - Audit-log every mutation.
The admin-crud skill scaffolds the router, page and table together.
A new HTTP endpoint (webhook, cron, upload)
Section titled “A new HTTP endpoint (webhook, cron, upload)”- Handler in
packages/core/src/http/. - Mount it in the
mountsarray inapps/api/src/index.ts. - Only if the web origin must serve it too, add the path to
PROXIED_PREFIXESorPROXIED_EXACTinapps/web/src/proxy.ts.
Shipping it
Section titled “Shipping it”main is production and is never pushed to directly. Branch off beta, PR into
beta, and promote beta → main when it is verified on staging. CI runs
Biome, typecheck, unit tests, the migration-ledger check and audit coverage on
every PR and again before the image is built.
If you work in parallel worktrees, coordinate migration numbers — two branches
both generating 00NN collide in the journal.
