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
| Tool | Configuration File | Status |
|---|---|---|
| Claude Code | CLAUDE.md → AGENTS.md | Fully Supported |
| Cursor | AGENTS.md | Fully Supported |
| GitHub Copilot | AGENTS.md | Supported |
| Other AI Agents | AGENTS.md | Supported |
How the Agent Docs Work
AI tools automatically read AGENTS.md at the project root, which points to the rest:
| File | Purpose |
|---|---|
AGENTS.md | Entry point — project overview, monorepo rules, pointers to sub-docs |
apps/launchsaas/AGENTS.md | App-specific critical rules, conventions, key wiring files |
agent_docs/architecture.md | Package map, provider interface pattern, path aliases |
agent_docs/workflows.md | DB changes, adding payment providers, SDD workflow |
CLAUDE.md | Claude 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:
| Principle | Guidance |
|---|---|
| Less is more | ~150–200 instructions max. Claude Code's system prompt already uses ~50. |
| Universal only | Every line appears in every session. Only include content that applies to all tasks. |
| Progressive disclosure | Put specialized context in agent_docs/ and reference it — don't duplicate. |
| No linting tasks | Use 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.tsCreating 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/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 buildfor type errors,pnpm run formatfor style