AI Agents
AI coding assistant support and configuration
Overview
This template includes comprehensive configuration for multiple AI coding assistants. All agents are pre-configured with project-specific context and development rules to help you build faster while maintaining code quality and consistency.
All AI agents are configured to read the /docs folder before making any changes. This ensures they understand the project architecture, patterns, and conventions.
Supported Agents
The following AI coding assistants have dedicated configuration files:
| Agent | Config Location | Description |
|---|---|---|
| Claude Code | .claude/commands/ | Anthropic Claude with custom slash commands |
| Cursor | .cursor/rules/ | Cursor IDE AI assistant with project rules |
| Windsurf | .windsurfrules | Codeium Windsurf assistant configuration |
| GitHub Copilot | .github/copilot-instructions.md | GitHub Copilot with project instructions |
| Antigravity | .agent/rules/ | Google Antigravity agent rules |
General Configuration
The AGENTS.md file in the project root provides context for all AI assistants, serving as a fallback for agents not explicitly configured.
What Agents Know
All configured agents have access to:
Documentation Reference
Agents are instructed to consult these core documentation files:
| File | Purpose |
|---|---|
| getting-started.md | Setup and prerequisites |
| app-architecture.md | Tech stack, structure, design |
| features.md | Feature module patterns (5-file) |
| database.md | Drizzle ORM, tables, operations |
| api.md | tRPC and OpenAPI patterns |
| errors.md | Error handling and translation |
| routing-i18n.md | Routing and i18n |
| auth.md | Better-Auth flows |
| components-ui-ux.md | UI components, styling |
| configuration.md | Environment and app config |
| development.md | Commands and workflows |
Scaffolding Templates
Agents can reference step-by-step templates in /docs/template/:
| Template | Use When |
|---|---|
| new-feature.md | Creating feature module |
| new-page.md | Creating page with routing |
| new-table.md | Adding database table |
| new-trpc-router.md | Creating tRPC router |
| add-translation.md | Adding i18n translations |
Tech Stack
Agents are configured to work with:
- Framework: Next.js 16+ (App Router)
- Database: PostgreSQL + Drizzle ORM
- API: tRPC (type-safe)
- Auth: Better-Auth
- UI: Shadcn UI + Tailwind CSS
- Forms: React Hook Form + Zod
- State: React Query (via tRPC)
Critical Rules
All agents follow these strict conventions to maintain code quality and consistency.
ALWAYS
Agents must follow these rules:
- Read
/docsfirst - Check documentation before implementation - Use
typenotinterface- TypeScript type definitions only - Use double quotes - Prefer
"over'for strings - Use Shadcn UI components - Import from
@/components/ui - Use
<Icon iconKey="..." />- Never import fromlucide-reactdirectly - Use declarative routing -
<PageHome.Link />orPageHome()for navigation - Use
createDrizzleOperations- For standard CRUD operations - Follow 5-file pattern -
schema.ts,functions.ts,fields.tsx,hooks.ts,prompts.tsx
NEVER
Agents are prohibited from:
- Generate summary .md files - Unless explicitly requested
- Use raw Drizzle queries - Unless complex joins necessary
- Use
revalidatePathwith tRPC - Use client-side invalidation instead - Use
<p>or<h1>directly - UseP,H1-H6components from@/components/ui/typography - Use
containerclass - UseSectioncomponent with variants - Use arbitrary Tailwind values - Avoid
w-[100px]patterns, use design tokens
Agent Workflow
All agents follow this structured workflow:
graph TD
A[Receive Request] --> B[Read /docs Documentation]
B --> C[Check Similar Patterns in src/features]
C --> D[Apply Project Conventions]
D --> E[Implement Changes]
E --> F[Verify Each Part]1. Understand
- Read relevant documentation in
/docs - Understand the task requirements
- Identify which patterns apply
2. Check Patterns
- Look at similar features in
src/features/ - Reference existing implementations
- Follow established conventions
3. Follow Conventions
- Apply critical rules (ALWAYS/NEVER)
- Use correct import paths
- Follow file naming conventions
- Use proper TypeScript patterns
4. Implement
- Build step by step
- Verify each part works
- Run type checking
- Ensure consistency
Agent-Specific Features
Claude Code
Location: .claude/commands/
Custom slash commands for common tasks:
/new-feature- Create a new feature module/new-page- Create a new page with routing/add-table- Add a database table/add-translation- Add i18n keys
Cursor
Location: .cursor/rules/
Project-specific rules that guide Cursor's AI:
- File organization patterns
- Import conventions
- Component structure
- Database operation patterns
Windsurf
Location: .windsurfrules
Single configuration file with:
- Development guidelines
- Code style rules
- Project structure understanding
GitHub Copilot
Location: .github/copilot-instructions.md
Instructions that appear in Copilot's context:
- Quick reference of critical rules
- Links to documentation
- Common patterns
Antigravity
Location: .agent/rules/
Google Antigravity agent configuration:
- Project conventions
- Architectural patterns
- Best practices
Working with Agents
Best Practices
Get the most out of AI agents:
- Be specific - Clear requests get better results
- Reference docs - Mention which pattern or template to follow
- Review changes - Always review agent-generated code
- Iterate - Ask for adjustments if needed
- Stay consistent - Agents maintain project conventions
Example Requests
Good requests:
Create a new feature for managing teams following the 5-file pattern.Add a page at /dashboard/settings following the declarative routing setup.Create a database table for projects with timestamps and soft delete.Less effective requests:
Make a teams feature (too vague)Add a settings page (doesn't specify patterns)Create a projects table (missing requirements)When Agents Help Most
Agents excel at:
- Creating boilerplate following established patterns
- Implementing CRUD operations with standard abstractions
- Adding translations across multiple locales
- Refactoring code to match conventions
- Generating type-safe API routes
Agents may need guidance for:
- Complex business logic
- Performance optimization decisions
- Architecture changes
- Security-critical code
Configuration Maintenance
Updating Agent Rules
All agent configuration files are version-controlled. To update:
- Edit the relevant config file (e.g.,
.cursor/rules/) - Test with the agent
- Commit changes
Keeping Documentation in Sync
When you update project patterns:
- Update
/docsfiles first - Agent configurations reference
/docs, so they stay current automatically - Update agent-specific commands/rules if needed
Adding New Conventions
When adding new conventions:
- Document in
/docs - Update
AGENTS.mdcritical rules - Test with agents
- Update agent-specific configs if needed
Troubleshooting
Agent Not Following Conventions
- Check if
/docsdocumentation is clear - Verify agent has access to config files
- Be more explicit in your request
- Reference specific docs in your prompt
Agent Creating Incorrect Patterns
- Point agent to relevant
/docsfile - Show example from
src/features/ - Ask agent to review and fix
Agent Missing Context
- Ensure you're in the project workspace
- Check config file location for your agent
- Explicitly mention pattern to follow
Next Steps
- Commands - Learn available npm scripts
- Best Practices - Development conventions
- Templates - Step-by-step task guides
- Patterns - Feature development patterns