Accessibility generator

From rshankras/claude-code-apple-skills · View interactive version

Accessibility generator is an AI agent skill from the GitHub repository rshankras/claude-code-apple-skills. Generate accessibility infrastructure for VoiceOver, Dynamic Type, and accessibility features. Use when improving app accessibility, adding accessibility labels and hints, or auditing compliance.

How to use this skill

Skill file

Accessibility Generator

Generate accessibility infrastructure for VoiceOver, Dynamic Type, and accessibility features.

When This Skill Activates

Pre-Generation Checks

# Check existing accessibility usage
grep -r "accessibilityLabel\|accessibilityHint\|AccessibilityFocused" --include="*.swift" | head -5

Key Features

Accessibility Labels

Image(systemName: "heart.fill")
    .accessibilityLabel("Favorite")
    .accessibilityHint("Double tap to remove from favorites")

Dynamic Type Support

Text("Title")
    .font(.title)  // Scales automatically
    .dynamicTypeSize(...DynamicTypeSize.accessibility3)  // Limit max size

Reduce Motion

@Environment(\.accessibilityReduceMotion) private var reduceMotion

withAnimation(reduceMotion ? nil : .spring()) {
    // Animation
}

VoiceOver Groups

VStack {
    Text("Item Name")
    Text("$9.99")
}
.accessibilityElement(children: .combine)

Visual Accessibility: Numbers and APIs (WWDC20)

| Setting | Threshold / API | What to do |

|---------|-----------------|------------|

| Contrast | 4.5:1 minimum ("generally the lowest acceptable ratio"); ~7.5:1 for comfort on dark backgrounds | Check text and glyphs against their actual backgrounds |

| Differentiate Without Color | UIAccessibility.shouldDifferentiateWithoutColor | Add shapes/symbols wherever color is the only signal (red/green states) |

| Button Shapes | UIAccessibility.buttonShapesEnabled + its change notification | Show borders/underlines on plain-text buttons when on |

| Increase Contrast | System colors adapt for free; custom colors need a "High Contrast" variant in the asset catalog | Never ship a single hex for both modes |

| Dynamic Type | preferredContentSizeCategory | Never truncate — set line count to 0 so text wraps; reflow layout at accessibility sizes |

| Bold Text | UIAccessibility.isBoldTextEnabled | Free with system text styles; custom fonts must swap weights manually |

| Reduce Motion | isReduceMotionEnabled, prefersCrossFadeTransitions | Gate animations, parallax, and video autoplay; prefer cross-fades over sliding transitions |

| Smart Invert | .accessibilityIgnoresInvertColors() | Apply to photos, videos, and full-color icons so they don't invert |

| Reduce Transparency | UIAccessibility.isReduceTransparencyEnabled | Render blur/vibrancy backgrounds as opaque |

SwiftUI mirrors most of these as environment values (\.accessibilityReduceMotion above, plus \.accessibilityDifferentiateWithoutColor, \.legibilityWeight, \.accessibilityReduceTransparency).

Deep Patterns (accessibility-patterns.md)

The full recipes live in accessibility-patterns.md:

Inclusive Design Principles (WWDC25)

Generated Files

Sources/Accessibility/
├── AccessibilityModifiers.swift   # Custom view modifiers
├── AccessibilityHelpers.swift     # Label builders
└── AccessibilityStrings.swift     # Localized labels

Audit Checklist

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.