Claude Templates / S-tier · Foundation
Foundation
The Auth & Onboarding Playbook
Supabase auth, the signup → onboarding wizard, and edge-level account gating.
AUTH-ONBOARDING-PLAYBOOK.md · 10 sections · 1,204 words · 10 KB · markdown
Everything between "stranger hits your site" and "activated user inside the product." Covers Supabase auth wiring, the auto-profile trigger that prevents orphaned accounts, a multi-step onboarding wizard, and the proxy-level auth gate that default-denies your API surface.
What's inside
- //Supabase auth setup with email + OAuth providers
- //The auto-profile database trigger (no orphaned auth.users rows)
- //A multi-step onboarding wizard with resumable step state
- //Account-status gating: trial, active, past_due, cancelled
- //proxy.ts edge auth with an explicit public-route allowlist
When to use it
Week 1, right after infrastructure.
Build these first
Straight from the file
If you keep confirmation disabled, the DB trigger from §4 handles everything. Simpler. Recommended for B2B/SaaS where the cold-email-list signal is the primary conversion event.
Table of contents
- 0. Use this spec
- 1. Architecture
- 2. Schema (Supabase)
- 3. proxy.ts (Edge auth)
- 4. Auto-create profile on signup
- 5. Onboarding wizard pattern
- 6. Account status enforcement
- 7. Email confirmation gotcha (read before configuring)
- 8. Common pitfalls
- 9. Kickoff prompt
How to run it
Drop AUTH-ONBOARDING-PLAYBOOK.md into your repo, then tell Claude Code: “Read AUTH-ONBOARDING-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
App Infrastructure
The mother playbook — the full stack, the topology, and the Week 0 → launch sequence.
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 →