### Install Platform Skills with skills.sh CLI Source: https://context7.com/rgmez/apple-accessibility-skills/llms.txt Use the `npx skills add` command to install individual platform skills. Available commands include listing all skills in a repo, listing installed skills, and updating installed skills. ```bash # Install individual platform skills npx skills add rgmez/apple-accessibility-skills@swiftui-accessibility-auditor npx skills add rgmez/apple-accessibility-skills@uikit-accessibility-auditor npx skills add rgmez/apple-accessibility-skills@appkit-accessibility-auditor # List all available skills in the repo npx skills list rgmez/apple-accessibility-skills # List installed skills npx skills list # Update installed skills npx skills update # Opt out of telemetry DISABLE_TELEMETRY=1 npx skills add rgmez/apple-accessibility-skills@swiftui-accessibility-auditor ``` -------------------------------- ### List all available skills.sh CLI commands Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/README.md Lists all available skills installed via the skills.sh CLI. This command provides an overview of all installed auditing skills. ```bash npx skills list ``` -------------------------------- ### Install SwiftUI Accessibility Auditor using skills.sh CLI Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/README.md Installs the SwiftUI accessibility auditor using the skills.sh CLI. This command adds the specified skill to your environment for auditing SwiftUI applications. ```bash npx skills add rgmez/apple-accessibility-skills@swiftui-accessibility-auditor ``` -------------------------------- ### Install AppKit Accessibility Auditor using skills.sh CLI Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/README.md Installs the AppKit accessibility auditor using the skills.sh CLI. This command adds the specified skill to your environment for auditing AppKit applications. ```bash npx skills add rgmez/apple-accessibility-skills@appkit-accessibility-auditor ``` -------------------------------- ### Implement Keyboard Operability and VoiceOver for Custom NSView Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/examples/appkit.md This example shows how to make a custom `NSView` operable via keyboard and discoverable by VoiceOver. It includes setting `acceptsFirstResponder`, handling `keyDown` events for common keys, and defining accessibility role and label. ```swift final class ClickableCardView: NSView { var onActivate: (() -> Void)? override var acceptsFirstResponder: Bool { true } override func keyDown(with event: NSEvent) { switch event.keyCode { case 36, 49: // Return, Space onActivate?() default: super.keyDown(with: event) } } override func accessibilityRole() -> NSAccessibility.Role? { .button } override func accessibilityLabel() -> String? { "Open details" } override func mouseDown(with event: NSEvent) { onActivate?() } } ``` -------------------------------- ### Install SwiftUI Auditor with Telemetry Opt-out Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/README.md Installs the SwiftUI accessibility auditor using the skills.sh CLI while disabling telemetry. Set the DISABLE_TELEMETRY environment variable to 1 to opt out. ```bash DISABLE_TELEMETRY=1 npx skills add rgmez/apple-accessibility-skills@swiftui-accessibility-auditor ``` -------------------------------- ### Install UIKit Accessibility Auditor using skills.sh CLI Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/README.md Installs the UIKit accessibility auditor using the skills.sh CLI. This command adds the specified skill to your environment for auditing UIKit applications. ```bash npx skills add rgmez/apple-accessibility-skills@uikit-accessibility-auditor ``` -------------------------------- ### Update skills.sh CLI Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/README.md Updates all installed skills managed by the skills.sh CLI. It's recommended to run this periodically to get the latest versions. ```bash npx skills update ``` -------------------------------- ### Smoke Test for Post-Install Verification Source: https://context7.com/rgmez/apple-accessibility-skills/llms.txt A sample smoke test request to verify accessibility auditing functionality after installation, focusing on SwiftUI views. ```text // ── SMOKE TEST (post-install verification) ── // "Audit this SwiftUI view for accessibility and return P0/P1/P2 findings, // patch-ready snippets, and a manual checklist." // Expected output: findings grouped by priority + patch snippets + verification steps ``` -------------------------------- ### Implement Dynamic Type with Custom Fonts in UIKit Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/examples/uikit.md Fixes a P0 accessibility issue where custom fonts do not scale with Dynamic Type settings. This example shows how to use UIFontMetrics to ensure fonts adjust to the user's content size category. ```swift titleLabel.font = UIFontMetrics(forTextStyle: .headline) .scaledFont(for: UIFont(name: "AvenirNext-DemiBold", size: 16) ?? .preferredFont(forTextStyle: .headline)) titleLabel.adjustsFontForContentSizeCategory = true subtitleLabel.font = UIFontMetrics(forTextStyle: .subheadline) .scaledFont(for: UIFont(name: "AvenirNext-Regular", size: 13) ?? .preferredFont(forTextStyle: .subheadline)) subtitleLabel.adjustsFontForContentSizeCategory = true ``` -------------------------------- ### Group UITableViewCell Elements for VoiceOver Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/examples/uikit.md Addresses a P1 accessibility issue where multiple labels in a UITableViewCell create too many VoiceOver stops. This example demonstrates grouping the cell into a single accessible element with a concise label and value. ```swift isAccessibilityElement = true accessibilityTraits = [.button] accessibilityLabel = "Invoice number 42" accessibilityValue = "Due in 7 days. Amount €320.00" titleLabel.isAccessibilityElement = false subtitleLabel.isAccessibilityElement = false amountLabel.isAccessibilityElement = false ``` -------------------------------- ### Repository Structure Overview Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/README.md Provides a high-level overview of the directory structure for the apple-accessibility-skills repository. This helps in understanding where different components and documentation are located. ```text apple-accessibility-skills/ ├── README.md ├── AGENTS.md ├── CONTRIBUTING.md ├── CHANGELOG.md ├── docs/ │ ├── skill-canonical-standard.md │ ├── releasing.md │ └── adapters/ ├── skills/ │ ├── swiftui-accessibility-auditor/ │ ├── uikit-accessibility-auditor/ │ └── appkit-accessibility-auditor/ └── examples/ ``` -------------------------------- ### List available skills.sh CLI commands Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/README.md Lists available skills for a specific repository using the skills.sh CLI. This command helps discover available auditing skills. ```bash npx skills list rgmez/apple-accessibility-skills ``` -------------------------------- ### Skill Frontmatter Requirements Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/docs/skill-canonical-standard.md Specifies the essential metadata required in the frontmatter of each SKILL.md file, including name, description, version, and compatibility. ```yaml --- name: description: version: 1.0.0 compatibility: [cursor, claude, codex, skills.sh] --- ``` -------------------------------- ### Quick Request Skeleton for Accessibility Audits Source: https://context7.com/rgmez/apple-accessibility-skills/llms.txt Provides a skeleton for making quick accessibility audit requests, specifying the auditor and desired output format. ```text // ── QUICK REQUEST SKELETON ── // "Use the Accessibility Auditor. // Return P0/P1/P2 findings, patch-ready fixes, and manual verification steps." ``` -------------------------------- ### Skill Router Rules for Framework-Specific Audits Source: https://context7.com/rgmez/apple-accessibility-skills/llms.txt Defines routing rules to map file types to appropriate accessibility auditing skills based on the framework (SwiftUI, UIKit, AppKit). ```text // ── ROUTING RULES ── // SwiftUI: View files, modifiers, @State, NavigationStack // → Load: skills/swiftui-accessibility-auditor/SKILL.md // UIKit: UIViewController, UIView, UITableViewCell, UICollectionViewCell // → Load: skills/uikit-accessibility-auditor/SKILL.md // AppKit: NSView, NSViewController, NSTableView, NSOutlineView // → Load: skills/appkit-accessibility-auditor/SKILL.md // Mixed-framework file: load multiple skills only when necessary // Default: load ONE skill per request ``` -------------------------------- ### AppKit Accessibility Issues and Patches Source: https://context7.com/rgmez/apple-accessibility-skills/llms.txt Demonstrates common accessibility issues in AppKit UI elements and their corresponding patches for improved VoiceOver support and keyboard navigation. ```swift // ── INPUT ── Three common AppKit patterns with accessibility issues // Pattern A: Icon-only NSButton with no label let settingsButton = NSButton( image: NSImage(systemSymbolName: "gearshape", accessibilityDescription: nil)!, target: self, action: #selector(openSettings) ) // Pattern B: Custom NSView card — mouse-only, invisible to VoiceOver final class ClickableCardView: NSView { var onActivate: (() -> Void)? override func mouseDown(with event: NSEvent) { onActivate?() } } // Pattern C: View-based NSTableView row — no concise VoiceOver summary // Row shows: Title "Invoice #0042" | Subtitle "Due in 7 days" | Amount "€320.00" ``` ```swift // ── PATCH A: label the toolbar button (P0) ── settingsButton.setAccessibilityLabel("Settings") ``` ```swift // ── PATCH B: make custom card keyboard-operable + VoiceOver-discoverable (P0) ── final class ClickableCardView: NSView { var onActivate: (() -> Void)? // Keyboard operability override var acceptsFirstResponder: Bool { true } override func keyDown(with event: NSEvent) { switch event.keyCode { case 36, 49: // Return (36), Space (49) onActivate?() default: super.keyDown(with: event) } } // VoiceOver role and label override func accessibilityRole() -> NSAccessibility.Role? { .button } override func accessibilityLabel() -> String? { "Open details" } override func mouseDown(with event: NSEvent) { onActivate?() } } ``` ```swift // ── PATCH C: expose a meaningful label/value on the table row (P1) ── // In the NSTableCellView or row-level view: cellView.setAccessibilityLabel("Invoice number 42") cellView.setAccessibilityValue("Due in 7 days. Amount €320.00") ``` ```swift // ── CONTENT CHANGE ANNOUNCEMENT ── NSAccessibility.post( element: updatedView, notification: .layoutChanged ) ``` -------------------------------- ### Ensure Dynamic Type Resilience in Compact Layout Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/examples/swiftui.md Avoid truncating important text in compact layouts, especially for values, by adjusting line limits or alignment for large Dynamic Type sizes. ```swift HStack { Text("Total") .font(.headline) Spacer() Text("€1,234.56") .font(.headline) .lineLimit(1) } .padding(.horizontal, 16) ``` ```diff HStack { Text("Total") .font(.headline) Spacer() Text("€1,234.56") .font(.headline) - .lineLimit(1) + .multilineTextAlignment(.trailing) } .padding(.horizontal, 16) ``` -------------------------------- ### SwiftUI Accessibility Before and After Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/README.md Compares a SwiftUI button before and after applying accessibility modifiers. Use `.accessibilityLabel` and `.accessibilityHint` to provide clear information for VoiceOver users. ```swift // Before (looks fine, fails in VoiceOver) Button(action: onClose) { Image(systemName: "xmark") } // After (minimal and explicit) Button(action: onClose) { Image(systemName: "xmark") } .accessibilityLabel("Close") .accessibilityHint("Dismisses this screen") ``` -------------------------------- ### UIKit Accessibility Issues and Patches Source: https://context7.com/rgmez/apple-accessibility-skills/llms.txt Demonstrates common accessibility issues in UIKit patterns like icon-only buttons, multi-label cells, and non-scaled custom fonts. Includes corresponding patches to resolve these issues, categorized by priority (P0/P1). ```swift // ── INPUT ── Three common UIKit patterns with accessibility issues // Pattern A: Icon-only UIBarButtonItem navigationItem.rightBarButtonItem = UIBarButtonItem( image: UIImage(systemName: "square.and.arrow.up"), style: .plain, target: self, action: #selector(share) ) // Pattern B: Multi-label table cell (too many VoiceOver stops) // In UITableViewCell.configure(with:) titleLabel.text = "Invoice #0042" subtitleLabel.text = "Due in 7 days" amountLabel.text = "€320.00" // Pattern C: Custom font not scaled titleLabel.font = UIFont(name: "AvenirNext-DemiBold", size: 16) subtitleLabel.font = UIFont(name: "AvenirNext-Regular", size: 13) ``` ```swift // ── PROMPT ── // "Use the uikit-accessibility-auditor skill. // Audit this UIViewController and its cells using the UIKit Accessibility Auditor. // Return prioritized findings (P0/P1/P2) and a patch-ready diff." ``` ```swift // ── PATCH A: add label to bar button (P0) ── navigationItem.rightBarButtonItem?.accessibilityLabel = "Share" ``` ```swift // ── PATCH B: collapse cell into a single accessibility element (P1) ── // In awakeFromNib or configure(with:): isAccessibilityElement = true accessibilityTraits = [.button] accessibilityLabel = "Invoice number 42" accessibilityValue = "Due in 7 days. Amount €320.00" titleLabel.isAccessibilityElement = false subtitleLabel.isAccessibilityElement = false amountLabel.isAccessibilityElement = false ``` ```swift // ── PATCH C: scale custom fonts with UIFontMetrics (P0) ── titleLabel.font = UIFontMetrics(forTextStyle: .headline) .scaledFont(for: UIFont(name: "AvenirNext-DemiBold", size: 16) ?? .preferredFont(forTextStyle: .headline)) titleLabel.adjustsFontForContentSizeCategory = true subtitleLabel.font = UIFontMetrics(forTextStyle: .subheadline) .scaledFont(for: UIFont(name: "AvenirNext-Regular", size: 13) ?? .preferredFont(forTextStyle: .subheadline)) subtitleLabel.adjustsFontForContentSizeCategory = true ``` ```swift // ── SCREEN CHANGE ANNOUNCEMENT ── // After dynamic content updates, announce appropriately: UIAccessibility.post(notification: .screenChanged, argument: firstFocusableView) UIAccessibility.post(notification: .announcement, argument: "Results updated") ``` -------------------------------- ### Audit SwiftUI for Accessibility Issues Source: https://context7.com/rgmez/apple-accessibility-skills/llms.txt This snippet demonstrates an audit of SwiftUI code for accessibility issues such as missing labels, poor VoiceOver semantics, and decorative elements. It includes expected findings and patch-ready code to resolve these issues, including fixes for dynamic type resilience. ```swift // ── INPUT ── Icon-only button with no label, and a tappable card row // with poor VoiceOver semantics Button(action: save) { Image(systemName: "tray.and.arrow.down") } HStack(spacing: 12) { Image(systemName: "sparkles") VStack(alignment: .leading) { Text("Pro Plan") Text("Renews monthly") .font(.subheadline) .foregroundStyle(.secondary) } } .onTapGesture { openPlanDetails() } // ── PROMPT ── // "Use the swiftui-accessibility-auditor skill. // Audit this SwiftUI snippet for iOS + macOS accessibility and return // P0/P1/P2 findings with a patch-ready diff." // ── EXPECTED OUTPUT ── // P0: Icon-only button has no meaningful accessibility label. // P0: Tappable HStack is not exposed as a single actionable element. // P1: Decorative icon should be hidden from accessibility tree. // ── PATCH ── // Fix 1: icon-only button Button(action: save) { Image(systemName: "tray.and.arrow.down") .accessibilityLabel("Save") } // Fix 2: tappable card row HStack(spacing: 12) { Image(systemName: "sparkles") .accessibilityHidden(true) // P1: hide decorative icon VStack(alignment: .leading) { Text("Pro Plan") Text("Renews monthly") .font(.subheadline) .foregroundStyle(.secondary) } } .onTapGesture { openPlanDetails() } .contentShape(Rectangle()) .accessibilityElement(children: .combine) // P0: single VoiceOver stop .accessibilityAddTraits(.isButton) .accessibilityLabel("Pro Plan") .accessibilityHint("Opens plan details") // ── DYNAMIC TYPE FIX (P1) ── // lineLimit(1) truncates values at large accessibility sizes — remove it HStack { Text("Total") .font(.headline) Spacer() Text("€1,234.56") .font(.headline) .multilineTextAlignment(.trailing) // was: .lineLimit(1) } .padding(.horizontal, 16) ``` -------------------------------- ### Improve Accessibility for Tappable Row with Decorative Image Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/examples/swiftui.md When a row is tappable, expose it as a single actionable element with appropriate labels and hints. Hide decorative images from accessibility. ```swift HStack(spacing: 12) { Image(systemName: "sparkles") VStack(alignment: .leading) { Text("Pro Plan") Text("Renews monthly") .font(.subheadline) .foregroundStyle(.secondary) } } .onTapGesture { openPlanDetails() } ``` ```diff HStack(spacing: 12) { - Image(systemName: "sparkles") + Image(systemName: "sparkles") + .accessibilityHidden(true) VStack(alignment: .leading) { Text("Pro Plan") Text("Renews monthly") .font(.subheadline) .foregroundStyle(.secondary) } } .onTapGesture { openPlanDetails() } + .contentShape(Rectangle()) + .accessibilityElement(children: .combine) + .accessibilityAddTraits(.isButton) + .accessibilityLabel("Pro Plan") + .accessibilityHint("Opens plan details") ``` -------------------------------- ### Add Accessibility Label to Icon-Only Button Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/examples/swiftui.md For icon-only buttons, provide an accessibility label to convey the button's action. This is crucial for users who rely on screen readers. ```swift Button(action: save) { Image(systemName: "tray.and.arrow.down") } ``` ```diff Button(action: save) { - Image(systemName: "tray.and.arrow.down") + Image(systemName: "tray.and.arrow.down") + .accessibilityLabel("Save") } ``` -------------------------------- ### Add Accessibility Label to Icon-Only UIBarButtonItem Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/examples/uikit.md Fixes a P0 accessibility issue where an icon-only bar button item lacks an accessibility label, making it undiscoverable by VoiceOver users. This snippet shows how to add the label. ```swift navigationItem.rightBarButtonItem = UIBarButtonItem( image: UIImage(systemName: "square.and.arrow.up"), style: .plain, target: self, action: #selector(share) ) navigationItem.rightBarButtonItem?.accessibilityLabel = "Share" ``` -------------------------------- ### Add Accessibility Label to Icon-Only NSButton Source: https://github.com/rgmez/apple-accessibility-skills/blob/main/examples/appkit.md Use this snippet to add an accessibility label to an icon-only NSButton, making it discoverable by VoiceOver. Ensure the `accessibilityDescription` is nil when creating the `NSImage` if you intend to set the label separately. ```swift let button = NSButton( image: NSImage(systemSymbolName: "gearshape", accessibilityDescription: nil)!, target: self, action: #selector(openSettings) ) button.setAccessibilityLabel("Settings") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.