- Installs
- 455
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/n0an/swift-formatstyle-agent-skill --skill swift-format-style- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads swift-format-style automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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:
- Check for legacy formatting patterns and replace with modern FormatStyle equivalents using
references/anti-patterns.md. - Validate number, percent, and currency formatting using
references/numeric-styles.md. - Validate date and time formatting using
references/date-styles.md. - Validate duration formatting using
references/duration-styles.md. - Validate measurement, list, person name, byte count, and URL formatting using
references/other-styles.md. - 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
Formattersubclasses (DateFormatter,NumberFormatter,MeasurementFormatter,DateComponentsFormatter,DateIntervalFormatter,PersonNameComponentsFormatter,ByteCountFormatter). - Never use C-style
String(format:)for number formatting. Always use.formatted()orFormatStyledirectly. - Never use
DispatchQueuefor formatting on background threads - FormatStyle types are value types and thread-safe. - Prefer
.formatted()instance method for simple cases, and explicitFormatStyletypes for reusable or complex configurations. - In SwiftUI, use
Text(_:format:)instead ofText("\(value.formatted())"). - Use
Decimalinstead ofFloat/Doublefor 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
CodableandHashable, making them safe to store and compare.
Output Format
If the user asks for a review, organize findings by file. For each issue:
- State the file and relevant line(s).
- Name the anti-pattern being replaced.
- Show a brief before/after code fix.
Skip files with no issues. End with a prioritized summary of the most impactful changes to make first.
If the user asks you to write or fix formatting code, make the changes directly instead of returning a findings report.
Example output:
RecordingView.swift
Line 42: Use Duration.formatted() instead of String(format:) for time display.
// Before
let minutes = Int(duration) / 60
let seconds = Int(duration) % 60
return String(format: "%02d:%02d", minutes, seconds)
// After
Duration.seconds(duration).formatted(.time(pattern: .minuteSecond))
Line 78: Use Text(_:format:) instead of string interpolation.
// Before
Text("\(fileSize.formatted(.byteCount(style: .file)))")
// After
Text(fileSize, format: .byteCount(style: .file))
Summary
- Legacy formatting (high): C-style String(format:) on line 42 should use Duration.formatted().
- SwiftUI (medium): Text interpolation on line 78 should use the format: parameter directly.
End of example.
References
references/anti-patterns.md- legacy patterns to replace: String(format:), DateFormatter, NumberFormatter, and other Formatter subclasses.references/numeric-styles.md- number, percent, and currency formatting with rounding, precision, sign, notation, scale, and grouping.references/date-styles.md- date/time compositing, ISO 8601, relative, verbatim, HTTP, interval, and components styles.references/duration-styles.md- Duration.TimeFormatStyle and Duration.UnitsFormatStyle with patterns, units, width, and fractional seconds.references/other-styles.md- measurement, list, person name, byte count, URL formatting, and custom FormatStyle creation.references/swiftui.md- SwiftUI Text integration and best practices.
FAQ
What does the swift-format-style skill do?
Writes and reviews Swift FormatStyle code, replacing legacy Formatter subclasses and C-style String(format:) with modern .formatted() APIs. Use when formatting numbers, dates, durations, measurements, lists, names, byte counts, or URLs.
How do I install swift-format-style?
Run npx skills add https://github.com/n0an/swift-formatstyle-agent-skill --skill swift-format-style in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/swift-format-style/ (personal) or .claude/skills/swift-format-style/ (project).
Which AI agents can use swift-format-style?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is swift-format-style safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains swift-format-style?
It is published by n0an in n0an/swift-formatstyle-agent-skill. It has 455 recorded installs.
Popular mobile skills
design-mobile-apps
designed-by-ai/skills
Design mobile app screens with Sleek, edit Sleek projects, and implement their designs in React Native or HTML.
ios-design
uizze.sh
Design and review iOS UI/UX for iPhone apps in SwiftUI, UIKit, or React Native. Use for mobile app design, screen redesigns, navigation flows, typography, forms, keyboard and safe-area layout, and accessibility checks. Apply Apple Human Interface Guidelines and consult real product references through the optional Uizze connection.
vercel-react-native-skills
vercel-labs/agent-skills
React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.
animate-expo
emilkowalski/skills
Build animations in React Native and Expo, making the decisions in the order that determines whether they feel right — should it animate, which thread it runs on, which properties, spring or timing, how the gesture hands off, how it degrades. Writes the implementation with Reanimated, Gesture Handler, Expo Router and expo-haptics. Use when animating anything in an Expo app, adding gestures, sheets, screen transitions, press feedback or haptics, or fixing motion that stutters on device. For web animation use animate.
xcode-project-setup
firebase/agent-skills
Safely modifies Xcode projects (.pbxproj) to add Swift Packages and link files. Use this skill whenever an iOS project needs dependencies installed (e.g. Firebase, Alamofire).
firebase-remote-config-basics
firebase/agent-skills
Manages Firebase Remote Config templates, feature flags, loading strategies, and SDKs (Android, iOS). Use when downloading/deploying remoteconfig JSON templates, managing version history/feature flags, setting in-app defaults, fetchAndActivate(), real-time listeners, or SDK setup. Don't use for Firebase Hosting, Auth, Firestore, Data Connect, Crashlytics, or App Hosting.
