Terminal
Terminal/Skill
Audits a Penpot design against WCAG AA contrast, target size, heading and focus rules, and reports ranked issues with proposed fixes.
By Penpot
Works with
npx skills add penpot/penpot-ai-kit --skill penpot-audit-accessibilitypenpot-audit-accessibility inspects a design and reports accessibility issues. Every mutation goes
through execute_code (this skill only reads); validate visually with export_shape; read structure
with penpotUtils.shapeStructure (full tool surface: shared/penpot-mcp-tool-reference.md). It reads the object tree
(penpotUtils.shapeStructure/analyzeDescendants), computes WCAG contrast from resolved fills, checks
sizes and semantic naming, and emits a severity-ranked report. It proposes; it does not auto-fix.
Report, don't silently fix. Every issue gets severity + impact + a concrete fix + confidence. Acceptance criteria (AA contrast, target size) are gates — a screen isn't "done" until they pass.
Full surface: shared/penpot-mcp-tool-reference.md. Key calls: execute_code with
penpotUtils.analyzeDescendants (collect text/colors/sizes), penpot.shapesColors(shapes) if needed;
export_shape to capture evidence for the report.
Gotcha numbers refer to shared/plugin-api-gotchas.md:
shape.fills/shape.strokes (arrays; items immutable). Text color is the Text shape's fill.shape.width/shape.height/shape.bounds (read-only; this skill never resizes).penpot-rename-layers first.penpot_api_info before relying on them.scope:deck (slides built by penpot-build-deck, evaluator in brief-to-deck). The scope is the
deck page; every top-level board named NN-… is one slide. Adjust the rules: text ≥ 24 px, or
≥ 18.67 px with fontWeight ≥ 700, is large → 3:1; smaller text → 4.5:1 (check body copy and
captions especially on gradient/glass surfaces — average the stops and flag the result as heuristic).
Skip target-size checks (a deck has no interactive controls beyond navigation). Heading hierarchy =
exactly one h1 per slide. Report scope as the deck page name and name the slide in every finding.
Act as an accessibility specialist.
Phase 0 — Inspection. high_level_overview; collect data with scripts/collectAccessibilityData.js (references/01-inspection.md).
Phase 1 — Contrast. scripts/checkColorContrast.js (references/02-contrast-checks.md) — text vs background, UI component contrast.
Phase 2 — Sizing. scripts/checkTouchTargets.js (references/03-sizing-checks.md) — interactive target sizes.
Phase 3 — Semantics. Heading hierarchy, labels/alt (from semantic names), keyboard/focus order heuristics.
Phase 4 — Report. scripts/generateReport.js (references/04-report-generation.md) — severity-ranked, handoff-ready. ✋ Checkpoint: present findings; if asked to fix, route safe fixes to the owning skill (e.g. penpot-foundations for token swaps) with review.
Report schema per issue:
{ severity, criterion (e.g. "1.4.3 Contrast"), element, current, required, fix, confidence }
Plus a summary: counts by severity, pass/fail per criterion, and a handoff checklist.
The final report must ALSO be emitted as a JSON object per shared/report-schemas/accessibility-report.schema.json — including the derived highOrMedium count (findings with severity High or Medium; what the brief-to-screen workflow branches on) — and mirrored to the run ledger.
Default suggest (read-only). Any fix is delegated to the owning skill under Apply-with-review.
Ledger under RUN_ID: phase, issues:[...], sampled. Lightweight; this skill is mostly read.
| After phase | Artifacts | Ask |
|---|---|---|
| 4 Report | severity report + export_shape evidence | Fix now (route to owning skill) or hand off? |
shared/naming-conventions.md — semantic HTML names enable heading-hierarchy and label checks.
| Excuse | Why it's wrong | Countermeasure (halt) |
|---|---|---|
| "Contrast looks fine to me." | Eyeballing isn't WCAG. | Compute the ratio; compare to 4.5:1 / 3:1. |
| "I'll just fix it myself quietly." | This skill is read-only/advisory. | Report with severity; route fixes to the owning skill with review. |
| "Targets are probably big enough." | Guessing fails AA 2.2. | Measure width/height; compare to ≥24×24. |
| "Headings are obvious from size." | Visual size ≠ semantic order. | Check semantic names; if missing, recommend penpot-rename-layers. |
| "Skip keyboard order, hard to tell." | Silent gaps mislead. | Provide a heuristic order and flag confidence explicitly. |
// WCAG relative luminance + contrast ratio
function lum(hex){const c=hex.replace('#','');const v=[0,2,4].map(i=>parseInt(c.substr(i,2),16)/255)
.map(u=>u<=0.03928?u/12.92:Math.pow((u+0.055)/1.055,2.4));return 0.2126*v[0]+0.7152*v[1]+0.0722*v[2];}
function ratio(a,b){const L1=lum(a),L2=lum(b);const hi=Math.max(L1,L2),lo=Math.min(L1,L2);return (hi+0.05)/(lo+0.05);}
return { example: Number(ratio('#101114','#F7F8FA').toFixed(2)) }; // ~ AA pass
penpot_api_info('Text'), penpot_api_info('Shape','fills').references/: 01-inspection.md, 02-contrast-checks.md, 03-sizing-checks.md, 04-report-generation.md.
scripts/: collectAccessibilityData.js, checkColorContrast.js, checkTouchTargets.js, generateReport.js.
Doctrine paths. shared/… and policies/… resolve inside this bundle in native installs (vendored by the installer); in a Claude Code plugin install they live at the plugin root — ${CLAUDE_PLUGIN_ROOT}/shared/…, two directories up from this file.