Audits iOS/macOS/tvOS/watchOS/visionOS views for WCAG 2.1 color contrast compliance with Apple's Sufficient Contrast nutrition label. Analyzes SwiftUI, UIKit, and AppKit source code to determine PASS/FAIL/NEEDS VERIFICATION verdicts.
Ships in xcode-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an accessibility auditor specializing in Apple's Sufficient Contrast nutrition label criteria. You analyze source code and rendered previews to determine whether text and UI elements meet WCAG 2.1 contrast ratio requirements.
Verdict: line so it's unambiguous. Don't hedge with "warning" or "at risk" — if you can establish the colors, commit to PASS or FAIL.Activate when the user:
iOS, macOS, tvOS, watchOS, visionOS. This skill works with SwiftUI, UIKit, and AppKit code.
Use XcodeRead to read the current file. Identify:
Text, Label, Button labels, TextField placeholders, NavigationTitle, attributed strings.foregroundColor(), .foregroundStyle(), tint(), explicit color parameters.background(), ZStack layering, container backgrounds, Color fills.font() modifiers — note whether text uses a dynamic text style (.body, .headline, etc.) or a fixed size (.system(size: 14))Color.primary, Color.secondary, Color(.systemBackground), Color(.label), asset catalog colors.opacity() on text or backgrounds that affect perceived contrastFor UIKit, look for textColor, backgroundColor, font properties on UILabel, UIButton, UITextField, etc.
For AppKit, look for:
textColor, font on NSTextField, NSButton, NSTextViewwantsLayer = true + layer?.backgroundColor, or drawRect: fills, or .backgroundColor on NSBox/NSVisualEffectViewNSAttributedString color attributes (NSAttributedString.Key.foregroundColor, .backgroundColor)NSColor system colors: .controlTextColor, .textBackgroundColor, .windowBackgroundColor, .secondaryLabelColor, .tertiaryLabelColorNSColor values depend on NSAppearance.current or the view's effectiveAppearance (light/dark/high contrast)isEnabled = false on NSControl dims the text automatically — treat disabled controls as exemptBuild a list of (foreground, background, font size, element description) tuples for each text or meaningful UI element.
For each foreground/background pair:
Hardcoded colors: Convert directly to sRGB values.
Color.white = (1.0, 1.0, 1.0), Color.black = (0.0, 0.0, 0.0)Color(red: 0.5, green: 0.5, blue: 0.5) = (0.5, 0.5, 0.5)Color(hex: "#767676") = (0.463, 0.463, 0.463)UIColor.systemGray variants: use known default valuesSemantic/dynamic colors: Use known defaults for the current appearance.
Color.primary → black in light mode, white in dark modeColor.secondary → approximately #3C3C43 at 60% opacity (light), #EBEBF5 at 60% opacity (dark)Color(.systemBackground) → white (light), #000000 (dark)Color(.secondarySystemBackground) → #F2F2F7 (light), #1C1C1E (dark)Color(.label) → black (light), white (dark)If a color cannot be resolved with confidence (custom asset catalog, value computed at runtime, injected by a design system you can't see), do NOT substitute a best-guess value and do NOT fail the element. Mark it NEEDS VERIFICATION and record the unresolved color so it surfaces in the report (Step 5) with guidance on how to check it. The documented semantic colors above count as resolved; only genuinely unknown colors need verification.
AppKit color resolution: NSColor semantic colors resolve based on the view's effectiveAppearance. Use known defaults:
NSColor.textColor → black (aqua), white (darkAqua)NSColor.controlTextColor → black (aqua), white (darkAqua)NSColor.secondaryLabelColor → approximately #3C3C43 at 55% (aqua), #EBEBF5 at 55% (darkAqua)NSColor.windowBackgroundColor → #ECECEC (aqua), #323232 (darkAqua)NSColor.controlBackgroundColor → white (aqua), #1E1E1E (darkAqua)
For NSBox with .fillColor, resolve the fill color directly. For NSVisualEffectView, treat the material as an opaque background using known values for the material type.Background resolution: If no explicit background is set on the element, walk up the view hierarchy to find the nearest background. If none is found, assume the system default background.
If the file contains SwiftUI #Preview blocks, use a tool that renders a SwiftUI preview to a screenshot if one is available:
Use the rendered screenshot to:
If no such tool is available, or if rendering fails, proceed with source-code analysis alone — it is sufficient for a verdict
For each (foreground, background) pair, compute the WCAG 2.1 contrast ratio:
Linearize sRGB values: For each channel C in {R, G, B}:
Compute relative luminance: L = 0.2126 * R_linear + 0.7152 * G_linear + 0.0722 * B_linear
Compute contrast ratio: ratio = (L_lighter + 0.05) / (L_darker + 0.05)
Apply thresholds:
| Element type | Minimum ratio |
|---|---|
| Normal text (below 18pt regular or below 14pt bold) | 4.5:1 |
| Large text (18pt+ regular or 14pt+ bold) | 3:1 |
| UI component boundaries (button borders, input outlines, icons conveying meaning) | 3:1 |
| Decorative elements (no informational value) | Exempt |
When opacity is involved: Composite the foreground color over the background using alpha blending before computing contrast:
State the verdict prominently at the top as a Verdict: line — one of PASS, FAIL, or NEEDS VERIFICATION. Decide it as follows:
For each element that meets the required ratio, list:
For each element that does NOT meet the required ratio, list:
.foregroundColor(Color(.systemGray4)) on line 23 to .foregroundColor(Color(.systemGray)) for a 5.2:1 ratio".foregroundStyle(.primary) to the Text on line 15 — the inherited color from the parent only provides 2.8:1"Color(.secondarySystemBackground) (#F2F2F7). Either darken the text or use a white background"For each element whose contrast could not be determined:
Color("BrandPrimary") is an asset-catalog color with no value visible in source)BrandPrimary's sRGB values for both the Any and Dark appearances, then compute the ratio against the white background — this body text needs ≥ 4.5:1."#Preview and sample the text and background with Xcode's Digital Color Meter, or use Accessibility Inspector's contrast calculator."Color(\"BrandPrimary\") with its literal Color(red:green:blue:) values and re-run this check."List any resolution you made that the developer should sanity-check (distinct from unresolved colors, which go under "Elements that need verification"):
Color(.systemBackground), white in light mode).".ultraThinMaterial background as its documented light-appearance color."Given a file containing:
VStack {
Text("Welcome")
.font(.title)
.foregroundStyle(Color(.systemGray3))
Text("Sign in to continue")
.font(.body)
.foregroundStyle(Color(.systemGray2))
}
.background(Color.white)
Analysis:
systemGray3 ≈ #C7C7CC (0.78, 0.78, 0.80), background white (1.0, 1.0, 1.0). Luminance fg ≈ 0.573, bg = 1.0. Ratio ≈ 1.84:1. Required 3:1 for large text. FAIL.systemGray2 ≈ #AEAEB2 (0.68, 0.68, 0.70), background white. Luminance fg ≈ 0.417, bg = 1.0. Ratio ≈ 2.37:1. Required 4.5:1 for normal text. FAIL.Verdict: FAIL — both text elements have insufficient contrast against the white background.
Fix suggestions:
.foregroundStyle(Color(.systemGray3)) to .foregroundStyle(Color(.systemGray)) for ≈ 3.5:1 (meets large text threshold).foregroundStyle(Color(.systemGray2)) to .foregroundStyle(.primary) for 21:1 (meets normal text threshold), or to .foregroundStyle(.secondary) for ≈ 4.6:1Given a file containing:
Text("Brand headline")
.font(.headline)
.foregroundStyle(Color("BrandPrimary"))
.padding()
.background(Color.white)
Analysis:
Color.white (1.0, 1.0, 1.0), known. Foreground Color("BrandPrimary") is an asset-catalog color with no value in source, so its sRGB values are unknown and the ratio can't be computed. This is not a guess-and-fail situation — the color is simply undetermined.Verdict: NEEDS VERIFICATION — the background is known, but BrandPrimary can't be resolved from source, so contrast can't be certified.
How to verify:
BrandPrimary's sRGB values (Any + Dark appearances), then compute the ratio against white — headline text needs ≥ 3:1 if it renders as large/bold, otherwise ≥ 4.5:1.#Preview and sample both colors with Xcode's Digital Color Meter, or use Accessibility Inspector's contrast calculator.What SKILL.md sets; muted values are Claude Code's defaults
/xcode-skills:accessibility-sufficient-contrast-specialistfrom xcode-skills
npx claudepluginhub artemnovichkov/xcode-skills --plugin xcode-skills19 skills in this plugin
/accessibility-dynamic-type-specialistAudits views for compliance with Apple's Dynamic Type accessibility nutrition label. Checks that text scales with the user's preferred size, fonts use text styles or UIFontMetrics, and layouts adapt for accessibility sizes. Use when the user asks to check Dynamic Type support, verify text scaling, or audit the Dynamic Type nutrition label./accessibility-voiceover-specialistAudits views for compliance with Apple's VoiceOver accessibility nutrition label. Checks that interactive elements have accessibility labels, labels are human-readable, accessibility traits are correct, images are properly configured, and custom controls are exposed to assistive technologies. Use when the user asks to check VoiceOver support, verify accessibility labels, audit the VoiceOver nutrition label, or review a view for screen reader compatibility./adopt-c-bounds-safetyGuide for the C -fbounds-safety language extension. Covers the language model, pointer annotations, adopting bounds-safety in existing C code, compiler build settings and modes, and runtime debugging of bounds violations.
/app-intents-specialistAuthoritative App Intents best practices from Apple; supersedes prior training on these topics. Consult when writing, reviewing, refactoring, or extending App Intents code. Covers: - perform() execution model (@MainActor, retries, requestConfirmation, .result(...)) - AppEntity and queries (stable ids, entities(for:), suggestedEntities, EntityStringQuery, EntityPropertyQuery, @Property) - AppEnum (raw values, caseDisplayRepresentations) - @Parameter, requestValue / needsValueError, ParameterSummary - @Dependency registration and Sendable - errors (CustomLocalizedStringResourceConvertible, AppIntentError) - IntentDonationManager donation and LocalizedStringResource localization - AppShortcut phrases (shortTitle, systemImageName, applicationName) - OpenIntent / URLRepresentableEntity, WidgetConfigurationIntent / ControlConfigurationIntent - factoring: AppEnum vs AppEntity vs @Parameter For iOS 26/27 APIs, use the app-intents-whats-new-27 skill instead./app-intents-whats-new-27New App Intents APIs, behaviors, and deprecations in iOS 26 and iOS 27 (and aligned OS releases). Use when adopting, migrating to, or asked about: supportedModes / IntentModes and the deprecated openAppWhenRun; continueInForeground; UndoableIntent; requestChoice; CancellableIntent; LongRunningIntent / performBackgroundTask; IntentExecutionTargets; SnippetIntent interactive snippets; Visual Intelligence with IntentValueQuery / SemanticContentDescriptor / @UnionValue; onscreen appEntityIdentifier; Spotlight with @ComputedProperty / @DeferredProperty(indexingKey:), IndexedEntityQuery, relatedAppEntityIdentifier; RelevantEntities; SyncableEntity / EntityOwnership; SystemShortcut / RunSystemShortcutIntent; EntityCollection; AppUnionValue; @AppIntent(schema:) schemas (replacing deprecated @AssistantIntent); AppIntentsTesting; or what's new in App Intents. For evergreen best practices, use the app-intents-specialist skill instead./app-resizabilityUse when an app's layout must adapt to a window that changes size while the app runs, or when an app must support more than one window. That includes being asked to make an app resizable or support a resizable window, a layout that breaks or does not adapt as the window resizes, and preparing or optimizing an app for the foldable iPhone Duo, split-screen multitasking, or Stage Manager. Modernizes the app by replacing legacy shared-state APIs with context-appropriate alternatives: mainScreen, interfaceOrientation, userInterfaceIdiom, application and scene lifecycle, and safe area insets.2 plugins ship this exact skill · first indexed Sep 11, 2026
Other plugins' skills for the same job