saas-scaffolder
Lays down a Next.js SaaS skeleton (provider-specific deps, env, Drizzle tenancy schema, middleware) and guides auth, billing and tenant isolation. Use when…
от borghei★ 1 250 звёзд на GitHub
Установить saas-scaffolder в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
SaaS Scaffolder
The agent stands up a Next.js App Router + TypeScript + Tailwind + Drizzle SaaS for the chosen auth, billing and tenancy providers, then implements auth, billing and tenant isolation from the reference code and checks isolation before anything ships.
What the tool writes, and what it does not. saas_scaffolder.py writes the file tree, a package.json whose dependencies follow --auth, --db and --payments, a provider-filtered .env.example, a Drizzle schema shaped by --tenancy, drizzle.config.ts, tsconfig.json, next.config.ts, Tailwind v4 PostCSS config, route protection (proxy.ts for Next.js 16+, which replaces middleware.ts; --next-major 15 writes middleware.ts) and a health route. Every other file is a // STUB that names the reference section to implement it from. It does not write application logic, so the result does not build until the stubs are filled.
When to Use
- Starting a new SaaS product, subscription app or multi-tenant platform.
- Standing up auth, billing and tenancy before building product features.
- Adding workspace or organization tenancy with roles and plan gating.
- Auditing an existing app's tenant config or source for isolation leaks (
tenant_config_validator.py).
Clarify First
Before scaffolding, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
- Auth provider: NextAuth (Auth.js v5) / Clerk / Supabase Auth (
--auth; changes dependencies, env and middleware). - Payments provider: Stripe / Lemon Squeezy / none (
--payments; adds or removes billing routes, deps and schema columns). - Tenancy model: workspace / organization / none (
--tenancy; shapes the schema and every query). - Database host: Neon / Supabase / other Postgres (
--db; picks the driver). Only Postgres is supported: the schema usesdrizzle-orm/pg-core.
Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
Workflow
- Scaffold into an empty directory:
saas_scaffolder.py --name <pkg> --auth ... --payments ... --tenancy ... --output <dir>. It refuses a non-empty--outputso it cannot overwrite work. Use--dry-runfirst to show the plan. - Install once and commit the lockfile.
next,reactand Tailwind get^ranges for majors known to be current (Next.js 16, React 19, Tailwind 4); every other dependency uses an npm tag (latest, orbetafornext-auth, whose v5 API the references use), because invented version numbers go stale. The lockfile from that first install is what makes later installs reproducible, so review it and commit it. Auth.js notes it is now part of Better Auth; read its upgrade guide (authjs.dev) before choosing it for a new project. With Auth.js v5,AUTH_URLis optional andAUTH_TRUST_HOST=trueis needed behind a reverse proxy. - Fill the stubs in phase order (foundation, database, auth, billing, UI) from references/workflow-and-quality.md.
grep -rl "STUB generated" .lists what remains. - Validate isolation: run
tenant_config_validator.py --src <app dir>. Fix every critical finding; unscoped queries are cross-tenant data leaks. - Done when:
npm run buildpasses, noSTUB generatedfiles remain, a test checkout updates the subscription row, a replayed webhook is a no-op, and the validator reports no critical findings.
Quick Start
# from engineering/saas-scaffolder/; scaffold outside the repo
OUT=$(mktemp -d)
python3 scripts/saas_scaffolder.py --name acme --auth clerk --payments none --tenancy none --output "$OUT/acme"
python3 scripts/saas_scaffolder.py --name acme --dry-run --format json # plan only, nothing written
python3 scripts/tenant_config_validator.py --config assets/sample_tenant_config.json # exit 0
python3 scripts/tenant_config_validator.py --config assets/flawed_tenant_config.json --src assets/flawed_src # exit 1, 5 critical
python3 scripts/feature_flag_manager.py --store "$OUT/flags.json" create --key sso --enabled --allowed-plans pro enterprise
python3 scripts/feature_flag_manager.py --store "$OUT/flags.json" evaluate --key sso --plan free # INACTIVE
Tools Overview
| Tool | Purpose | Key flags | Exit codes |
|---|---|---|---|
scripts/saas_scaffolder.py |
Tree, provider-specific package.json, .env.example, schema, configs, proxy.ts (or middleware.ts); stubs for the rest |
--name, --auth nextauth|clerk|supabase, --db neondb|supabase|postgres, --payments stripe|lemonsqueezy|none, --tenancy workspace|organization|none, --features a,b, --next-major 16, --output, --dry-run, --format json |
0 done; 2 invalid name or non-empty output |
| `scripts/tenant_c |
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- assets/flawed_src/projects-route.ts
- assets/flawed_tenant_config.json
- assets/sample_tenant_config.json
- references/auth-billing-and-tenancy.md
- references/project-structure-and-schema.md
- references/workflow-and-quality.md
- scripts/feature_flag_manager.py
- scripts/saas_scaffolder.py
- scripts/tenant_config_validator.py
FAQ
Что делает скилл saas-scaffolder?
Lays down a Next.js SaaS skeleton (provider-specific deps, env, Drizzle tenancy schema, middleware) and guides auth, billing and tenant isolation. Use when starting a SaaS, subscription app or multi-tenant platform.
Как установить скилл saas-scaffolder?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл saas-scaffolder запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…