If you're still using DateFormatter, NumberFormatter, or String(format:) in Swift projects, this skill will hunt them down and replace them with modern FormatStyle APIs. It reviews your code against a set of anti-patterns and rewrites formatting logic to use .formatted() and proper FormatStyle types for numbers, dates, durations, measurements, lists, and more. The skill knows the difference between simple cases where .formatted() works and complex scenarios where you need explicit FormatStyle configuration. It also catches SwiftUI-specific issues like using string interpolation in Text views instead of the format parameter. Targets iOS 15+ and knows which features require iOS 16+. Think of it as a linter and refactoring tool rolled into one, specifically for Apple's formatting APIs.
npx -y skills add n0an/swift-formatstyle-agent-skill --skill swift-format-style --agent claude-codeInstalls into .claude/skills of the current project.
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:
references/anti-patterns.md.references/numeric-styles.md.references/date-styles.md.references/duration-styles.md.references/other-styles.md.references/swiftui.md.If doing partial work, load only the relevant reference files.
Formatter subclasses (DateFormatter, NumberFormatter, MeasurementFormatter, DateComponentsFormatter, DateIntervalFormatter, PersonNameComponentsFormatter, ByteCountFormatter).String(format:) for number formatting. Always use .formatted() or FormatStyle directly.DispatchQueue for formatting on background threads - FormatStyle types are value types and thread-safe..formatted() instance method for simple cases, and explicit FormatStyle types for reusable or complex configurations.Text(_:format:) instead of Text("\(value.formatted())").Decimal instead of Float/Double for currency values.Codable and Hashable, making them safe to store and compare.If the user asks for a review, organize findings by file. For each issue:
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:
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))
End of example.
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.cursor/plugins
metabase/metabase
metabase/metabase
telagod/code-abyss
github/awesome-copilot
DietrichGebert/ponytail