swift-formatstyle-macos

Create type-safe FormatStyle conformances for macOS UI value display.

1|Updated Jun 5, 2026
One-click install
npx skills add https://github.com/LaughingJackalope/macos-skills --skill swift-formatstyle-macos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swift-formatstyle-macos
Source: https://github.com/LaughingJackalope/macos-skills/tree/main/swift-formatstyle-macos
Command: npx skills add https://github.com/LaughingJackalope/macos-skills --skill swift-formatstyle-macos

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill eliminates the tedious and error-prone work of using legacy Foundation formatters like DateFormatter and NumberFormatter, which are not thread-safe, not Sendable, and require manual locale and calendar management for macOS UI value display.

Core Features & Use Cases

  • Built-in FormatStyle Conformances: Type-safe, chainable formatting for Date, Number, Measurement, List, and Duration types that replace legacy formatters with a unified API.
  • Custom FormatStyle Implementation: Patterns for creating reusable, chainable custom formatters for domain-specific types like file sizes, storage ratios, and network speeds.
  • macOS-Specific Display Patterns: Optimized formatting for common macOS UI contexts including menu items, status bar extras, inspector panels, and aligned Table columns in both AppKit and SwiftUI.
  • Use Case: For example, you can format file sizes for Finder-like Table columns with monospaced aligned digits, create compact date labels for menu bar extras, and build locale-aware temperature displays for inspector panels without manual formatter configuration.

Quick Start

Use the swift-formatstyle-macos skill to format a file size value for display in a macOS Table column with aligned monospaced digits and locale-aware unit abbreviations.

Frequently Asked Questions about swift-formatstyle-macos

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I format dates and numbers in macOS UI without using legacy Foundation formatters?

Format dates and numbers in macOS UI by adopting type-safe, chainable FormatStyle conformances that replace legacy Foundation formatters. This approach eliminates thread-safety issues and manual locale management while providing built-in styles for Date, Number, Measurement, List, and Duration types.

Why does NumberFormatter cause thread-safety issues in Swift macOS apps?

NumberFormatter causes thread-safety issues because it is not Sendable and requires manual locale management. You can avoid these errors by using type-safe FormatStyle conformances designed for thread-safe formatter reuse across SwiftUI and AppKit macOS UI components.

What is the best way to display aligned numeric columns in a SwiftUI Table on macOS?

The best way to display aligned numeric columns in a SwiftUI Table is using monospaced digit formatting provided by FormatStyle. This ensures aligned numeric columns via monospaced digit formatting without relying on error-prone legacy Foundation formatters.

Can I create custom formatters for domain-specific types like file sizes in macOS?

Yes, you can create custom formatters for domain-specific types like file sizes, storage ratios, and network speeds. The Skill provides patterns for building reusable, chainable custom FormatStyle implementations for locale-aware display in macOS UI components.

How do I format compact date labels for a macOS menu bar extra?

Format compact date labels for a macOS menu bar extra by applying built-in Date FormatStyle conformances. These provide optimized, space-constrained display patterns specifically for macOS UI contexts like status bar extras and menu items.