SaasOpportunities Logo
SaasOpportunities

The Best Claude Code Prompts for Building a SaaS MVP

Claude Code is Anthropic's AI-powered CLI that helps you build software through natural language conversations. This prompt library gives you production-ready examples optimized for Claude Code's Explore → Plan → Code → Commit workflow.

CLI Interface
Conversational coding in your terminal. Perfect for focused workflows.
CLAUDE.md Files
Project context that persists across sessions. Like .cursorrules but for Claude.
Slash Commands
Reusable prompt templates stored in .claude/commands/

Why These Prompts Work with Claude Code

Step-by-Step Workflow

Follows Claude Code's recommended Explore → Plan → Code → Commit pattern. Each step waits for your approval before proceeding.

Uses Extended Thinking

Prompts trigger Claude's extended reasoning for better planning and architectural decisions before writing code.

Tool-Aware Prompts

Designed for Claude's file reading, editing, bash execution, and grep tools. Maximizes autonomous capability.

Verification Built-In

Each step includes testing and verification. Claude shows you what it built before moving forward.

What You'll Build with These Prompts

  • Complete database schema with Drizzle ORM
  • Server Actions for all CRUD operations
  • React components with shadcn UI
  • Stripe subscription integration
  • Production-ready deployment to Vercel

Step 1: Add CLAUDE.md File

Create this file in your project root. Claude Code will automatically read it to understand your project structure, coding standards, and common commands.

CLAUDE.md
Project documentation and coding standards for Claude
# SaaS MVP Development Guide

This project is a production-ready SaaS MVP built with modern best practices.

## Tech Stack
- **Frontend**: Next.js 15 (App Router), React, TypeScript (strict mode)
- **Styling**: Tailwind CSS + Shadcn UI components
- **Database**: Supabase (PostgreSQL) with Drizzle ORM
- **Auth**: Kinde Auth
- **Payments**: Stripe (subscriptions)
- **Email**: Resend + @react-email/components
- **Deployment**: Vercel

## Project Structure
```
app/
├── actions/         # Server actions for mutations
├── api/            # API routes (Stripe webhooks, etc.)
├── dashboard/      # Main app dashboard
└── [route]/page.tsx # Pages
components/         # React components
db/
├── schema.ts       # Drizzle schema
└── index.ts        # Database connection
emails/            # Email templates
lib/               # Utility functions
```

## Code Standards

### TypeScript
- Always use strict mode
- No 'any' types - use proper type annotations
- Functional components with hooks
- Interface over type for object shapes

### React/Next.js
- **Server components by default** - only use "use client" when needed:
  - Using state (useState, useReducer)
  - Using effects (useEffect, useLayoutEffect)
  - Event handlers (onClick, onChange, etc.)
  - Browser-only APIs
- Server Actions in `app/actions/` for all mutations
- Call `revalidatePath()` after mutations
- Proper loading states and error handling

### Database (Drizzle ORM)
- snake_case for database columns
- camelCase for TypeScript field names
- Always filter queries by `userId` for security
- Use transactions for multi-step operations
- Include proper foreign keys and indexes
- Generate SQL for Supabase (don't use drizzle-kit push)

### Security
- **CRITICAL**: Every server action MUST check authentication:
  ```typescript
  import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";

  export async function myServerAction() {
    const { getUser } = getKindeServerSession();
    const user = await getUser();

    if (!user) {
      throw new Error("Unauthorized");
    }

    // Filter by userId
    const data = await db.select()
      .from(table)
      .where(eq(table.userId, user.id));
  }
  ```
- Validate all inputs with Zod
- Never expose secrets in client code
- Use environment variables for API keys
- Verify Stripe webhook signatures

### UI/UX
- Mobile-first responsive design
- Use Shadcn UI components (Dialog, Card, Button, Input, Textarea, Badge, Tabs, etc.)
- Loading states for all async operations
- Error boundaries and helpful error messages
- Toast notifications for user feedback
- Professional look (like Stripe or Linear)

### File Naming
- Components: PascalCase (`UserProfile.tsx`)
- Routes: kebab-case (`user-profile/page.tsx`)
- Actions: camelCase (`createPost.ts`)
- Constants: UPPER_SNAKE_CASE

## Common Commands

### Development
```bash
npm run dev          # Start dev server
npm run build        # Build for production
npm run lint         # Run ESLint
```

### Database
```bash
npm run db:generate  # Generate Drizzle migrations
npm run db:push      # Push schema to Supabase
```

### Testing Stripe
Use test cards: `4242 4242 4242 4242` (any future expiry, any CVC)

## Deployment Checklist
- [ ] `npm run build` succeeds with no errors
- [ ] All TypeScript errors fixed
- [ ] Environment variables set in Vercel
- [ ] Kinde callback URLs updated
- [ ] Stripe webhook endpoint configured
- [ ] Database migrations run in production

## Important Notes
- Keep components under 200 lines
- One feature per file
- CRUD operations in server actions only
- Always review AI-generated code before committing
- Test on mobile and desktop

💡 Pro Tip: Hierarchical CLAUDE.md Files

You can create CLAUDE.md files at different levels:

  • ~/.claude/CLAUDE.md - Global defaults for all projects
  • ~/projects/CLAUDE.md - Shared across all projects in this folder
  • ~/projects/my-saas/CLAUDE.md - Specific to this project (most specific wins)

Step 2: Complete SaaS MVP Prompt

This comprehensive prompt walks Claude through building your entire SaaS using the Explore → Plan → Code → Commit workflow. Start Claude Code CLI and paste this prompt.

Complete SaaS MVP Builder
10-step guided workflow for building a complete SaaS
I need you to build a complete, production-ready SaaS MVP called [YOUR_PRODUCT_NAME].

## Product Details
**What it does**: [BRIEF_DESCRIPTION]
**Core problem it solves**: [MAIN_PAIN_POINT]
**Target users**: [WHO_USES_IT]
**Key features**: [LIST_2_4_CORE_FEATURES]

## Build Requirements

Use the **Explore → Plan → Code → Commit** workflow. For each step:
1. Explore relevant files and patterns
2. Create a detailed plan using extended thinking
3. Implement the solution
4. Show me what you built before moving to next step

### Step 1: Database Schema Design

**Explore**: Read the existing `db/schema.ts` file to understand the current schema pattern.

**Plan**: Design the schema for [YOUR_PRODUCT_NAME]:
- Users table: id (varchar 255), email, firstName, lastName, role, createdAt, stripeCustomerId, stripeSubscriptionId, subscriptionStatus, subscriptionEndsAt
- 2-4 custom tables for the core features
- snake_case columns, camelCase TypeScript
- Foreign keys to users.id
- Proper indexes on frequently queried fields

**Code**:
- Update `db/schema.ts` with new tables
- Generate SQL I can run in Supabase (don't use drizzle-kit push)
- Save SQL to a file

**Verify**: Show me the schema and SQL before proceeding.

---

### Step 2: Theme & Branding

**Explore**: Read `app/globals.css` and `components/LandingPageClient.tsx` to understand current styling.

**Plan**:
- Choose 2 Google Fonts that match [YOUR_PRODUCT_NAME] personality
- Select brand colors (primary, secondary, accent) that fit the product
- Draft new landing page copy

**Code**:
- Update `app/globals.css`:
  - Add @import for Google Fonts at top (before @tailwind)
  - Update CSS variables for colors
- Update `components/LandingPageClient.tsx`:
  - New hero headline
  - Feature card copy
  - Relevant Lucide React icons

**Verify**: Show me the color scheme and copy before proceeding.

---

### Step 3: Server Actions for Core Features

For each core feature of [YOUR_PRODUCT_NAME]:

**Explore**: Read existing server actions to understand the pattern.

**Plan**: Design the server actions needed:
- create[Feature](data)
- get[Features](userId)
- update[Feature](id, data)
- delete[Feature](id)

**Code**: Create `app/actions/[feature].ts`:
- Import getKindeServerSession, db, schema
- All functions check authentication
- Validate inputs with Zod
- Filter queries by userId
- Call revalidatePath after mutations
- Proper error handling

**Test**: Run the actions and verify they work.

---

### Step 4: React Components

For each core feature:

**Explore**: Look at existing components to match the style.

**Plan**: Design the component hierarchy:
- Create[Feature]Dialog (form in Dialog)
- [Feature]List (display all items)
- [Feature]Card (single item display)
- [Feature]Stats (summary metrics)

**Code**:
- Use shadcn UI components (Dialog, Card, Button, Input, Textarea, Badge)
- Add "use client" only where needed (forms, dialogs)
- Loading states and error handling
- Mobile responsive
- Call server actions

**Verify**: Test the components in the browser.

---

### Step 5: Dashboard Integration

**Explore**: Read `app/dashboard/page.tsx`.

**Plan**:
- Stats overview at top
- Onboarding for new users (no data yet)
- Main feature sections
- Use Tabs for different views if needed

**Code**:
- Import all feature components
- Fetch data with server actions
- Clean, organized layout
- Mobile responsive

**Test**: Visit /dashboard and verify everything works.

---

### Step 6: Subscription Plans

**Explore**: Check if `lib/subscription.ts` exists.

**Plan**:
- Free plan limits: [DEFINE_LIMITS]
- Plus plan: $49/year, unlimited
- Helper functions: isPlusUser, canAccess[Feature]

**Code**:
- Create `lib/subscription.ts` with helpers
- Create `components/UpgradePrompt.tsx` (Dialog explaining benefits)
- Create `app/pricing/page.tsx` (comparison table)
- Enforce limits in server actions (check plan, return error if limit reached)

**Test**: Try hitting limits as free user.

---

### Step 7: Stripe Integration

**Explore**: Read existing Stripe code if any.

**Plan**:
- Checkout session creation
- Webhook handlers for subscription events
- Customer portal for managing subscriptions

**Code**:
- `app/api/create-checkout-session/route.ts` - create session
- `app/api/webhooks/stripe/route.ts`:
  - Verify webhook signature
  - checkout.session.completed → update user to Plus
  - customer.subscription.updated → handle renewals
  - customer.subscription.deleted → downgrade to Free
- Link pricing page to checkout

**Test**: Test with Stripe test cards (4242 4242 4242 4242).

---

### Step 8: Email Templates

**Explore**: Check `emails/` directory for existing patterns.

**Plan**:
- Welcome email when user signs up
- Subscription confirmation after checkout

**Code**:
- `emails/WelcomeEmail.tsx` with @react-email/components
- `emails/SubscriptionConfirmation.tsx`
- `lib/email.ts` with sendWelcomeEmail, sendSubscriptionConfirmation
- Trigger in webhooks and auth callbacks

**Test**: Trigger emails and check Resend dashboard.

---

### Step 9: Production Preparation

**Explore**: Run `npm run build` to find issues.

**Plan**: Fix all build errors and prepare for deployment.

**Code**:
- Fix all TypeScript errors
- Fix all ESLint warnings
- Create `.env.example` with all required vars
- Verify no hardcoded secrets
- Add comments to complex code

**Test**:
- `npm run build` succeeds
- All features work in production build
- Mobile responsive
- No console errors

---

### Step 10: Final Polish & Testing

**Test Everything**:
- Sign up new user → see onboarding
- Create/edit/delete items → verify CRUD works
- Hit free plan limit → see upgrade prompt
- Checkout with test card → become Plus user
- Verify unlimited access
- Test on mobile and desktop
- Verify emails sent

**Commit**: Create a comprehensive commit with all changes.

## Success Criteria

The MVP is complete when:
- ✅ All CRUD operations work
- ✅ Authentication flow complete
- ✅ Stripe checkout functional
- ✅ Free users hit limits correctly
- ✅ Plus users have unlimited access
- ✅ Emails trigger properly
- ✅ Mobile and desktop responsive
- ✅ Zero TypeScript errors
- ✅ `npm run build` succeeds
- ✅ Ready to deploy to Vercel

Work through each step carefully. After completing each step, show me what you created and ask if you should proceed to the next step. Use your tools to explore, read files, make changes, and test thoroughly.

🚀 How to Use This Prompt

  1. 1. Install Claude Code: curl https://claude.com/install -fsS | bash
  2. 2. Start Claude: claude
  3. 3. Paste the prompt with your product details filled in
  4. 4. Claude will work through each step, showing you progress
  5. 5. Review and approve each step before proceeding
  6. 6. Use /clear between major features to maintain focus

Step 3: Custom Slash Commands (Optional)

Create reusable prompt templates in .claude/commands/. Access them by typing /command-name in Claude Code.

/build-feature
Quickly scaffold a new feature with CRUD operations
<!-- .claude/commands/build-feature.md -->
Build a new feature for this SaaS application.

Ask me:
1. Feature name (e.g., "task management", "team collaboration")
2. Brief description of what it does
3. Main user actions (create, view, edit, delete, etc.)

Then:
1. **Design the schema**: Add table(s) to db/schema.ts
2. **Generate SQL**: Create migration file
3. **Server actions**: Create app/actions/[feature].ts with CRUD operations
4. **Components**: Build Create[Feature]Dialog, [Feature]List, [Feature]Stats
5. **Dashboard**: Integrate into app/dashboard/page.tsx
6. **Test**: Verify everything works

Follow all standards in CLAUDE.md.
/fix-build
Fix all TypeScript and build errors
<!-- .claude/commands/fix-build.md -->
Fix all build errors and TypeScript issues.

Steps:
1. Run `npm run build`
2. Read all errors
3. Fix each error systematically:
   - Missing imports
   - Type errors
   - Unused variables
   - ESLint issues
4. Verify `npm run build` succeeds
5. Show summary of what was fixed
/setup-stripe
Complete Stripe subscription integration
<!-- .claude/commands/setup-stripe.md -->
Set up Stripe subscription payments.

Create:
1. **lib/subscription.ts**:
   - isPlusUser(user)
   - canAccessFeature(user, feature)
   - Free/Plus plan definitions

2. **app/api/create-checkout-session/route.ts**:
   - Create Stripe checkout session
   - Return checkout URL

3. **app/api/webhooks/stripe/route.ts**:
   - Verify webhook signature
   - Handle checkout.session.completed
   - Handle customer.subscription.updated
   - Handle customer.subscription.deleted

4. **app/pricing/page.tsx**:
   - Pricing comparison table
   - Checkout buttons

5. **Enforce limits**:
   - Update server actions to check plan
   - Show upgrade prompts when limit reached

Test with card: 4242 4242 4242 4242
/review-code
Security and quality review of recent changes
<!-- .claude/commands/review-code.md -->
Review recent changes for quality and security.

Check:
1. **Security**:
   - All server actions check authentication
   - Queries filtered by userId
   - No exposed secrets
   - Input validation with Zod

2. **TypeScript**:
   - No 'any' types
   - Proper type annotations
   - No unused variables

3. **React**:
   - "use client" only when needed
   - Proper error handling
   - Loading states

4. **Performance**:
   - Efficient queries
   - Proper indexes
   - No unnecessary re-renders

Provide specific suggestions for improvements.

Pro Tips for Claude Code

  • Use /clear between tasks: Maintains focused context and prevents token bloat
  • Be specific: "Add error handling to createPost function" beats "improve the code"
  • Queue messages: Type multiple prompts and Claude will process them intelligently
  • Visual iteration: Share screenshots of designs and iterate based on feedback
  • Test-first: Ask Claude to write failing tests, then implement to make them pass
  • Course-correct early: Review plans before code to save iteration cycles

Want Pre-Filled Prompts?

These free prompts work for any product. But if you want to save time, we've got you covered:

Validated SaaS Ideas

Browse curated opportunities with pre-filled Claude Code prompts. Just copy, paste, and build.

  • Product details already filled in
  • Database schema designed for you
  • Complete MVP starter code included
Custom Ideas

Have your own idea? Submit it and we'll generate custom Claude Code prompts tailored to your vision.

  • AI analyzes your problem and generates perfect prompts
  • Custom database schema for your specific needs
  • Tailored to your target market and features

$10/month • Pre-filled Claude Code prompts • Complete MVP starter code

More AI Coding Tool Prompts

Google Antigravity

Prompts for Google's agentic development platform with Gemini 3

View prompts →
Cursor

Prompts for Cursor's AI-powered code editor

View prompts →
OpenAI Codex

Prompts for OpenAI o1 and GPT-4o

View prompts →