Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.swiftaiboilerplate.com/llms.txt

Use this file to discover all available pages before exploring further.

AI-Assisted Development

SwiftAI Boilerplate Pro ships with configurations for three AI coding tools: Claude Code, Cursor AI, and Bolt AI. Each one reads your project structure, follows your architecture, and generates code that fits. No setup required. Open the project and start building.

Claude Code (CLAUDE.md)

The boilerplate includes a production-tested CLAUDE.md that gives Claude Code full project context from the first message. Claude reads it automatically when you open the project directory.

What CLAUDE.md Covers

  • Architecture: MVVM patterns, module boundaries, which abstractions to use
  • Build commands: Environment-aware instructions for Xcode MCP vs Claude Code CLI
  • Anti-patterns: No UIKit, no ObservableObject, no raw URLSession
  • File conventions: Naming patterns, organization, where new code belongs
  • Integration specifics: Supabase, RevenueCat, OpenRouter configuration

How Agentic Development Works

  1. Open Claude Code in your project directory
  2. Describe the feature you want
  3. Claude reads your codebase, generates code following your patterns, builds it, and iterates until it works
Claude understands the module boundaries, uses the right abstractions, and writes code that looks like the rest of your project.

Example Workflow

You: "Add a favorites feature. Users should be able to bookmark conversations
     and see them in a dedicated tab."

Claude Code:
  - Reads CLAUDE.md and existing module structure
  - Creates SwiftData model in Storage package
  - Adds FavoritesRepository with protocol
  - Builds FavoritesViewModel following MVVM pattern
  - Creates FavoritesView using DesignSystem tokens
  - Wires dependencies through CompositionRoot
  - Runs build to verify compilation

Community Skills

You can extend Claude’s iOS knowledge with community skills. These teach Claude about platform conventions, Xcode tooling, and SwiftUI best practices.

Apple Skills

Apple platform conventions, Xcode project structure, App Store review awareness./install-skill https://github.com/mhanlon/apple-skills

iOS Simulator

Lets Claude boot, build, install, and interact with the iOS Simulator directly./install-skill https://github.com/nicholascallee/ios-simulator-claudecode
For the full list of recommended skills and module mappings, see the Agentic Development Setup guide.

Cursor AI Rules (.cursor/rules/)

Cursor AI reads .mdc (Markdown Code) files from your project to understand patterns and constraints. Four rule files are included.

Included Rule Files

core.mdc

Applied to: All Swift filesFile size limits (max 400 lines), MVVM patterns, dependency injection, error handling, Swift Concurrency, testing requirements.

swiftui-views.mdc

Applied to: View files (*View.swift)View composition, state management, list optimization, navigation, form handling, accessibility.

architecture.mdc

Applied to: Repositories, Clients, PackagesModular package boundaries, protocol-based APIs, repository pattern, CompositionRoot, structured logging, test doubles.

design-system.mdc

Applied to: DesignSystem, AppShellDSColors tokens, DSFonts/DSText typography, DSSpacing tokens, component library usage, theme consistency.

How It Works

Open the project in Cursor. The rules load automatically. Ask Cursor to build something, and it follows your architecture.
You: "Create a new chat settings view"

Cursor generates code with:
  - DSColors, DSFonts, DSSpacing (DesignSystem tokens)    ✅
  - Protocol-based dependencies (testable)                 ✅
  - Under 400 lines (properly composed)                    ✅
  - Loading and error states                               ✅
  - Accessibility labels                                   ✅

Example Prompts

"Create a new settings view using DesignSystem components"
"Add a profile page with avatar, name, email, and sign-out"
"Build a subscription paywall with three tiers"
Cursor will use DSColors for colors, DSFonts for typography, DSSpacing for layout, and create a proper ViewModel with loading and error states.
"Add a ProfileViewModel with user info and sign-out"
"Create SettingsViewModel with theme switching"
"Build ChatViewModel with message streaming"
Cursor will mark ViewModels as @MainActor, inject dependencies via initializer, use protocol types, and add structured logging.
"Create a new feature package for Notifications"
"Add a feature package for User Profile"
Cursor will create proper Package.swift, define protocol-based public APIs, keep implementation internal, and add tests.
"Refactor this to use repository pattern"
"Extract this logic to a separate package"
"Convert this to use DesignSystem components"

Bolt AI Chat Modes (.bolt/)

Bolt AI provides 12 specialized AI assistants for different development tasks. Each mode loads relevant context and uses a domain-specific system prompt.

Available Chat Modes

iOS Developer

/dev (default). General iOS/SwiftUI development with MVVM and async/await.

Architecture

/arch. Package boundaries, protocol-based APIs, clean architecture.

SwiftUI

/ui. View composition, DesignSystem usage, state management, accessibility.

Feature Dev

/feature. Self-contained feature modules with protocol APIs and tests.

Integration

/integration. Supabase, RevenueCat, Firebase setup and troubleshooting.

Testing

/test. Unit tests, mock protocols, test doubles, async testing.

Debug

/debug. Bug diagnosis, crash analysis, memory leaks, performance.

Performance

/perf. Memory management, lazy loading, rendering optimization.

Package Dev

/package. Swift Package Manager, API design, dependencies.

Deploy

/deploy. App Store submission, TestFlight, provisioning, CI/CD.

Accessibility

/a11y. VoiceOver, Dynamic Type, inclusive design, WCAG compliance.

Documentation

/doc. Technical writing, API docs, integration guides.

Before and After

Without configurations, AI generates code with hardcoded colors, no ViewModel, direct singleton dependencies, and no error handling. With configurations, the same prompt produces code that follows your architecture.

Without Configurations

Prompt: “Create a user profile view with avatar and sign-out”
struct ProfileView: View {
  @State var user: User?

  var body: some View {
    VStack {
      Image(systemName: "person.circle")
        .font(.system(size: 80))
        .foregroundColor(.blue)  // ❌ Hardcoded color

      Text(user?.name ?? "")
        .font(.title)  // ❌ Not from DesignSystem

      Button("Sign Out") {  // ❌ No error handling
        AuthManager.shared.signOut()  // ❌ Direct dependency
      }
      .padding()
      .background(Color.red)  // ❌ Hardcoded color
    }
  }
}

With Configurations

Same prompt, same AI tool:
import SwiftUI
import DesignSystem
import Auth

struct ProfileView: View {
  @StateObject private var viewModel: ProfileViewModel

  var body: some View {
    ScrollView {
      VStack(spacing: DSSpacing.large) {
        Circle()
          .fill(DSColors.brandPrimary)
          .frame(width: 80, height: 80)
          .overlay {
            Text(viewModel.user?.initials ?? "")
              .font(DSFonts.title1)
              .foregroundStyle(DSColors.textOnPrimary)
          }

        VStack(spacing: DSSpacing.small) {
          DSText(viewModel.user?.name ?? "Loading...", style: .title2)

          if let email = viewModel.user?.email {
            DSText(email, style: .body, color: DSColors.textSecondary)
          }
        }

        DSButton("Sign Out", style: .secondary) {
          Task { await viewModel.signOut() }
        }
        .padding(.top, DSSpacing.large)
      }
      .dsPadding()
    }
    .navigationTitle("Profile")
    .loading(viewModel.isLoading)
    .errorAlert(error: $viewModel.errorMessage)
    .task { await viewModel.load() }
  }
}

@MainActor
final class ProfileViewModel: ObservableObject {
  @Published var user: User?
  @Published var isLoading = false
  @Published var errorMessage: String?

  private let authClient: AuthClient

  init(authClient: AuthClient) {
    self.authClient = authClient
  }

  func load() async {
    isLoading = true
    defer { isLoading = false }
    user = await authClient.currentUser()
  }

  func signOut() async {
    isLoading = true
    errorMessage = nil
    defer { isLoading = false }

    do {
      try await authClient.signOut()
      AppLogger.info("User signed out", category: .auth)
    } catch {
      errorMessage = AppError.from(error).userMessage
      AppLogger.error("Sign out failed: \(error)", category: .auth)
    }
  }
}
DesignSystem tokens, protocol-based dependencies, proper MVVM, error handling, loading states, structured logging, @MainActor, async/await. All from the same one-line prompt.

Customization

Modifying Cursor Rules

Edit .mdc files in .cursor/rules/. Each file has YAML frontmatter (description, globs, alwaysApply) followed by markdown sections with good/bad code examples. Changes take effect when you save.

Modifying CLAUDE.md

Edit CLAUDE.md in your project root. Add your own patterns, anti-patterns, or module-specific instructions. Claude picks up changes on the next conversation.

Adding Bolt Chat Modes

Edit .bolt/chat-modes.json to add custom modes:
{
  "chatModes": {
    "my-mode": {
      "name": "My Mode",
      "description": "What this mode does",
      "systemPrompt": "Instructions for AI",
      "context": ["paths/to/focus/on"],
      "tools": ["codeGeneration", "fileManagement"]
    }
  }
}

Documentation

Agentic Development Setup

CLAUDE.md details and community skills

Cursor Rules README

Detailed guide on Cursor AI rules

Architecture Guide

The patterns AI follows

DesignSystem Guide

Design tokens reference

Questions

None of them are required. All three are supported. Claude Code works best for agentic development (building full features from a description). Cursor works best for inline code generation while you edit. Bolt works best for chat-based task switching. Use whichever fits your workflow, or combine them.
Yes. The patterns in CLAUDE.md and .mdc files work as reference for any AI tool. You can paste relevant sections into ChatGPT, Copilot, or any assistant that accepts context.
The opposite. AI configurations make code generation faster and more accurate because the AI gets it right the first time. Less time fixing, more time shipping.
Yes. Edit CLAUDE.md, .cursor/rules/*.mdc, or .bolt/chat-modes.json to match your preferences. Changes take effect immediately (Cursor, Bolt) or on the next conversation (Claude Code).
No. These configurations only guide AI code generation. They don’t lint or enforce anything on code you write by hand.

Next Steps

Build Your First Feature

Use AI to build a feature with your project’s patterns

Architecture Overview

Understand the patterns AI follows

Testing Guide

Let AI write tests for your features