# CLAUDE.md: SwiftUI app (Swift 6)

## Build & test
- `xcodebuild -scheme App -destination 'platform=iOS Simulator,name=iPhone 16' build test`
- Format/lint with `swift format` / SwiftLint if configured.

## Conventions
- Swift 6 language mode with strict concurrency. Fix data-race errors properly (actors, `Sendable`, `@MainActor`); don't silence them with `@unchecked Sendable` or `nonisolated(unsafe)`.
- UI state with the Observation framework: `@Observable` classes, `@State` for owned models, `@Bindable` for bindings, `@Environment` for shared ones. No new `ObservableObject`/`@Published`.
- Views stay small; extract subviews instead of long `body`s. Previews with `#Preview` for every view.
- Navigation with `NavigationStack` and typed `navigationDestination(for:)`.
- Async work with `async/await` and `.task {}` modifiers (auto-cancelled). No completion handlers in new code; no `DispatchQueue.main.async` in SwiftUI code.
- Persistence with SwiftData (`@Model`, `@Query`) if the project uses it; otherwise follow the existing store.
- Networking through one `APIClient` using `URLSession` + `Codable`.
- Accessibility: labels on icon-only buttons, support Dynamic Type, no fixed font sizes.

## Tests
Swift Testing (`import Testing`, `@Test`, `#expect`) for new tests.

## Don't
Don't force unwrap (`!`) outside tests, or edit the `.pbxproj` by hand when a Swift package or file can be added via the project's tooling.
