{"_id":"@beksomega/wcag-cli","_rev":"3-cf3f1edc1789d38d673dab0699e98595","name":"@beksomega/wcag-cli","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@beksomega/wcag-cli","version":"0.1.0","keywords":["wcag","a11y","accessibility","cli","mcp","modelcontextprotocol","ai-agents","wcag22","wai"],"author":{"name":"Beka Westberg"},"license":"MIT","_id":"@beksomega/wcag-cli@0.1.0","maintainers":[{"name":"beksomega","email":"bekawestberg@gmail.com"}],"homepage":"https://github.com/BeksOmega/wcag-cli#readme","bugs":{"url":"https://github.com/BeksOmega/wcag-cli/issues"},"bin":{"wcag":"dist/cli.js","wcag-cli":"dist/cli.js"},"dist":{"shasum":"9099b38605836e1bc742432bbd9fbb7de97ed65f","tarball":"https://registry.npmjs.org/@beksomega/wcag-cli/-/wcag-cli-0.1.0.tgz","fileCount":15,"integrity":"sha512-wxtRUvleKqN/oRkcaymnDOsvx+Ql6cOKAYuYN3cMMsyuiCnK0MWhBKV9EGNxmmz5wco/T/St5NJBpnr42GDR5Q==","signatures":[{"sig":"MEQCICBnCSVDc3o5ZfNM3zwJiDPe9o0cD2sWEPqy6Rf+XZmDAiBaXJ14bY/OPRtQy+axEBCkDZMk95ru/i6Svo61C3+Nsw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":399347},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"scripts":{"dev":"tsx src/cli.ts","test":"vitest run","build":"tsup","sync-data":"tsx scripts/sync-data.ts","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run sync-data && npm run build && npm run test"},"_npmUser":{"name":"beksomega","email":"bekawestberg@gmail.com"},"repository":{"url":"git+https://github.com/BeksOmega/wcag-cli.git","type":"git"},"_npmVersion":"10.9.7","description":"Token-efficient WCAG 2.2 exploration CLI and MCP server for AI agents and developers","directories":{},"_nodeVersion":"22.22.2","dependencies":{"commander":"^12.0.0","@modelcontextprotocol/sdk":"^1.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.1","tsup":"^8.0.2","vitest":"^1.4.0","typescript":"^5.4.3","@types/node":"^20.11.30"},"_npmOperationalInternal":{"tmp":"tmp/wcag-cli_0.1.0_1788240121930_0.9203099025647605","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@beksomega/wcag-cli","version":"0.1.1","keywords":["wcag","a11y","accessibility","cli","mcp","modelcontextprotocol","ai-agents","wcag22","wai"],"author":{"name":"Beka Westberg"},"license":"MIT","_id":"@beksomega/wcag-cli@0.1.1","maintainers":[{"name":"beksomega","email":"bekawestberg@gmail.com"}],"homepage":"https://github.com/BeksOmega/wcag-cli#readme","bugs":{"url":"https://github.com/BeksOmega/wcag-cli/issues"},"bin":{"wcag":"dist/cli.js","wcag-cli":"dist/cli.js"},"dist":{"shasum":"d249aa7cc070259ba3c8c6796b5a5e9170bf48f2","tarball":"https://registry.npmjs.org/@beksomega/wcag-cli/-/wcag-cli-0.1.1.tgz","fileCount":15,"integrity":"sha512-qk8ZNLPnweenzFWgP8pLfDgJnNmLmwv6PiTxf+w/Jpa5v6iBia9t2WllpgDNst3v39RlxOiuU2w3RukVSsnqTw==","signatures":[{"sig":"MEUCIQCjBwRj5O/c8/rOw+cXuIQOlOS00MnJirY+N2yQNrID1AIgOLSutVUkyP45Tvx9S+6kcCfD8UNNXLQhKo1iwh/DStE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDDrieYQSmoCPBA+2/aD6kMwnAAjw1z1pnjdVDZcmCnhgIhAJasAxo159ojTaFLhGg2ahViuXZ36bLDO2RysJI/y3lD","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":399781},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"scripts":{"dev":"tsx src/cli.ts","test":"vitest run","build":"tsup","sync-data":"tsx scripts/sync-data.ts","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run sync-data && npm run build && npm run test"},"_npmUser":{"name":"beksomega","email":"bekawestberg@gmail.com"},"repository":{"url":"git+https://github.com/BeksOmega/wcag-cli.git","type":"git"},"_npmVersion":"10.9.7","description":"Token-efficient WCAG 2.2 exploration CLI and MCP server for AI agents and developers","directories":{},"_nodeVersion":"22.22.2","dependencies":{"commander":"^12.0.0","@modelcontextprotocol/sdk":"^1.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.1","tsup":"^8.0.2","vitest":"^1.4.0","typescript":"^5.4.3","@types/node":"^20.11.30"},"_npmOperationalInternal":{"tmp":"tmp/wcag-cli_0.1.1_1788240383615_0.07796071611723909","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"_id":"@beksomega/wcag-cli@0.1.2","bin":{"wcag":"dist/cli.js","wcag-cli":"dist/cli.js"},"bugs":{"url":"https://github.com/BeksOmega/wcag-cli/issues"},"dist":{"shasum":"ec33866efa4d341829e86de5409a6e85e0d0f636","tarball":"https://registry.npmjs.org/@beksomega/wcag-cli/-/wcag-cli-0.1.2.tgz","fileCount":13,"integrity":"sha512-Qe7WOn5Q/n0FxzWVP7Yq97czlJyZdgK4iJPxo3xMLDv+3xxUbOWhSOkbtz0s1DTGxsboxGTtTlM4qB4NNhkZBw==","signatures":[{"sig":"MEUCIAmDHXc5FtsNxIg6QmHHFbm40la2skUZWYuQDQoqguHuAiEAvsCibUZUyUYDeLxtg9l1fZxIjgRVaamzZXy795F1Fh4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC0JkCi+d2vyK4HlxYjTUG/d+M/zim4ldrMOs4fXxzOTQIhAM+1MCf5QvMEd8sNh9/wAFnmwv4NrjcKOkwch3hFHGOw"}],"unpackedSize":2181213},"main":"./dist/index.js","name":"@beksomega/wcag-cli","type":"module","types":"./dist/index.d.ts","author":{"name":"Beka Westberg"},"engines":{"node":">=18.0.0"},"license":"MIT","scripts":{"dev":"tsx src/cli.ts","test":"vitest run","build":"tsup","sync-data":"tsx scripts/sync-data.ts","typecheck":"tsc --noEmit","test:watch":"vitest","prepublishOnly":"npm run sync-data && npm run build && npm run test"},"version":"0.1.2","_npmUser":{"name":"beksomega","email":"bekawestberg@gmail.com"},"homepage":"https://github.com/BeksOmega/wcag-cli#readme","keywords":["wcag","a11y","accessibility","cli","mcp","modelcontextprotocol","ai-agents","wcag22","wai"],"repository":{"url":"git+https://github.com/BeksOmega/wcag-cli.git","type":"git"},"_npmVersion":"10.9.7","description":"Token-efficient WCAG 2.2 exploration CLI and MCP server for AI agents and developers","directories":{},"maintainers":[{"name":"beksomega","email":"bekawestberg@gmail.com"}],"_nodeVersion":"22.22.2","dependencies":{"commander":"^12.0.0","@modelcontextprotocol/sdk":"^1.6.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.1","tsup":"^8.0.2","vitest":"^1.4.0","typescript":"^5.4.3","@types/node":"^20.11.30"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wcag-cli_0.1.2_1788561254734_0.7633215070883392"}}},"time":{"created":"2026-09-01T05:22:01.798Z","modified":"2026-09-04T22:34:15.148Z","0.1.0":"2026-09-01T05:22:02.077Z","0.1.1":"2026-09-01T05:26:23.723Z","0.1.2":"2026-09-04T22:34:14.853Z"},"bugs":{"url":"https://github.com/BeksOmega/wcag-cli/issues"},"author":{"name":"Beka Westberg"},"license":"MIT","homepage":"https://github.com/BeksOmega/wcag-cli#readme","keywords":["wcag","a11y","accessibility","cli","mcp","modelcontextprotocol","ai-agents","wcag22","wai"],"repository":{"url":"git+https://github.com/BeksOmega/wcag-cli.git","type":"git"},"description":"Token-efficient WCAG 2.2 exploration CLI and MCP server for AI agents and developers","maintainers":[{"name":"beksomega","email":"bekawestberg@gmail.com"}],"readme":"# wcag-cli\n\n> **Token-efficient WCAG 2.2 exploration CLI and MCP server designed for AI agents and human engineers.**\n\n[![npm version](https://img.shields.io/npm/v/@beksomega/wcag-cli.svg)](https://www.npmjs.com/package/@beksomega/wcag-cli)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nBrowsing the official WCAG Quick Reference web application can easily dump 50,000+ tokens of HTML, CSS, and DOM overhead into an AI coding assistant's context window. \n\n`wcag-cli` solves this by delivering **sub-second, progressive-disclosure CLI commands and an MCP server** backed by a **vendored, offline snapshot of the official W3C WCAG 2.2 dataset**.\n\nBuilt according to [Agent DX Principles](https://justin.poehnelt.com/posts/rewrite-your-cli-for-ai-agents/):\n- ⚡ **Zero-Latency Offline Execution**: Bundles `wcag22.json` directly (~306 KB) for instant (<5ms) queries in sandboxed environments without network egress.\n- 🔗 **Canonical Web Links**: Every command provides canonical W3C specification (`specUrl`), Understanding (`understandingUrl`), and QuickRef (`quickrefUrl`) links so AI agents can link humans directly to the spec.\n- 🌳 **First-Class Situations (Decision Trees)**: Directly query the 52 conditional implementation scenarios (e.g. decorative image vs. complex chart vs. input button) for targeted techniques without token dumps.\n- 🎯 **Context Window Discipline**: Field projection (`--fields`) and compact Markdown output prevent token bloat.\n- 🛡️ **Hallucination Hardening**: Defensively normalizes malformed agent arguments (`1.4.3?fields=all`, `SC-1.4.3`, `%201.4.3`).\n- 🔍 **Schema Introspection**: `wcag schema` lets agents self-serve command and model definitions at runtime.\n- 🔌 **Dual Surface (CLI + MCP)**: Native terminal commands alongside a built-in stdio Model Context Protocol (MCP) server.\n\n---\n\n## Installation\n\n### Run instantly with npx\n```bash\nnpx @beksomega/wcag-cli tree\nnpx @beksomega/wcag-cli get 1.4.3\n```\n\n### Install globally\n```bash\nnpm install -g @beksomega/wcag-cli\nwcag --help\n```\n\n---\n\n## CLI Usage\n\n### 1. Hierarchy & Overview (`tree`)\nGet a concise overview of the 4 Principles and 13 Guidelines (~150 tokens):\n```bash\nwcag tree\nwcag tree --level AA\n```\n\n### 2. List & Filter Criteria (`list`)\nFilter by conformance level (`A`, `AA`, `AAA`) or guideline, with field projections:\n```bash\n# Markdown list of all Level AA criteria\nwcag list --level AA\n\n# Filter by guideline with strict field projection (returns ~40 tokens)\nwcag list --guideline 1.4 --fields num,handle,level --output json\n```\n\n### 3. Conditional Situations / Decision Trees (`situations` / `situation`)\nExplore conditional implementation scenarios for a specific UI context:\n```bash\n# List all situations for Non-text Content (returns Situations A through F)\nwcag situations 1.1.1\n\n# Get techniques tailored strictly to Situation F (purely decorative images)\nwcag situation 1.1.1 F\n\n# Search across situations (e.g., finding complex chart guidance)\nwcag situations --search \"chart\"\n```\n\n### 4. Inspect Success Criteria (`get`)\nInspect normative requirement text, details, and exceptions:\n```bash\n# Get criterion by number or slug\nwcag get 1.4.3\nwcag get contrast-minimum\n\n# Target a specific situation directly (returns ~120 tokens instead of ~800)\nwcag get 1.1.1 --situation F\n\n# Include sufficient and failure techniques filtered by technology\nwcag get 1.1.1 --techniques --tech html,aria\n\n# WCAG 2.2 new criteria\nwcag get 2.5.7 --techniques   # Dragging Movements\nwcag get 3.3.8               # Accessible Authentication\n```\n\n### 5. Code Review Failures Checklist (`failures`)\nRetrieve common failure anti-patterns to check during code review:\n```bash\nwcag failures 1.1.1\nwcag failures 2.1.2\n```\n\n### 6. Look up Techniques (`tech`)\nInspect specific technique or failure IDs (e.g. `ARIA6`, `G18`, `F3`):\n```bash\nwcag tech ARIA6\nwcag tech F3\n```\n\n### 7. Full-Text Search (`search`)\nRanked keyword search across criteria, situations, and techniques:\n```bash\nwcag search \"color contrast\" --level AA\nwcag search \"dragging\" --limit 3\nwcag search \"focus visible\"\n```\n\n### 8. Schema Introspection (`schema`)\nDump machine-readable JSON schemas for agent introspection:\n```bash\nwcag schema\nwcag schema situations\n```\n\n### 9. Upstream Sync (`sync`)\nOptionally refresh the local cache with the latest errata from the W3C repository:\n```bash\nwcag sync\n```\n\n---\n\n## Model Context Protocol (MCP) Server\n\n`wcag-cli` includes a built-in stdio MCP server for agent hosts (Claude Desktop, Cursor, Jetski, Cline).\n\n### Configuration\n\n#### Claude Desktop / Cursor (`claude_desktop_config.json`)\n```json\n{\n  \"mcpServers\": {\n    \"wcag\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@beksomega/wcag-cli\", \"mcp\"]\n    }\n  }\n}\n```\n\n### Available MCP Tools:\n- `wcag_tree`: Retrieve principle and guideline structure.\n- `wcag_list_criteria`: Filter criteria by level, guideline, or principle.\n- `wcag_list_situations`: List conditional decision branches for a criterion.\n- `wcag_get_situation`: Get details and techniques for a specific conditional situation.\n- `wcag_get_criterion`: Inspect normative requirements and techniques (with optional `situation` filter).\n- `wcag_get_failures`: Retrieve code review failure checklists.\n- `wcag_get_technique`: Look up specific technique / failure doc.\n- `wcag_search`: Search WCAG standards, situations, and techniques.\n\n---\n\n## Agent Guidance Files\n\nThis repository ships with:\n- [`SKILL.md`](./SKILL.md): Standard Agent Skill definition for tool-calling agents.\n- [`CONTEXT.md`](./CONTEXT.md): Context window discipline guidelines and progressive-disclosure workflows for coding agents.\n\n---\n\n## Programmatic TypeScript API\n\n```typescript\nimport { getDatabase } from '@beksomega/wcag-cli';\n\nconst db = getDatabase();\n\n// Query situations\nconst situations = db.getSituations('1.1.1');\nconsole.log(situations.map(s => `Situation ${s.letter}: ${s.title}`));\n\n// Query specific situation\nconst sitF = db.getSituation('1.1.1', 'F');\nconsole.log(sitF?.techniques);\n\n// Search\nconst results = db.search('contrast', { level: 'AA', limit: 3 });\n```\n\n---\n\n## License\n\nMIT © [Beka Westberg](https://github.com/BeksOmega)\n","readmeFilename":"README.md"}