Stack Contract
This page is the contract. If another page is more detailed, use this page to resolve defaults.
Documentation Rules
Section titled “Documentation Rules”- The Fenod Stack Handbook is the canonical documentation surface.
- English is the Source Locale unless a page explicitly says otherwise.
- Major guides should follow the Guide Shape: Default Path, Gotchas, Agent Notes, and Related Guides.
- Recipes should be Implementation Recipes: exact tools, file locations, commands, gotchas, and verification.
- Diagrams should be Decision Diagrams: useful for boundaries, flows, lifecycle loops, and decision maps.
- Node 24 for new projects; Node 22 only for existing projects until migration
- pnpm
- TanStack Start for full-stack apps
- Astro/Starlight for docs and content-heavy sites
- Hono + ORPC for APIs
- Drizzle 0.44.x stable + D1 for relational data; do not upgrade client work to Drizzle v1 RC yet
- Better Auth latest 1.6.x for authentication
- Tailwind v4 + shadcn/ui for UI foundations
- TanStack Query/Router/Form/Table where relevant
- TanStack AI for app-level chat, tools, streaming, and agent state
- Cloudflare AI Gateway for provider routing, budgets, and stored keys
- Cloudflare Workers as the default runtime for new apps and dynamic sites
- Cloudflare Workers Static Assets for new static/docs/content sites when starting fresh
- Cloudflare Pages only for existing connected docs/static projects where the GitHub integration is already the simplest path
- R2 for files
- KV for config/cache, not relational data
- Queues/Workflows for async jobs
- Durable Objects for stateful coordination
- Wrangler for deploys by default; Alchemy v2 only for multi-resource/multi-stage projects (see Deployment)
- Infisical or Bitwarden Secrets Manager for secrets
- Vite 8 + Rolldown for new projects;
rolldown-viteonly as a Vite 7 migration bridge - Ultracite + tsgo + Vitest + Playwright for quality gates
- tsdown for internal package builds
Do Not Use By Default
Section titled “Do Not Use By Default”- npm/yarn instead of pnpm
- Prisma instead of Drizzle
- Postgres unless explicitly requested
- Express when Hono fits
- tRPC when ORPC is the stack choice
- Clean/hexagonal architecture ceremony for small apps
- repository interfaces around Drizzle without real pain
- raw Cloudflare Global API Key
- broad account-scoped deploy tokens
- plaintext
.envfiles in Git - provider keys in client-side code
- unreviewed major upgrades of auth/RPC/ORM packages
- Drizzle v1 RC on client projects before the stable migration plan is written
- Vercel AI SDK for new app code unless an unsupported workflow requires it
Architecture Rule
Section titled “Architecture Rule”Use feature slices:
packages/api/src/routers/{feature}/├── index.ts├── router.ts└── service.tsRouters validate and expose contracts. Services hold business logic and call Drizzle directly.
Verification Rule
Section titled “Verification Rule”Before declaring work done, run the smallest relevant ladder:
pnpm lintpnpm typecheckpnpm testpnpm buildFor UI changes, verify in a browser. For production-impacting changes, require explicit approval and auditability.