# checks.md — Accessibility Pack --- ## Scope This pack audits JSX and TSX source files for common accessibility (a11y) defects: missing `alt` attributes on images, click handlers on non-interactive elements without keyboard support, `target="_blank"` anchors lacking `rel="noopener noreferrer"`, animations and transitions without a `prefers-reduced-motion` guard, and interactive elements in Tailwind v4 projects that rely on default cursor styles (Tailwind v4 no longer sets `cursor:pointer` on buttons globally). Checks self-scope to `.jsx` and `.tsx` files; a JavaScript back-end project with no JSX will match the `language:javascript` gate but produce zero findings, which is the expected graceful behaviour. This pack does NOT audit semantic HTML correctness (heading order, landmark regions, colour contrast ratios) or ARIA attribute validity — those require specialised tooling beyond grep and LLM scanning. **Pack ID:** `ccgm/accessibility` **Applies when:** `language:javascript` --- ## applies_when Rationale | Condition | Reason | |-----------|--------| | `language:javascript` | The ecosystem detector emits `javascript` for any repository that has a `package.json`. JSX/TSX files only appear in JavaScript (or TypeScript) projects; there is no signal to produce on Go, Python, or other non-JS codebases. Using `language:javascript` is the broadest correct gate: it covers plain-JS React, TypeScript React, and Next.js projects alike. Checks then internally scope themselves to `.jsx`/`.tsx` files, so a Node API with no JSX produces zero findings rather than false positives. | --- ## Checks --- ### `a11y/img-missing-alt` **Severity:** `medium` **Confidence:** `medium` **Detection:** `llm` #### Detection The LLM agent scans JSX/TSX source files for `` elements (and `` from next/image or similar) that are missing an `alt` attribute, or where `alt` is an empty string on a non-decorative image. **Tool (if detection = tool or hybrid):** n/a Rule / rule-id: n/a Fallback when tool absent: llm **LLM instruction (if detection = llm or hybrid):** ``` READ AND APPLY: ~/.claude/skills/audit/reference/fix-patterns.md Use the Fix Type Reference table from that file to assign fix_type and fix_confidence to each finding. Do not rely on memory — open and apply the file. Scan JSX and TSX source files (.jsx, .tsx) for image elements missing an `alt` attribute or using `alt=""` on what appears to be a non-decorative image. Flag as findings: 1. elements with no `alt` attribute at all 2. elements (Next.js next/image, or similar framework wrappers) with no `alt` prop 3. or elements where alt="" but the surrounding context (captions, filename, aria-label, or descriptive class names) suggests the image conveys meaningful content Do NOT flag: - when there is an explicit comment, aria-hidden="true", or role="presentation" indicating the image is purely decorative - Auto-generated or vendored component files (node_modules, .gen.tsx, generated/) - SVG inline elements (use conventions, not alt) For each finding report: file path, line number, the JSX element, and what alt text would be appropriate based on context. Mark auto_fixable: false (requires a human to write meaningful alt text describing the image content). ``` #### Spine Wiring ```yaml check_id: a11y/img-missing-alt detection: llm ``` #### Severity / Confidence **Severity rationale:** Missing `alt` attributes make images completely inaccessible to screen reader users. For content-carrying images this is a WCAG 2.1 Level A failure — the lowest passing bar. Medium severity: real impact on screen reader users but does not break the application for sighted users. **Confidence rationale:** Detecting absent `alt` props on `` elements is a straightforward structural scan. The LLM can identify the element, check for the attribute, and assess whether `alt=""` is intentional based on context. Some judgment is required for the decorative vs. non-decorative distinction, so confidence is medium rather than high. **Rubric entry:** `a11y/img-missing-alt` #### Fixture **True positive** (`src/components/Avatar.tsx`): ```tsx // FINDS: missing alt attribute function Avatar({ url }: { url: string }) { return ; } ``` **True negative** (should produce NO finding): ```tsx // OK: alt attribute provided function Avatar({ url }: { url: string }) { return User avatar; } ``` --- ### `a11y/click-without-keyboard` **Severity:** `medium` **Confidence:** `medium` **Detection:** `llm` #### Detection The LLM agent scans JSX/TSX files for `onClick` handlers attached to non-interactive elements (`
`, ``, `
  • `, etc.) that lack both an `onKeyDown`/`onKeyUp` handler AND an appropriate `role` attribute. **Tool (if detection = tool or hybrid):** n/a Rule / rule-id: n/a Fallback when tool absent: llm **LLM instruction (if detection = llm or hybrid):** ``` READ AND APPLY: ~/.claude/skills/audit/reference/fix-patterns.md Use the Fix Type Reference table from that file to assign fix_type and fix_confidence to each finding. Do not rely on memory — open and apply the file. Scan JSX and TSX source files (.jsx, .tsx) for onClick handlers attached to non-interactive HTML elements that are inaccessible to keyboard-only users. Flag as findings: any non-interactive element (
    , ,

    ,

  • , ,
    ,
    ,
    ,