supastarter
Supastarter
Use this skill when you need to change or extend a Supastarter-based Next.js SaaS app and you want the implementation to match the real codebase instead of generic boilerplate patterns.
What this skill gives you
- the actual monorepo structure used by this project
- the real App Router layout and provider chain
- the exact oRPC + Better Auth + Prisma patterns used in production code
- grounded references for payments, organizations, settings, onboarding, marketing, mail, storage, analytics, and deployment
- task-specific guides for adding endpoints, pages, models, and billing flows
How to use this skill
Keep this file lean and use the reference docs on demand.
Default workflow
- Read the brief and classify the change:
- setup/config
- routing/layout
- API/backend
- auth/organizations
- database/payments
- UI/forms
- marketing/content
- deployment
- Open the matching reference files from the lists below.
- Copy the existing pattern instead of inventing a new one.
- Prefer the task guides in
references/tasks/when the request is implementation-oriented. - Use the cheatsheets for commands, imports, file locations, and env vars.
Start here first
If you are new to the codebase, read these in order:
references/setup/monorepo-structure.mdreferences/setup/import-conventions.mdreferences/setup/config-feature-flags.mdreferences/conventions/typescript-patterns.mdreferences/conventions/component-patterns.mdreferences/cheatsheets/file-locations.md
That gives you the repo shape, imports, config switches, TS/component conventions, and where new files belong.
Quick architecture map
App structure
apps/web— Next.js App Router apppackages/api— Hono + oRPC API surfacepackages/auth— Better Auth setuppackages/database— Prisma schema, client, queries, generated artifactspackages/payments— billing config, provider abstraction, Stripe implementationpackages/mail— email rendering and deliverypackages/storage— S3-compatible signed URLspackages/ui— reusable UI components
Route groups
- marketing pages live under
apps/web/app/(marketing)/[locale] - protected product routes live under
apps/web/app/(saas) /app/**gets the full SaaS provider + guard chain
For the actual nesting and providers, read:
references/routing/routing-marketing.mdreferences/routing/routing-saas.mdreferences/routing/layout-chain.mdreferences/routing/access-guards.mdreferences/routing/providers-document.mdreferences/routing/middleware-proxy.md
Reference map by task
Setup, repo shape, and conventions
Read these when you need global orientation or project-wide rules:
references/setup/environment-setup.mdreferences/setup/monorepo-structure.mdreferences/setup/import-conventions.mdreferences/setup/config-feature-flags.mdreferences/setup/next-config.mdreferences/setup/tooling-biome.mdreferences/conventions/naming.mdreferences/conventions/typescript-patterns.mdreferences/conventions/component-patterns.mdreferences/conventions/code-review-checklist.md
Use the cheatsheets when you need a fast answer:
references/cheatsheets/commands.mdreferences/cheatsheets/imports.mdreferences/cheatsheets/file-locations.mdreferences/cheatsheets/env-vars.md
Routing, layouts, guards, and shell
Read these when the task involves pages, providers, redirects, auth gates, or dashboard chrome:
references/routing/routing-marketing.mdreferences/routing/routing-saas.mdreferences/routing/layout-chain.mdreferences/routing/access-guards.mdreferences/routing/providers-document.mdreferences/routing/middleware-proxy.md
API work
Read these when adding or changing backend procedures or client integrations:
references/api/overview.mdreferences/api/procedure-tiers.mdreferences/api/root-router.mdreferences/api/transport-handlers.mdreferences/api/next-route-bridge.mdreferences/api/client-integration.mdreferences/api/contact-module.mdreferences/api/payments-organizations-modules.md
Authentication and session behavior
Read these when changing login, signup, session access, org invitations, or auth feature flags:
references/auth/overview.mdreferences/auth/better-auth-config.mdreferences/auth/feature-flags.mdreferences/auth/client-auth-client.mdreferences/auth/server-session-helpers.mdreferences/auth/session-hook-provider.mdreferences/auth/login-flow.mdreferences/auth/signup-invitations.md
Database and query layer
Read these before touching schema, Prisma client usage, or shared queries:
references/database/schema-overview.mdreferences/database/prisma-client.mdreferences/database/query-patterns.mdreferences/database/users-organizations-purchases.mdreferences/database/generation-exports.md
Payments and billing
Read these when changing plans, checkout flows, customer IDs, Stripe logic, or purchase resolution:
references/payments/plans-config.mdreferences/payments/provider-abstraction.mdreferences/payments/stripe-provider.mdreferences/payments/customer-ids.mdreferences/payments/checkout-and-portal-flow.mdreferences/payments/webhook-flow.md
Organizations, onboarding, and settings
Read these for multi-tenant UX and post-signup flows:
references/organizations/active-organization-context.mdreferences/organizations/organization-select.mdreferences/organizations/create-organization-form.mdreferences/organizations/members-and-invitations.mdreferences/onboarding/onboarding-flow.mdreferences/onboarding/onboarding-step-one.mdreferences/settings/account-settings.mdreferences/settings/billing-security-and-avatar.mdreferences/hooks/auth-hooks.mdreferences/hooks/organization-hooks.mdreferences/hooks/consent-hooks.md
UI, forms, analytics, and client patterns
Read these when building interactive client components:
references/ui/components.mdreferences/ui/forms.mdreferences/ui/theme-tokens.mdreferences/ui/styling-patterns.mdreferences/ui/feedback-overlays.mdreferences/patterns/form-with-zod.mdreferences/patterns/react-query-orpc.mdreferences/patterns/server-prefetch.mdreferences/patterns/organization-scoped-page.mdreferences/patterns/direct-upload-s3.mdreferences/analytics/provider-overview.mdreferences/analytics/consent-flow.mdreferences/ai/models-and-exports.mdreferences/ai/prompt-helpers.md
Mail, i18n, storage, marketing, and deployment
Read these when the feature crosses user communication, localization, content, assets, or infra:
references/mail/send-email.mdreferences/mail/template-rendering.mdreferences/mail/email-templates.mdreferences/mail/providers.mdreferences/i18n/setup.mdreferences/i18n/messages-loading.mdreferences/i18n/locale-routing.mdreferences/storage/bucket-config.mdreferences/storage/s3-provider.mdreferences/storage/signed-urls.mdreferences/marketing/home-page-components.mdreferences/marketing/content-collections.mdreferences/marketing/pages.mdreferences/deployment/environment-checklist.mdreferences/deployment/local-services.mdreferences/deployment/vercel.mdreferences/logging.mdreferences/utils.md
Use the task guides for implementation requests
If the user asks you to add something concrete, start here:
- Add an API endpoint:
references/tasks/add-api-endpoint.md - Add a SaaS page:
references/tasks/add-saas-page.md - Add a marketing page:
references/tasks/add-marketing-page.md - Add a database model:
references/tasks/add-database-model.md - Integrate billing:
references/tasks/integrate-payments.md
These task guides point back to the underlying references and actual file locations.
Common decision rules
When changing UI
- default to server components
- add
"use client"only when hooks/browser APIs are required - use the existing form stack:
react-hook-form+zod+ shared form components - use deep UI imports such as
@repo/ui/components/button
Read:
references/conventions/component-patterns.mdreferences/ui/forms.mdreferences/ui/components.mdreferences/ui/styling-patterns.md
When changing backend/API
- procedures live in
packages/api/modules/* - route them through the module router and then the root router
- validate inputs with Zod
- use
publicProcedure,protectedProcedure, oradminProceduredeliberately
Read:
references/api/procedure-tiers.mdreferences/api/root-router.mdreferences/api/transport-handlers.mdreferences/tasks/add-api-endpoint.md
When changing auth or organizations
- check auth feature flags first
- match Better Auth plugin usage already in the repo
- treat org-aware and account-aware routes differently
- reuse session and active-organization helpers before inventing new hooks
Read:
references/auth/feature-flags.mdreferences/auth/server-session-helpers.mdreferences/organizations/active-organization-context.mdreferences/routing/access-guards.md
When changing data or billing
- schema changes start in
schema.prisma - query helpers belong in
packages/database/prisma/queries - billing behavior flows through payments config, provider abstraction, and API procedures
Read:
references/database/schema-overview.mdreferences/database/query-patterns.mdreferences/payments/plans-config.mdreferences/payments/stripe-provider.mdreferences/tasks/add-database-model.mdreferences/tasks/integrate-payments.md
High-signal pitfalls
- Do not import shared packages through deep relative paths; use aliases from
references/setup/import-conventions.md. - Do not invent a new form approach; match
references/ui/forms.mdandreferences/patterns/form-with-zod.md. - Do not bypass the oRPC layer with ad hoc handlers unless the task explicitly requires it.
- Do not put Prisma calls directly into app components if a shared query helper pattern already exists.
- Do not guess where files belong; check
references/cheatsheets/file-locations.mdfirst. - Do not hardcode env assumptions; check
references/setup/environment-setup.mdandreferences/cheatsheets/env-vars.md.
Minimal reading sets
Use these smaller bundles when you need speed:
“I need to add one protected API procedure”
Read:
references/tasks/add-api-endpoint.mdreferences/api/procedure-tiers.mdreferences/api/root-router.mdreferences/auth/server-session-helpers.mdreferences/database/query-patterns.md
“I need to add one new dashboard page”
Read:
references/tasks/add-saas-page.mdreferences/routing/routing-saas.mdreferences/routing/access-guards.mdreferences/routing/middleware-proxy.mdreferences/organizations/active-organization-context.md
“I need to add one new marketing page or content page”
Read:
references/tasks/add-marketing-page.mdreferences/routing/routing-marketing.mdreferences/marketing/pages.mdreferences/marketing/content-collections.md
“I need to change auth UI or signup/login behavior”
Read:
references/auth/overview.mdreferences/auth/login-flow.mdreferences/auth/signup-invitations.mdreferences/auth/feature-flags.mdreferences/mail/email-templates.md
“I need to touch billing or subscriptions”
Read:
references/payments/plans-config.mdreferences/payments/customer-ids.mdreferences/payments/stripe-provider.mdreferences/payments/webhook-flow.mdreferences/settings/billing-security-and-avatar.md
Final reminder
This skill is intentionally split into many small reference files. Do not load everything blindly. Start with the smallest relevant bundle above, then expand into neighboring references only when the task actually needs them.