Claude Templates / S-tier · Foundation
Foundation
The App Infrastructure Playbook
The mother playbook — the full stack, the topology, and the Week 0 → launch sequence.
APP-INFRASTRUCTURE-PLAYBOOK.md · 12 sections · 3,757 words · 29 KB · markdown
This is the first file you hand Claude when you say "build me a new app." It defines the entire stack — Vercel, Supabase, Trigger.dev, GitHub — the deployment topology, every environment variable, and the order the other playbooks get executed in. Everything else in this library assumes this one ran first.
What's inside
- //The locked stack and why each piece was chosen over the alternatives
- //Week 0 bootstrap: repo, domain, Vercel project, Supabase project, env wiring
- //The full env-var table with which service each key lives in
- //Architectural rules that are non-negotiable (no federated auth, workers for anything over 60s)
- //The execution order for every other playbook in the library
- //An anti-pattern list drawn from real deploys that broke
When to use it
Day 1. Before any code.
Build these first
Nothing. This one stands alone.
Straight from the file
When you say "I want to launch a new app," this is the first thing the agent reads. It explains the full stack, the deployment topology, the bootstrapping sequence (Week 0 → Launch), and points to every other tier-S/A/B/C playbook in the order they should be executed.
Table of contents
- 0. Use this spec
- 1. The stack (canonical)
- 2. Deployment topology
- 3. Bootstrapping sequence (Week 0)
- 4. Reference repo structure (mirror BKE)
- 5. The build sequence (order of operations)
- 6. Environment variables checklist
- 7. Hard architectural rules (locked-in decisions across all apps)
- 8. Common pitfalls (from BKE lab notes)
- 9. Agent kickoff prompt (paste into Claude when launching a new app)
- 10. Reference files in BKE (every key pattern)
- 11. Cross-reference index
How to run it
Drop APP-INFRASTRUCTURE-PLAYBOOK.md into your repo, then tell Claude Code: “Read APP-INFRASTRUCTURE-PLAYBOOK.md and implement it in this codebase.” It's written for an agent to execute end to end. Search the file for angle-bracket placeholders and swap in your own project names, domains, and keys before the first run.
More foundation playbooks
Auth & Onboarding
Supabase auth, the signup → onboarding wizard, and edge-level account gating.
Read + download →S-tierStripe Billing
Customer linkage, plan tiers, a webhook handler that survives replays, and checkout.
Read + download →S-tierCredit Metering
A credit ledger, atomic spend RPC, refund-on-failure, and cost analytics that hold up.
Read + download →