LogoLaunchSaaS

AI-Assisted Development

Guide for using AI coding tools (Claude Code, Cursor, GitHub Copilot) to develop with LaunchSaaS

LaunchSaaS ships with a layered agent documentation structure that AI coding tools read automatically. No manual setup required for most tools.

Supported AI Tools

ToolConfiguration FileStatus
Claude CodeCLAUDE.md → AGENTS.mdFully Supported
CursorAGENTS.mdFully Supported
GitHub CopilotAGENTS.mdSupported
Other AI AgentsAGENTS.mdSupported

How the Agent Docs Work

AI tools automatically read AGENTS.md at the project root, which points to the rest:

FilePurpose
AGENTS.mdEntry point — project overview, monorepo rules, pointers to sub-docs
apps/launchsaas/AGENTS.mdApp-specific critical rules, conventions, key wiring files
docs/architecture.mdPackage map, provider interface pattern, path aliases
docs/workflows.mdDB changes, adding payment providers, SDD workflow
CLAUDE.mdClaude Code entry point — loads AGENTS.md

When asking AI to build a feature, reference apps/launchsaas/AGENTS.md explicitly if the AI isn't following project patterns.

Writing a Good CLAUDE.md

CLAUDE.md is injected into every Claude Code session — high leverage, but easy to overload. See Writing a Good CLAUDE.md for a full guide. Key principles:

PrincipleGuidance
Less is more~150–200 instructions max. Claude Code's system prompt already uses ~50.
Universal onlyEvery line appears in every session. Only include content that applies to all tasks.
Progressive disclosurePut specialized context in docs/ and reference it — don't duplicate.
No linting tasksUse Biome/ESLint via hooks or CI, not Claude.

Common Tasks

Creating a Server Action

Create a server action to update user profile with email and name fields.
Use userActionClient since it requires authentication.
Follow the pattern in apps/launchsaas/src/actions/user.ts

Creating a Protected Page

Create a new protected page at /dashboard/settings that allows users to update their preferences.
Follow the pattern in apps/launchsaas/src/app/[locale]/(protected)/

Adding a Payment Provider

Add Polar as a new payment provider.
Follow the factory pattern in packages/capabilities/payment/src/
Check existing providers like Stripe for reference.

Database Migration

Add a new "preferences" column to the users table.
Create proper migration using Drizzle.
Remember: don't edit auth.ts manually - it's auto-generated.

Best Practices

  • Reference file paths — always include the exact file or directory the AI should follow
  • Point to existing code — "follow the pattern in src/actions/user.ts" beats a long description
  • Verify output — run pnpm run build for type errors, pnpm run format for style

Resources