cursor-handbook / frontend
Cursor rule31 starsChanged 3 months agoMITView on GitHub
Accessibility (a11y) rules for frontend components. Apply when editing UI or markup.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository30 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/architecture/core-principles.mdcCursor rule
- .cursor/rules/architecture/dependency-management.mdcCursor rule
- .cursor/rules/architecture/token-efficiency.mdcCursor rule
- .cursor/rules/backend/api-design.mdcCursor rule
- .cursor/rules/backend/code-organization.mdcCursor rule
- .cursor/rules/backend/error-handling.mdcCursor rule
- .cursor/rules/backend/handler-patterns.mdcCursor rule
- .cursor/rules/backend/nodejs.mdcCursor rule
- .cursor/rules/backend/typescript.mdcCursor rule
- .cursor/rules/cloud/containerization.mdcCursor rule
- .cursor/rules/cloud/infrastructure.mdcCursor rule
- .cursor/rules/cloud/serverless.mdcCursor rule
- .cursor/rules/database/migration-rules.mdcCursor rule
- .cursor/rules/database/query-patterns.mdcCursor rule
- .cursor/rules/database/schema-design.mdcCursor rule
- .cursor/rules/devops/ci-cd.mdcCursor rule
- .cursor/rules/devops/documentation-standards.mdcCursor rule
- .cursor/rules/devops/monitoring.mdcCursor rule
- .cursor/rules/frontend/component-patterns.mdcCursor rule
- .cursor/rules/frontend/performance.mdcCursor rule
- .cursor/rules/frontend/state-management.mdcCursor rule
- .cursor/rules/main-rules.mdcCursor rule
- .cursor/rules/security/guardrails.mdcCursor rule
- .cursor/rules/security/secrets-rules.mdcCursor rule
- .cursor/rules/security/security-compliance.mdcCursor rule
- .cursor/rules/testing/integration-testing.mdcCursor rule
- .cursor/rules/testing/mock-patterns.mdcCursor rule
- .cursor/rules/testing/testing-standards.mdcCursor rule
The file
Show its rules and text
We split this accessibility.mdc into the rules it gives an agent
15 rules. About 0 are common, 5 are distinctive, and 10 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.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 12
Use semantic elements: <nav>, <main>, <article>, <section>, <aside>
- Very specific: line 13
Use heading hierarchy: <h1> → <h2> → <h3> (never skip levels)
- Very specific: line 14
Use <button> for actions, <a> for navigation — never swap them
- Very specific: line 15
Use <label> for all form inputs with htmlFor attribute
- Very specific: line 16
Use <fieldset> and <legend> for related form groups
- Very specific: line 19
Add aria-label to icon-only buttons
- Very specific: line 20
Use aria-live regions for dynamic content updates
- Very specific: line 21
Add role attributes when semantic HTML isn't sufficient
- Very specific: line 22
Use aria-expanded for collapsible sections
- Very specific: line 23
Use aria-describedby for complex form validation messages
- Distinctive: line 26
All interactive elements MUST be keyboard accessible
- Distinctive: line 34
Don't convey information through color alone — use icons or text
- Distinctive: line 46
Test with keyboard navigation
- Distinctive: line 47
Test with screen readers (VoiceOver, NVDA)
- Distinctive: line 48
Use axe-core or Lighthouse for automated a11y audits
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 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.
Files
--- description: "Accessibility (a11y) rules for frontend components. Apply when editing UI or markup." alwaysApply: false globs: "**/*.tsx,**/*.jsx,**/*.vue,**/components/**/*" --- # Accessibility Rules ## WCAG 2.1 AA Compliance (Minimum) ### Semantic HTML - Use semantic elements: `<nav>`, `<main>`, `<article>`, `<section>`, `<aside>` - Use heading hierarchy: `<h1>` → `<h2>` → `<h3>` (never skip levels) - Use `<button>` for actions, `<a>` for navigation — never swap them - Use `<label>` for all form inputs with `htmlFor` attribute - Use `<fieldset>` and `<legend>` for related form groups ### ARIA Attributes - Add `aria-label` to icon-only buttons - Use `aria-live` regions for dynamic content updates - Add `role` attributes when semantic HTML isn't sufficient - Use `aria-expanded` for collapsible sections - Use `aria-describedby` for complex form validation messages ### Keyboard Navigation - All interactive elements MUST be keyboard accessible - Visible focus indicators on all focusable elements - Logical tab order (avoid `tabIndex` > 0) - Escape key closes modals and dropdowns - Enter/Space activates buttons and links ### Visual - Minimum contrast ratio: 4.5:1 for normal text, 3:1 for large text - Don't convey information through color alone — use icons or text - Support text zoom up to 200% without loss of content - Provide text alternatives for all images: `alt` attribute - Animated content must be pausable ### Forms - Clear error messages linked to the field via `aria-describedby` - Required fields marked with `aria-required="true"` - Form validation errors announced to screen readers - Autofill support for common fields (name, email, address) ### Testing - Test with keyboard navigation - Test with screen readers (VoiceOver, NVDA) - Use axe-core or Lighthouse for automated a11y audits - Include a11y tests in CI pipeline
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
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.

