A comprehensive guide for setting up Claude Code CLI with PRD-driven workflows, extended thinking (ultrathink), planning modes, community agent skills, essential MCP servers, and Xcode optimizations for professional Swift/SwiftUI iOS development.
- Installation
- Configuration Hierarchy
- Essential MCP Servers
- Community Agent Skills
- CLAUDE.md Setup for iOS Projects
- PRD-Driven Development Workflow
- Extended Thinking & Ultrathink
- Plan Mode Configuration
- Custom Slash Commands for iOS
- Subagents Configuration
- Output Styles
- Plugins System
- Xcode Optimizations
- Sandbox Mode & Safe Development
- Settings & Permissions
- Hooks for Swift Development
- Complete Project Structure
- Best Practices & Tips
# Install via Homebrew
brew install claude
# Verify installation
claude --version# macOS/Linux - Native installer (no Node.js required)
curl -fsSL https://claude.ai/install.sh | bash
# Or install latest version
curl -fsSL https://claude.ai/install.sh | bash -s latest# Global npm install (do NOT use sudo)
npm install -g @anthropic-ai/claude-code
# Migrate existing npm install to native
claude install# Start Claude Code and authenticate via OAuth
claude
# Or set API key environment variable
export ANTHROPIC_API_KEY="your-key-here"# Use specific model at startup
claude --model claude-opus-4-5-20250929
claude --model claude-sonnet-4-5-20250929
claude --model claude-3-5-haiku-20241022
# Or set default model
export ANTHROPIC_MODEL="claude-sonnet-4-5-20250929"Claude Code uses a layered configuration system where each level can override the one below:
Priority (Highest to Lowest):
βββ 1. Session flags (--model, --permission-mode)
βββ 2. Environment variables
βββ 3. .claude/settings.local.json (local - personal, gitignored)
βββ 4. .claude/settings.json (project - shared with team)
βββ 5. ~/.claude/settings.json (user - global)
| Scope | Description | Storage |
|---|---|---|
| local | Available only to you in current project (default for MCP) | .claude/settings.local.json |
| project | Shared with team via git | .claude/settings.json, .mcp.json |
| user | Available across all your projects | ~/.claude/settings.json |
| File | Scope | Git Status | Purpose |
|---|---|---|---|
~/.claude.json |
User | N/A | User state, feature flags, project MCP configs |
~/.claude/settings.json |
User | N/A | Global preferences, plugins, status line |
~/.claude/CLAUDE.md |
User | N/A | Global instructions |
~/.claude/skills/ |
User | N/A | Personal Agent Skills |
~/.claude/commands/ |
User | N/A | Personal slash commands |
.claude/settings.json |
Project | Committed | Team settings |
.claude/settings.local.json |
Local | Gitignored | Personal overrides |
.mcp.json |
Project | Committed | Project MCP servers (alternative) |
CLAUDE.md |
Project | Committed | Main project context |
.claude/skills/ |
Project | Committed | Project Agent Skills |
.claude/commands/ |
Project | Committed | Project slash commands |
.claude/agents/ |
Project | Committed | Project subagents |
Note: MCP servers are stored in ~/.claude.json under the projects key, organized by project path. The .mcp.json file is an alternative project-level configuration method.
#!/bin/bash
# Complete MCP setup for iOS development
# Note: Configuration stored in ~/.claude.json under projects key
echo "π Installing Essential MCP Servers..."
# Core iOS Development - Choose one:
# Option 1: XcodeBuildMCP (Recommended - Full featured)
npx -y @smithery/cli@latest install cameroncooke/xcodebuildmcp --client claude-code
# Option 2: xc-mcp (Alternative - Lightweight)
# claude mcp add xc-mcp -- npx -y xc-mcp
# Version Control
claude mcp add github -- npx -y @modelcontextprotocol/server-github
# Memory & Context (Choose one)
claude mcp add memory -- npx -y @modelcontextprotocol/server-memory
# OR for advanced memory features:
# claude mcp add memory-keeper -- npx -y mcp-memory-keeper
# History
claude mcp add claude-historian-mcp -- npx claude-historian-mcp
# Verify
claude mcp list
echo "β
Essential MCP servers installed!"
echo ""
echo "Note: Configuration stored in ~/.claude.json"
echo "For team projects, consider creating a .mcp.json file instead"
echo ""
echo "Optional servers for advanced use cases:"
echo " - Filesystem: Advanced file operations"
echo " - Sequential Thinking: Complex reasoning"These are useful for specific scenarios but not required for iOS development:
# Filesystem - Advanced file operations (useful for complex refactoring)
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystem
# Sequential Thinking - Complex multi-step reasoning
claude mcp add sequential-thinking -- npx -y @modelcontextprotocol/server-sequential-thinkingThere are two main MCP servers for Xcode integration. Choose based on your needs:
Source: cameroncooke/xcodebuildmcp
Installation:
# Via Smithery (Recommended)
npx -y @smithery/cli@latest install cameroncooke/xcodebuildmcp --client claude-code
# Or manual
claude mcp add xcodebuild -- npx cameroncooke/xcodebuildmcpBest for:
- Complete build and test automation
- CI/CD integration
- Simulator management
- Runtime log capture
- Swift Package operations
Key Tools:
| Tool | Description |
|---|---|
mcp__xcodebuildmcp__build_sim_name_proj |
Build for simulator |
mcp__xcodebuildmcp__test_sim_name_proj |
Run tests |
mcp__xcodebuildmcp__capture_logs |
Debug runtime issues |
mcp__xcodebuildmcp__list_simulators |
Show available devices |
mcp__xcodebuildmcp__boot_simulator |
Boot a simulator |
mcp__xcodebuildmcp__install_app |
Install app on device |
mcp__xcodebuildmcp__launch_app |
Launch installed app |
mcp__xcodebuildmcp__screenshot |
Capture simulator screenshot |
mcp__xcodebuildmcp__swift_package_build |
Build Swift package |
mcp__xcodebuildmcp__swift_package_test |
Run Swift package tests |
mcp__xcodebuildmcp__clean |
Clean build products |
Source: conorluddy/xc-mcp
Installation:
# Via npm
claude mcp add xc-mcp -- npx -y xc-mcp
# Or add to .mcp.jsonBest for:
- Lightweight Xcode project interaction
- Quick builds without full pipeline
- Simpler setup for smaller projects
- Alternative to XcodeBuildMCP
When to use which:
- Use XcodeBuildMCP for production projects with full CI/CD needs
- Use xc-mcp for lighter-weight projects or as an alternative
- Can use both but typically choose one to avoid conflicts
Recommendation: Start with XcodeBuildMCP for comprehensive iOS development. Try xc-mcp if you need a lighter alternative or want to experiment with different workflows.
Installation:
claude mcp add github -- npx -y @modelcontextprotocol/server-githubCapabilities:
- Create and manage issues
- Review pull requests
- Search repositories and code
- Manage branches
- Clone and fork repositories
Usage:
> Create an issue on @github:repo://owner/repo for the authentication bug
> Review @github:pr://owner/repo/123 and suggest improvements
> Search @github:code://owner/repo for "SwiftUI navigation"
Authentication:
# In Claude session
/mcp
# Select GitHub β Authenticate β Complete OAuth flowInstallation:
claude mcp add memory -- npx -y @modelcontextprotocol/server-memoryCapabilities:
- Persistent context across sessions
- Remember project-specific decisions
- Store architectural choices
- Maintain conversation history
Usage:
> Remember that we use MVVM with @Observable for this project
> What architecture pattern did we decide on?
> Store this: We always use Swift 6 strict concurrency
Note: For more advanced memory and history tracking, see Claude Historian MCP below, which provides conversation history search and timeline features.
Installation:
claude mcp add claude-historian-mcp -- npx claude-historian-mcpCapabilities:
- Track full conversation history
- Reference past decisions and implementations
- Search through previous sessions
- Maintain project timeline
Usage:
> What did we discuss about the networking layer last week?
> Show me the history of authentication implementation decisions
Installation:
claude mcp add filesystem -- npx -y @modelcontextprotocol/server-filesystemCapabilities:
- Advanced file operations
- Directory watching
- Glob pattern matching
- Batch file operations
Use Cases for iOS:
- Complex project-wide refactoring
- Batch file renaming/reorganization
- Advanced search patterns across codebase
Installation:
claude mcp add sequential-thinking -- npx -y @modelcontextprotocol/server-sequential-thinkingCapabilities:
- Multi-step reasoning
- Complex problem decomposition
- Chain-of-thought processing
Use Cases for iOS:
- Complex architectural decisions
- Multi-step migration planning
- Algorithm design and optimization
MCP servers are automatically configured when you install them using claude mcp add or via Smithery. The configuration is stored in:
~/.claude.json - Under the projects key, organized by project path:
{
"projects": {
"/path/to/your/project": {
"mcpServers": {
"xcodebuildmcp": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@smithery/cli@latest", "run", "cameroncooke/xcodebuildmcp"]
},
"github": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"]
}
}
}
}
}Alternative: .mcp.json - Project-level configuration (committed to git):
{
"mcpServers": {
"XcodeBuildMCP": {
"command": "npx",
"args": ["-y", "xcodebuildmcp@latest"],
"env": {
"INCREMENTAL_BUILDS_ENABLED": "true",
"XCODEBUILDMCP_SENTRY_DISABLED": "true",
"XCODEBUILDMCP_DYNAMIC_TOOLS": "true",
"XCODEBUILDMCP_ENABLED_WORKFLOWS": "simulator,device,project-discovery,swift-package"
}
}
}
}When to use which:
| Method | Storage | Committed | Best For |
|---|---|---|---|
claude mcp add |
~/.claude.json |
No | Personal setup, quick testing |
.mcp.json |
Project root | Yes | Team collaboration, consistent setup |
Recommended Approach:
- Personal/Testing: Use
claude mcp addcommands (stored in~/.claude.json) - Team Projects: Create
.mcp.jsonin project root for consistent team setup .mcp.jsonsettings override~/.claude.jsonfor that project
Configuration Priority:
1. Project .mcp.json (highest - team configuration)
2. ~/.claude.json projects[path].mcpServers (personal per-project)
Tip: Use
claude mcp listto see all configured servers and their sources. Servers can be managed via/mcpcommand during a session.
# List all configured servers
claude mcp list
# Get details for a specific server
claude mcp get XcodeBuildMCP
# Remove a server
claude mcp remove XcodeBuildMCP
# Check server status (in session)
/mcp
# Authenticate with OAuth-enabled servers
/mcp # Then select "Authenticate"Agent Skills are automatically invoked by Claude based on context. Install community skills to enhance Claude's capabilities.
Source: Axiom Documentation | GitHub
What it is: A comprehensive suite of 50+ specialized iOS development skills for Claude Code. Axiom provides deep expertise across the entire iOS development lifecycle with automated auditors, analyzers, and implementation helpers.
Key Capabilities:
- Build & Debugging: Build fixer, crash analyzer, test debugger, Xcode debugging
- Performance: SwiftUI performance analyzer, Swift performance analyzer, energy auditor, build optimizer
- Architecture: SwiftUI architecture auditor, navigation auditor, concurrency auditor
- Data: Core Data auditor, SwiftData migration, iCloud auditor, storage auditor
- UI/UX: Accessibility auditor, Liquid Glass (iOS 26+), TextKit auditor, HIG compliance
- Testing: Test runner, test failure analyzer, testing auditor, UI testing, simulator tester
- Security: Security/privacy scanner, IAP auditor, networking auditor
- Apple Frameworks: Foundation Models (on-device AI), Vision, Camera Capture, Core Location, and more
How it works: Axiom skills activate automatically based on context. When you're working on iOS/Swift code, Claude detects relevant patterns and invokes the appropriate skill.
Example triggers:
"My build is failing" β axiom:ios-build skill activates
"Check my SwiftUI performance" β axiom:swiftui-performance-analyzer activates
"Audit my app for accessibility" β axiom:accessibility-auditor activates
"I'm getting Swift concurrency warnings" β axiom:swift-concurrency activates
Direct invocation:
/axiom:fix-build # Fix Xcode build failures
/axiom:audit accessibility # Run accessibility audit
/axiom:run-tests # Run and analyze tests
/axiom:analyze-crash # Parse crash logs
Why use Axiom:
- β Comprehensive: 50+ specialized skills covering all iOS development areas
- β Automatic: Skills invoke based on context - no manual setup needed
- β Up-to-date: Includes iOS 26/WWDC 2025 documentation and Liquid Glass support
- β Production-Ready: Auditors catch real issues before they reach users
- β Diagnostic-First: Environment and build issues diagnosed before code investigation
Recommendation: Axiom is pre-installed when using the Axiom-enabled Claude Code setup. It complements other skills like Swift Concurrency and SwiftUI skills with deeper diagnostic and auditing capabilities.
Source: affaan-m/everything-claude-code β 27.4K stars
What it is: Complete Claude Code configuration collection from an Anthropic hackathon winner. Battle-tested over 10+ months of intensive daily use building real products. This is the most comprehensive, production-ready collection of Claude Code configurations available.
What's included:
- 9 Specialized Agents: Planner, Architect, TDD Guide, Code Reviewer, Security Reviewer, Build Error Resolver, E2E Runner, Refactor Cleaner, Doc Updater
- 11 Skills: Coding standards, backend patterns, frontend patterns, continuous learning, and more
- 11 Commands: /plan, /review, /test, and other workflow automations
- 10 Hooks: Automated workflows for common development tasks
- MCP Configurations: Pre-configured MCP servers
- Memory Persistence: Context survives across sessions
- Strategic Compaction: Control when context compacts
- Continuous Learning: Auto-extract patterns from your sessions
Installation (Recommended - Plugin Method):
# Add as marketplace and install as plugin
/plugin marketplace add affaan-m/everything-claude-code
/plugin install everything-claude-code@everything-claude-codeAlternative (Manual Installation):
# Clone and copy components
git clone https://github.com/affaan-m/everything-claude-code.git
cp everything-claude-code/agents/*.md ~/.claude/agents/
cp everything-claude-code/commands/*.md ~/.claude/commands/
cp -r everything-claude-code/skills/* ~/.claude/skills/
# See repo for hooks and MCP configurationsWhy use this:
- β Production-Proven: Built while shipping real products
- β Comprehensive: Everything you need in one place
- β Well-Documented: Shorthand and longform guides included
- β Active Development: Regular updates and community contributions
- β Cross-Platform: Works on Windows, macOS, Linux
Documentation:
- Shorthand Guide (Start here)
- Longform Guide (Advanced topics)
Recommendation for iOS Developers: Install this plugin to get a complete, battle-tested workflow. Then customize the agents/skills for iOS-specific patterns using the individual skills below.
If you prefer to pick and choose specific skills rather than the all-in-one solution above:
Recommended: Using npx skills add
# Install iOS development skills with one command each
# You'll be prompted to choose global (~/.claude/skills) or project (.claude/skills) location
# Core iOS Skills
npx skills add https://github.com/AvdLee/Swift-Concurrency-Agent-Skill
npx skills add https://github.com/AvdLee/SwiftUI-Agent-Skill
npx skills add https://github.com/AvdLee/Core-Data-Agent-Skill
npx skills add https://github.com/Dimillian/Skills
# Observability & Production Patterns
npx skills add https://github.com/nexus-labs-automation/mobile-observability
npx skills add https://github.com/numman-ali/n-skills
# Optional: OpenSkills CLI for additional skill management
npx skills add https://github.com/numman-ali/openskillsAlternative: Manual Git Clone
#!/bin/bash
# Manual installation with full control over directory names
SKILLS_DIR="$HOME/.claude/skills"
mkdir -p "$SKILLS_DIR"
cd "$SKILLS_DIR"
git clone https://github.com/AvdLee/Swift-Concurrency-Agent-Skill.git swift-concurrency
git clone https://github.com/AvdLee/SwiftUI-Agent-Skill.git swiftui
git clone https://github.com/AvdLee/Core-Data-Agent-Skill.git core-data
git clone https://github.com/Dimillian/Skills.git dimillian-skills
git clone https://github.com/nexus-labs-automation/mobile-observability.git mobile-observability
git clone https://github.com/numman-ali/n-skills.git n-skills
git clone https://github.com/numman-ali/openskills.git openskills
echo "β
All skills installed!"Source: AvdLee/Swift-Concurrency-Agent-Skill
Installation:
# Recommended
npx skills add https://github.com/AvdLee/Swift-Concurrency-Agent-Skill
# Or manual
cd ~/.claude/skills/
git clone https://github.com/AvdLee/Swift-Concurrency-Agent-Skill.git swift-concurrencyCapabilities:
- Swift 6 concurrency best practices
- Actor isolation and Sendable compliance
- Async/await pattern implementation
- MainActor usage guidelines
- Data race detection and fixes
- Task group management
- AsyncSequence and AsyncStream
Automatic Activation: Claude automatically uses this skill when:
- Writing concurrent code
- Fixing concurrency warnings
- Implementing async APIs
- Reviewing code for data races
Example Usage:
> Implement a concurrent image downloader that downloads multiple images safely
> Fix these Swift 6 concurrency warnings in my ViewModel
> Review this actor implementation for thread safety issues
Source: AvdLee/SwiftUI-Agent-Skill
Installation:
# Recommended
npx skills add https://github.com/AvdLee/SwiftUI-Agent-Skill
# Or manual
cd ~/.claude/skills/
git clone https://github.com/AvdLee/SwiftUI-Agent-Skill.git swiftuiCapabilities:
- Modern SwiftUI patterns and best practices
- State management (@State, @Binding, @Observable, @Environment)
- View composition and reusability
- Navigation (NavigationStack, NavigationPath)
- Animations and transitions
- Performance optimization
- Accessibility implementation
- iOS 17+ features (Observable macro, #Preview)
Automatic Activation: Claude automatically uses this skill when:
- Building SwiftUI views and components
- Implementing state management
- Creating navigation flows
- Adding animations
- Optimizing SwiftUI performance
Example Usage:
> Create a SwiftUI view with proper state management using @Observable
> Implement navigation between these three screens
> Add smooth animations to this button interaction
> Optimize this List view for better performance
Why use this:
- β Expert Knowledge: Created by Antoine van der Lee (SwiftLee)
- β Modern Patterns: Focuses on latest SwiftUI APIs (iOS 17+)
- β Non-Opinionated: Best practices without forcing specific architectures
- β Complements Swift Concurrency Skill: Works great together for complete coverage
Source: AvdLee/Core-Data-Agent-Skill
Installation:
# Recommended
npx skills add https://github.com/AvdLee/Core-Data-Agent-Skill
# Or manual
cd ~/.claude/skills/
git clone https://github.com/AvdLee/Core-Data-Agent-Skill.git core-dataCapabilities:
- Core Data stack setup and configuration
- NSManagedObject subclass generation
- Fetch requests and NSFetchedResultsController
- Background context and thread safety
- Migration strategies (lightweight and custom)
- Performance optimization and batch operations
- CloudKit integration with NSPersistentCloudKitContainer
Automatic Activation: Claude automatically uses this skill when:
- Setting up Core Data in a project
- Creating or modifying data models
- Writing fetch requests or predicates
- Implementing data persistence
- Debugging Core Data issues
Example Usage:
> Set up a Core Data stack with CloudKit sync
> Create a fetch request with sorting and filtering
> Implement background saving with proper merge policies
> Migrate my Core Data model to add a new entity
Why use this:
- β Expert Knowledge: Created by Antoine van der Lee (SwiftLee)
- β Modern Patterns: Covers latest Core Data APIs and best practices
- β Complements SwiftData: Useful for projects maintaining Core Data alongside SwiftData
Source: Dimillian/Skills
Installation:
# Recommended
npx skills add https://github.com/Dimillian/Skills
# Or manual
cd ~/.claude/skills/
git clone https://github.com/Dimillian/Skills.git dimillian-skillsIncluded Skills:
- SwiftUI Component Library
- Navigation patterns
- Data modeling best practices
- Testing strategies
- Performance optimization
- Accessibility implementation
Automatic Activation:
- Building SwiftUI interfaces
- Creating reusable components
- Implementing navigation
- Writing tests
Source: nexus-labs-automation/mobile-observability
Installation:
# Recommended
npx skills add https://github.com/nexus-labs-automation/mobile-observability
# Or manual
cd ~/.claude/skills/
git clone https://github.com/nexus-labs-automation/mobile-observability.git mobile-observabilityCapabilities:
- Analytics integration (Firebase, Mixpanel, Amplitude)
- Crash reporting setup (Crashlytics, Sentry)
- Performance monitoring
- User behavior tracking
- A/B testing implementation
- Feature flagging
- Remote configuration
Example Usage:
> Set up Firebase Analytics for this screen
> Implement crash reporting with proper context
> Add performance monitoring to track app launch time
Source: numman-ali/n-skills
Installation:
# Recommended
npx skills add https://github.com/numman-ali/n-skills
# Or manual
cd ~/.claude/skills/
git clone https://github.com/numman-ali/n-skills.git n-skillsWhat it is: n-skills is a curated collection of production-ready agent skills that have been tested and refined for real-world use. Unlike general skill repositories, n-skills focuses on battle-tested patterns and workflows that have proven effective in professional development environments.
Key Features:
- Production-Ready: All skills are tested in real-world scenarios
- Well-Documented: Each skill includes detailed usage examples
- iOS-Focused: Many skills specifically target iOS/Swift development
- Active Maintenance: Regularly updated with new patterns and fixes
Included Skill Categories:
- Code Quality: Linting, formatting, and code review workflows
- Testing Patterns: Unit test generation, UI testing strategies
- Architecture: MVVM, Clean Architecture, and modular design
- Performance: Optimization techniques and profiling
- DevOps: CI/CD integration, deployment automation
Example Skills:
- SwiftUI component generation with tests
- API client generation from OpenAPI specs
- Database migration strategies
- Localization workflow automation
Usage: Skills from n-skills activate automatically based on context, or you can reference them directly:
> Use the n-skills API client pattern to create a networking layer
> Apply the n-skills testing strategy to this ViewModel
Source: numman-ali/openskills
Installation:
# Recommended
npx skills add https://github.com/numman-ali/openskills
# Or manual
cd ~/.claude/skills/
git clone https://github.com/numman-ali/openskills.git openskillsWhat it is: OpenSkills is a CLI-based skill management system that closely matches Claude Code's skills format. It uses the same prompt structure, marketplace approach, and folder organization, but operates via command-line interface rather than being built into tools.
Capabilities:
- Skill discovery and installation via CLI
- Compatible skill format with Claude Code
- Community-driven skill marketplace
- Easy skill sharing and distribution
Source: wshobson/agents
What it is: A plugin-based system for Claude Code that provides modular agents, commands, and skills. Unlike traditional CLI tools or monolithic repositories, Agents uses isolated plugins where each plugin is completely self-contained.
How It Works: Each plugin is completely isolated with its own agents, commands, and skills:
- Install only what you need - Each plugin loads only its specific agents, commands, and skills
- Minimal token usage - No unnecessary resources loaded into context (~300 tokens per plugin)
- Mix and match - Compose multiple plugins for complex workflows
- Clear boundaries - Each plugin has a single, focused purpose
- Progressive disclosure - Skills load knowledge only when activated
Example: Installing python-development loads 3 Python agents, 1 scaffolding tool, and makes 5 skills available (~300 tokens), not the entire marketplace.
Installation & Usage:
# Add the marketplace to Claude Code
/plugin marketplace add wshobson/agents
# Browse available plugins
/plugin list
# Install specific plugins
/plugin install python-development
/plugin install swift-development # If available for iOSBenefits:
- β Token Efficient: Only ~300 tokens per plugin vs thousands for entire marketplace
- β Focused: Each plugin does one thing well
- β Composable: Combine multiple plugins for complex workflows
- β Progressive: Skills load only when activated
- β
Integrated: Works directly within Claude Code via
/plugincommands
Note: This is a plugin system for Claude Code, not a standalone CLI tool. It integrates directly into your Claude Code workflow.
Discover and download agent skills and templates from these marketplaces:
Primary Marketplaces:
-
- 71,000+ agent skills - Largest marketplace by far
- AI semantic search - Find skills by natural language, not just keywords
- 22+ categories organized by SDLC phase (Development, Testing, DevOps, etc.)
- Quality filters - Filter by stars (min 2β ), maintenance status, popularity
- marketplace.json support - One-command
/plugin installfor compatible skills - Auto-synced with GitHub - Continuously updated with latest community skills
- Compatible with: Claude Code, Codex CLI, ChatGPT (SKILL.md standard)
- Independent community project - Aggregates skills from public GitHub repos
- Why it's #1: Best discoverability with smart search + massive collection
-
- Official Vercel package manager ecosystem for AI agent skills
- Two installation tools available:
npx skills add- Lighter CLI by Vercelnpx add-skill- Full-featured open-source CLI (GitHub)
- Quality-curated skills with leaderboard
- 20,000+ installs within days of launch
- Cross-platform: Claude Code, Cursor, Codex, Copilot, and more
- Note for iOS: Primarily web/React/Next.js focused, but useful if you do full-stack
-
AI Templates - aitmpl.com/agents
- Visual browser for Claude Code templates
- Ready-to-use project configurations
- Pre-built
.claude/directory structures - Browse before downloading
-
Agent Skills Registry - agent-skills.md
- Community-driven skill marketplace
- Search by technology (Swift, SwiftUI, iOS)
- One-command installation
- Wide variety of domains
-
Skill Creator AI - skillcreator.ai/explore
- AI-powered skill discovery
- Explore curated agent skills
- Browse by category and use case
- Community contributions
GitHub Repositories:
- claude-code-templates - Template source files
- Ai-Agent-Skills - Curated skills collection
How to use templates and skills:
# Method 1: npx skills add (RECOMMENDED)
# One-liner installation that works with any GitHub repo URL
# Prompts you to choose installation location and handles symlinks automatically
# Install iOS-specific skills:
npx skills add https://github.com/AvdLee/Swift-Concurrency-Agent-Skill
npx skills add https://github.com/AvdLee/SwiftUI-Agent-Skill
npx skills add https://github.com/AvdLee/Core-Data-Agent-Skill
npx skills add https://github.com/Dimillian/Skills
npx skills add https://github.com/nexus-labs-automation/mobile-observability
npx skills add https://github.com/numman-ali/n-skills
# When prompted, choose:
# - Global (~/.claude/skills) for skills you want across all projects
# - Project (.claude/skills) for project-specific skills
#
# The CLI handles symlinks and folder structure automatically
# Short syntax also available:
npx skills i https://github.com/author/skill-name
# Method 2: OpenSkills CLI
# Community-driven CLI-based skill management
# Compatible with Claude Code's skills format
cd ~/.claude/skills/
git clone https://github.com/numman-ali/openskills.git
# Follow OpenSkills CLI instructions for skill discovery and management
# Method 3: Manual Git Clone (Full Control)
# For those who prefer manual management
cd ~/.claude/skills/
git clone https://github.com/AvdLee/Swift-Concurrency-Agent-Skill.git swift-concurrency
git clone https://github.com/AvdLee/SwiftUI-Agent-Skill.git swiftui
git clone https://github.com/AvdLee/Core-Data-Agent-Skill.git core-data
git clone https://github.com/Dimillian/Skills.git dimillian-skills
# Method 4: Browse Marketplaces for Discovery
# Use these to find skills, then install with Method 1:
# - SkillsMP (https://skillsmp.com/) - 71K+ skills with AI semantic search
# - Skills.sh (https://skills.sh/) - Vercel's curated marketplace
# - AI Templates (https://www.aitmpl.com/agents) - Visual template browser
# - Agent Skills Registry (https://agent-skills.md/) - Community marketplaceBenefits:
- β Jumpstart new projects with proven configurations
- β Learn best practices from working examples
- β Standardize setup across team projects
- β Reduce initial configuration time
- β Visual browsing of available templates
- β AI-powered discovery on SkillsMP (71K+ skills searchable by natural language)
Tip: Start with SkillsMP.com's AI semantic search to find exactly what you need from 71,000+ skills. Use natural language queries like "iOS unit testing patterns" instead of just keywords. Filter by quality (stars) and maintenance status to find actively maintained skills.
Create .claude/skills/my-custom-skill/SKILL.md:
---
name: my-custom-skill
description: Brief description with keywords like "SwiftUI", "networking", "Core Data" for automatic activation
allowed-tools: Read, Write, Edit, mcp__xcodebuildmcp__*
---
# My Custom Skill
## Purpose
[What this skill helps with]
## Instructions
1. [Step-by-step instructions]
2. [Claude should follow]
## Best Practices
- [Key practice 1]
- [Key practice 2]
## Code Templates
```swift
// Include reusable templates
### Managing Skills
```bash
# List installed skills
ls ~/.claude/skills/
# Update all skills
cd ~/.claude/skills/
for dir in */; do cd "$dir"; git pull; cd ..; done
# Remove a skill
rm -rf ~/.claude/skills/skill-name
The CLAUDE.md file is your primary context provider. Claude automatically loads it at session start.
Create CLAUDE.md in your project root:
# Project: [Your App Name]
## Quick Reference
- **Platform**: iOS 17+ / macOS 14+
- **Language**: Swift 6.0
- **UI Framework**: SwiftUI
- **Architecture**: MVVM with @Observable
- **Minimum Deployment**: iOS 17.0
- **Package Manager**: Swift Package Manager
## MCP Integration
**IMPORTANT**: This project uses the following MCP servers:
- **XcodeBuildMCP**: All Xcode build/test/simulator operations
- **GitHub**: Repository and issue management (@github:repo://owner/repo)
- **Memory**: Persistent context across sessions
- **Historian**: Conversation history and past decisions
## Agent Skills Active
- **Swift Concurrency**: async/await, actors, Sendable compliance
- **Dimillian's SwiftUI Components**: Reusable UI patterns
- **Mobile Observability**: Analytics, crash reporting, monitoring
- **n-skills**: Production-ready patterns and workflows
- **OpenSkills**: Best practices and community standards
## Build Commands
- Build: `mcp__xcodebuildmcp__build_sim_name_proj`
- Test: `mcp__xcodebuildmcp__test_sim_name_proj`
- Clean: `mcp__xcodebuildmcp__clean`
- Logs: `mcp__xcodebuildmcp__capture_logs`
## Project Structure
\`\`\`
MyApp/
βββ App/ # App entry point
βββ Features/ # Feature modules (MVVM)
β βββ [FeatureName]/
β β βββ Views/ # SwiftUI views
β β βββ ViewModels/ # @Observable classes
β β βββ Models/ # Data models
βββ Core/ # Shared utilities
β βββ Extensions/
β βββ Services/
β βββ Networking/
βββ Resources/ # Assets, Localizations
βββ Tests/
\`\`\`
## Coding Standards
### Swift 6 Concurrency
- Use strict concurrency checking
- Mark types as Sendable where appropriate
- Use @MainActor for UI-bound code
- Prefer actors over DispatchQueue
- Use async/await over completion handlers
- Never use `DispatchQueue.main.async { @MainActor in ... }`
### SwiftUI Patterns
- Extract views when they exceed 100 lines
- Use @State for local view state only
- Use @Environment for dependency injection
- Prefer NavigationStack over deprecated NavigationView
- Use @Bindable for bindings to @Observable objects
- Always provide accessibility labels
### Navigation Pattern
```swift
// Use NavigationStack with type-safe routing
enum Route: Hashable {
case detail(Item)
case settings
}
NavigationStack(path: $router.path) {
ContentView()
.navigationDestination(for: Route.self) { route in
// Handle routing
}
}// Always use typed errors
enum AppError: LocalizedError {
case networkError(underlying: Error)
case validationError(message: String)
var errorDescription: String? {
switch self {
case .networkError(let error): return error.localizedDescription
case .validationError(let msg): return msg
}
}
}- Unit tests for all ViewModels (80%+ coverage)
- UI tests for critical user flows
- Use Swift Testing framework (@Test, #expect)
- Mock network and external dependencies
- Test concurrency with Task { }
- Use deprecated APIs (UIKit when SwiftUI suffices)
- Create massive monolithic views
- Use force unwrapping (!) without documentation
- Ignore Swift 6 concurrency warnings
- Write completion-based async code
- Use ObservableObject (use @Observable instead)
- Use Combine (use async/await instead)
When starting new features:
- Read the PRD from
docs/PRD.md - Create feature spec in
docs/specs/[feature-name].md - Use
ultrathinkfor architectural decisions - Use Plan Mode (
Shift+Tab) for implementation strategy - Implement incrementally with tests
- Use Memory MCP to store important decisions
@import docs/PRD.md
@import docs/ARCHITECTURE.md
@import docs/ROADMAP.md
docs/
βββ PRD.md # Main Product Requirements Document
βββ ARCHITECTURE.md # System architecture decisions
βββ ROADMAP.md # Development roadmap & priorities
βββ specs/ # Feature specifications
β βββ 000-project-setup.md
β βββ 001-authentication.md
β βββ 002-dashboard.md
β βββ template.md
βββ tasks/ # Task breakdowns
βββ 000-sample.md
βββ [feature]-tasks.md
# Product Requirements Document: [App Name]
## Executive Summary
[Brief description of the product and its primary value proposition]
## Problem Statement
[What problem does this solve? Who experiences this problem?]
## Target Users
- **Primary**: [Description]
- **Secondary**: [Description]
## Success Metrics
| Metric | Target | Measurement |
|--------|--------|-------------|
| User Retention | 40% D7 | Analytics |
| App Rating | 4.5+ | App Store |
| Crash-Free Rate | 99.5% | Crashlytics |
## Core Features
### Feature 1: [Name]
**Priority**: P0 (Must Have)
**Description**: [Detailed description]
**User Stories**:
- As a [user type], I want [action] so that [benefit]
**Acceptance Criteria**:
- [ ] Criterion 1
- [ ] Criterion 2
**Technical Requirements**:
- iOS 17+ required
- Offline support needed
- Data persistence via SwiftData
## Non-Functional Requirements
- **Performance**: App launch < 2s, smooth 60fps scrolling
- **Accessibility**: WCAG 2.1 AA compliance
- **Localization**: English (primary), [other languages]
- **Security**: Keychain for credentials, certificate pinning
## Out of Scope (v1.0)
- [Feature explicitly not included]
## Technical Constraints
- Swift 6.0+ with strict concurrency
- SwiftUI-only (no UIKit unless necessary)
- SwiftData for persistence
- Minimum iOS 17.0
## Timeline
| Phase | Duration | Deliverables |
|-------|----------|--------------|
| Design | 2 weeks | Figma mockups |
| Development | 8 weeks | MVP features |
| Testing | 2 weeks | QA sign-off |
| Launch | 1 week | App Store submission |Create .claude/commands/ with these files:
.claude/commands/create-prd.md
---
description: Create a new PRD from requirements discussion
allowed-tools: Read, Write, Edit
---
# Create Product Requirements Document
Based on our discussion, create a comprehensive PRD in `docs/PRD.md`.
Follow this structure:
1. Executive Summary
2. Problem Statement
3. Target Users
4. Success Metrics
5. Core Features with user stories and acceptance criteria
6. Non-Functional Requirements
7. Technical Constraints
8. Timeline
Ask clarifying questions before writing. Use ultrathink for comprehensive planning..claude/commands/generate-spec.md
---
description: Generate feature specification from PRD
argument-hint: <feature-name>
allowed-tools: Read, Write
---
# Generate Feature Specification
Read the PRD at `docs/PRD.md` and create a detailed specification for: $ARGUMENTS
1. Extract relevant user stories and requirements
2. Define acceptance criteria
3. Design technical architecture
4. Create the spec file at `docs/specs/$ARGUMENTS.md`
ultrathink about the technical design before writing.Extended thinking is disabled by default in Claude Code. You can enable it on-demand.
| Method | Description |
|---|---|
| Tab key | Press Tab to toggle Thinking on/off during session |
| Prompt triggers | Use phrases like "think", "think hard", "ultrathink" |
| Environment variable | Set MAX_THINKING_TOKENS for permanent enablement |
| Keyword | Budget | Best For |
|---|---|---|
think |
~4K tokens | Simple planning, quick decisions |
think hard / megathink |
~10K tokens | Medium complexity |
think harder / think longer |
~16K tokens | Complex analysis |
ultrathink |
~32K tokens (max) | Architecture, critical debugging |
# Simple planning
"Think about how to structure this view"
# Medium complexity
"Think hard about the navigation architecture for this feature"
# Complex architectural decisions
"Ultrathink about how to design the offline sync system for this app"
β Use Ultrathink for:
- System architecture decisions
- Complex debugging (e.g., race conditions, memory leaks)
- Large-scale refactoring planning
- Migration strategies (UIKit β SwiftUI, CoreData β SwiftData)
- Performance optimization analysis
β Avoid Ultrathink for:
- Simple code changes
- Well-specified tasks with clear steps
- Rapid prototyping iterations
Plan Mode instructs Claude to analyze codebases with read-only operations - perfect for:
- Multi-step implementation planning
- Code exploration before making changes
- Interactive development with iterative direction refinement
# Start new session in Plan Mode
claude --permission-mode plan
# Or use -p flag for headless Plan Mode query
claude --permission-mode plan -p "Analyze the authentication system and suggest improvements"- Press
Shift+Tabto cycle: Normal β Auto-Accept β Plan Mode - Plan Mode indicator:
βΈ plan mode on - Auto-Accept indicator:
β΅β΅ accept edits on
Use Opus for planning, Sonnet for execution:
# Plan with Opus
claude --model claude-opus-4-5-20250929 --permission-mode plan
# Execute with Sonnet (more cost-effective)
claude --model claude-sonnet-4-5-20250929build.md
---
description: Build the iOS project intelligently
allowed-tools: mcp__xcodebuildmcp__*
---
# Build Project
Detect the project type and build appropriately:
1. Check for .xcworkspace or .xcodeproj
2. Use XcodeBuildMCP to build for iOS Simulator
3. Report any build errors with suggested fixestest.md
---
description: Run all relevant tests
allowed-tools: mcp__xcodebuildmcp__*, Bash(swift *)
---
# Run Tests
Based on current context:
- For main app: `mcp__xcodebuildmcp__test_sim_name_proj`
- For Swift packages: `mcp__xcodebuildmcp__swift_package_test`
- Report test results and any failuresrun-app.md
---
description: Build and launch app on simulator
allowed-tools: mcp__xcodebuildmcp__*
---
# Build and Run
1. List available simulators
2. Build the app for the default simulator (iPhone 15)
3. Boot the simulator if needed
4. Install and launch the app
5. Start capturing logscreate-view.md
---
description: Create a new SwiftUI view with ViewModel
argument-hint: <ViewName>
allowed-tools: Read, Write
---
# Create SwiftUI View: $ARGUMENTS
Create a new SwiftUI view following project patterns:
1. Read existing views for style reference
2. Create `$ARGUMENTS.swift` in appropriate Features directory
3. Create `${ARGUMENTS}ViewModel.swift` as @Observable class
4. Add preview provider
5. Follow project's navigation and styling patternsSubagents are specialized AI assistants invoked to handle specific task types.
.claude/agents/ios-architect.md
---
name: ios-architect
description: iOS architecture expert for system design and patterns
model: claude-opus-4-5-20250929
tools: Read, Grep, Glob
---
You are an expert iOS architect specializing in Swift and SwiftUI.
Your expertise includes:
- MVVM, MVC, VIPER, Clean Architecture
- Swift Concurrency (actors, async/await, Sendable)
- SwiftUI navigation patterns
- Dependency injection
- SwiftData and Core Data
- Modular app architecture
When consulted:
1. Analyze the existing codebase structure
2. Consider scalability and maintainability
3. Propose patterns that fit the team's expertise
4. Provide concrete Swift code examples
5. Consider testing implicationsOutput Styles adapt Claude Code for different use cases.
| Style | Description |
|---|---|
| Default | Standard software engineering focus |
| Explanatory | Provides educational "Insights" while coding |
| Learning | Collaborative learn-by-doing with TODO(human) markers |
# Open style menu
/output-style
# Or switch directly
/output-style explanatory
/output-style learningPlugins extend Claude Code with custom functionality.
# Open plugin manager
/plugin
# Add custom marketplace
claude plugin marketplace add owner/repo
# Install directly
claude plugin install plugin-name@marketplace-nameBased on Oleksandr Khorbushko's Guide with updates for Swift 6 and Xcode 15+
Add these to your project's build settings or .xcode.env file:
Build Performance
# Increase concurrent compile tasks (adjust based on your Mac's cores)
export IDEBuildOperationMaxNumberOfConcurrentCompileTasks=8
# Enable build timing
export CLANG_ENABLE_BUILD_TIMING=YES
# Swift compilation optimization
export SWIFT_COMPILATION_MODE=wholemodule # Release
export SWIFT_COMPILATION_MODE=incremental # Debug
# Enable module caching
export SWIFT_MODULE_CACHING_ENABLED=YES
# Swift 6 specific optimizations
export SWIFT_ENFORCE_EXCLUSIVE_ACCESS=on # Memory safety
export SWIFT_DETERMINISTIC_HASHING=1 # Reproducible builds
# Enable explicit modules (Xcode 15+)
export SWIFT_ENABLE_EXPLICIT_MODULES=YES
# Reduce index time (CI/CD only - disables code completion locally)
export COMPILER_INDEX_STORE_ENABLE=NOSwift 6 Concurrency Settings
# Enable strict concurrency checking
SWIFT_STRICT_CONCURRENCY=complete
# Enable upcoming features
SWIFT_UPCOMING_FEATURE_CONCISE_MAGIC_FILE=YES
SWIFT_UPCOMING_FEATURE_EXIST_ANY=YES
SWIFT_UPCOMING_FEATURE_IMPLICIT_OPEN_EXISTENTIALS=YESXcode 15+ Specific Optimizations
# Enable explicit modules for faster incremental builds
SWIFT_ENABLE_EXPLICIT_MODULES=YES
# Use new build system features
BUILD_LIBRARY_FOR_DISTRIBUTION=NO # Unless building a framework
# Enable background compilation
COMPILER_INDEX_STORE_ENABLE=YES
INDEX_ENABLE_BUILD_ARENA=YES
# Optimize asset catalog compilation
ASSETCATALOG_COMPILER_OPTIMIZATION=space # or 'time' for faster buildsSource: Pol Piella's Xcode EditorConfig Guide
EditorConfig provides consistent coding styles across different editors and IDEs, including Xcode (14.3+).
Installation:
Create .editorconfig in your project root:
# EditorConfig for iOS/Swift Projects
# https://editorconfig.org
root = true
# All files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# Swift files
[*.swift]
indent_style = space
indent_size = 4
max_line_length = 120
# SwiftUI files (same as Swift)
[*.swift]
indent_style = space
indent_size = 4
# Xcode project files
[*.{xcodeproj,xcworkspace}/**.pbxproj]
indent_style = tab
# YAML files
[*.{yml,yaml}]
indent_style = space
indent_size = 2
# JSON files
[*.json]
indent_style = space
indent_size = 2
# Markdown files
[*.md]
trim_trailing_whitespace = false
max_line_length = off
# Plist files
[*.plist]
indent_style = tab
# Strings files
[*.strings]
indent_style = space
indent_size = 2Key Benefits:
- Automatic Formatting: Xcode 14.3+ respects EditorConfig settings automatically
- Team Consistency: All team members get the same formatting regardless of their Xcode settings
- Language-Specific: Different rules for Swift, YAML, JSON, etc.
- Version Control Friendly: Committed to repo, applies to all contributors
Xcode Integration:
- Xcode 14.3+ has built-in EditorConfig support
- No plugins or extensions needed
- Settings are applied automatically when opening files
- Overrides local Xcode text editing preferences for files in the project
Common Settings Explained:
| Setting | Options | Description |
|---|---|---|
indent_style |
space, tab | Use spaces or tabs for indentation |
indent_size |
number | Number of spaces per indent level |
max_line_length |
number, off | Maximum line length (Xcode warns beyond this) |
end_of_line |
lf, crlf, cr | Line ending style (lf = Unix/macOS) |
charset |
utf-8, etc. | File character encoding |
trim_trailing_whitespace |
true, false | Remove whitespace at end of lines |
insert_final_newline |
true, false | Ensure file ends with newline |
Advanced Swift Configuration:
# Swift files with strict formatting
[*.swift]
indent_style = space
indent_size = 4
max_line_length = 120
trim_trailing_whitespace = true
insert_final_newline = true
# Enforce consistent line endings
end_of_line = lf
# Match Swift API Design Guidelines spacing
# (Xcode 15+ supports additional Swift-specific rules)Verification:
# Check if EditorConfig is working
# Open a Swift file in Xcode and check:
# Xcode > Settings > Text Editing > Indentation
# It should show "(using EditorConfig)" when activeIntegration with Other Tools: EditorConfig works alongside:
- SwiftLint (formatting rules)
- swift-format (code formatting)
- Xcode's built-in formatting (Ctrl+I)
Best Practices:
- Commit
.editorconfigto version control - Keep settings consistent with your SwiftLint rules
- Document any project-specific deviations
- Review EditorConfig when onboarding new team members
General:
- Navigation: Uses Focused Editor
- Double Click Navigation: Uses Separate Window
- Issues: Show Live Issues β
- Enable: Automatically trim trailing whitespace
- Enable: Including whitespace-only lines
Text Editing:
- Enable: Code folding ribbon
- Enable: Line numbers
- Enable: Code completion
- Enable: Show type information
- Indentation: 4 spaces (not tabs)
- Enable: Automatically balance brackets
Behaviors (Xcode > Settings > Behaviors):
- Build Starts: Hide navigator
- Build Succeeds: Show navigator (+ play sound for motivation!)
- Build Fails: Show issue navigator + beep
- Testing: Show test navigator
- Run Completes: Show debug navigator
Locations:
- DerivedData: Custom location (ideally RAM disk)
- Archives: ~/Library/Developer/Xcode/Archives (default)
Key Bindings (Optional but Recommended):
- β + Shift + O: Open Quickly
- β + Shift + J: Reveal in Project Navigator
- β + Shift + F: Find in Project
- ^ + β + β: Switch between .swift and Test file
- β + K: Clear Console
Create .swiftlint.yml with Swift 6 optimizations:
# SwiftLint Configuration for Swift 6 Projects
included:
- Sources
- App
- Features
- Core
excluded:
- Carthage
- Pods
- DerivedData
- .build
- Tests/MockData
- "**/*.generated.swift"
analyzer_rules:
- unused_declaration
- unused_import
disabled_rules:
- trailing_whitespace
- todo
opt_in_rules:
- array_init
- closure_spacing
- empty_count
- explicit_init
- first_where
- force_unwrapping
- sorted_first_last
- strict_fileprivate
- unavailable_function
- unneeded_parentheses_in_closure_argument
- vertical_parameter_alignment_on_call
# Swift 6 Concurrency
- actor_isolated
- sendable_function_not_sendable
- missing_sendable_annotation
line_length:
warning: 120
error: 200
ignores_comments: true
ignores_urls: true
file_length:
warning: 500
error: 1000
ignore_comment_only_lines: true
type_body_length:
warning: 300
error: 500
function_body_length:
warning: 50
error: 100
cyclomatic_complexity:
warning: 10
error: 20
ignores_case_statements: true
identifier_name:
min_length:
warning: 2
max_length:
warning: 40
error: 50
excluded:
- id
- url
- URL
- db
- x
- y
- i
- j
# Swift 6 specific
strict_concurrency: warning
actor_isolated: warning
reporter: "xcode"Pre-Build: SwiftLint
#!/bin/bash
if which swiftlint >/dev/null; then
swiftlint
else
echo "warning: SwiftLint not installed"
fiPre-Build: Swift Format Check
#!/bin/bash
if which swift-format >/dev/null; then
swift-format lint --recursive Sources/
else
echo "warning: swift-format not installed, run: brew install swift-format"
fiCreate .swift-format in project root:
{
"version": 1,
"lineLength": 120,
"indentation": {
"spaces": 4
},
"respectsExistingLineBreaks": true,
"lineBreakBeforeControlFlowKeywords": false,
"lineBreakBeforeEachArgument": true,
"lineBreakBeforeEachGenericRequirement": false,
"prioritizeKeepingFunctionOutputTogether": true,
"indentConditionalCompilationBlocks": true,
"lineBreakAroundMultilineExpressionChainComponents": true,
"rules": {
"AllPublicDeclarationsHaveDocumentation": false,
"AlwaysUseLowerCamelCase": true,
"AmbiguousTrailingClosureOverload": true,
"BeginDocumentationCommentWithOneLineSummary": true,
"DoNotUseSemicolons": true,
"DontRepeatTypeInStaticProperties": true,
"FileScopedDeclarationPrivacy": true,
"FullyIndirectEnum": true,
"GroupNumericLiterals": true,
"IdentifiersMustBeASCII": true,
"NeverForceUnwrap": false,
"NeverUseForceTry": false,
"NeverUseImplicitlyUnwrappedOptionals": false,
"NoAccessLevelOnExtensionDeclaration": true,
"NoBlockComments": true,
"NoCasesWithOnlyFallthrough": true,
"NoEmptyTrailingClosureParentheses": true,
"NoLabelsInCasePatterns": true,
"NoLeadingUnderscores": false,
"NoParensAroundConditions": true,
"NoVoidReturnOnFunctionSignature": true,
"OneCasePerLine": true,
"OneVariableDeclarationPerLine": true,
"OnlyOneTrailingClosureArgument": true,
"OrderedImports": true,
"ReturnVoidInsteadOfEmptyTuple": true,
"UseLetInEveryBoundCaseVariable": true,
"UseShorthandTypeNames": true,
"UseSingleLinePropertyGetter": true,
"UseSynthesizedInitializer": true,
"UseTripleSlashForDocumentationComments": true,
"UseWhereClausesInForLoops": true,
"ValidateDocumentationComments": true
}
}Install Recommended Tools:
# SwiftLint
brew install swiftlint
# Swift Format
brew install swift-format
# Periphery (finds unused code)
brew install periphery
# XcodeGen (project generation from YAML)
brew install xcodegenPeriphery Configuration (.periphery.yml):
# Find unused code
targets:
- MyApp
schemes:
- MyApp
retain_public: false
disable_redundant_public_analysis: false
clean_build: false.claude/settings.json:
{
"model": "claude-sonnet-4-5-20250929",
"permissions": {
"allow": [
"Read", "Glob", "Grep",
"mcp__xcodebuildmcp__build_*",
"mcp__xcodebuildmcp__test_*",
"mcp__xcodebuildmcp__list_*",
"Bash(git status)",
"Bash(git diff *)"
],
"deny": [
"Write", "Edit",
"Bash(rm *)",
"Bash(git push *)"
]
}
}{
"permissions": {
"allow": [
"Read", "Glob", "Grep",
"Write(docs/*)",
"Edit(docs/*)",
"mcp__xcodebuildmcp__*"
],
"deny": [
"Write(*.swift)",
"Edit(*.swift)"
]
}
}# Start in Plan Mode (read-only)
claude --permission-mode plan
# Return to normal development
claude{
"model": "claude-sonnet-4-5-20250929",
"permissions": {
"allow": [
"mcp__xcodebuildmcp__*",
"Read", "Write", "Edit",
"Bash(git *)",
"Bash(swift *)",
"Bash(swiftlint *)"
],
"deny": [
"Read(.env*)",
"Write(.env*)",
"Bash(rm -rf *)"
]
},
"env": {
"PROJECT_NAME": "MyApp",
"DEFAULT_SIMULATOR": "iPhone 15",
"SWIFT_VERSION": "6.0",
"IOS_DEPLOYMENT_TARGET": "17.0"
}
}Hooks execute at various points in Claude Code's lifecycle.
{
"hooks": {
"SessionStart": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/session-start.sh"
}
]
}
],
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "jq -r '.tool_input.file_path' | { read f; [[ \"$f\" == *.swift ]] && swiftlint lint --path \"$f\" --quiet; }"
}
]
}
]
}
}.claude/hooks/session-start.sh
#!/bin/bash
PROJECT_NAME=$(basename "$(pwd)")
SWIFT_VERSION=$(swift --version 2>/dev/null | head -1)
echo "π Starting $PROJECT_NAME session" >&2
echo "π± $SWIFT_VERSION" >&2
# Check if simulator is booted
if ! xcrun simctl list devices booted | grep -q "Booted"; then
echo "π‘ No simulator running. Use /run-app to boot one." >&2
fiMyiOSApp/
βββ .claude/
β βββ commands/ # Project slash commands
β β βββ build.md
β β βββ test.md
β β βββ run-app.md
β β βββ create-view.md
β β βββ create-prd.md
β βββ agents/ # Project subagents
β β βββ ios-architect.md
β β βββ swift-reviewer.md
β βββ skills/ # Project Agent Skills
β β βββ ios-testing/
β β βββ SKILL.md
β βββ hooks/ # Automation hooks
β β βββ session-start.sh
β βββ settings.json # Team settings (committed)
β βββ settings.local.json # Personal settings (gitignored)
βββ .mcp.json # MCP server configuration
βββ .editorconfig # EditorConfig for consistent formatting
βββ CLAUDE.md # Main project context
βββ docs/
β βββ PRD.md
β βββ ARCHITECTURE.md
β βββ specs/
β βββ tasks/
βββ MyApp/
β βββ App/
β βββ Features/
β βββ Core/
β βββ Resources/
βββ MyAppTests/
βββ Package.swift
βββ .swiftlint.yml
# Claude Code
.claude/settings.local.json
.claude/*.log
# Keep these committed
!.claude/commands/
!.claude/agents/
!.claude/hooks/
!.claude/settings.jsonFor optimal Xcode and Git workflow, see thoughtbot's Xcode and Git guide:
Key Tips:
- Use
.gitattributesfor proper project file merging - Configure Xcode to use relative paths
- Avoid committing user-specific settings (
.xcuserstate) - Use Git LFS for large assets if needed
Recommended .gitattributes:
*.pbxproj merge=union
*.xcscheme merge=union
*.xcworkspacedata merge=unionThis helps prevent merge conflicts in Xcode project files.
π Recommended Reading: For comprehensive iOS development best practices beyond Claude Code setup, see the Infinum iOS Handbook which covers architecture patterns, testing strategies, and team workflows.
-
Start with Planning
- Use Plan Mode for new features
- Write specs before code
- Use
ultrathinkfor architectural decisions
-
Incremental Development
- Complete one task at a time
- Test after each change
- Commit frequently
-
Leverage Agent Skills
- Swift Concurrency skill for async code
- Mobile Observability for analytics
- n-skills for production-ready patterns
- Skills activate automatically
-
Use MCP Servers Effectively
- XcodeBuildMCP for all Xcode operations
- GitHub MCP for issue/PR management
- Memory MCP for cross-session context
# Starting a new feature with concurrency
"Read the PRD and spec for authentication. Ultrathink about the implementation.
Use Swift Concurrency skill best practices. Create a task breakdown."
# Debugging with logs
"The app crashes when logging in. Capture logs with XcodeBuildMCP and
ultrathink to identify the root cause. Check for concurrency issues."
# Using GitHub integration
"Review the PR at @github:pr://owner/repo/123 and provide feedback on
the authentication implementation."
# Storing decisions
"Remember: We decided to use SwiftData with CloudKit sync. Store this
decision for future reference."
| Shortcut | Action |
|---|---|
Tab |
Toggle extended thinking on/off |
Shift+Tab |
Cycle permission modes |
Ctrl+C |
Cancel current operation |
Ctrl+O |
Toggle verbose mode (see thinking) |
/ |
Open slash command menu |
@ |
Reference files, directories, MCP resources |
| Command | Description |
|---|---|
/help |
Show all available commands |
/clear |
Clear conversation context |
/compact |
Summarize and compress context |
/cost |
Show token usage and cost |
/model |
Change model mid-session |
/mcp |
Manage MCP servers |
/build |
Build project (custom command) |
/test |
Run tests (custom command) |
# Check Claude Code health
claude doctor
# Debug MCP connections
claude --mcp-debug
# View session logs
tail -f ~/.claude/logs/session.log
# Reset configuration
rm -rf ~/.claude && claude- Install Claude Code CLI (native method)
- Authenticate with Claude account
- Install all essential MCP servers (run setup script)
- Install community agent skills (Swift Concurrency, SwiftUI, Dimillian, n-skills, etc.)
- Create project
.claude/directory structure - Create root
CLAUDE.mdwith project context - Create
.mcp.jsonwith MCP server configuration - Create
.editorconfigfor consistent formatting - Create essential slash commands (build, test, run-app)
- Set up hooks for Swift linting
- Configure SwiftLint with
.swiftlint.yml - Apply Xcode optimizations
- Create
docs/structure for PRD workflow - Write initial PRD
- Configure permissions in
settings.json - Test:
/buildand/run-app
- Claude Code Official Docs
- XcodeBuildMCP GitHub
- xc-mcp GitHub
- MCP Documentation
- Memory Keeper MCP - Advanced memory system
- Axiom iOS Development Skills - β 50+ specialized iOS skills with automated auditors, analyzers, and iOS 26 support
- AvdLee's Swift Concurrency Skill - Expert Swift Concurrency guidance
- AvdLee's SwiftUI Skill - Modern SwiftUI patterns and best practices
- AvdLee's Core Data Skill - Core Data stack setup, migrations, and CloudKit sync
- Dimillian's Skills Collection
- Nexus Labs Mobile Observability
- n-skills - Production Skills - Curated production-ready agent skills
- OpenSkills - CLI Tool - CLI for managing skills
- Agents Plugin System - Modular plugin system for Claude Code
- Everything Claude Code - β Complete all-in-one configuration from Anthropic hackathon winner
- SkillsMP - β 71,000+ skills with AI semantic search (LARGEST marketplace)
- Skills.sh - Official Vercel package manager for AI agent skills
- AI Templates - Visual browser for Claude Code templates
- Agent Skills Registry - Community skill marketplace with search
- Skill Creator AI - AI-powered skill discovery and exploration
- Claude Code Templates - Template repository (GitHub)
- Ai-Agent-Skills - Curated skills repository (GitHub)
- Vercel Agent Skills - Official Vercel skills (React/Next.js focused)
- Make Xcode Great Again - Xcode performance optimization
- Xcode EditorConfig Setup - Consistent formatting with EditorConfig
- Xcode and Git: Bridging the Gap - Git integration best practices for Xcode projects
- Infinum iOS Handbook - Comprehensive iOS development guide covering architecture, testing, CI/CD, and best practices
Inspired by and builds upon: Onur Keskin's Claude Code iOS Dev Guide
- Anthropic for Claude Code CLI
- Charles Wiltgen for Axiom - comprehensive iOS development skills suite
- Affaan Mustafa for Everything Claude Code - comprehensive configuration collection
- Vercel for Skills.sh and agent skills ecosystem
- Cameron Cooke for XcodeBuildMCP
- Conor Luddy for xc-mcp
- Antoine van der Lee for Swift Concurrency, SwiftUI, and Core Data Skills
- Thomas Ricouard (Dimillian) for Skills Collection
- Nexus Labs for Mobile Observability
- Numan Ali for n-skills and OpenSkills
- skillcreatorai for Ai-Agent-Skills collection
- Carlos Davila for Claude Code Templates
- Pol Piella for EditorConfig Xcode guide
- Oleksandr Khorbushko for Xcode optimization guide
- thoughtbot for Xcode/Git integration guide
- Infinum for comprehensive iOS handbook
- The entire iOS development community
Last Updated: January 2026
Claude Code Version: 2.1.7