Skip to content
SwiftSkills

Swift API design and style with AI agents: naming, FormatStyle and interface writing

Install a Swift API Design Guidelines skill so the agent names types and methods the Apple way, add Airbnb Swift Style or Bylaws for formatting lint, prefer Foundation FormatStyle for locale-aware strings, and run an iOS code audit plus writing-for-interfaces before merge so unclear copy and invented APIs do not ship.

Last updated:

This page is about getting a coding agent to name Swift APIs consistently, lint style, format values with Foundation, and write clear UI copy. For a Claude Code-only shopping list of SwiftUI skills, see Best Claude Code skills for SwiftUI. Localization workflows live in Localizing an iOS app with AI agents.

What the agent has to get right

Three layers show up in almost every PR an agent opens:

  1. API surface — type and method names, argument labels, boolean wording, documentation comments. Skills such as Swift API Design encode those conventions for the agent.

  2. Formatting and style — indentation, import order, access control. Airbnb Swift Style enforces that guide in Agent Skills tools; Bylaws is a brew-installed linter the agent can run.

  3. Presented values and UI words — dates, numbers and measurements should go through Foundation FormatStyle; customer-facing strings should follow Writing in the Human Interface Guidelines.

From Apple's FormatStyle reference: types conforming to the protocol take an input type and produce formatted instances of an output type (often String or AttributedString). The formatting process accounts for locale-specific conventions such as grouping and separators for numbers and presentation of units for measurements.

From HIG Writing: determine the app's voice, match tone to context, prefer clear short wording, and write for everyone (plain language, accessibility and localization in mind).

Rules worth adding to AGENTS.md or CLAUDE.md:

Swift APIs: follow the project's API Design / style skill for naming. Never invent one-off argument labels. Format dates, numbers and measurements with Foundation FormatStyle (or the project's locale helpers), not string interpolation. UI copy: clear voice, tone matched to context, no jargon; run writing-for-interfaces on alerts and empty states before merge.

Step 1: naming with an API design skill

Ask the agent to:

  1. Install Swift API Design (npx skills add https://github.com/Erikote04/Swift-API-Design-Guidelines-Agent-Skill).

  2. Review new public types and methods against the skill before opening a PR.

  3. Prefer the project's existing naming patterns when they already match the skill; do not rename the whole module in one pass.

Honest limit: the upstream Swift API Design Guidelines document lives outside developer.apple.com; this guide only cites Apple facts from FormatStyle and HIG Writing. The skill still teaches the agent those naming conventions from its own README content.

Step 2: style lint (Airbnb or Bylaws)

Pick one lane:

  • Airbnb Swift Style skill when the team already follows that guide — install with the README npx skills add … --skill airbnb-swift-style command.

  • Bylaws when you want a CLI the agent can run: brew install theblixguy/tap/bylaws, then bylaws lint in the repo.

Do not install every style skill at once; collisions confuse the agent. One primary style source plus the API design skill is enough.

Step 3: FormatStyle instead of hand-built strings

When the agent formats a Date, number or Measurement, point it at Swift FormatStyle and Apple's FormatStyle documentation. Reject PRs that build user-visible strings with raw interpolation when a format style exists.

Example shape (API names from Apple's doc; tune for your types):

swift

Text(price, format: .currency(code: "EUR"))
Text(eventDate, format: Date.FormatStyle(date: .abbreviated, time: .shortened))

Step 4: audit and UI writing before merge

  1. iOS Code Audit — structured review before a large refactor or release branch.

  2. Writing for Interfaces — alerts, onboarding, empty states and accessibility strings against HIG Writing.

  3. Keep accessibility audits (VoiceOver nutrition labels, Dynamic Type) on the Accessibility audits guide; this page only covers copy.

Tools compared (6)

ToolBest forAgents (README)Install (README)LicenseStarsLast push
Swift API Design (Erikote04)Applies Swift API Design Guidelines naming and documentation conventions for agent-written APIsClaude Code, Cursor, Codexnpx skills add https://github.com/Erikote04/Swift-API-Design-Guidelines-Agent-SkillMIT3118 Feb 2026 ⚠
Airbnb Swift Style (cassiewallace)Enforces the Airbnb iOS Swift Style Guide in Agent Skills–compatible toolsClaude Code, Cursor, Windsurfnpx skills add https://github.com/cassiewallace/Airbnb-Swift-Style-Agent-Skill --skill airbnb-swift-styleMIT272 Apr 2026 ⚠
iOS Code Audit (jazzychad)Structured iOS/Swift code audit checklist for quality, architecture and risk before mergeClaude Code, Cursor, Codexnpx skills add https://github.com/jazzychad/ios-code-auditMIT4021 May 2026 ⚠
Swift FormatStyle (n0an)Agent skill for Foundation FormatStyle and locale-aware formatting instead of hand-built stringsClaude Code, Cursor, Codexnpx skills add https://github.com/n0an/Swift-FormatStyle-Agent-SkillMIT158 Sep 2026 ⚠
Writing for Interfaces (andrewgleave)Interface-writing skill for UI copy: voice, tone, clarity and inclusive languageClaude Code, Cursor, Codexnpx skills add https://github.com/andrewgleave/skills --skill writing-for-interfacesMIT3423 Apr 2026 ⚠
Bylaws (theblixguy)Brew-installed Swift style linter (bylaws lint) agents can run in the projectClaude Code, Cursor, Codexbrew install theblixguy/tap/bylaws then bylaws lintMIT5129 Oct 2026

⚠ = no push for more than 4 weeks. Bylaws was pushed on 29 Oct 2026; the other five are older — read their output before treating every suggestion as current.

Which one to pick:

  • Naming public Swift APIs: Swift API Design.

  • Team uses Airbnb's guide: Airbnb Swift Style.

  • Want a CLI lint in CI: Bylaws.

  • Locale-aware dates/numbers/measurements: Swift FormatStyle.

  • Pre-merge quality pass: iOS Code Audit.

  • Alerts, empty states, onboarding copy: Writing for Interfaces.

A prompt that keeps the agent honest

Setting up the agent itself: Claude Code for iOS development, Codex for iOS development or Cursor rules for SwiftUI.

Review Sources/Networking for public API naming against the Swift API Design skill. Do not rename private helpers. Replace any hand-built date or currency strings with Foundation FormatStyle. Run Bylaws (or the Airbnb style skill) and list remaining style findings. Draft alert and empty-state copy with writing-for-interfaces; keep VoiceOver label work for a separate accessibility pass.

FAQ

What is Swift API design for AI coding agents?
It means teaching the agent how to name and shape Swift APIs: argument labels, boolean methods, value types and documentation comments. Catalog skills such as Swift API Design encode those conventions so Claude Code, Cursor or Codex stop inventing one-off names. Pair them with style and FormatStyle skills when the task is formatting or UI copy.
Should the agent hard-code date and number strings?
No. Apple's FormatStyle protocol on developer.apple.com converts a value into another representation such as a string and accounts for locale-specific conventions like grouping, separators and measurement units. Prefer Foundation format styles (and related locale-aware APIs) over hand-built string interpolation for dates, numbers and measurements.
How does HIG Writing fit with API design skills?
Apple's Human Interface Guidelines Writing page on developer.apple.com covers voice, tone, clarity and inclusive language for onboarding, alerts and accessibility text. Writing-for-interfaces teaches agents those UI-copy rules; Swift API Design and style skills cover type and method naming. Use both when a feature needs public API and customer-facing strings.
Which tool should I install first?
Start with Swift API Design for naming. Add Airbnb Swift Style when the team follows that guide, or Bylaws when you want brew-installed lint. Use Swift FormatStyle for locale-aware presentation. Run iOS code audit before a large refactor, and writing-for-interfaces when shipping alerts, empty states or onboarding copy.
Does this replace the best Claude Code skills for SwiftUI guide?
No. That guide is a Claude Code shopping list across SwiftUI tasks. This page owns API naming, style lint, FormatStyle and interface writing across Claude Code, Cursor and Codex, with Apple facts from FormatStyle and HIG Writing on developer.apple.com.