Your code changed. Your docs didn't.
Detect when your docs drift from your code. TypeScript packages, REST APIs (OpenAPI), Clarity contracts — Drift extracts what your API actually is and finds every doc that's now wrong.
# Gate PRs/branches in CI
drift ci --all --min 80
# Full package scan (coverage + lint + prose drift + health)
drift scan
# Triage issues locally
drift lint- Teams shipping TypeScript libraries, SDKs, or CLI packages with public exports.
- API teams whose hand-written guides must stay true to their OpenAPI spec.
- Maintainers who want CI to catch documentation regressions before merge.
- DX/DevRel teams that need docs accuracy to scale with release velocity.
- Apps with no API surface to document (no exports, no spec, no contract).
- Teams whose docs are not part of their release workflow.
- Repos that are not ready to enforce docs quality in CI.
- Broken docs create support load, failed onboarding, and release risk.
- Drift turns docs quality from a manual checklist into a repeatable CI gate.
- You get machine-readable issues with file/line locations so fixes are fast.
- Run
drift scanin your package and review issues. - Set a baseline threshold:
drift ci --all --min 80. - Add the GitHub Action and enforce the gate on pull requests.
Entry auto-detects from package.json metadata (types, exports, main, module, bin).
Best fit: libraries, SDKs, and CLI packages that publish an exported API surface.
If you only do one thing: run drift ci --all --min 80 in pull requests and fail when coverage or lint falls below your bar.
| Command | When To Use It |
|---|---|
drift ci --all --min 80 |
Fail pull requests when docs quality drops |
drift scan |
Run a full docs audit locally before opening a PR |
drift lint |
Find signature/JSDoc mismatches with file and line data |
drift coverage --min 80 |
Enforce a documentation coverage floor |
drift list --undocumented |
Build a backlog of missing docs work |
Need full command/flag details? See docs/cli-reference.md or run drift --tools.
All commands output {ok, data, meta} JSON to stdout. Human-readable output when running in a terminal.
# Pipe to jq
drift coverage --json 2>/dev/null | jq '.data.score'
# Check exit codes in CI
drift lint || echo "Issues found"
drift coverage --min 80 || echo "Below threshold"Detection is the tool's job. Mutation and judgment are the agent's job. Deterministic edges, LLM in the middle: drift extracts what the API actually is; agents verify what the docs claim.
MCP — expose drift's truth primitives to any agent (Claude Code, Cursor, custom):
claude mcp add drift -- drift mcp
# tools: drift_extract, drift_list, drift_get, drift_scan, drift_diff, drift_breakingSkills — shipped in skills/, install by copying into ~/.claude/skills/:
/drift— coverage, validate, fix workflows against any truth source/docs-verify— audit an entire docs site against the API: agent extracts claims page by page, verifies each withdrift get, reports phantom/wrong-param/stale findings with file:line
# Machine-readable command discovery
drift --tools17 drift types across 4 categories:
| Category | Types | Description |
|---|---|---|
| structural | 7 | JSDoc types/params don't match code signature |
| semantic | 3 | Deprecation, visibility, broken {@link} references |
| example | 4 | @example code has errors or doesn't work |
| prose | 3 | Markdown docs import non-existent exports, call non-existent members, or promote deprecated APIs |
Every drift issue includes filePath and line for agent-driven fixes.
TypeScript source OpenAPI 3.x document Clarity contract
| | |
| openpkg-ts | openapi adapter | clarity adapter
v v v
ApiSpec (one portable API structure)
| drift scan / lint / coverage / list / get / diff
v
structured facts (JSON to stdout, file:line locations)
|
v
agents verify docs claims against the facts
Truth adapters map any API surface into one spec; analysis runs against it. Every command outputs facts — agents decide what to do with them. Deterministic edges, LLM in the middle.
drift scan # TypeScript package (entry auto-detected)
drift scan --spec openapi.json # REST API — path or URL, lang inferred
drift scan --abi token.abi.json token.clar # Clarity contract
drift get candidateInfo --spec https://developers.ashbyhq.com/openapi/ashby-api.json# GitHub Actions
- uses: ryanwaits/drift/action@v1
with:
min-coverage: 80# Or run directly
drift scan --min 80
# Compose primitives
drift coverage --min 80
drift lint
drift examples- New to Drift:
docs/getting-started.md - Setting CI gates:
docs/ci-integration.md - Configuring thresholds and discovery:
docs/configuration.md - Building custom tooling:
docs/sdk.md - Full map by role:
docs/guide-map.md
- Two surfaces, one engine — composed commands for humans, primitives for agents
- Every primitive is individually addressable —
scanis a convenience, not a gate - Primitives output structured facts with location data for efficient agent fixes
Truth adapters: @openpkg-ts/sdk (TypeScript) · @driftdev/openapi-adapter · @driftdev/clarity-adapter
Engine: @driftdev/sdk (ApiSpec + 17 drift detectors)
Surfaces: drift CLI (23 commands) · drift mcp (agent tools) · skills/ (agent playbooks)
MIT licensed. Free and open source.