Manage — Generates complete, production-ready SaaS project boilerplate including authentication, database schemas, billing integration, API routes, and a working dashboard using Next.js 14+
Manage — Generates complete, production-ready SaaS project boilerplate including authentication, database schemas, billing integration, API routes, and a working dashboard using Next.js 14+
[{"name":"code_or_task","type":"string","description":"Code snippet, script, or task description to process","required":true},{"name":"context","type":"string","description":"Additional context or background information","required":false}]
output_schema
[{"name":"result","type":"string","description":"Generated or refactored code output"},{"name":"explanation","type":"string","description":"Explanation of changes or implementation decisions"}]
SaaS Scaffolder
Tier: POWERFUL Category: Product Team Domain: Full-Stack Development / Project Bootstrapping
The following phases must be completed in order. Validate at the end of each phase before proceeding.
Phase 1 — Foundation
1. Next.js initialized with TypeScript and App Router
2. Tailwind CSS configured with custom theme tokens
3. shadcn/ui installed and configured
4. ESLint + Prettier configured
5. .env.example created with all required variables
✅ Validate: Run npm run build — no TypeScript or lint errors should appear.
🔧 If build fails: Check tsconfig.json paths and that all shadcn/ui peer dependencies are installed.
Phase 2 — Database
6. Drizzle ORM installed and configured
7. Schema written (users, accounts, sessions, verification_tokens)
8. Initial migration generated and applied
9. DB client singleton exported from lib/db.ts
10. DB connection tested in local environment
✅ Validate: Run a simple db.select().from(users) in a test script — it should return an empty array without throwing.
🔧 If DB connection fails: Verify DATABASE_URL format includes ?sslmode=require for NeonDB/Supabase. Check that the migration has been applied with drizzle-kit push (dev) or drizzle-kit migrate (prod).
14. Session callback adds user ID and subscription status
15. Middleware protects dashboard routes
16. Login and register pages built with error states
✅ Validate: Sign in via OAuth, confirm session user has id and subscriptionStatus. Attempt to access /dashboard without a session — you should be redirected to /login.
🔧 If sign-out loops occur in production: Ensure NEXTAUTH_SECRET is set and consistent across deployments. Add declare module "next-auth" to extend session types if TypeScript errors appear.
Phase 4 — Payments
17. Stripe client initialized with TypeScript types
18. Checkout session route created
19. Customer portal route created
20. Stripe webhook handler with signature verification
21. Webhook updates user subscription status in DB idempotently
✅ Validate: Complete a Stripe test checkout using a 4242 4242 4242 4242 card. Confirm stripeSubscriptionId is written to the DB. Replay the checkout.session.completed webhook event and confirm idempotency (no duplicate DB writes).
🔧 If webhook signature fails: Use stripe listen --forward-to localhost:3000/api/webhooks/stripe locally — never hardcode the raw webhook secret. Verify STRIPE_WEBHOOK_SECRET matches the listener output.
Phase 5 — UI
22. Landing page with hero, features, pricing sections
23. Dashboard layout with sidebar and responsive header
24. Billing page showing current plan and upgrade options
25. Settings page with profile update form and success states
✅ Validate: Run npm run build for a final production build check. Navigate all routes manually and confirm no broken layouts, missing session data, or hydration errors.
Reference Files
For additional guidance, generate the following companion reference files alongside the scaffold:
PITFALLS.md — Common failure modes: missing NEXTAUTH_SECRET, webhook secret mismatches, Edge runtime conflicts with Drizzle, unextended session types, and migration strategy differences between dev and prod.
BEST_PRACTICES.md — Stripe singleton pattern, server actions for form mutations, idempotent webhook handlers, Suspense boundaries for async dashboard data, server-side feature gating via stripeCurrentPeriodEnd, and rate limiting on auth routes with Upstash Redis + @upstash/ratelimit.
Why This Skill Exists
Manage — Generates complete, production-ready SaaS project boilerplate including authentication, database schemas, billing integration, API routes, and a working dashboard using Next.js 14+
When to Use
Use this skill when the task requires saas scaffolder capabilities.
What If Fails
If this skill fails to produce the expected output: (1) verify input completeness, (2) retry with more specific context, (3) fall back to the parent workflow without this skill.