@raabbit/fix508
v0.1.0
Published
fix508 — WCAG 2.1 AA / Section 508 accessibility fixer for React components. CLI powered by Claude.
Maintainers
Readme
fixa11y
WCAG 2.1 AA / Section 508 accessibility fixer for React components, powered by Claude.
Scan or fix a single .tsx / .jsx / .ts / .js component and get back concrete issues (or a corrected file) — with inline WHY comments tying each change to a WCAG criterion.
Install
npm install -g @raabbit/fix508Or run without installing:
npx @raabbit/fix508 scan Button.tsxRequires Node.js 18.17+.
API key
fixa11y uses your own Anthropic API key. Set it once:
export ANTHROPIC_API_KEY=sk-ant-...Precedence (highest wins):
--api-key <key>flagFIX508_API_KEYenv varANTHROPIC_API_KEYenv var
Get a key at https://console.anthropic.com/.
Commands
fixa11y scan <target>
Report accessibility issues in a file or directory.
# Scan a single file
fixa11y scan components/Button.tsx
# Scan a directory (default cap: 10 files)
fixa11y scan ./components
# Scan with a higher file limit
fixa11y scan ./src --max-files 50fixa11y audit <target> [options]
Run an aggregate accessibility audit on a file or directory with optional JSON report.
# Audit a single file
fixa11y audit components/Button.tsx
# Audit a directory
fixa11y audit ./components
# Audit with a JSON report
fixa11y audit ./components --report report.json
# Audit with a higher file limit and report
fixa11y audit ./src --max-files 50 --report audit.jsonfixa11y fix <file> [options]
Apply accessibility fixes to a single React component file.
| Option | Description |
| ----------------- | ------------------------------------------------------------- |
| -d, --diff | Show a unified diff instead of the full fixed file. |
| -w, --write | Overwrite the file in place (prompts unless --yes). |
| -y, --yes | Skip the overwrite confirmation prompt. |
| --no-comments | Do not add inline WHY comments to fixes. |
| --api-key <key> | Anthropic API key (overrides env vars). |
| --model <id> | Anthropic model ID (advanced; defaults to claude-sonnet-4-6). |
# Preview fixes as a diff
fixa11y fix components/Button.tsx --diff
# Apply fixes with confirmation
fixa11y fix components/Button.tsx --write
# Apply fixes without prompting (CI-friendly)
fixa11y fix components/Button.tsx --write --yesCommon workflows
Scan a component and see issues:
fixa11y scan components/Button.tsxPreview how to fix a component:
fixa11y fix components/Button.tsx --diffApply a fix and update the file:
fixa11y fix components/Button.tsx --writeSave the fixed file to a new location:
fixa11y fix components/Button.tsx > Button.fixed.tsxCreate and apply a patch:
fixa11y fix components/Button.tsx --diff > button.patch
git apply button.patchAudit a directory of components:
fixa11y audit ./componentsSave an audit report as JSON:
fixa11y audit ./components --report report.jsonScan multiple components for a summary:
fixa11y scan ./src/components --max-files 30Exit codes
| Code | Meaning | | ---: | ------------------------------------------ | | 0 | Clean — no issues, or operation succeeded. | | 1 | Scan found issues, or fix applied. | | 2 | Out of scope (not a React component). | | 3 | Validation error (bad file type, empty). | | 4 | API / network failure. | | 5 | Config error (missing API key). |
Human output goes to stderr; fixed code and diffs go to stdout, so fixa11y fix file.tsx > out.tsx works cleanly.
Scope
fixa11y is a strict accessibility specialist — it is not a general coding assistant. It only addresses WCAG 2.1 AA / Section 508 issues: alt text, keyboard operability, focus indicators, ARIA, semantic HTML, labels, landmarks, live regions, etc. Anything else (refactors, perf, types, styling) is refused as out of scope.
License
MIT
