CLAUDE.md for an iOS app in Swift
Tells Claude how to build and test an iOS app from the command line with xcodebuild, plus SwiftUI and concurrency conventions. Change the scheme and simulator to match your project.
Tested with Claude Code 2.1.329
Spots to fill
{{app_name}}App namee.g.Pantry{{scheme}}Xcode scheme namee.g.Pantry{{simulator}}Simulator to test on (list them with `xcrun simctl list devices`)e.g.iPhone 17
CLAUDE.md
# {{app_name}}
iOS app in Swift and SwiftUI.
## Commands
- Build: `xcodebuild -scheme {{scheme}} -destination 'platform=iOS Simulator,name={{simulator}}' build`
- Test: `xcodebuild -scheme {{scheme}} -destination 'platform=iOS Simulator,name={{simulator}}' test`
- Lint: `swiftlint`
Build and run the tests before saying a task is done. If the build fails, read the first
error in the log, not the last.
## Conventions
- SwiftUI views stay small; move logic into `@Observable` models.
- Mark UI code `@MainActor`; use `async`/`await`, not completion handlers.
- No force unwraps (`!`) outside tests; handle the nil case.
- User-facing text goes through the String Catalog (`Localizable.xcstrings`).
## Do not
- Edit `*.xcodeproj` / `project.pbxproj` by hand unless asked; describe the change instead.
- Change signing, bundle identifiers or entitlements.
- Add a Swift package without saying why.
CLAUDE.md
# Pantry
iOS app in Swift and SwiftUI.
## Commands
- Build: `xcodebuild -scheme Pantry -destination 'platform=iOS Simulator,name=iPhone 17' build`
- Test: `xcodebuild -scheme Pantry -destination 'platform=iOS Simulator,name=iPhone 17' test`
- Lint: `swiftlint`
Build and run the tests before saying a task is done. If the build fails, read the first
error in the log, not the last.
## Conventions
- SwiftUI views stay small; move logic into `@Observable` models.
- Mark UI code `@MainActor`; use `async`/`await`, not completion handlers.
- No force unwraps (`!`) outside tests; handle the nil case.
- User-facing text goes through the String Catalog (`Localizable.xcstrings`).
## Do not
- Edit `*.xcodeproj` / `project.pbxproj` by hand unless asked; describe the change instead.
- Change signing, bundle identifiers or entitlements.
- Add a Swift package without saying why.