tpt-accessfix

TypeScript

WCAG accessibility audit + automated remediation for React, Vue, Angular, Svelte & vanilla HTML — CLI, VS Code, browser extension, Figma & IntelliJ plugins, with confidence-tiered codemods, trend tracking, and compliance reports.

0 stars0 forks0 watchers

Languages

TypeScript78.2%Python7.0%Rust6.9%JavaScript4.3%HTML2.7%CSS0.9%
README

TPT AccessFix

Open-source accessibility automation platform that goes beyond traditional a11y auditing by providing automated remediation suggestions and one-click fixes for common WCAG violations.

Architecture

tpt-accessfix/
├── packages/
│   ├── shared/              # Shared types, enums, utilities
│   ├── core/                # Audit engine, rules engine, codemods
│   ├── cli/                 # CLI tool (tpt-accessfix)
│   ├── vscode-extension/    # VS Code extension
│   ├── browser-extension/   # Chrome & Firefox extension
│   ├── component-library/   # Accessible React components
│   ├── storybook-addon/     # Storybook a11y addon
│   ├── figma-plugin/        # Figma design plugin
│   ├── sketch-plugin/       # Sketch design plugin
│   ├── intellij-plugin/     # IntelliJ IDEA plugin
│   └── vim-plugin/          # Vim/Neovim plugin
├── engines/
│   ├── ml-engine/           # Python ML component (Python)
│   └── rust-engine/         # Performance engine (Rust)
├── examples/                # Usage examples
└── docs/                    # Documentation

Quick Start

# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run an accessibility audit
pnpm --filter tpt-accessfix build
./packages/cli/dist/index.js audit . --output html

# Or use the CLI directly
tpt-accessfix init
tpt-accessfix audit . --output html
tpt-accessfix fix . --dry-run

CLI Commands

CommandDescription
tpt-accessfix init [dir]Generate .tpt-accessfix.json config
tpt-accessfix audit [dir]Run accessibility audit
tpt-accessfix fix [dir]Apply high-confidence auto-fixes
tpt-accessfix watch [dir]Real-time re-audit on file save
tpt-accessfix report [dir]Generate formatted report (html/markdown/sarif)
tpt-accessfix compliance [dir]Full WCAG compliance report for legal documentation
tpt-accessfix trend [dir]Analyse accessibility score over time
tpt-accessfix benchmark [dir]Compare score against industry averages

Key flags

tpt-accessfix audit .
  --output <format>       # json, html, junit, sarif, markdown
  --framework <fw>        # react, vue, angular, svelte, vanilla, auto
  --level <level>         # A, AA, AAA
  --interactive           # Interactive mode with auto-fix prompts
  --save-snapshot         # Append score to .tpt-accessfix-snapshots.json

tpt-accessfix fix .
  --dry-run               # Preview without making changes

tpt-accessfix compliance .
  --project <name>        # Project name on the report
  --auditor <name>        # Auditor name
  --level AA              # WCAG level

tpt-accessfix benchmark .
  --industry <category>   # technology, healthcare, education, finance, ecommerce, government…
  --list-industries       # Print all available categories

WCAG Rules Implemented (16 rules)

Rule IDWCAGDescriptionConfidence
alt-text1.1.1Images must have alt textHigh
form-labels1.3.1, 3.3.2Form inputs need labelsHigh
semantic-html1.3.1Use semantic HTML5 elementsHigh
heading-hierarchy1.3.1Headings must form proper hierarchyHigh
language-attribute3.1.1HTML needs lang attributeHigh
skip-navigation2.4.1Pages need skip navigation linkHigh
focus-indicator2.4.7Interactive elements need visible focusHigh
focus-appearance2.4.13Focus indicators must be visible (AAA)High
aria-roles4.1.2Interactive elements need ARIA rolesMedium
keyboard-support2.1.1Click handlers need keyboard supportMedium
color-contrast1.4.3Text needs sufficient contrast (4.5:1)Medium
target-size2.5.8Interactive targets ≥ 24×24 CSS pxMedium
dragging-movements2.5.7Dragging operations need alternativesMedium
non-text-contrast1.4.11UI component contrast ≥ 3:1Medium
contrast-enhanced1.4.6Enhanced contrast 7:1 (AAA)Low
text-spacing1.4.12Text spacing adjustments (AAA)Low

Confidence System

  • High: Auto-applied (e.g., missing alt text, form labels)
  • Medium: Requires review (e.g., ARIA role suggestions)
  • Low: Educational guidance (e.g., keyboard patterns)

Technology Stack

  • TypeScript - Core engine, CLI, all plugins
  • Python - ML-based remediation suggestions
  • Rust - High-performance parallel rule execution
  • Playwright - Runtime accessibility tree capture
  • Babel/SWC - AST manipulation for codemods

License

Apache License 2.0