Cursor Setup Guide¶
AI Velocity Exclusive
Cursor rules are exclusive to AI Velocity tier.
18 optimized Cursor rules that teach your AI assistant about your codebase.
Overview¶
All rules are:
- ✅ Under 500 lines (Cursor best practice)
- ✅ Properly described (searchable metadata)
- ✅ Auto-attached (loaded when relevant)
- ✅ Well-organized (numbered system)
The 18 Rules¶
Core & Always-Applied¶
000-core-project.mdc (112 lines)
- Project overview & stack
- Clean architecture pattern
- Directory structure
- Always applies to every conversation
API Development¶
100-api-workflow.mdc (223 lines)
- Complete API development workflow
- Schemas → Services → Controllers → Frontend
- Auto-attaches when working in:
app/controllers/,app/services/,app/schemas/,frontend/src/hooks/api/
Frontend (3 Rules)¶
200-frontend-components.mdc (296 lines)
- Component architecture
- Unified component system
- Layout patterns
- Auto-attaches:
frontend/src/components/,frontend/src/pages/
210-frontend-hooks-state.mdc (276 lines)
- React hooks patterns
- State management
- Form handling
- Auto-attaches:
frontend/src/hooks/,frontend/src/context/
220-frontend-performance.mdc (207 lines)
- Performance optimization
- Memoization patterns
- Testing & theming
- Auto-attaches:
frontend/src/**/*.test.tsx,frontend/src/theme/
Backend (2 Rules)¶
300-backend-clean-architecture.mdc (184 lines)
- Controllers → Services → Models
- Dependency injection
- Configuration system
- Auto-attaches:
app/controllers/,app/services/,app/models.py
310-backend-database.mdc (214 lines)
- Database patterns
- Query optimization
- Migrations
- Testing
- Auto-attaches:
app/db.py,app/models.py,migrations/,tests/
Error Handling (2 Rules)¶
400-backend-errors.mdc (130 lines)
- Backend exception handling
- Custom errors
- FastAPI error responses
- Auto-attaches:
app/core/exceptions.py,app/controllers/
410-frontend-errors.mdc (183 lines)
- Error boundaries
- Error pages
- useErrorHandler hook
- Auto-attaches:
frontend/src/components/ErrorBoundary.tsx,frontend/src/utils/errorHandler.ts
Configuration¶
500-environment-config.mdc (484 lines)
- Environment configuration
- Auto-loading system
- Development workflows
- Auto-attaches:
**/*.env*,**/config/**,**/Taskfile*
Payments (2 Rules)¶
600-payments-stripe.mdc (201 lines)
- Stripe integration patterns
- Payment manager
- Webhook handling
- Auto-attaches:
**/payment*,**/webhook*
605-payments-rbac.mdc (194 lines)
- Payment-to-RBAC integration
- Permission updates
- Security best practices
- Auto-attaches:
app/core/access_control.py,app/permissions.py
Plans & RBAC¶
610-plans-rbac-system.mdc (350 lines)
- Plan-based RBAC system
- Feature permissions
- Access control decorators
- Auto-attaches:
app/permissions.py,app/core/access_control.py
Deployment (3 Rules)¶
700-deployment-guide.mdc (312 lines)
- Deployment architecture strategies
- Platform comparisons
720-railway-deployment.mdc (285 lines)
- Railway-specific deployment
- Tested workflows
- Troubleshooting
730-digital-ocean-deployment.mdc (293 lines)
- Digital Ocean App Platform
- Droplet deployment
- Cost optimization
CI/CD¶
810-github-actions-cicd.mdc (481 lines)
- Automated testing workflows
- Deployment automation
- Auto-attaches:
.github/workflows/**
Best Practices¶
999-development-best-practices.mdc (487 lines)
- Feature implementation guidelines
- Code quality standards
- Maintenance best practices
- Always applies
How Cursor Uses These¶
Always-Applied Rules (2)¶
Load in every conversation:
- 000-core-project.mdc
- 999-development-best-practices.mdc
Auto-Attached Rules (16)¶
Load automatically when you work in matching files based on globs pattern.
Manual Reference¶
Type @rule-name to explicitly include a rule.
Customizing Rules¶
- Edit files in
.cursor/rules/ - Update
descriptionfor better searchability - Modify
globsto change when rule applies - Set
alwaysApply: truefor core rules
Best Practices¶
- Let rules auto-attach (don't manually reference unless needed)
- Keep rules under 500 lines
- Add descriptions for search
- Use specific globs for targeted application
Related Documentation¶
- Claude Code Setup - Alternative AI tool
- AI Workflows - How to use AI effectively
- Cursor Official Docs
Files Location¶
All rules in: .cursor/rules/
View them directly in your editor at .cursor/rules/