What to put in an AGENTS.md for iOS
Agents learned Swift before Swift 6 strict concurrency and Swift Testing, so state the Xcode version, each target's language mode, and which test framework new tests use. Give the exact scheme and destination: agents can't guess them.
By Himanshu Singh · Updated · How we score →
Which commands should it list?
xcodebuild -listschemes, targets and configurationsxcodebuild -scheme App buildbuild one schemexcodebuild test -scheme App -destination 'platform=iOS Simulator,name=iPhone 17'tests on a simulator; name one installed on the machinexcodebuild test … -only-testing:AppTests/FooTestsone test target, class or methodswift testtests of a local Swift package
Write them as your repo runs them, with its package manager and flags, plus how to run one test.
What layout should it explain?
- Workspace or project (
-workspaceor-project), and the scheme and destination CI uses. - Which code is in local Swift packages, tested with
swift test, and which in app targets. - Each target's Swift Language Version and Strict Concurrency Checking level.
What do agents get wrong?
- In Swift 6 language mode data races are compile errors; fix them, don't drop the target back to Swift 5.
- New tests use Swift Testing (
import Testing,@Test,#expect); XCTest can stay alongside it. - Migrate to Swift 6 one module at a time; name targets still on Swift 5 so an agent doesn't switch them.
From the official docs: developer.apple.com/_index.html (new tab) · developer.apple.com/adoptingswift6 (new tab) · developer.apple.com/testing (new tab) · swift.org/testing.html (new tab). The rest of the file is the same for any project: what goes in an AGENTS.md.
iOS repos with an AGENTS.md or CLAUDE.md (4)
Built on iOS; 4 pass the AGENTS.md check in full.
| Repo | File | Length | Stars | Language | Score |
|---|---|---|---|---|---|
| onevcat/ | AGENTS.md | 3,974 chars | 24.4k ★ | Swift | 74.5 |
| mozilla-mobile/ | AGENTS.md | 1,694 chars | 13.1k ★ | Swift | 78.2 |
| wordpress-mobile/ | AGENTS.md | 6,191 chars | 3.9k ★ | Swift | 84.6 |
| home-assistant/ | AGENTS.md | 8,078 chars | 2.4k ★ | Swift | 76.5 |
By language: Swift AGENTS.md examples
More examples: Next.js · React · FastAPI · Flutter · Android · .NET · Rails · Vue · Laravel · Django · Angular · React Native · Spring Boot · all examples