AI-Assisted Development with Cursor & Bolt
SwiftAI Boilerplate Pro includes comprehensive AI coding assistant configurations for Cursor AI and Bolt AI, enabling you to build faster with consistent, enterprise-grade code quality.Zero Setup Required - Just open the project in Cursor or Bolt and start coding. The AI automatically follows your architecture patterns!
Why This Matters
AI coding assistants are powerful, but without proper guidance they can generate:- ❌ Massive view files (500+ lines)
- ❌ Hardcoded colors and fonts
- ❌ Direct dependencies (tight coupling)
- ❌ Inconsistent architecture patterns
- ❌ Poor error handling
- ✅ Views under 400 lines (properly composed)
- ✅ DesignSystem usage everywhere (DSColors, DSFonts, DSSpacing)
- ✅ Protocol-based dependencies (fully testable)
- ✅ Consistent MVVM architecture
- ✅ Comprehensive error handling
Cursor AI Rules (.cursor/rules/)
Cursor AI automatically reads .mdc (Markdown Code) files to understand your project patterns.
Included Rule Files
core.mdc
Applied to: All Swift files
- File size limits (max 400 lines)
- MVVM architecture patterns
- Swift Package Manager best practices
- Dependency injection
- Error handling & logging
- Swift Concurrency (async/await)
- Testing requirements
swiftui-views.mdc
Applied to: View files (
*View.swift)- View composition patterns
- State management (@State, @StateObject)
- List optimization (LazyVStack)
- Navigation patterns
- Form handling
- Async operations
- Accessibility (VoiceOver)
architecture.mdc
Applied to: Repositories, Clients, Packages
- Modular package boundaries
- Protocol-based API design
- Repository pattern
- Composition root (DI)
- Domain-specific errors
- Structured logging
- Test doubles & mocks
design-system.mdc
Applied to: DesignSystem, AppShell
- Color system (DSColors tokens)
- Typography (DSFonts, DSText)
- Spacing tokens (DSSpacing)
- Component library usage
- Loading & error states
- Theme consistency
How It Works
-
Open project in Cursor
-
Start coding with AI
- Cursor automatically reads
.cursor/rules/*.mdcfiles - AI follows your architecture patterns
- No configuration needed!
- Cursor automatically reads
-
Get perfect code
Example Prompts
Creating Views
Creating Views
Prompts that work perfectly:AI will automatically:
- Use DSColors for all colors
- Use DSFonts/DSText for typography
- Use DSSpacing for padding/spacing
- Create proper ViewModels
- Add loading states
- Include error handling
Creating ViewModels
Creating ViewModels
Prompts that work perfectly:AI will automatically:
- Mark as @MainActor
- Use @Published for state
- Inject dependencies via initializer
- Use protocol types
- Add comprehensive error handling
- Include proper logging
Creating Feature Packages
Creating Feature Packages
Prompts that work perfectly:AI will automatically:
- Create proper Package.swift
- Define protocol-based public API
- Keep implementation internal
- Add comprehensive tests
- Follow SPM best practices
Refactoring
Refactoring
Prompts that work perfectly:AI will automatically:
- Follow established patterns
- Maintain consistency
- Update tests
- Preserve functionality
Bolt AI Chat Modes (.bolt/)
Bolt AI provides 12 specialized AI assistants for different development tasks.
Available Chat Modes
iOS Developer
Shortcut:
/dev (default)General iOS/SwiftUI development with MVVM patterns and async/awaitArchitecture
Shortcut:
/archModular design, package boundaries, protocol-based APIs, clean architectureSwiftUI
Shortcut:
/uiView composition, DesignSystem usage, state management, accessibilityFeature Dev
Shortcut:
/featureCreating self-contained feature modules with protocol APIs and testsIntegration
Shortcut:
/integrationSupabase, RevenueCat, Firebase setup and troubleshootingTesting
Shortcut:
/testUnit tests, mock protocols, test doubles, async testingDebug
Shortcut:
/debugBug diagnosis, crash analysis, memory leaks, performance issuesPerformance
Shortcut:
/perfMemory management, lazy loading, rendering optimizationPackage Dev
Shortcut:
/packageSwift Package Manager, API design, dependenciesDeploy
Shortcut:
/deployApp Store submission, TestFlight, provisioning, CI/CDAccessibility
Shortcut:
/a11yVoiceOver, Dynamic Type, inclusive design, WCAG complianceDocumentation
Shortcut:
/docTechnical writing, API docs, integration guides, tutorialsHow to Use Chat Modes
Select a mode using shortcuts:- ✅ Specialized context - Only loads relevant files
- ✅ Expert system prompts - Domain-specific knowledge
- ✅ Focused tools - Appropriate capabilities
- ✅ Consistent patterns - Follows project standards
Mode Selection Guide
- Development
- Integration
- Quality
- Deployment
For new features: Use
/dev or /featureFor UI work: Use /uiFor architecture decisions: Use /archFor packages: Use /packageReal-World Example
Let’s see the difference AI configurations make:Without Configurations ❌
Prompt: “Create a user profile view with avatar and sign-out” AI generates:- ❌ Hardcoded colors
- ❌ Not using DesignSystem
- ❌ No ViewModel
- ❌ Direct dependency on singleton
- ❌ No error handling
- ❌ No loading states
- ❌ Not testable
With Configurations ✅
Same prompt: “Create a user profile view with avatar and sign-out” AI generates:- ✅ Uses DSColors everywhere
- ✅ Uses DSFonts, DSText, DSSpacing
- ✅ Uses DSButton component
- ✅ Proper MVVM with ViewModel
- ✅ Protocol-based dependency (AuthClient)
- ✅ Comprehensive error handling
- ✅ Loading states
- ✅ Structured logging
- ✅ @MainActor for UI updates
- ✅ Async/await
- ✅ Fully testable
Benefits for Your Business
Faster Development
Build features 2-3x faster with AI that understands your architecture
Consistent Quality
Every line of AI-generated code follows your standards
Lower Maintenance
Less technical debt, easier refactoring, better testability
Team Onboarding
New developers immediately productive with AI assistance
Design System
UI consistency enforced automatically across all features
Best Practices
Swift Concurrency, protocols, error handling - all automatic
SEO Keywords
This boilerplate is optimized for discovery around:- Cursor AI - AI-powered code editor
- Cursor Rules -
.mdcrule files for Cursor - Bolt AI - AI development platform
- AI-Assisted iOS Development - Build iOS apps with AI
- SwiftUI AI Code Generation - Generate SwiftUI with AI
- iOS Boilerplate with AI - Pre-configured for AI assistance
- Cursor AI Swift - Cursor AI for Swift development
- Bolt AI iOS - Bolt AI for iOS apps
- .MDC Files - Markdown Code for AI rules
- AI Code Quality - Maintain quality with AI
Customization
Modifying Cursor Rules
Edit.mdc files in .cursor/rules/:
❌ BAD: Anti-pattern
Documentation
Cursor Rules README
Detailed guide on using Cursor AI rules
Bolt Chat Modes README
Complete chat mode reference
Architecture Guide
Understand the patterns AI follows
DesignSystem Guide
Learn about the design tokens
Get Started
1
Open in Cursor
Download and install Cursor AI, then open the project
2
Start Coding
Ask Cursor to build features - it automatically follows your rules
3
Use Chat Modes (Optional)
If using Bolt, select specialized modes with
/ui, /arch, etc.4
Customize (Optional)
Edit
.cursor/rules/*.mdc to adjust patterns for your needsNo configuration required! The AI rules work automatically when you open the project.
Questions?
Do I need Cursor or Bolt?
Do I need Cursor or Bolt?
Cursor rules work with Cursor AI (free and paid versions).Bolt chat modes work with Bolt.new and similar tools.The configurations are optional but highly recommended for AI-assisted development.
Can I use other AI assistants?
Can I use other AI assistants?
Yes! While optimized for Cursor and Bolt, the patterns documented in
.mdc files serve as excellent reference for any AI assistant. You can copy examples to ChatGPT, Claude, or other tools.Will this slow down my development?
Will this slow down my development?
No! The rules make AI faster and more accurate. You spend less time fixing AI-generated code because it’s correct the first time.
Can I modify the rules?
Can I modify the rules?
Absolutely! Edit
.cursor/rules/*.mdc files to match your preferences. Changes take effect immediately when you save.Do the rules apply to my code?
Do the rules apply to my code?
The rules only guide AI code generation. They don’t lint or enforce anything on your manually-written code. Think of them as “AI training documentation.”
