Skip to content
Back to skills

Docs Drift

ASecurity

Cross-check the living docs against the real code to find places where the docs describe behavior the code does not have. Default is a READ-ONLY scan that writes no file. With --apply, fix verified in-scope drift without a separate diff-approval round.

  • 12 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 2, 2026
ai-agentsbashgit

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add mxrsv/agents-skills --skill docs-drift --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Docs Drift?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Docs Drift
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mxrsv-docs-drift/badge)](https://www.skillsdirectory.com/skills/mxrsv-docs-drift)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: docs-drift
description: Cross-check the living docs against the real code to find places where the docs describe behavior the code does not have. Default is a READ-ONLY scan that writes no file. With --apply, fix verified in-scope drift without a separate diff-approval round.
---

# docs-drift — audit the docs against the code

## Two modes, strictly separated

| Command               | Permissions                                                                                                                   |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `/docs-drift`         | **ABSOLUTELY READ-ONLY.** Writes no file, not even the ledger. Prints the report to the screen.                               |
| `/docs-drift --apply` | Returns the ledger in chat and fixes/deletes verified in-scope drift. Routine corrections need no separate approval; material decisions follow the approval rule in `rules/core/docs.md`. Staging and committing follow the task's authorization. |

The default is scan. Switch to apply only when the user explicitly types `--apply`.

Before writing anything in apply mode: run `git status --porcelain` and report if the worktree is dirty — the reviewer needs to tell which diff is the skill's and which was already there.

## Step 0 — run tier 1 first

`bash ~/.claude/scripts/docs-anchors.sh <doc-root>` to get the list of dead anchors. Those are certain drift, no need to re-verify.

## Step 1 — extract claims

Living docs = `AGENTS.md`, `README.md`, `CHANGELOG.md` at the root + `docs/README.md`, `docs/DESIGN-LANGUAGE.md`, every file under `docs/{user,internals,operations}/` (+ legacy UPPERCASE `docs/*.md` not yet cleaned up: `ARCHITECTURE.md`, `CONTEXT.md`, `PRD.md`…). Do NOT treat `docs/specs/` or legacy `docs/plans/` as living docs: active specs record approved requirements and status. Completed records are frozen history. Retired `review/` and `mockups/` also remain outside this scan.

Living docs carry no intent labels: every behavior claim describes current behavior and is audited. Planned work lives in specs, not in living docs; a passage that marks itself net-new or a gap is drift to fix or delete, not backlog.

## Step 2 — verify with code, not with other docs

1. `grep` / `glob` in the source directories.
2. Run the related tests.
3. `git log --all -S'<symbol>' -- ':!docs/'` when you need to know whether the symbol ever existed.

⚠️ **`-S` also matches its own audit output — `-- ':!docs/'` is MANDATORY.** Without excluding `docs/`, a `not-in-history` result flips after the audit is committed.

## Step 3 — classify

`shipped` · `partial` · `not-in-history` · `removed` · `contradicted` · `unknown`.

- `partial` must state which part exists and which does not — do NOT collapse it into "exists".
- Before concluding `not-in-history`: run `git rev-parse --is-shallow-repository` and look for squash merges. Shallow or squash present → downgrade to `unknown` with the reason. `-S` only proves "not seen in reachable history".

## Hard constraints

- Do NOT edit product code.
- Scan mode: write NO file.
- Apply mode: return the ledger in chat and fix verified drift within the task's scope (fix or delete in place, do not add a "Chưa khớp thực tế" table). Report out-of-scope findings without editing them; resolve material decisions under the approval rule before dependent changes.
- Do NOT infer from doc to doc. Every conclusion must point back to a `file:line` or a git command with output.
- Cannot verify → `unknown` with the reason. Do NOT guess.
- Staging and committing follow the task's authorization.

## Output with `--apply`

1. Return the ledger in chat: claim, source doc, status, evidence and HEAD sha at audit time. Do not require an issue id, post externally or write a report file.
2. Drifted passages in the living docs: rewrite verified claims correctly, or delete stale passages within scope. Routine corrections need no separate diff approval.
3. A list of items needing a human decision, ordered by the risk of leaving them as is; each item is one line in the report. Keep follow-up decisions in chat; do not auto-file them.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.