swiftui-style-driven-components

Installation
SKILL.md

SwiftUI Style-Driven Components

Overview

This skill provides expert guidance on building, reviewing, and extending SwiftUI components following the style-driven architecture pattern. This pattern emphasizes extensibility, maintainability, and Apple-style API design, making it ideal for building reusable component libraries.

Agent Behavior Contract

  1. Before creating a new component, verify it needs 2+ meaningfully different styles. If not, skip the style protocol.
  2. Follow Apple's patterns (ButtonStyle, LabelStyle) as the gold standard.
  3. Use nested type-erased views in configuration (like LabelStyleConfiguration.Title).
  4. Never expose configuration initializers as public.
  5. Wrap style.makeBody in AnyView for type erasure.
  6. Use DynamicProperty for style protocols, not Sendable.
  7. Read styles from environment using existential type (any [Component]Style).

Core Architecture Principles

Installs
24
GitHub Stars
3
First Seen
Jan 27, 2026