Skip to content

Commit 601fe54

Browse files
committed
feat: add Antigravity strict profile rules (maximum enforcement)
1 parent 7ad1789 commit 601fe54

6 files changed

Lines changed: 1767 additions & 0 deletions

File tree

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
---
2+
trigger: always_on
3+
---
4+
5+
# Accessibility Standards - STRICT (Zero Tolerance)
6+
7+
## Compliance Requirements - MANDATORY
8+
9+
- WCAG 2.1 Level AA MINIMUM (AAA when possible)
10+
- 100% keyboard accessibility (no exceptions)
11+
- ALL features tested with screen readers before PR approval
12+
- Automated accessibility tests REQUIRED in CI/CD
13+
- Manual accessibility testing MANDATORY for all UI changes
14+
15+
## POUR Principles - Strict Enforcement
16+
17+
### Perceivable - MUST BE ACCESSIBLE
18+
19+
- ALL images MUST have alt text (or alt="" if decorative) - NO EXCEPTIONS
20+
- ALL videos MUST have captions
21+
- ALL audio MUST have transcripts
22+
- Color contrast MUST be 4.5:1 minimum (7:1 for AAA preferred)
23+
- NEVER use color alone to convey information
24+
- Text MUST be resizable up to 200% without loss of content
25+
26+
### Operable - MUST WORK WITH KEYBOARD
27+
28+
- ALL functionality MUST work with keyboard only
29+
- Visible focus indicators REQUIRED (minimum 2px outline)
30+
- Focus order MUST be logical
31+
- NO keyboard traps (zero tolerance)
32+
- NEVER use `tabIndex > 0` (PR rejection if found)
33+
- NO time limits unless user can control them
34+
35+
### Understandable - MUST BE CLEAR
36+
37+
- Proper heading hierarchy (h1 > h2 > h3, NO skipping)
38+
- Semantic HTML MANDATORY (header, nav, main, footer, button)
39+
- Form labels REQUIRED for ALL inputs
40+
- Error messages MUST be clear and actionable
41+
- Language attribute MUST be set on all pages
42+
43+
### Robust - MUST WORK EVERYWHERE
44+
45+
- Valid HTML (pass W3C validator)
46+
- Test with NVDA, JAWS, VoiceOver, TalkBack (ALL required)
47+
- Works with assistive technologies
48+
- Compatible with all major browsers + screen readers
49+
50+
## Implementation Requirements - STRICT
51+
52+
### Screen Reader Support - MANDATORY
53+
54+
- Use semantic HTML FIRST (button, not div with onClick)
55+
- ARIA ONLY when semantic HTML insufficient
56+
- role="alert" MUST be used sparingly (overuse = PR rejection)
57+
- Announce ALL state changes (loading, success, error)
58+
- Test EVERY feature with screen reader before PR
59+
60+
### Form Accessibility - ZERO TOLERANCE
61+
62+
- ALL form fields MUST have associated labels (no visual-only labels)
63+
- Required fields MUST be indicated programmatically
64+
- Error messages MUST be associated with inputs (aria-describedby)
65+
- Form validation MUST happen on blur or submit (not on every keystroke)
66+
- Success confirmations MUST be announced to screen readers
67+
68+
### Interactive Elements - STRICT REQUIREMENTS
69+
70+
- Buttons MINIMUM size: 44x44 CSS pixels (WCAG AAA)
71+
- Links MUST have descriptive text (no "click here", "read more")
72+
- External links MUST indicate new window/tab
73+
- Custom controls MUST have proper ARIA attributes
74+
- ALL custom actions MUST be keyboard accessible
75+
76+
### Mobile Accessibility - MANDATORY
77+
78+
- Touch targets MINIMUM 44x44 pixels
79+
- Pinch-to-zoom MUST be enabled (no viewport user-scalable=no)
80+
- Test with VoiceOver (iOS) AND TalkBack (Android)
81+
- Orientation changes MUST be supported
82+
- Touch gestures MUST have keyboard alternatives
83+
84+
## Testing Requirements - MANDATORY
85+
86+
### Automated Testing - REQUIRED
87+
88+
- axe-core or jest-axe in ALL unit tests
89+
- Lighthouse accessibility score MUST be 100
90+
- pa11y in CI/CD pipeline (build fails on errors)
91+
- ESLint jsx-a11y plugin with ALL rules enabled
92+
- NO eslint-disable for a11y rules without architect approval
93+
94+
### Manual Testing - REQUIRED BEFORE PR
95+
96+
- Keyboard navigation test (Tab, Shift+Tab, Enter, Space, Escape)
97+
- Screen reader test with NVDA (Windows) OR VoiceOver (Mac)
98+
- Color contrast analyzer (ALL text and UI elements)
99+
- Zoom to 200% test (content must remain readable)
100+
- Test with CSS disabled (content must be understandable)
101+
102+
### Testing Checklist - ALL REQUIRED
103+
104+
- [ ] Keyboard navigation works for ALL functionality
105+
- [ ] Visible focus indicators present
106+
- [ ] Focus order is logical
107+
- [ ] Screen reader announces content correctly
108+
- [ ] Color contrast passes 4.5:1 (7:1 preferred)
109+
- [ ] Alt text provided for ALL meaningful images
110+
- [ ] Form labels properly associated
111+
- [ ] Error messages clear and associated
112+
- [ ] NO automatic timeouts
113+
- [ ] NO flashing content
114+
- [ ] Semantic HTML used throughout
115+
- [ ] Zoom to 200% tested and working
116+
- [ ] Mobile touch targets 44x44px minimum
117+
118+
## Prohibited Practices - IMMEDIATE PR REJECTION
119+
120+
### NEVER DO THESE
121+
122+
- NEVER use `tabIndex > 0`
123+
- NEVER use color alone to convey information
124+
- NEVER disable zoom (viewport user-scalable=no)
125+
- NEVER use flashing/blinking content
126+
- NEVER create keyboard traps
127+
- NEVER use non-semantic HTML for interactive elements
128+
- NEVER skip heading levels (h1 to h3)
129+
- NEVER use `role="presentation"` on interactive elements
130+
- NEVER use placeholder as label
131+
- NEVER auto-play audio/video
132+
- NEVER mock screen reader implementations with aria-label hacks
133+
134+
## ARIA - Use ONLY When Necessary
135+
136+
### First Rule of ARIA: Don't Use ARIA
137+
138+
- Use semantic HTML FIRST
139+
- ARIA only when semantic HTML insufficient
140+
- NEVER change semantic meaning with ARIA
141+
- ALL ARIA controls MUST be keyboard accessible
142+
143+
### Allowed ARIA Patterns (Only These)
144+
145+
- `aria-label`: When visual label not present
146+
- `aria-labelledby`: Associate existing label
147+
- `aria-describedby`: Additional description
148+
- `aria-live`: Dynamic content announcements (polite or assertive only)
149+
- `aria-expanded`: Collapsible content state
150+
- `aria-hidden="true"`: Hide decorative elements ONLY
151+
- `aria-invalid`: Form validation errors
152+
153+
### ARIA Violations = PR Rejection
154+
155+
- Incorrect role usage
156+
- Missing required ARIA attributes
157+
- ARIA on non-interactive elements
158+
- Conflicting ARIA and HTML semantics
159+
160+
## Color Contrast - STRICT REQUIREMENTS
161+
162+
### Minimum Ratios (AAA Preferred)
163+
164+
- Normal text: 4.5:1 minimum (7:1 for AAA)
165+
- Large text (18pt+ or 14pt+ bold): 3:1 minimum (4.5:1 for AAA)
166+
- UI components: 3:1 minimum
167+
- Icons: 3:1 minimum
168+
- States (hover, focus, active): 3:1 minimum
169+
170+
### Testing Required
171+
172+
- Use Color Contrast Analyzer tool
173+
- Test ALL color combinations
174+
- Test hover/focus/active states
175+
- Test with grayscale view
176+
- Test with color blindness simulators
177+
178+
## Enforcement
179+
180+
### PR Review Requirements
181+
182+
- Accessibility checklist MUST be completed
183+
- Screen reader testing video/screenshots required for UI changes
184+
- Automated tests MUST pass (100 Lighthouse score)
185+
- Manual testing MUST be documented
186+
- Architect review REQUIRED for custom ARIA usage
187+
188+
### Build Pipeline
189+
190+
- Builds FAIL on accessibility violations
191+
- axe-core violations block merge
192+
- Lighthouse score < 100 blocks merge
193+
- ESLint a11y errors block merge
194+
195+
## Resources - MANDATORY READING
196+
197+
- WCAG 2.1: https://www.w3.org/WAI/WCAG21/quickref/
198+
- ARIA Authoring Practices: https://www.w3.org/WAI/ARIA/apg/
199+
- WebAIM: https://webaim.org/

0 commit comments

Comments
 (0)