Drift Audit Skill
Conduct a comprehensive audit to identify where code practice diverges from documented standards.
Context
Standards drift happens gradually — code patterns diverge from standards, documentation becomes stale, agent context falls out of sync with reality. This skill teaches you to run a formal audit and act on findings.
Domain Context
Drift can occur in three ways:
- Code drift — Code doesn't follow documented standards
- Documentation drift — Standards docs are stale compared to actual practice
- Context drift — Agent files (CLAUDE.md, AGENTS.md) are out of sync with code/standards
The weekly drift audit is a scheduled ceremony that catches these issues between PRs.
Reference: levels/L2-ceremonies/ceremonies/weekly-drift-audit.md
Instructions
Run verify-all.sh — Execute all verification scripts
./scripts/verify-all.sh
- This runs typecheck, tests, build, lint, and documentation checks
- Identify any failures and note their types
- Deliverable: Verification output with pass/fail status
Run check-drift.sh — Detect standards infrastructure issues
./levels/L2-ceremonies/scripts/check-drift.sh
- Verifies docs/standards/ directory exists and has content
- Verifies CLAUDE.md references standards
- Verifies agent files reference valid standard paths
- Deliverable: Drift detection output
Review recent PRs for compliance — Spot-check compliance in merged code
- Review last 3-5 PRs merged to main
- For each PR, check: Did code changes follow documented standards?
- Identify any standards violations that slipped through
- Deliverable: List of compliance issues found
Check for new standards needing wiring — Identify undiscovered standards
- Look for patterns that appear 3+ times in codebase but have no standard
- Review recent PRs for new conventions that emerged
- Identify if any new standards were added but not wired into agent context
- Deliverable: List of new patterns/standards to document or wire
Update agent context if architecture changed — Keep context in sync
- If directory structure changed, update CLAUDE.md
- If deployment process changed, update AGENTS.md
- If new team convention emerged, update .cursor/rules/
- Deliverable: Updated context files
Summarize findings and create issues — Document results for the team
- Create a summary report showing: Categories of drift found, Severity (critical/high/medium/low)
- For critical/high severity issues, create GitHub issues with fixes
- For medium/low severity issues, log as notes for backlog refinement
- Deliverable: Audit report and action items
Anti-Patterns
Ceremony theater — Running audit but not acting on results
- Wrong: Run scripts, note failures, close the report without fixing anything
- Right: Run audit, identify issues, create issues/PRs to fix
- Impact: Standards drift continues undetected
- Guard: Every audit should result in at least 1-2 action items
Rubber-stamping results — Reading output without understanding it
- Wrong: "check-drift.sh passed, so we're good"
- Right: "check-drift.sh passed AND I reviewed recent PRs AND found X issues"
- Impact: Real drift is missed
- Guard: Always spend 15+ minutes reviewing actual code changes, not just script output
False positives from vague standards — Misinterpreting results
- Happens when: Standards are written so vaguely that violations are ambiguous
- Example: "Code should be readable" is too vague to audit
- Guard: When reviewing PRs, only flag violations of specific, measurable standards
- If you can't cite a specific rule, it's not a real violation
Further Reading
levels/L2-ceremonies/ceremonies/weekly-drift-audit.md — Full ceremony definition
levels/L2-ceremonies/scripts/check-drift.sh — Drift detection script
levels/L1-context/library/quality/governance.md — Standards drift prevention
1---2name: drift-audit3description: Run a thorough drift audit to detect standards divergence4---56# Drift Audit Skill78Conduct a comprehensive audit to identify where code practice diverges from documented standards.910## Context1112Standards drift happens gradually — code patterns diverge from standards, documentation becomes stale, agent context falls out of sync with reality. This skill teaches you to run a formal audit and act on findings.1314## Domain Context1516Drift can occur in three ways:17181. **Code drift** — Code doesn't follow documented standards192. **Documentation drift** — Standards docs are stale compared to actual practice203. **Context drift** — Agent files (CLAUDE.md, AGENTS.md) are out of sync with code/standards2122The weekly drift audit is a scheduled ceremony that catches these issues between PRs.2324Reference: `levels/L2-ceremonies/ceremonies/weekly-drift-audit.md`2526## Instructions27281. **Run verify-all.sh** — Execute all verification scripts2930 ```bash31 ./scripts/verify-all.sh32 ```3334 - This runs typecheck, tests, build, lint, and documentation checks35 - Identify any failures and note their types36 - Deliverable: Verification output with pass/fail status37382. **Run check-drift.sh** — Detect standards infrastructure issues3940 ```bash41 ./levels/L2-ceremonies/scripts/check-drift.sh42 ```4344 - Verifies docs/standards/ directory exists and has content45 - Verifies CLAUDE.md references standards46 - Verifies agent files reference valid standard paths47 - Deliverable: Drift detection output48493. **Review recent PRs for compliance** — Spot-check compliance in merged code50 - Review last 3-5 PRs merged to main51 - For each PR, check: Did code changes follow documented standards?52 - Identify any standards violations that slipped through53 - Deliverable: List of compliance issues found54554. **Check for new standards needing wiring** — Identify undiscovered standards56 - Look for patterns that appear 3+ times in codebase but have no standard57 - Review recent PRs for new conventions that emerged58 - Identify if any new standards were added but not wired into agent context59 - Deliverable: List of new patterns/standards to document or wire60615. **Update agent context if architecture changed** — Keep context in sync62 - If directory structure changed, update CLAUDE.md63 - If deployment process changed, update AGENTS.md64 - If new team convention emerged, update .cursor/rules/65 - Deliverable: Updated context files66676. **Summarize findings and create issues** — Document results for the team68 - Create a summary report showing: Categories of drift found, Severity (critical/high/medium/low)69 - For critical/high severity issues, create GitHub issues with fixes70 - For medium/low severity issues, log as notes for backlog refinement71 - Deliverable: Audit report and action items7273## Anti-Patterns74751. **Ceremony theater** — Running audit but not acting on results76 - Wrong: Run scripts, note failures, close the report without fixing anything77 - Right: Run audit, identify issues, create issues/PRs to fix78 - Impact: Standards drift continues undetected79 - Guard: Every audit should result in at least 1-2 action items80812. **Rubber-stamping results** — Reading output without understanding it82 - Wrong: "check-drift.sh passed, so we're good"83 - Right: "check-drift.sh passed AND I reviewed recent PRs AND found X issues"84 - Impact: Real drift is missed85 - Guard: Always spend 15+ minutes reviewing actual code changes, not just script output86873. **False positives from vague standards** — Misinterpreting results88 - Happens when: Standards are written so vaguely that violations are ambiguous89 - Example: "Code should be readable" is too vague to audit90 - Guard: When reviewing PRs, only flag violations of specific, measurable standards91 - If you can't cite a specific rule, it's not a real violation9293## Further Reading9495- `levels/L2-ceremonies/ceremonies/weekly-drift-audit.md` — Full ceremony definition96- `levels/L2-ceremonies/scripts/check-drift.sh` — Drift detection script97- `levels/L1-context/library/quality/governance.md` — Standards drift prevention