swift-format-style

Solid

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.

Code & Development 9 stars 1 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
33
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

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`. 1. Validate number, percent, and currency formatting using `references/numeric-styles.md`. 1. Validate date and time formatting using `references/date-styles.md`. 1. Validate duration formatting using `references/duration-styles.md`. 1. Validate measurement, list, person name, byte count, and URL formatting using `references/other-styles.md`. 1. 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 re...

Details

Author
n0an
Repository
n0an/Swift-FormatStyle-Agent-Skill
Created
5 months ago
Last Updated
3 days ago
Language
N/A
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category