install
source · Clone the upstream repo
git clone https://github.com/ComeOnOliver/skillshub
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/ComeOnOliver/skillshub "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/pproenca/dot-skills/ios-design-system" ~/.claude/skills/comeonoliver-skillshub-ios-design-system-ef78b1 && rm -rf "$T"
manifest:
skills/pproenca/dot-skills/ios-design-system/SKILL.mdsource content
Airbnb iOS Design System Best Practices
Opinionated, strict design system engineering for SwiftUI iOS 26 / Swift 6.2 apps. Contains 50 rules across 8 categories, prioritized by impact. Derived from Airbnb's Design Language System (DLS), Airbnb Swift Style Guide, Apple Human Interface Guidelines, and WWDC sessions. Mandates @Equatable on every view, @Observable for state, and style protocols as the primary component API.
Mandated Architecture Alignment
This skill is designed to work alongside
swift-ui-architect. All code examples follow the same non-negotiable constraints:
- Feature modules depend on
+Domain
; no directDesignSystem
dependencyData
for mutable UI state,@Observable
/ObservableObject
never@Published
macro on every view@Equatable- Style protocols as the primary component styling API (Airbnb DLS pattern)
- Asset catalog as the source of truth for color values
- Local SPM package for design system module boundary
Scope & Relationship to Sibling Skills
This skill is the infrastructure layer — it teaches how to BUILD the design system itself. When loaded alongside sibling skills:
| Sibling Skill | Its Focus | This Skill's Focus |
|---|---|---|
| Architecture (modular MVVM-C, route shells, protocol boundaries) | Design system infrastructure (tokens, styles, governance) |
| Using design primitives (semantic colors, typography) | Engineering the token system that provides those primitives |
| Auditing/fixing visual quality issues | Preventing those issues via governance and automation |
| HIG compliance patterns | Asset and component infrastructure that makes compliance easy |
Clinic Architecture Contract (iOS 26 / Swift 6.2)
All guidance in this skill assumes the clinic modular MVVM-C architecture:
- Feature modules import
+Domain
only (neverDesignSystem
, never sibling features)Data - App target is the convergence point and owns
, concrete coordinators, and Route Shell wiringDependencyContainer
stays pure Swift and defines models plus repository,Domain
,*Coordinating
, andErrorRouting
contractsAppError
owns SwiftData/network/sync/retry/background I/O and implements Domain protocolsData- Read/write flow defaults to stale-while-revalidate reads and optimistic queued writes
- ViewModels call repository protocols directly (no default use-case/interactor layer)
When to Apply
Reference these guidelines when:
- Setting up a design system for a new iOS app
- Building token architecture (colors, typography, spacing, sizing)
- Creating reusable component styles (ButtonStyle, LabelStyle, custom DLS protocols)
- Organizing asset catalogs (colors, images, icons)
- Migrating from ad-hoc styles to a governed token system
- Preventing style drift and enforcing consistency via automation
- Building theming infrastructure for whitelabel or multi-brand apps
- Reviewing PRs for ungoverned colors, hardcoded values, or shadow tokens
Rule Categories by Priority
| Priority | Category | Impact | Prefix | Rules |
|---|---|---|---|---|
| 1 | Token Architecture | CRITICAL | | 6 |
| 2 | Color System Engineering | CRITICAL | | 7 |
| 3 | Component Style Library | CRITICAL | | 10 |
| 4 | Typography Scale | HIGH | | 5 |
| 5 | Spacing & Sizing System | HIGH | | 5 |
| 6 | Consistency & Governance | HIGH | | 7 |
| 7 | Asset Management | MEDIUM-HIGH | | 5 |
| 8 | Theme & Brand Infrastructure | MEDIUM | | 5 |
Quick Reference
1. Token Architecture (CRITICAL)
- Use Raw → Semantic → Component token layerstoken-three-layer-hierarchy
- Use caseless enums for token namespacestoken-enum-over-struct
- One token file per design domaintoken-single-file-per-domain
- Extend ShapeStyle for dot-syntax colorstoken-shapestyle-extensions
- Source color tokens from asset catalogtoken-asset-catalog-source
- Avoid over-abstracting beyond three layerstoken-avoid-over-abstraction
2. Color System Engineering (CRITICAL)
- Organize color assets with folder groups by rolecolor-organized-xcassets
- Define both appearances for every custom colorcolor-complete-pairs
- Limit custom colors to under 20 semantic tokenscolor-limit-palette
- Never use Color literals or hex in view codecolor-no-hex-in-views
- Prefer system colors before custom tokenscolor-system-first
- Set brand color as app tint, don't scatter itcolor-tint-not-brand-everywhere
- Audit for ungoverned colors with a build scriptcolor-audit-script
3. Component Style Library (CRITICAL)
- Define custom style protocols for complex DLS componentsstyle-dls-protocol-pattern
- Apply @Equatable to every design system viewstyle-equatable-views
- Build accessibility into style protocols, not individual viewsstyle-accessibility-first
- Use Style protocols instead of wrapper viewsstyle-protocol-over-wrapper
- Provide static member syntax for custom stylesstyle-static-member-syntax
- Make styles responsive to environment valuesstyle-environment-awareness
- Views for containers, modifiers for stylingstyle-view-for-containers-modifier-for-styling
- One style catalog file per component typestyle-catalog-file
- Prefer configuration structs over many parametersstyle-configuration-over-parameters
- Create a preview catalog for all stylesstyle-preview-catalog
4. Typography Scale (HIGH)
- Define a type scale enum wrapping system stylestype-scale-enum
- Use system text styles before custom onestype-system-styles-first
- Register custom fonts with a centralized extensiontype-custom-font-registration
- Limit typography variations to 3-4 per screentype-max-styles-per-screen
- Use one font design per apptype-avoid-font-design-mixing
5. Spacing & Sizing System (HIGH)
- Define spacing tokens as a caseless enumspace-token-enum
- Define corner radius tokens by component typespace-radius-tokens
- Zero hardcoded numbers in view layout codespace-no-magic-numbers
- Use EdgeInsets constants for composite paddingspace-insets-pattern
- Define size tokens for common dimensionsspace-size-tokens
6. Consistency & Governance (HIGH)
- Enforce consistent naming conventions across all tokensgovern-naming-conventions
- Isolate the design system as a local SPM packagegovern-spm-package-boundary
- Every visual value has one definition pointgovern-single-source-of-truth
- Use SwiftLint rules to enforce token usagegovern-lint-for-tokens
- Isolate tokens in a dedicated directorygovern-design-system-directory
- Migrate to tokens incrementallygovern-migration-incremental
- Prevent feature modules from defining local tokensgovern-prevent-local-tokens
7. Asset Management (MEDIUM-HIGH)
- Separate asset catalogs for colors, images, iconsasset-separate-catalogs
- Use SF Symbols before custom iconsasset-sf-symbols-first
- Use PDF/SVG vectors, never multiple PNGsasset-icon-export-format
- Use compression and on-demand resourcesasset-image-optimization
- Consistent naming convention for all assetsasset-naming-convention
8. Theme & Brand Infrastructure (MEDIUM)
- Use EnvironmentKey for theme propagationtheme-environment-key
- Avoid building a theme system unless neededtheme-dont-over-theme
- Use .tint() as primary brand expressiontheme-tint-for-brand
- Use ColorScheme for light/dark, not custom themingtheme-light-dark-only
- Separate brand identity from system mechanicstheme-brand-layer-separation
How to Use
Read individual reference files for detailed explanations and code examples:
- Section definitions - Category structure and impact levels
- Rule template - Template for adding new rules
Reference Files
| File | Description |
|---|---|
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |