CLAUDE.md TemplatesCLAUDE.md Template

CLAUDE.md Template: Production Planning SaaS — CLAUDE.md template for Next.js TS Supabase Clerk Stripe

CLAUDE.md Template: Production Planning SaaS stack — CLAUDE.md template with Next.js TS Supabase Clerk Stripe, AI scheduling, capacity planning, and order tracking.

CLAUDE.md templateProduction Planning SaaSNext.jsTypeScriptSupabaseClerkStripeAI schedulingcapacity planningorder trackingClaude Code

Target User

Developers building a Production Planning SaaS with Next.js, TypeScript, Supabase, Clerk, Stripe, AI scheduling, capacity planning, and order tracking.

Use Cases

  • Bootstrap a production planning SaaS with a hands-on CLAUDE.md template
  • Define Claude Code for AI assisted scheduling and capacity planning
  • Secure multi-tenant auth and billing with Clerk and Stripe
  • Launch features for AI scheduling and real-time order tracking

Markdown Template

CLAUDE.md Template: Production Planning SaaS — CLAUDE.md template for Next.js TS Supabase Clerk Stripe

# CLAUDE.md
Project role: Lead Full-Stack Engineer building a production planning SaaS with Next.js TypeScript Supabase Clerk Stripe AI scheduling capacity planning and order tracking

Architecture rules:
- Use Next.js app router with TypeScript
- Use Supabase as the primary database and authentication layer
- Clerk handles user authentication and session management
- Stripe handles customer billing and subscriptions
- AI scheduling module integrates with internal scheduling services
- All data flows are real time where feasible via Supabase realtime

File structure rules:
- Keep code under src
- Use apps for Next.js apps
- Separate domains into features scheduling capacity orders and auth
- Use shared lib for utilities and API clients

Authentication rules:
- Enforce multi tenant isolation at database layer
- Use Clerk for all user sign in sign up and session management
- Validate tokens server side before allowing sensitive operations

Database rules:
- Supabase Row Level Security policies
- No private data exposed to clients without authorization
- Use secure database roles and restricted service role access on server

Validation rules:
- Validate inputs with strict schemas before any operation
- Use defensive programming to avoid partial writes
- Provide meaningful error messages to the client

Security rules:
- Never expose secret keys in client code
- Use environment variables configured per deployment
- Enforce TLS and secure cookies
- Audit trails for critical actions

Testing rules:
- Unit tests for UI components and hooks
- Integration tests for API routes and Supabase interactions
- End to end tests for AI scheduling and Stripe webhooks

Deployment rules:
- Deploy to provider with CI CD
- Configure environment variables in each env
- Use preview deployments for PRs

Things Claude must not do:
- Do not access production secrets directly in prompts
- Do not mutate production data without validation
- Do not bypass auth and RBAC checks
- Do not hardcode API keys in code blocks

Overview

CLAUDE.md template for a complete Production Planning SaaS. This page focuses on a stack that uses Next.js with TypeScript, Supabase for data and auth, Clerk for user management, Stripe for payments, and AI scheduling capable of machine capacity planning and order tracking. The template provides a copyable CLAUDE.md block and stack-specific guidance to accelerate a production planning product.

Direct answer: This CLAUDE.md template delivers a concrete Claude Code blueprint to bootstrap a production planning SaaS with the exact stack listed, including architecture rules, file layout, security patterns, and deployment considerations.

When to Use This CLAUDE.md Template

  • Starting a production planning SaaS with Next.js and TS where AI scheduling improves scheduling efficiency.
  • Integrating capacity planning and order tracking on a unified platform using Supabase as the data backbone.
  • Establishing robust auth and billing with Clerk and Stripe in a multi-tenant environment.
  • Creating a repeatable CLAUDE.md workflow to onboard new engineers quickly.

Copyable CLAUDE.md Template

# CLAUDE.md
Project role: Lead Full-Stack Engineer building a production planning SaaS with Next.js TypeScript Supabase Clerk Stripe AI scheduling capacity planning and order tracking

Architecture rules:
- Use Next.js app router with TypeScript
- Use Supabase as the primary database and authentication layer
- Clerk handles user authentication and session management
- Stripe handles customer billing and subscriptions
- AI scheduling module integrates with internal scheduling services
- All data flows are real time where feasible via Supabase realtime

File structure rules:
- Keep code under src
- Use apps for Next.js apps
- Separate domains into features scheduling capacity orders and auth
- Use shared lib for utilities and API clients

Authentication rules:
- Enforce multi tenant isolation at database layer
- Use Clerk for all user sign in sign up and session management
- Validate tokens server side before allowing sensitive operations

Database rules:
- Supabase Row Level Security policies
- No private data exposed to clients without authorization
- Use secure database roles and restricted service role access on server

Validation rules:
- Validate inputs with strict schemas before any operation
- Use defensive programming to avoid partial writes
- Provide meaningful error messages to the client

Security rules:
- Never expose secret keys in client code
- Use environment variables configured per deployment
- Enforce TLS and secure cookies
- Audit trails for critical actions

Testing rules:
- Unit tests for UI components and hooks
- Integration tests for API routes and Supabase interactions
- End to end tests for AI scheduling and Stripe webhooks

Deployment rules:
- Deploy to provider with CI CD
- Configure environment variables in each env
- Use preview deployments for PRs

Things Claude must not do:
- Do not access production secrets directly in prompts
- Do not mutate production data without validation
- Do not bypass auth and RBAC checks
- Do not hardcode API keys in code blocks

Recommended Project Structure

production-planning-saas/
├── package.json
├── next.config.js
├── tsconfig.json
├── public/
└── src/
    ├── app/
    │   ├── page.tsx
    │   └── ...
    ├── components/
    ├── features/
    │   ├── scheduling/
    │   ├── capacity/
    │   └── orders/
    ├── lib/
    │   ├── supabase.ts
    │   └── stripe.ts
    ├── services/
    │   ├── ai/
    │   └── billing/
    └── utils/

Core Engineering Principles

  • Design for multi-tenant scale with strict data isolation
  • Data first: real time updates via Supabase and robust APIs
  • Security by default: enforce RBAC, validation, and encrypted secrets
  • DX oriented: clear interfaces, predictable file structure, reproducible builds
  • Explicit boundary between server and client logic
  • Observability: structured logging, metrics, and error handling

Code Construction Rules

  • Use TypeScript with strict mode and precise types for API contracts
  • Leverage Next.js App Router with server components where possible
  • Centralize API clients in a single lib layer (supabase.ts stripe.ts)
  • Validate all inputs with strict schemas before processing
  • Keep feature boundaries explicit and avoid cross cutting state leaks
  • Do not introduce direct client secrets in front end

Security and Production Rules

  • Implement Row Level Security in Supabase and tenant aware endpoints
  • Store secrets in environment variables; never in code
  • Use Stripe webhooks with signature verification
  • Enable TLS, secure cookies, and strict CORS policies
  • Audit critical actions and maintain immutable logs

Testing Checklist

  • Unit tests for UI components and hooks
  • API integration tests for Supabase interactions
  • End to end tests for AI scheduling flows and Stripe webhooks
  • Load and performance tests for capacity planning computations

Common Mistakes to Avoid

  • Ignoring multi tenancy in data models and policies
  • Over exposing secrets or keys to client bundles
  • Skipping Stripe webhook verification tests
  • Hardcoding endpoints or credentials in CLAUDE.md blocks

Related implementation resources: AI Use Case for Carpentry Shops Using Inventory Tools To Track Wood Stock Levels and Auto-Order Common Sizes and Skill Files for PMs: Building Realistic Clickable SaaS Demos with CLAUDE.md Templates.

FAQ

What is this CLAUDE.md Template for?
A ready to edit Claude Code blueprint for a Production Planning SaaS using Next.js TS Supabase Clerk Stripe with AI scheduling and capacity planning.
Which tech stack does this cover?
Next.js App Router with TypeScript, Supabase for data and auth, Clerk for authentication, Stripe for billing, and AI scheduling with capacity planning and order tracking.
What should I paste into CLAUDE.md?
Copy the CLAUDE.md template block exactly as shown and adapt project specific details like project role file structure and service endpoints.
Does this include deployment guidance?
Yes. It includes deployment rules for Vercel or similar hosting, environment variables, and CI CD considerations.
How do I test the templates?
The template provides unit and integration checks, end to end flow verification for AI scheduling, and Stripe webhooks testing.
Is security covered?
Yes. It includes authentication authorization data validation and secure API patterns for multi tenant use.