# AGENTS.md - this project

Instructions for AI coding agents working in this repository.

## Project

A Swift + SwiftUI project.

Stack: Swift + SwiftUI.

## Commands

- Build: `xcodebuild -scheme <Scheme> build`
- Tests: `xcodebuild test -scheme <Scheme> -destination "platform=iOS Simulator,name=iPhone 16"`

## How to work in this repo

- Read the relevant files before editing. Follow the patterns already in the codebase over these generic rules.
- Make the smallest change that solves the task. Do not refactor or reformat unrelated code.
- Before saying a task is done, run the type-check, lint and tests listed under Commands and fix what you broke.
- If requirements are ambiguous, ask one clear question instead of guessing.
- Never commit secrets, API keys or `.env` files. Use env vars and keep `.env.example` up to date.
- Do not add a new dependency when the standard library or an existing dependency already covers it.
- Ask before adding, removing or upgrading any dependency.
- Ask before changing database schemas, auth, payments or CI configuration.
- Never delete files, drop data or run destructive commands (`rm -rf`, `git push --force`, `DROP TABLE`) without explicit approval.
- Keep each change under ~200 changed lines where possible; split larger work into steps.

## Swift + SwiftUI

- Use SwiftUI for new UI. Keep views small; extract subviews instead of long `body` properties.
- For iOS 17+ targets, use the Observation framework (`@Observable`) instead of `ObservableObject` / `@Published`.
- Use async/await and structured concurrency. Mark UI-facing types `@MainActor`.
- Respect Swift 6 strict concurrency: make shared types `Sendable` instead of silencing warnings.
- No force unwraps (`!`) outside tests.
- Store secrets in the Keychain, never in `UserDefaults`.
- Avoid editing `.pbxproj` by hand; ask the user to add files or targets in Xcode if needed.

## Reference docs

- [SwiftUI docs](https://developer.apple.com/documentation/swiftui)
