Skip to content
Agent Friendly Code

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 configurations
  • xcodebuild -scheme App buildbuild one scheme
  • xcodebuild test -scheme App -destination 'platform=iOS Simulator,name=iPhone 17'tests on a simulator; name one installed on the machine
  • xcodebuild test … -only-testing:AppTests/FooTestsone test target, class or method
  • swift 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 (-workspace or -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.

iOS repos with an AGENTS.md or CLAUDE.md
RepoFileLengthStarsLanguageScore
onevcat/KingfisherAGENTS.md 3,974 chars24.4k ★Swift74.5
mozilla-mobile/firefox-iosAGENTS.md 1,694 chars13.1k ★Swift78.2
wordpress-mobile/WordPress-iOSAGENTS.md 6,191 chars3.9k ★Swift84.6
home-assistant/iOSAGENTS.md 8,078 chars2.4k ★Swift76.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