agentleFS
krzysztofsurdykrzysztofsurdy/code-virtuoso/skills/knowledge/accessibility/SKILL.md

accessibility

Skill22 starsChanged 9 months agoMITView on GitHub

Web accessibility patterns and WCAG 2.1/2.2 compliance for inclusive user interfaces. Use when the user asks to build accessible components, audit a UI for a11y issues, fix screen reader problems, implement keyboard navigation, check color contrast ratios, add ARIA attributes, create accessible forms, or establish accessibility standards for a team. Covers the POUR principles (Perceivable, Operable, Understandable, Robust), semantic HTML, focus management, and automated/manual a11y testing strategies.

70 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use web-quality-audit, core-web-vitals and 8 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • RodrigoTomeESSkill

    web-quality-audit

    Comprehensive web quality audit covering performance, accessibility, SEO, and best practices. Use when asked to "audit my site", "review web quality", "run lighthouse audit", "check page quality", or "optimize my website".

    Also in 8 projects that use this

  • thisisAhsanIqbalSkill

    core-web-vitals

    Audits HTML patterns that affect Core Web Vitals (LCP, CLS, INP). Checks for layout shift causes, largest contentful paint blockers, and interaction responsiveness issues. Use when optimising page performance or fixing Google PageSpeed Insights warnings.

    Also in 10 projects that use this

  • agentset-aiCursor rule

    animations

    Animations Rules and Best Practices

    Also in 3 projects that use this

  • kpbraySkill

    best-practices

    Applies Power BI best practices, BPA rules, and enterprise standards. Use for quality validation, naming conventions, and performance optimization.

    Also in 7 projects that use this

  • YepAPISkill

    background-jobs

    Queue workers with BullMQ/Inngest/Trigger.dev, job retries, dead letter queues, concurrency.

    Also in 3 projects that use this

  • mmondoraSkill

    data-modeling

    Schema design, multi-tenant data isolation, and migration management. Firestore and PostgreSQL patterns, RLS, UUID v7 conventions. Use when designing database schemas, writing migrations, or implementing multi-tenant data access.

    Also in 4 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 64 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never skip levels (do not jump from <h2> to <h4>)

    line 68
  2. Distinctive:

    Use headings for structure, not for visual styling - CSS handles appearance

    line 69
  3. Distinctive:

    Every form control needs a programmatically associated label:

    line 98
  4. Very specific:

    Use aria-describedby to associate error messages with their input

    line 115
  5. Very specific:

    Use aria-invalid="true" on fields that fail validation

    line 116
  6. Distinctive:

    Do not rely solely on color or an asterisk to indicate required status - add text like "(required)"

    line 122
  7. Distinctive:

    Test with browser developer tools (Chrome DevTools shows contrast ratios on hover)

    line 139
  8. Distinctive:

    Test designs with simulated color blindness (protanopia, deuteranopia, tritanopia)

    line 141

“Common” is measured: kept by at least 6 in 10 of the 64 edited versions of this file we could read. “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
SKILL.md

Web Accessibility

Accessibility is not a feature you bolt on at the end - it is a quality attribute that must be considered from the first line of markup. Building accessible interfaces means that people with visual, motor, auditory, or cognitive disabilities can perceive, navigate, and interact with your application. It also means better usability for everyone: keyboard power users, people on slow connections, users with temporary injuries, and those in constrained environments.

Why Accessibility Matters

DimensionImpact
LegalLegislation in most jurisdictions (ADA, EAA, Section 508, EN 301 549) requires digital products to be accessible. Non-compliance carries litigation risk and financial penalties.
EthicalRoughly 16% of the global population lives with some form of disability. Excluding them from digital services is a choice, not an inevitability.
BusinessAccessible products reach a wider audience, improve SEO (structured content helps crawlers), reduce support costs, and correlate with higher overall usability scores.
Technical qualityAccessibility constraints force clean markup, proper semantics, and separation of concerns - all of which improve maintainability.

WCAG Principles: POUR

The Web Content Accessibility Guidelines organize all success criteria under four principles. Every accessibility requirement maps to at least one.

PrincipleQuestion It AnswersExamples
PerceivableCan users sense the content?Text alternatives for images, captions for video, sufficient color contrast, resizable text
OperableCan users interact with every control?Keyboard operability, enough time to complete tasks, no seizure-triggering animations, clear navigation
UnderstandableCan users comprehend the content and UI behavior?Readable language, predictable navigation, input assistance and error messages
RobustDoes it work across assistive technologies?Valid markup, proper use of ARIA, compatibility with screen readers and other tools

Conformance Levels

WCAG defines three levels. Each higher level includes all criteria from the levels below it.

LevelTarget AudienceTypical Requirement
ABare minimum - removes the most severe barriersMost legal and procurement requirements start here
AAIndustry standard - addresses the majority of barriers for most usersRequired by ADA, EAA, Section 508, and most organizational policies
AAAHighest standard - not always achievable for all content typesAspirational goal; apply selectively where feasible

For most projects, target Level AA. It covers the vast majority of real-world accessibility needs without imposing requirements that conflict with certain content types.


Semantic HTML Fundamentals

Native HTML elements carry built-in semantics, keyboard behavior, and screen reader announcements. Using the right element is the single most effective accessibility technique.

Instead OfUseWhy
<div onclick="..."><button>Buttons are focusable, announce their role, and respond to Enter and Space
<span class="link"><a href="...">Links announce as "link," support middle-click, and appear in link lists
<div class="header"><header>, <nav>, <main>, <footer>Landmark elements let screen reader users jump between page regions
<div class="list"><ul> / <ol> with <li>Lists announce item count and position ("item 3 of 7")
<div class="table"><table> with <th>Table headers associate data cells with their labels for screen readers
Styled <div> for input<input>, <select>, <textarea>Native form controls have label association, validation, and assistive tech support built in

Heading Hierarchy

Headings create an outline that screen reader users navigate like a table of contents. Follow these rules:

  • One <h1> per page that describes the page purpose
  • Never skip levels (do not jump from <h2> to <h4>)
  • Use headings for structure, not for visual styling - CSS handles appearance

Common Accessibility Issues

IssueImpactFix
Missing alt text on imagesScreen readers announce the filename or nothingAdd descriptive alt; use alt="" for purely decorative images
Insufficient color contrastUsers with low vision cannot read textMeet 4.5:1 ratio for normal text, 3:1 for large text (AA)
No keyboard access to interactive elementsKeyboard and switch users are completely blockedUse native interactive elements or add tabindex="0" and key handlers
Missing form labelsScreen readers cannot announce what an input is forAssociate every input with a <label> using for/id or wrapping
Auto-playing mediaDisorienting for screen reader users, harmful for those with cognitive disabilitiesNever auto-play; if unavoidable, provide a visible pause/stop control
Missing skip linkKeyboard users must tab through the entire nav on every pageAdd a skip-to-main-content link as the first focusable element
No focus indicatorKeyboard users lose track of their position on the pageNever remove outline without providing a visible custom alternative
Missing page languageScreen readers may mispronounce contentSet lang attribute on <html> (e.g., lang="en")
Inaccessible dynamic contentScreen readers do not announce changes that happen after page loadUse ARIA live regions to announce dynamic updates
Missing document titleScreen reader users cannot identify the page when switching tabsSet a unique, descriptive <title> for every page
Touch targets too smallMotor-impaired users cannot reliably tap small controlsMinimum 24x24 CSS pixels (AA), prefer 44x44 for comfortable interaction
Motion and animationCan cause vestigo, nausea, or seizuresRespect prefers-reduced-motion media query; never flash more than 3 times per second

Accessible Forms

Forms are where accessibility failures cause the most real-world harm - users cannot complete purchases, registrations, or critical workflows.

Label Association

Every form control needs a programmatically associated label:

<!-- Explicit association -->
<label for="email">Email address</label>
<input type="email" id="email" name="email" required>

<!-- Implicit association (wrapping) -->
<label>
  Email address
  <input type="email" name="email" required>
</label>

Error Handling

  • Display errors inline next to the relevant field, not only at the top of the form
  • Use aria-describedby to associate error messages with their input
  • Use aria-invalid="true" on fields that fail validation
  • Provide clear, specific error text ("Enter an email in the format name@example.com" not "Invalid input")

Required Fields

  • Mark required fields with required attribute (for native validation) or aria-required="true" (for custom validation)
  • Do not rely solely on color or an asterisk to indicate required status - add text like "(required)"

Color and Contrast

Color must never be the only means of conveying information. Pair it with text, icons, patterns, or other visual cues.

Contrast ratios (WCAG AA):

ElementMinimum Ratio
Normal text (under 18pt / 14pt bold)4.5:1
Large text (18pt+ / 14pt+ bold)3:1
UI components and graphical objects3:1

Quick wins:

  • Test with browser developer tools (Chrome DevTools shows contrast ratios on hover)
  • Respect prefers-color-scheme for dark mode support
  • Test designs with simulated color blindness (protanopia, deuteranopia, tritanopia)

Reference Files

ReferenceContents
ARIA PatternsWhen to use ARIA, roles and properties, widget patterns (tabs, modals, accordions, dropdowns), live regions, landmark roles
Keyboard and FocusTab order, arrow key navigation, focus trapping, skip links, focus restoration, visible focus indicators, touch targets
Testing StrategiesAutomated tools, manual testing checklist, screen reader testing, contrast verification, accessibility tree, CI integration

Integration with Other Skills

SituationRecommended Skill
Building REST or GraphQL APIs with accessible error responsesInstall knowledge-virtuoso from krzysztofsurdy/code-virtuoso for API design guidance
Security headers that affect accessibility (CSP, iframe restrictions)Install knowledge-virtuoso from krzysztofsurdy/code-virtuoso for security patterns
Testing accessible components with unit and integration testsInstall knowledge-virtuoso from krzysztofsurdy/code-virtuoso for testing strategies
Performance optimization that does not sacrifice accessibilityInstall knowledge-virtuoso from krzysztofsurdy/code-virtuoso for performance guidance

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.