lewibs/dark-factory/detect-drift
Claude Code and agent skill by lewibs/dark-factory
- community
Checking that the SKILL.md file is still in the repository.
Audit parity between docs/docs/ system documentation and actual implementation. Detects stale references, undocumented flows, and broken behavioral claims. Use when validating whether documented systems match implemented code.
Install
npx vskill@latest install lewibs/dark-factory/detect-driftSKILL.md
The same SKILL.md was published earlier as lewibs/dark-factory/detect-drift.
Required
Use this skill whenever drift may exist between docs/docs/ system documentation and code.
- Determine audit target:
- Docs audit: targets
docs/docs/*.md— checks documented system behavior against code. - A specific doc file can be targeted instead of the full directory.
- Build inventory and baseline checklist artifacts.
- Enumerate all files in
docs/docs/*.md. Check that each documented system still exists in the codebase. - Generate checklists:
python ~/.dark-factory/agents/documentation/skills/detect-drift/scripts/generate_checklists.py- Review:
tmp/drift-checklists/DRIFT-SUMMARY.mdtmp/drift-checklists/docs/*.md- Temporary artifact rule: files under
tmp/drift-checklists/are process-only. Delete them after reporting findings.
- Validate references (docs -> code).
- For each doc, inspect:
### Flow: <file.function>, <test-path|N/A>headingsCore fileslists- Mermaid node file references
- Confirm referenced files exist.
- Flag broken paths and stale renamed/deleted references.
- Validate test mapping for each flow (docs -> tests).
- For every flow row/heading with a concrete test path, confirm the test file exists.
- Confirm at least one test in that file is relevant to the documented flow.
- If a flow is
N/A, treat as acceptable only when the doc explicitly justifies it.
- Validate code-to-doc parity with a second agent (code -> docs).
- Spawn a second agent dedicated to code-first discovery.
- Primary agent responsibility: doc-first verification (steps 2-4).
- Second agent responsibility:
- scan changed and adjacent code paths,
- identify major implemented flows not represented in any doc,
- report missing coverage and suggested owning doc.
- Merge findings and de-duplicate before final report.
- Validate docs do not over-claim implementation.
- If a doc claims a system behavior, verify the code matches.
- Flag behavior documented as implemented when code is absent or materially different.
- Produce a structured findings report.
- Severity levels:
Critical,Major,Minor,Nitpick. - Include exact
path:linereferences in docs/tests/code. - Include matrix buckets:
extra: doc entries that have no valid code/test target (stale or deleted)missing: implemented flows/surfaces not represented in any docdifferent: doc and code both exist but contract or test mapping divergeswrong: ownership or boundary claims attached to the wrong doc
- Resolve or document deferrals.
- Fix straightforward drift immediately when requested.
- For deferred items, add explicit TODOs with owning doc and file targets.
- Cleanup generated artifacts.
- After providing the findings summary, delete generated checklist files:
rm -rf tmp/drift-checklists
Context
This skill is a bidirectional contract audit:
- Docs -> Code: ensure documented flows/files/tests are real.
- Code -> Docs: ensure major implemented flows are documented.
- Docs -> Checklist Artifacts: create actionable audit lists per doc.
The goal is to prevent silent drift between source-of-truth documentation and actual implementation.
Checklist Generation
- Generator:
agents/documentation/skills/detect-drift/scripts/generate_checklists.py - Templates:
agents/documentation/skills/detect-drift/templates/plan-checklist-template.md- Output (temporary):
tmp/drift-checklists/DRIFT-SUMMARY.mdtmp/drift-checklists/docs/*.md
Troubleshooting
- Doc references deleted files:
- Update paths to new locations or mark as intentionally deleted migration history.
- Remove temporary refactor tables when migration is complete.
- Tests exist but do not exercise documented flow:
- Add/adjust tests or narrow doc claims.
- Do not keep broad claims without executable coverage.
- Code has major undocumented behavior:
- Add flow rows/types to the owning doc.
- If ownership is unclear, define ownership first, then document.
- Second agent cannot be used:
- Continue with local code-first pass.
- Mark report as single-agent audit and note reduced confidence.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/detect-drift/SKILL.md
Popularity
- Repository forks
- 1
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lewibs/dark-factory/detect-drift)