swift-format-style

swift-format-style is a skill for Claude Code, Codex from n0an/Swift-FormatStyle-Agent-Skill. It costs 50 tokens per session (955 once invoked), scanned A, original, MIT.

A Swift coding guide for displaying numbers, dates, durations, measurements, names, byte counts, lists, and URLs with modern FormatStyle APIs.

In plain words
What is it for?
Use it when writing or reviewing Swift and SwiftUI code that turns values into text for users.
Why use it?
It replaces older formatter classes and C-style formatting with the newer formatting approach supported by recent Apple operating systems.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the swift-format-style plugin — 1 skill shipped together

Good fit Use it when writing or reviewing Swift and SwiftUI code that turns values into text for users.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/n0an/swift-formatstyle-agent-skill/swift-format-style
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add n0an/Swift-FormatStyle-Agent-Skill --skill swift-format-style
Clone the repo
git clone --depth 1 https://github.com/n0an/Swift-FormatStyle-Agent-Skill

Made for: Claude Code, Codex.

Or install swift-format-style, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for swift-format-style

README.md
[![agentmods](https://agentmods.dev/badge/skills/n0an/swift-formatstyle-agent-skill/swift-format-style/github.svg)](https://agentmods.dev/skills/n0an/swift-formatstyle-agent-skill/swift-format-style)
Your own site
<a href="https://agentmods.dev/skills/n0an/swift-formatstyle-agent-skill/swift-format-style"><img src="https://agentmods.dev/badge/skills/n0an/swift-formatstyle-agent-skill/swift-format-style/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for swift-format-style

Your own site · 80×15
<a href="https://agentmods.dev/skills/n0an/swift-formatstyle-agent-skill/swift-format-style"><img src="https://agentmods.dev/badge/skills/n0an/swift-formatstyle-agent-skill/swift-format-style.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 955 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 4 Apr 2026
  • Snyk pass 4 Apr 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00050 $0.00955
Opus 5 $0.00025 $0.00477
Sonnet 5 $0.00010 $0.00191
Haiku 4.5 $0.00005 $0.00096

Measured 9d ago against content hash 8a4983d20be3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

swift-format-style scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

swift-format-style/SKILL.md · 91 lines

How it starts

The opening of the file, as written. The whole thing — 91 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Write and review Swift code that formats values for display, ensuring modern FormatStyle APIs are used instead of legacy Formatter subclasses or C-style formatting.

Review process:

  1. Check for legacy formatting patterns and replace with modern FormatStyle equivalents using references/anti-patterns.md.
  2. Validate number, percent, and currency formatting using references/numeric-styles.md.
  3. Validate date and time formatting using references/date-styles.md.
  4. Validate duration formatting using references/duration-styles.md.
  5. Validate measurement, list, person name, byte count, and URL formatting using references/other-styles.md.
  6. Check SwiftUI Text views for proper FormatStyle integration using references/swiftui.md.

If doing partial work, load only the relevant reference files.

Core Instructions

  • Target iOS 15+ / macOS 12+ minimum for basic FormatStyle. Duration and URL styles require iOS 16+ / macOS 13+.
  • Never use legacy Formatter subclasses (DateFormatter, NumberFormatter, MeasurementFormatter, DateComponentsFormatter, DateIntervalFormatter, PersonNameComponentsFormatter, ByteCountFormatter).
  • Never use C-style String(format:) for number formatting. Always use .formatted() or FormatStyle directly.
  • Never use DispatchQueue for formatting on background threads - FormatStyle types are value types and thread-safe.
  • Prefer .formatted() instance method for simple cases, and explicit FormatStyle types for reusable or complex configurations.
  • In SwiftUI, use Text(_:format:) instead of Text("\(value.formatted())").
  • Use Decimal instead of Float/Double for currency values.
  • FormatStyle types are locale-aware by default. Only set locale explicitly when you need a specific locale different from the user's current locale.
  • FormatStyle types conform to Codable and Hashable, making them safe to store and compare.

Output Format

If the user asks for a review, organize findings by file. For each issue:

Read the full file on GitHub · 91 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 9d ago First seen · 91 lines · 50 tokens per session scan A 8a4983d20be3

Subscribe to this mod's changes

swift-format-style is a skill published in the GitHub repository n0an/Swift-FormatStyle-Agent-Skill (9 stars, last pushed yesterday), licensed MIT. It adds 50 tokens to every session and 955 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

app-intents

Writes and reviews Swift App Intents code that exposes app actions and data to Siri, Shortcuts, Spotlight, widgets, Control Center, and Apple Intelligence. Use when adding AppIntent, AppEntity, OpenIntent, AppShortcutsProvider, EntityQuery, Focus Filters, AssistantEntity/AssistantIntent schemas, on-screen awareness…

n0an/App-Intents-Agent-Skill · 99 tokens

swift-expert

Expert-level Swift development for iOS, macOS with SwiftUI, Combine, and modern Swift 5.9+. Use when the user mentions iOS, macOS, SwiftUI, Combine, async await, or Apple platforms, or when the task involves Modern Swift Features, Basics and Optionals, Functions and Closures, or Structs and Classes.

personamanagmentlayer/pcl · 76 tokens

ios-expert

Expert in iOS development with SwiftUI, UIKit, Combine, and Apple ecosystem integration. Use when the user mentions mobile, Swift, SwiftUI, UIKit, Apple platforms, or Xcode, or when the task involves iOS App Architecture, SwiftUI Fundamentals, UIKit Essentials, or Combine Framework.

personamanagmentlayer/pcl · 64 tokens

test-modernizer

Modernize test suites to use modern Swift Testing features or migrate from XCTest.

superagents-lab/xcode27-skills · 19 tokens

swiftui-whats-new-27

New SwiftUI APIs, behaviors, and deprecations introduced in the 2027 OS releases (iOS 27, macOS 27, watchOS 27, tvOS 27, visionOS 27). Use when a SwiftUI view using @State fails to compile with "used before being initialized", "invalid redeclaration of synthesized property", or "extraneous argument label" errors after…

superagents-lab/xcode27-skills · 566 tokens

swift-review

Review Swift/iOS code: SwiftUI, Combine, UIKit, App Store guidelines and iOS architecture.

camilooscargbaptista/cto-toolkit · 23 tokens