From next-task
Detects documentation-code drift via grep/AST fact extraction from CLI commands, APIs, env vars, public functions and LLM-graded semantic analysis of mismatches.
How this skill is triggered — by the user, by Claude, or both
Slash command
/next-task:drift-detectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Principle: code does deterministic collection; AI does one semantic analysis pass.
Principle: code does deterministic collection; AI does one semantic analysis pass. Avoids multi-agent token waste — single well-prompted synthesis call.
docs/, .tomllm comments. # output: doc_files[]Extract without AI:
CLI commands → grep `#\[command\]` / `clap::Command` / argparse / click decorators
MCP tools → grep `#[tool]` / tool schema definitions
Public functions → AST: all `pub fn`, `export function`, `def` without leading `_`
Config keys → grep TOML/JSON schema keys in datum files
Environment vars → grep `env!()`, `os.getenv`, `process.env.`
API endpoints → grep route decorators (`@app.get`, `#[get]`, `router.get`)
Extract without AI:
README commands → grep ` ``` ` blocks containing CLI invocations
Documented envs → grep `ENV_VAR_NAME` pattern in .md files
Skill triggers → grep activation phrases in SKILL.md files
Datum fields → parse TOML keys from .tomllm files
Pass code_facts and doc_claims to one analysis call:
Prompt: "Given these documented claims and these code facts, identify:
1. Claims in docs not supported by code (doc leads code — stale)
2. Code surfaces not mentioned in docs (code leads docs — undocumented)
3. Semantic mismatches where names/behavior differ
Grade each finding HIGH/MEDIUM/LOW certainty."
| Type | Description | Grade |
|---|---|---|
stale-doc | Docs describe removed/changed feature | HIGH if name mismatch, MEDIUM if semantic |
undocumented | Code exists, no docs | MEDIUM |
mismatch | Docs and code describe different behavior | LOW (AI judgment) |
version-skew | Docs reference old version numbers/flags | HIGH |
/drift-detect # Full repo scan
/drift-detect --path <dir> # Scope to directory
/drift-detect --focus docs # Only stale-doc findings
/drift-detect --focus code # Only undocumented findings
/drift-detect --fix # Auto-stub missing docs (MEDIUM certainty only)
drift-detect report: .b00t/
━━━━━━━━━━━━━━━━━━━━━━━━━━━
[HIGH] 2 stale documentation findings
✗ README references `b00t run` — command removed in cli v0.8
✗ CLAUDE.md documents `--model-size` flag — not in current clap schema
[MEDIUM] 3 undocumented code surfaces
⚠ `b00t hive activate` — no README entry
⚠ MCP tool `b00t_agent_vote_create` — not in docs
⚠ env var `VLLM_DTYPE` — not in .env.example
[LOW] 1 semantic mismatch
? SKILL.md says deslop "auto-removes"; code-quality rules say "surfaces for review" — reconcile
Total: 6 findings | Auto-fixable stubs: 3 | Stale to remove: 2 | Human review: 1
Runs at REVIEW phase of /next-task.
Invoked standalone post-implementation to check docs kept current.
npx claudepluginhub elasticdotventures/_b00t_ --plugin next-taskAudits codebase documentation against actual behavior, producing a severity-tagged drift report (STALE, MISSING, OUTDATED, DUPLICATE). Read-only review.
Detects documentation that has drifted from code by scanning for renamed APIs, undocumented code, stale comments, and mismatched architecture constraints. Useful after feature work, during code review, or as periodic hygiene.
Audits repository documentation for drift, stale statements, broken references, and README mismatches before corrective PRs.