drift-check
Detect documentation drift (docs out of sync with code). Use after changes, periodically, or when something feels wrong. Returns severity-rated findings with specific fixes.
When & Why to Use This Skill
The Drift Check skill is an automated diagnostic tool designed to eliminate 'documentation rot' by ensuring technical documentation remains perfectly synchronized with the underlying codebase. It proactively identifies discrepancies between code reality and documented expectations across server actions, API routes, database schemas, and security policies, providing severity-rated findings and specific remediation steps to maintain high-quality, reliable project references.
Use Cases
- Post-Feature Verification: Run a drift check immediately after merging new features or bug fixes to ensure that all changes in server actions and API endpoints are accurately captured in the documentation.
- Security & Compliance Auditing: Periodically validate that Row-Level Security (RLS) policies and database permissions in the code match the documented security protocols to prevent unauthorized access or compliance gaps.
- Developer Onboarding: Use the tool to audit and update documentation before a new team member joins, ensuring they are working with accurate information and reducing friction during the learning curve.
- Refactoring Safety Net: Before and after major architectural changes, use drift-check to identify which parts of the documentation have become obsolete or require immediate updates to reflect the new system structure.
| name | drift-check |
|---|---|
| description | Detect documentation drift (docs out of sync with code). Use after changes, periodically, or when something feels wrong. Returns severity-rated findings with specific fixes. |
| allowed-tools | Read, Glob, Grep, Bash |
Drift Check
Detect documentation rot by comparing code reality against documented expectations.
When to Use
- After completing a feature or bug fix
- Before starting work on unfamiliar area
- When behavior doesn't match expectations
- Periodically (weekly recommended)
Severity Levels
| Severity | Areas | Action Required |
|---|---|---|
| 🔴 Critical | Auth/RLS wrong, billing docs incorrect, schema mismatch | Fix immediately |
| 🟠 High | Server action undocumented, invariant violated | Fix this session |
| 🟡 Medium | Route missing from surfaces, stale checklist | Fix soon |
| 🟢 Low | Minor description inaccuracy | Track |
Check Categories
- Server Actions vs Docs — Actions exist in code but not documented (or vice versa)
- Routes vs User Surfaces — Routes exist but not in feature doc tables
- Schema vs Data Model — Tables/columns don't match docs
- RLS vs Permissions Docs — Policies undocumented or incorrect
- Invariants vs Reality — Can't find code enforcing documented invariants
- Workflow Steps vs UI — Documented steps don't match actual UI
Quick Check Commands
# Count server actions
find app/actions -name "*.ts" | wc -l
# Count routes
find app -name "page.tsx" | wc -l
# Recent migrations (verify reflected in docs)
ls -lt supabase/migrations/ | head -5
Output
## Drift Check Report — [date]
**Scope**: [full / feature-name]
| Severity | Count |
|----------|-------|
| 🔴 Critical | [n] |
| 🟠 High | [n] |
| 🟡 Medium | [n] |
| 🟢 Low | [n] |
### Issues Found
[For each issue: category, location, finding, remediation]
### No Drift Found
[Areas checked with no issues]
Related
- Detailed check procedures: See reference/check-procedures.md
- Remediation templates: See reference/remediation-templates.md
- Severity scoring matrix: See reference/severity-matrix.md
- After finding drift: Run
/doc-updateto fix