# swift-formatstyle

Teaches AI assistants to replace legacy Formatter subclasses with Foundation FormatStyle in Swift and SwiftUI. Useful for locale-safe numbers, dates, and currencies.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 2700 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swift-formatstyle/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/swift-formatstyle

## What it 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.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/swift-formatstyle/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/swift-formatstyle/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/swift-formatstyle/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/swift-formatstyle/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills swift-formatstyle
```

2. **Manually: put the files in place**
- File: `.github/skills/swift-formatstyle/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swift-formatstyle
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/swift-formatstyle/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swift-formatstyle -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swift-formatstyle/SKILL.md

## When to use it
- 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
- 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

## Similar
- [swift-expert](https://affpapa.org/en/nevibecode/agents/swift-expert.md) — subagent · 378 installs
- [ios-swift-development](https://affpapa.org/en/nevibecode/skills/ios-swift-development.md) — skill · 1500 installs
- [swift-architecture-skill](https://affpapa.org/en/nevibecode/skills/swift-architecture-skill.md) — skill · 2000 installs
- [clerk-swift](https://affpapa.org/en/nevibecode/skills/clerk-swift.md) — skill · 14500 installs
- [axiom-swift](https://affpapa.org/en/nevibecode/skills/axiom-swift.md) — skill · 1200 installs
- [swift-api-design-guidelines-skill](https://affpapa.org/en/nevibecode/skills/swift-api-design-guidelines-skill.md) — skill · 1200 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
