AI-Assisted Development
Guide for using AI coding tools (Claude Code, Cursor, GitHub Copilot) to develop with LaunchSaaS
AI-Assisted Development
LaunchSaaS is optimized for AI-assisted development. This guide covers how to configure and use popular AI coding tools effectively with the project.
Supported AI Tools
| Tool | Configuration File | Status |
|---|---|---|
| Claude Code | CLAUDE.md, .claude/settings.json | Fully Supported |
| Cursor | AGENTS.md | Fully Supported |
| GitHub Copilot | AGENTS.md | Supported |
| Other AI Agents | AGENTS.md | Supported |
Quick Setup
Claude Code
Claude Code reads CLAUDE.md and AGENTS.md automatically. For enhanced capabilities, install plugins and skills:
Installing Plugins
Plugins enhance Claude Code's capabilities. To install:
- Open Claude Code in your terminal
- Run
/pluginscommand to open the plugins manager - Enable the recommended plugins listed below
See Claude Code Plugins Documentation for more details.
The .claude/settings.json file in this project declares recommended plugins,
but you need to manually enable them in Claude Code the first time.
Recommended Plugins:
| Plugin | Purpose | How to Enable |
|---|---|---|
context7 | Fetches latest docs for Better Auth, Drizzle, Next.js, etc. | /plugins → Search "context7" → Enable |
feature-dev | Guides multi-file feature development | /plugins → Search "feature-dev" → Enable |
typescript-lsp | Real-time TypeScript type checking | /plugins → Search "typescript-lsp" → Enable |
code-simplifier | Code refactoring and simplification | /plugins → Search "code-simplifier" → Enable |
After enabling, your .claude/settings.json should look like:
{
"plugins": {
"context7@claude-plugins-official": true,
"feature-dev@claude-plugins-official": true,
"typescript-lsp@claude-plugins-official": true,
"code-simplifier@claude-plugins-official": true
}
}Installing Skills
Skills are reusable prompt templates. To install from vercel-labs/agent-skills:
npx add-skill vercel-labs/agent-skillsThis will prompt you to select which skills to install. Recommended skills for this project:
| Skill | Purpose |
|---|---|
vercel-react-best-practices | React/Next.js performance optimization guidelines |
web-design-guidelines | Web interface design best practices |
Skills are automatically discovered when placed in .claude/skills/.
No additional configuration needed.
Cursor / VS Code
Cursor automatically reads AGENTS.md in the project root. No additional configuration needed.
For best results:
- Open the project root folder
- Cursor will index
AGENTS.mdand understand project patterns - Reference specific files in your prompts for better context
GitHub Copilot
GitHub Copilot reads AGENTS.md for project context. For additional customization, create .github/copilot-instructions.md.
Configuration Files
AGENTS.md
The primary configuration file for all AI tools. Contains:
- Project architecture and patterns
- Tech stack overview
- Coding conventions
- Database schema patterns
- Server Actions patterns
- Payment integration patterns
- Auto-update rules for AGENTS.md when making architectural changes
- Auto-update rules for user documentation when making user-facing changes
CLAUDE.md
Claude Code-specific configuration. Contains:
- Reference to follow AGENTS.md guidelines
- Claude-specific exploration strategies (Task tool, Explore agent)
- Tool usage preferences (Glob, Grep, Read)
- Recommended skills from vercel-labs
.claude/settings.json
Claude Code plugins configuration.
Common Tasks with AI
Creating a Server Action
Prompt:
Create a server action to update user profile with email and name fields.
Use userActionClient since it requires authentication.
Follow the pattern in src/actions/user.tsExpected behavior: AI will:
- Create Zod schema in
src/schemas/ - Create action in
src/actions/usinguserActionClient - Follow existing patterns from the codebase
Creating a Protected Page
Prompt:
Create a new protected page at /dashboard/settings that allows users to update their preferences.
Follow the pattern in src/app/[locale]/(protected)/Adding a Payment Provider
Prompt:
Add Polar as a new payment provider.
Follow the factory pattern in src/lib/features/payment/
Check existing providers like Stripe for reference.Creating an Email Template
Prompt:
Create a new email template for order confirmation.
Follow the pattern in src/components/email/
Use React Email components.Database Migration
Prompt:
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
Provide Sufficient Context
- Reference specific file paths
- Mention the expected behavior
- Include relevant constraints
Good prompt:
Create a checkout action in src/actions/billing.ts using userActionClient.
It should create an order record and redirect to the payment provider.
Follow the pattern in the existing createCheckoutSession action.Bad prompt:
Add checkout functionalityFollow Project Patterns
LaunchSaaS uses consistent patterns. Always remind AI to:
- Use factory pattern for new providers (payment, email, storage)
- Use next-safe-action for Server Actions with Zod validation
- Use shadcn/ui components for UI
- Follow App Router conventions (Server Components by default)
Verify AI Output
After AI generates code:
- Check type safety - Run
pnpm run buildto catch type errors - Check patterns - Ensure code follows AGENTS.md conventions
- Run lint - Execute
pnpm run lintfor style issues - Test manually - Verify the feature works as expected
Troubleshooting
context7 Plugin Issues
If context7 cannot fetch documentation:
- Check if library ID is correct (use
resolve-library-idfirst) - Common library IDs:
- Better Auth:
/better-auth/better-auth - Drizzle ORM:
/drizzle-team/drizzle-orm - Next.js:
/vercel/next.js - Stripe:
/stripe/stripe-node
- Better Auth:
AI Not Following Project Patterns
If AI generates code that doesn't match project conventions:
- Explicitly reference AGENTS.md in your prompt
- Point to existing similar code as example
- Be specific about which pattern to follow
Example:
Follow the Server Actions pattern documented in AGENTS.md.
Use userActionClient like in src/actions/user.tsTypeScript Errors
Use the typescript-lsp plugin for real-time type checking:
- Ensure plugin is enabled in
.claude/settings.json - AI will catch type errors before generating code
- If errors persist, run
pnpm run buildfor detailed output
Optional: Additional Plugins and Skills
Additional Plugins
These plugins are optional but can be useful for specific tasks:
| Plugin | Purpose | Documentation |
|---|---|---|
frontend-design | High-quality UI design generation for marketing pages | Plugin Docs |
Additional Skills
For creating custom project-specific skills:
| Skill | Purpose | Installation |
|---|---|---|
skill-writer | Guide for creating custom AI agent skills | npx add-skill anthropics/skill-writer |
See Agent Skills Specification for more details on creating custom skills.