@devinnn/docdrift
v0.2.3
Published
Detect and remediate documentation drift with Devin sessions
Maintainers
Readme
Devin Doc Drift (Client E: DataStack)
Docs that never lie: detect drift between merged code and docs, then open low-noise, evidence-grounded remediation via Devin sessions.
Table of contents
Deliverables
- npm package: @devinnn/docdrift — TypeScript CLI (
docdrift)validate— Validate docdrift.yamldetect --base <sha> --head <sha>— Check for driftrun --base <sha> --head <sha>— Full run with Devinstatus --since 24h— Show run statussla-check— Check for doc-drift PRs open 7+ days and open a reminder issuebaseline set [SHA]— UpdatelastKnownBaselinein docdrift.yaml (default: GITHUB_SHA or HEAD)setup— Interactive setup (Devin analyzes repo, generates v2 docdrift.yaml)generate-yaml— Generate config from repo fingerprint[--output path] [--force]export— Export DeepWiki to static MDX[--repo owner/name] [--out path] [--fail-on-secrets]
- GitHub Action:
.github/workflows/devin-doc-drift.yml - Repo-local config:
docdrift.yaml - Demo API + OpenAPI exporter + driftable docs
- PR template + Loom script
Quick start
# Interactive setup (requires DEVIN_API_KEY; add repo in Devin Machine first)
npx @devinnn/docdrift setup
# Or generate config only (scriptable)
npx @devinnn/docdrift generate-yaml --output docdrift.yaml --force→ Setup guide — Setup options, prerequisites
Modes & spec providers
| Mode | When it runs |
| ---- | -------------- |
| strict (default) | Only when spec drift is detected (OpenAPI, GraphQL, etc.). No spec drift → no Devin session. |
| auto | Also when pathMappings match (file changes hit match patterns). |
| Spec formats | openapi3, swagger2, graphql, fern, postman |
→ Configuration — Modes, spec providers, full config
Guides
| Guide | What’s inside |
| ----- | -------------- |
| Setup | setup vs generate-yaml, prerequisites |
| Configuration | Modes, spec providers; links to full schema |
| How it works | Detection, gate, core flow, low-noise design |
| Ecosystems | OpenAPI, FastAPI, Fern, GraphQL, Mintlify, Postman, monorepos |
| Local development | Local usage, demo without GitHub |
| CI & GitHub | GitHub Actions, secrets, demo on GitHub |
| Using in another repo | Published package, CLI, GitHub Actions |
| Publishing | Publishing the npm package |
| Export | DeepWiki static snapshot to MDX |
| Loom script | Recording script for demos |
Reference
- docdrift.yaml — Full configuration schema and validation
Project docs layout (this repo)
| Path | Purpose |
| ---- | ------- |
| apps/docs-site/openapi/openapi.json | Published OpenAPI spec (docdrift updates when drift detected) |
| apps/docs-site/docs/api/ | API reference MDX (npm run docs:gen) |
| apps/docs-site/docs/guides/ | Conceptual guides (auth, etc.) |
Generated spec from code: openapi/generated.json (npm run openapi:export). Drift = generated vs published differ.
Why low-noise
- Single branch strategy — One branch for all runs; Devin updates the existing PR when present (default
branchStrategy: single) - Single session, single PR — One Devin session for the whole docsite
- Gate on spec diff — No session when no drift (strict mode)
- Baseline drift (
lastKnownBaseline) — Compare to last known sync; no drift since then → no session - requireHumanReview — Issue when PR touches guides/prose
- 7-day SLA — Reminder issue for stale doc-drift PRs
- Confidence gating — Allowlist, exclude, idempotency
→ How it works — Detection, flow, evidence bundle
