agentleFS
gygantskiyMatilyockgygantskiyMatilyock/ios-developer-agents/.cursor/rules/ios-accessibility-validator.mdc

ios-developer-agents / rules

Cursor rule30 starsChanged 11 months agoMITView on GitHub

Accessibility audit for iOS UI code

The file

We split this ios-accessibility-validator.mdc into the rules it gives an agent

5 rules. About 0 are common, 5 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    When working with iOS UI code, check for accessibility compliance with Apple HIG and WCAG 2.2.

    line 8
  2. Distinctive:

    All interactive elements have meaningful accessibilityLabel

    line 13
  3. Distinctive:

    No hardcoded font sizes that won't scale

    line 32
  4. Distinctive:

    Check contrast and color usage:

    line 38
  5. Distinctive:

    All interactive elements are minimum 44x44 points

    line 48

≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
ios-accessibility-validator.mdc
---
description: Accessibility audit for iOS UI code
globs: ["**/*.swift", "**/*.storyboard", "**/*.xib", "**/ContentView.swift", "**/*View.swift", "**/*ViewController.swift"]
---

# iOS Accessibility Validator

When working with iOS UI code, check for accessibility compliance with Apple HIG and WCAG 2.2.

## VoiceOver Compatibility

Check accessibility labels:
- All interactive elements have meaningful accessibilityLabel
- Labels are concise and descriptive (not "Button" or "Image")
- Labels don't include element type (VoiceOver announces automatically)
- Images have accessibilityLabel or marked as decorative (.accessibilityHidden(true))
- Icon-only buttons have descriptive labels
- Labels update when state changes ("Play" -> "Pause")

Check traits:
- .button for tappable non-Button elements
- .header for section headers
- .link for navigation links
- .adjustable for sliders, steppers, pickers
- .selected for current selection

## Dynamic Type

Check text scaling:
- Text uses UIFont.preferredFont(forTextStyle:) or SwiftUI .font(.body/.title/etc.)
- Custom fonts use UIFontMetrics for scaling
- No hardcoded font sizes that won't scale
- Layouts don't clip at large accessibility sizes
- @ScaledMetric for custom spacing in SwiftUI

## Color Accessibility

Check contrast and color usage:
- Text meets 4.5:1 contrast (normal) or 3:1 (large text 18pt+)
- Information not conveyed by color alone
- Error states have icons/text, not just red color
- Uses semantic colors (UIColor.label, .systemBackground)
- Supports both light and dark mode

## Touch Targets

Check target sizes:
- All interactive elements are minimum 44x44 points
- Adequate spacing between targets
- contentEdgeInsets extends small visuals

## Motion

Check animation handling:
- Respects UIAccessibility.isReduceMotionEnabled
- Provides reduced-motion alternatives

## Output

Flag issues as:
- CRITICAL: Blocks users (cite WCAG criterion)
- HIGH/MEDIUM/LOW: With code fix examples

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.