swift-formatstyle — Claude Code skill: what it does, how to install
Teaches AI assistants to replace legacy Formatter subclasses with Foundation FormatStyle in Swift and SwiftUI. Useful for locale-safe numbers, dates, and currencies.
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a claude-codeWhat swift-formatstyle does
This skill guides assistants through replacing legacy NumberFormatter and DateFormatter setups with type-safe FormatStyle APIs. It covers localized numbers, ISO 4217 currencies, dates, measurements, names, and lists.
The instructions prioritize SwiftUI integration via Text(_:format:) so the view layer owns the rendered output. When user input must round-trip back into data models, it introduces matching ParseableFormatStyle implementations based on explicit locales or user environment settings.
Availability is a strict boundary here. While standard styles run on iOS 15+, Duration patterns and URL formatters require iOS 16, and anchored relative date styles demand iOS 18.
What it helps with
- replace legacy Formatter subclasses with modern FormatStyle
- configure locale-aware currency and decimal parsing without precision loss
- format dates, measurements, and lists directly inside SwiftUI Text
- verify UI rendering across different locale conventions and numbering systems
Example prompts for the agent
- Refactor this legacy DateFormatter code to Foundation FormatStyle for iOS 16
- Show how to format currency using Text(_:format:) with an ISO 4217 code
- Implement ParseableFormatStyle to parse a decimal amount from user input
How to install swift-formatstyle
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a claude-code2Manually: put the files in place
~/.claude/skills/swift-formatstyle/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/swift-formatstyle/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a codex2Manually: put the files in place
.agents/skills/swift-formatstyle/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a cursor2Manually: put the files in place
.cursor/skills/swift-formatstyle/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install dpearson2699/swift-ios-skills swift-formatstyle2Manually: put the files in place
.github/skills/swift-formatstyle/SKILL.md1Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a gemini-cli2Platform CLI
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swift-formatstyleManually: put the files in place
.devin/skills/swift-formatstyle/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about swift-formatstyle
How do I install swift-formatstyle in Claude Code?
Run npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a claude-code.
What does swift-formatstyle do?
It provides patterns and rules for using Foundation FormatStyle and ParseableFormatStyle, helping agents output locale-correct formatting for numbers, dates, and text in Swift.
Which iOS versions does swift-formatstyle target?
Base FormatStyle requires iOS 15+. Formatting for Duration and URL needs iOS 16 or newer, while Date.AnchoredRelativeFormatStyle is restricted to iOS 18+.