Go accessibility auditing toolkit for WCAG 2.0, 2.1, and 2.2 compliance testing.
- β WCAG Compliance Testing - Supports WCAG 2.0, 2.1, and 2.2 at levels A, AA, and AAA
- π Multiple Audit Modes - Single page, site crawling, and user journey testing
- πͺ axe-core Integration - Industry-standard accessibility testing via axe-core
- π€ LLM-as-a-Judge - Optional AI evaluation to reduce false positives
- π Report Formats - JSON, HTML, Markdown, VPAT 2.4, WCAG-EM, OpenACR, CSV
- π MCP Server - Model Context Protocol integration for AI assistants
- π HTTP API - REST API for programmatic access
- π€ Multi-Agent Spec - Integration with multi-agent workflows
go install github.com/plexusone/agent-a11y/cmd/agent-a11y@latest- Go 1.25+
- Chrome/Chromium browser (for browser-based testing)
# Audit a single page (outputs agent-optimized JSON by default)
agent-a11y audit https://example.com
# Human-readable output
agent-a11y audit https://example.com --human
# With design system integration for token suggestions
agent-a11y audit https://example.com --design-system /path/to/design-system/
# With source mapping (maps findings to source files)
agent-a11y audit https://localhost:3000 --source-map ./dist/
# Audit with site crawling
agent-a11y audit https://example.com --crawl --depth 2
# Specify WCAG level and version
agent-a11y audit https://example.com --level AA --version 2.2
# Output to file with format (human-readable formats)
agent-a11y audit https://example.com --human -o report.html --format html
# Enable LLM evaluation (reduces false positives)
agent-a11y audit https://example.com --llm-provider anthropic --llm-model claude-sonnet-4-20250514Agent-Optimized Output: The default output is structured JSON with actionable fix patterns for coding agents. Use --human for human-readable reports.
Validate that accessibility issues have been fixed:
# Create baseline from first audit
agent-a11y validate https://example.com --save-baseline -o baseline.json
# After coding agent applies fixes, validate
agent-a11y validate https://example.com --baseline baseline.json
# CI mode: fail if regressions introduced
agent-a11y validate https://example.com --baseline baseline.json --fail-on-regressionpackage main
import (
"context"
"fmt"
"log"
a11y "github.com/plexusone/agent-a11y"
)
func main() {
// Create auditor
auditor, err := a11y.New(
a11y.WithLevel(a11y.LevelAA),
a11y.WithVersion(a11y.Version22),
)
if err != nil {
log.Fatal(err)
}
defer auditor.Close()
// Audit a page
result, err := auditor.AuditPage(context.Background(), "https://example.com")
if err != nil {
log.Fatal(err)
}
fmt.Println(result.Summary())
// WCAG 2.2 Level AA: Conformant (Score: 95/100, Issues: 0 critical, 0 serious, 1 moderate, 2 minor)
}| Command | Description |
|---|---|
audit <url> |
Run accessibility audit on a URL |
serve |
Start HTTP API server |
mcp serve |
Start MCP server for AI assistants |
compare <before> <after> |
Compare accessibility between two URLs |
demo list |
List available demo sites |
demo run [name] |
Run demo audit on sample sites |
version |
Show version information |
| Format | Flag | Description |
|---|---|---|
| JSON | --format json |
Machine-readable JSON output |
| HTML | --format html |
Interactive HTML report |
| Markdown | --format markdown |
Markdown report |
| VPAT | --format vpat |
VPAT 2.4 accessibility conformance report |
| WCAG-EM | --format wcag |
WCAG-EM evaluation report |
| OpenACR | --format openacr |
OpenACR machine-readable accessibility report |
| CSV | --format csv |
CSV export of findings |
Create a config file at ~/.agent-a11y.yaml or specify with --config:
wcag:
level: AA
version: "2.2"
browser:
headless: true
timeout: 30s
llm:
enabled: true
provider: anthropic
model: claude-sonnet-4-20250514
crawl:
depth: 2
maxPages: 50
delay: 500msagent-a11y supports multiple LLM providers for AI-assisted evaluation:
| Provider | Environment Variable |
|---|---|
| Anthropic | ANTHROPIC_API_KEY |
| OpenAI | OPENAI_API_KEY |
GOOGLE_API_KEY |
|
| xAI | XAI_API_KEY |
| Ollama | (local, no key required) |
Run as an MCP server for integration with AI assistants:
agent-a11y mcp serveAdd to your Claude Desktop config:
{
"mcpServers": {
"a11y": {
"command": "agent-a11y",
"args": ["mcp", "serve"]
}
}
}Start the API server:
agent-a11y serve --port 8080Endpoints:
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/audits |
Create a new audit job |
| GET | /api/v1/audits |
List all audit jobs |
| GET | /api/v1/audits/{id} |
Get audit job status and results |
| DELETE | /api/v1/audits/{id} |
Cancel an audit job |
| GET | /api/v1/audits/{id}/report |
Get audit report (JSON or HTML) |
| GET | /api/v1/audits/{id}/openacr |
Get OpenACR report (YAML or JSON) |
| GET | /api/v1/health |
Health check |
Get an OpenACR report for a completed audit:
# Get as YAML (default)
curl http://localhost:8080/api/v1/audits/{id}/openacr
# Get as JSON
curl http://localhost:8080/api/v1/audits/{id}/openacr?format=json
# With custom metadata
curl "http://localhost:8080/api/v1/audits/{id}/openacr?product_name=MyApp&product_version=1.0.0&author_email=a11y@example.com"agent-a11y integrates with the multi-agent-spec for use in multi-agent workflows:
result, _ := auditor.AuditPage(ctx, url)
// Convert to AgentResult for multi-agent workflows
agentResult := result.AgentResult()
// Get narrative for reports
narrative := result.Narrative()See the examples directory:
- basic - Simple single-page audit
- multi-agent - Multi-agent workflow integration
# Run tests
go test -v ./...
# Run linter
golangci-lint run
# Build CLI
go build -o agent-a11y ./cmd/agent-a11yMIT