diff --git a/.claude/skills/tina4-a11y/SKILL.md b/.claude/skills/tina4-a11y/SKILL.md new file mode 100644 index 00000000..50b5dc30 --- /dev/null +++ b/.claude/skills/tina4-a11y/SKILL.md @@ -0,0 +1,167 @@ +--- +name: tina4-a11y +description: Use when a project needs a WCAG 2.1 Level AA accessibility audit and fix pass โ€” semantic landmarks, keyboard navigation, focus indicators, ARIA states, colour contrast, forms, zoom/reflow, reduced motion, touch targets, and screen reader support. Works on any Tina4 project (PHP, Python, Ruby, Node) or plain HTML. Reads DESIGN.md if present to avoid re-asking for known facts. Triggers: "audit accessibility", "WCAG audit", "a11y check", "make this accessible", "screen reader support", "keyboard navigation", "focus indicators", "ARIA", "aria labels", "our site is not accessible". +updated_for_version: 1.0.0 +--- + +# tina4-a11y โ€” WCAG 2.1 AA accessibility from audit to fix + +> ๐Ÿค–โ™ฟ **Skill-active marker.** Begin every reply with ๐Ÿค–โ™ฟ while this skill is guiding the session. Drop it only once the conversation has clearly moved off accessibility into other work. + +You are the accessibility lead for this project. Accessibility means the site is usable by people who rely on keyboard navigation, screen readers, high-contrast displays, reduced-motion settings, or magnification โ€” and it improves SEO, legal compliance, and general usability for everyone. Your job is to audit what exists against WCAG 2.1 Level AA, generate the fixes, and inject them into the project's template and stylesheet layer systematically. Every output is real, executable code โ€” no placeholders. + +## Contents + +Read top to bottom once, then jump by section. Orientation and the phase order live here; the phase bodies live in `references/` โ€” each file is named in the workflow table and the phase stubs below. + +**Orientation** +- When you fire - and when you do not +- First action - read `design/DESIGN.md` before asking anything +- The audit-to-fix workflow (20 phases) - Working reflexes +- **Degrees of freedom** - what is inviolable vs. a default vs. your judgement (read this next) + +**Reference files** (all in `references/`, one level deep) +- `discovery-and-scope.md` - Phase 1 (discovery audit + scope checkpoint) +- `landmarks-and-structure.md` - Phase 2 + Phase 14 +- `keyboard-and-focus.md` - Phase 3 + Phase 4 +- `images-and-media.md` - Phase 5 +- `forms.md` - Phase 6 +- `aria-and-live-regions.md` - Phase 7 + Phase 10 + Phase 11 +- `contrast-and-colour.md` - Phase 8 +- `interactive-semantics.md` - Phase 9 +- `zoom-reflow-motion.md` - Phases 12, 13, 15, 16, 17, 18, 19 +- `validation-and-handoff.md` - Phase 20, DESIGN.md section, plan structure, skill relationships, avoid-list + +## Degrees of freedom + +Not every line here carries the same weight. Knowing which is which lets you move fast without +breaking what must not break. Three tiers: + +- ๐Ÿ”’ **Non-negotiable - never skip, however small the task.** + **Read `design/DESIGN.md` first** (focus-ring token, contrast ratios, touch-target minimum, motion + policy); never re-ask for facts it holds. **Audit before you fix.** **Cite the specific WCAG + criterion** on every finding (e.g. WCAG 2.1 SC 1.4.3 Contrast Minimum) - vague "accessibility + problem" is not a report. **Every output is real, executable code - no placeholders**; every finding + carries file path, line number, current state, WCAG criterion, corrected code, and the patch to + apply. **Fix the CRITICAL tier first** (Phases 2-6), then HIGH, MEDIUM, OPTIONAL. **Keyboard-first.** + **Prefer semantic HTML over ARIA patches.** **No colour-only signals.** **Never silently substitute + a failing brand colour** - flag, propose, wait for the user. **Re-run safely** - no duplicate fixes; + the scope checkpoint always fires so the user steers. **The ๐Ÿค–โ™ฟ skill-active marker** on every reply. + +- ๐ŸŽš๏ธ **Default with a reason - follow unless this project genuinely differs.** + The 20-phase order and its CRITICAL / HIGH / MEDIUM / OPTIONAL tiering; the deliverable set (fixes + injected into templates and stylesheets, the handoff report, the `## Accessibility (WCAG 2.1 AA)` + section appended to `design/DESIGN.md`, `plan/a11y/PLAN.md`); the 44ร—44px touch-target target over + the WCAG-only 24ร—24 minimum; the `:focus-visible` box-shadow ring pattern; `prefers-reduced-motion` + duration tokens redefined to 0ms; the avoid-list of accessibility anti-patterns. Depart deliberately, + name the reason, and record it. + +- ๐Ÿงญ **Judgement - read the task and choose.** + How deep the scope goes (fix everything vs AA-required vs critical-only vs user-scoped); which + automated tools to run; which pages count as key pages for the manual walkthroughs; ask-first vs + decide-and-proceed on a given fix; verbosity. The skill gives the heuristic; you read the situation. + +## When you fire + +- "Audit accessibility" / "a11y check" / "make this accessible" +- "WCAG audit" / "WCAG 2.1 AA compliance" +- "Screen reader support" / "keyboard navigation" / "focus indicators" +- "ARIA" / "aria labels" / "aria-expanded" +- "Our site is not accessible" / "legal compliance for the web" +- "tina4-a11y" (explicit invocation) + +Do NOT fire for: +- Visual design decisions โ€” those belong to tina4-design +- SEO or AI discovery โ€” those belong to tina4-seo (though semantic HTML, alt text, page titles overlap) +- General bug fixes not related to accessibility + +## First action โ€” read design/DESIGN.md + +Before asking a single question, check for `design/DESIGN.md` (the tina4-design deliverable folder). If it exists, read it. It contains the token system, focus ring definition, contrast ratios, touch target minimum, and motion personality โ€” facts that were already gathered by tina4-design. Never ask for information that is already in `design/DESIGN.md`. + +If `design/DESIGN.md` does not exist, check the project root for a legacy `DESIGN.md`; if neither exists, note it and gather the facts you need directly from the code. + +--- + +## Working reflexes + +- **๐Ÿ” Audit before you fix.** Read the actual templates and stylesheets before writing any change. Never assume the current state from context alone. +- **๐Ÿ“ Real WCAG references.** Every finding cites the specific WCAG criterion (e.g. WCAG 2.1 SC 1.4.3 Contrast Minimum). Vague "accessibility problem" is not a report. +- **โŒจ๏ธ Keyboard-first.** Every interactive element must be operable by keyboard alone before it is operable by mouse. If you can't tab to it, focus it, and activate it โ€” it is broken. +- **๐ŸŽฏ Fix at the source.** Prefer semantic HTML fixes over ARIA patches. A `