mattmakes/multi-herdr/swift-format-style
Claude Code and agent skill by mattmakes/multi-herdr
- community
Checking that the SKILL.md file is still in the repository.
Writes and reviews Swift FormatStyle code for values shown to the user, replacing legacy Formatter subclasses and C-style String(format:) with modern .formatted() APIs. Use when displaying formatted numbers, dates, durations, measurements, lists, names, byte counts, or URLs.
Install
npx vskill@latest install mattmakes/multi-herdr/swift-format-styleSKILL.md
The same SKILL.md was published earlier as mattmakes/multi-herdr/swift-format-style.
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+.
- For display, do not use legacy
Formattersubclasses (DateFormatter,NumberFormatter,MeasurementFormatter,DateComponentsFormatter,DateIntervalFormatter,PersonNameComponentsFormatter,ByteCountFormatter). For a fixed wire format, use.iso8601or a POSIX locale with the Gregorian calendar. - 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.
Line 78: Use Text(_:format:) instead of string interpolation.
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.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/swift-format-style/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mattmakes/multi-herdr/swift-format-style)