agentleFS
renfei-designrenfei-design/Figma-AI-Bridge/.github/skills/a11y-audit/SKILL.md

a11y-audit

Skill17 starsChanged 9 months agoMITView on GitHub

Audit Figma designs for WCAG accessibility issues — color contrast, minimum font size, touch target sizing, and missing text alternatives. Use when asked to check accessibility, audit contrast ratios, find a11y issues, verify WCAG compliance, or review designs for accessibility problems. Scans nodes, analyzes offline, and annotates issues in Figma.

19 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use perf-audit, i18n and 10 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.
  • CorentinGCSkill

    perf-audit

    Audit de performance web — bundle size, lazy loading, memoization, images, Core Web Vitals, Server vs Client Components. À invoquer avec /perf-audit.

    Also in 3 projects that use this

  • ffsshhttiikkSkill

    i18n

    Internationalization and localization

    Also in 3 projects that use this

  • fefogarciaSkill

    dependency-audit

    Comprehensive dependency health auditing for JavaScript/TypeScript projects. Run npm audit, detect outdated packages, check for security advisories, and verify license compliance. Prioritises vulnerabilities by severity and provides actionable fix recommendations.

    Also in 3 projects that use this

  • VercelSkill

    deploy

    Deploy applications to Vercel. Use when the user says "deploy", "deploy to Vercel", "push to production", "deploy my app", or "go live".

    Also in 4 projects that use this

  • AICreator-WindSkill

    design-review

    编码设计师工具。设计审计和修复。

    Also in 3 projects that use this

  • GitHubSkill

    refactor

    Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 14 edited versions we read keep these.

  • 7

    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:

    Use FIGMA_TIMEOUT_MS=30000 for scan commands, FIGMA_TIMEOUT_MS=60000 for large trees

    line 21
  2. Very specific:

    Efficient approach: Use get_node_info on the root frame with full children — the nested children array includes fills for all descendants, …

    line 55
  3. Distinctive:

    Run the analysis script:

    line 59
  4. Distinctive:

    Wait for user to review. They may choose: annotate all, annotate selected, or skip.

    line 85
  5. Distinctive:

    Only the smaller dimension is reported if one axis passes

    line 120
  6. Distinctive:

    Check if the parent has a SOLID fill → use that color

    line 135
  7. Distinctive:

    If not, check the grandparent (up to 3 levels)

    line 136
  8. Very specific:

    If no solid fill found in ancestors, assume #FFFFFF (white)

    line 137
  9. Distinctive:

    If an ancestor has a gradient or image fill, flag as "manual review needed"

    line 138
  10. Distinctive:

    Opacity compositing: If a text node has fill opacity < 1, blend with background before computing contrast.

    line 157

“Common” is measured: kept by at least 6 in 10 of the 14 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

Figma Accessibility Audit

Scan Figma frames for WCAG 2.2 accessibility violations and annotate issues directly. Be fast — scan, analyze, present, annotate.

Prerequisites

  • figma-ai-bridge plugin running in Figma and connected
  • Helper scripts:
    • scripts/figma_cmd.mjs <channel> <command> [paramsJSON] — single command
    • .github/skills/a11y-audit/scripts/a11y_check.py — offline analysis
  • Reference: .github/skills/a11y-audit/references/wcag-criteria.md
  • Use FIGMA_TIMEOUT_MS=30000 for scan commands, FIGMA_TIMEOUT_MS=60000 for large trees

Workflow — Do This Quickly

1. Scan text nodes

Get the selection, then scan all text nodes:

FIGMA_TIMEOUT_MS=30000 node scripts/figma_cmd.mjs <ch> scan_text_nodes '{"nodeId":"<id>"}' > /tmp/a11y_text_scan.json

Returns {textNodes: [{id, name, characters, fontSize, fontFamily, fontStyle, width, height, x, y, path, depth}]}.

2. Scan interactive elements

Scan for component instances and frames (potential buttons/controls):

FIGMA_TIMEOUT_MS=30000 node scripts/figma_cmd.mjs <ch> scan_nodes_by_types '{"nodeId":"<id>","types":["INSTANCE","COMPONENT"]}' > /tmp/a11y_components.json

Returns {matchingNodes: [{id, name, type, bbox: {x, y, width, height}}]}.

3. Enrich with full node info

Batch-fetch details including fills and parent background colors:

FIGMA_TIMEOUT_MS=60000 node scripts/figma_cmd.mjs <ch> get_nodes_info '{"nodeIds":["<id1>","<id2>",...]}' > /tmp/a11y_node_details.json

For each text node, also fetch its parent node(s) to find the background color. Walk up the tree: get the text node's parent from get_node_info, check if it has a solid fill. If not, get that node's parent. Stop at 3 levels or when a solid fill is found.

Efficient approach: Use get_node_info on the root frame with full children — the nested children array includes fills for all descendants, so you can walk the tree in one call for background resolution.

4. Analyze (offline)

Run the analysis script:

python3 .github/skills/a11y-audit/scripts/a11y_check.py \
  /tmp/a11y_text_scan.json \
  /tmp/a11y_components.json \
  --details /tmp/a11y_node_details.json \
  --out /tmp/a11y_issues.json

The script performs all checks offline and outputs categorized issues. It prints a summary to stdout.

5. Present issues for review

Show a table to the user:

#NodeIssueCurrentRequiredSeverity

Group by severity (errors first, then warnings). Include:

  • Contrast — show ratio and required ratio
  • Font size — show size and minimum
  • Touch target — show dimensions and minimum
  • Empty text — flag nodes with no content
  • Image alt — flag images without annotations

Wait for user to review. They may choose: annotate all, annotate selected, or skip.

6. Annotate issues in Figma

On user approval, apply annotations:

FIGMA_TIMEOUT_MS=30000 node scripts/figma_cmd.mjs <ch> set_multiple_annotations '{"nodeId":"<rootId>","annotations":<annotations_array>}'

The annotations array comes from the annotations field in /tmp/a11y_issues.json.

Checks Performed

Color Contrast (WCAG 1.4.3 / 1.4.6)

LevelNormal textLarge text (>=18px or >=14px bold)
AA (error)>= 4.5:1>= 3:1
AAA (warning)>= 7:1>= 4.5:1
  • Foreground color = text node's first solid fill color
  • Background color = nearest ancestor's first solid fill, or #FFFFFF if none found
  • Gradient/image backgrounds flagged as "manual review" (cannot auto-compute)
  • Opacity is factored into the effective color before computing contrast

Minimum Font Size (Best Practice)

  • Flag text nodes with fontSize < 12px as warning
  • Flag text nodes with fontSize < 10px as error

Touch Target Size (WCAG 2.5.8)

  • Flag interactive elements (INSTANCE/COMPONENT) smaller than 44×44px
  • Interactive element detection by name (case-insensitive): button, btn, link, icon, toggle, checkbox, radio, switch, tab, chip, action, fab
  • Only the smaller dimension is reported if one axis passes

Empty Text Content

  • Flag text nodes where characters is empty or whitespace-only
  • Severity: warning

Image Without Annotation (WCAG 1.1.1)

  • Nodes with image fills (type: "IMAGE") that have no annotations
  • Severity: warning

Background Color Resolution

  1. Get the text node's parent from get_node_info (or from the root tree)
  2. Check if the parent has a SOLID fill → use that color
  3. If not, check the grandparent (up to 3 levels)
  4. If no solid fill found in ancestors, assume #FFFFFF (white)
  5. If an ancestor has a gradient or image fill, flag as "manual review needed"

Annotation Format

**A11y: <Issue Type>** — <Description>

Examples:

  • **A11y: Contrast** — Ratio 2.8:1 (need 4.5:1 for AA)
  • **A11y: Font Size** — 10px is below 12px minimum
  • **A11y: Touch Target** — 32×28px is below 44×44px minimum
  • **A11y: Empty Text** — Text node has no content
  • **A11y: Image Alt** — Image has no annotation (add alt text description)

Notes

  • AA is the default target. AA violations = errors, AAA violations = warnings.
  • Large text threshold: >=18px regular weight, or >=14px with fontWeight >= 700 (bold).
  • Opacity compositing: If a text node has fill opacity < 1, blend with background before computing contrast.
  • Hidden nodes are skipped by scan_text_nodes and scan_nodes_by_types automatically.
  • Performance: For large frames (1000+ nodes), use chunked scanning: scan_text_nodes with {"useChunking": true, "chunkSize": 200}.

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.