webspec-index
Query WHATWG, W3C, and TC39 web specifications from the command line.
Features
- Full-text search across HTML, DOM, URL, CSS, ECMAScript, and 70+ other specifications
- Cross-reference tracking — see incoming/outgoing references between spec sections
- Graph traversal — build cross-reference graphs with JSON, Mermaid, or Graphviz DOT output
- Auto URL indexing for whitelisted domains — query non-hardcoded specs by URL
- Fast SQLite indexing with FTS5 for instant queries
- Algorithm and IDL extraction with rendered markdown content
- LSP server for inline spec hovers and step validation in your editor
- LLM-friendly
--helpoutput — automatically detected when run inside Claude Code, Codex, Gemini CLI, or OpenCode
Installation
Or build from source:
Quick Start
# Look up a spec section (algorithm, definition, heading, IDL)
# Full-text search
# Check if an anchor exists (exit code 0 = found, 1 = not found)
# Find anchors by glob pattern
# List all headings in a spec
# Cross-references (exact or shorthand)
# Graph traversal
# Query dedicated WebIDL definitions
# Update specs to latest versions
All commands support --format json (default) or --format markdown.
Spec data is fetched and cached locally on first query — no setup needed.
Spec refreshes are freshness-based: once checked, a spec is considered fresh for 24h. When refreshed, the CLI fetches live HTML and re-indexes only if content changed.
AI Agent Integration
Skill file
Drop SKILL.md into your repo to teach the agent how to use the CLI.
Editor Integration
The webspec-lens extension provides inline spec hovers, step validation, and coverage tracking. Available for VS Code and any LSP-compatible editor.
See editors/vscode/ and editors/zed/ for details.
How It Works
- Fetches spec HTML from WHATWG/W3C/TC39 spec URLs
- Parses sections, algorithms, IDL definitions, and cross-references
- Indexes in SQLite with FTS5 for fast full-text search
- Refreshes snapshots on a 24h cadence with content-hash change detection
Development
License
MIT