Drift Detector

Detects implementation drift from documented invariants, ADRs, and architectural constraints.

1|Updated Apr 25, 2026
One-click install
npx skills add https://github.com/htxryan/claude-code-config-profiles --skill drift-detector-htxryan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Drift Detector
Source: https://github.com/htxryan/claude-code-config-profiles/tree/main/.agents/skills/compound/agents/drift-detector
Command: npx skills add https://github.com/htxryan/claude-code-config-profiles --skill drift-detector-htxryan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases gradually diverge from their documented architecture: module boundaries erode, data flows deviate from ADRs, and naming conventions become inconsistent. This Skill catches that drift before it compounds by comparing the current implementation against established constraints. ## Core Features & Use Cases - Automated Constraint Checking: Runs ca audit --json to verify the implementation against recorded invariants and architectural decisions. - Document Cross-Referencing: Reads invariants from docs/invariants/ and ADRs from docs/adr/ to compare module boundaries, data flows, and naming conventions against the actual code. - Pipeline Integration: Operates as a subagent between module-boundary-reviewer and implementation-reviewer in a TDD review pipeline, returning DRIFT, RISK, or CLEAR verdicts. - Use Case: After refactoring a service layer, run this check to confirm the new code still respects the layering rules and data-flow contracts recorded in your ADRs before merging. ## Quick Start Ask the agent to check the current implementation for drift against the documented invariants and ADRs and report any violations.

Frequently Asked Questions about Drift Detector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check code for architecture drift?▼

Run the drift detection check, which executes ca audit --json for automated constraint verification and compares the implementation against invariants in docs/invariants and ADRs in docs/adr. It reports each finding as DRIFT, RISK, or CLEAR.

What is architectural drift in software development?▼

Architectural drift is the gradual divergence of implementation code from documented constraints such as invariants, ADRs, module boundaries, and naming conventions. Detecting it early prevents structural erosion that makes systems harder to maintain.

Where does drift detection fit in a code review pipeline?▼

It runs as a subagent between module-boundary-reviewer and implementation-reviewer in a TDD pipeline, acting as a final consistency check. Findings are returned directly to the calling agent.

What documentation does drift detection require?▼

It reads invariants from docs/invariants and ADRs from docs/adr when present, and uses ca search for past architectural decisions. Without these documents, automated checking via ca audit still applies but manual comparison coverage is reduced.

What do the DRIFT, RISK, and CLEAR verdicts mean?▼

DRIFT means the implementation violates a documented constraint, RISK means it is borderline and may drift further, and CLEAR means it aligns with all checked constraints. Every deviation is reported even if the code appears to work.