drift
llms.txt16 starsChanged 8 months agoMITView on GitHub
Catches what AI coding tools break silently — structural erosion across files that passes all your tests. Drift is a quality control layer for AI-generated Python code: pattern fragmentation, architecture violations, mutant duplicates, and 21 more structural signals. No LLM in the detection pipeline. Release status: v2.51.1 Package: drift-analyzer Install: pip install -q drift-analyzer (add -q for quiet output, hiding verbose dependency chains) Repository: https://github.com/mick-gsk/drift Documentation: https://mick-gsk.github.io/drift/ Command: drift analyze --repo . Drift runs as CLI or MCP server. Both…
- Installs packages
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- brainstormingSkill
- drift-adr-workflowSkill
- drift-agent-prompt-authoringSkill
- drift-commit-pushSkill
- drift-dependency-updateSkill
- drift-docs-gap-fixSkill
- drift-evidence-artifact-authoringSkill
- drift-finding-message-authoringSkill
- drift-ground-truth-fixture-developmentSkill
- drift-mcp-repo-ops-usageSkill
- drift-pr-review-loopSkill
- drift-pr-reviewSkill
- drift-releaseSkill
- drift-risk-audit-artifact-updatesSkill
- drift-security-triageSkill
- drift-session-handover-authoringSkill
- drift-signal-development-full-lifecycleSkill
- fix-failing-actionsSkill
- grill-meSkill
- guard-src-drift-apiSkill
- guard-src-drift-commandsSkill
- guard-src-drift-ingestionSkill
- guard-src-drift-outputSkill
- guard-src-drift-signalsSkill
- guard-src-driftSkill
- improve-codebase-architectureSkill
- prd-to-issuesSkill
- self-improving-agentSkill
- simplify-and-hardenSkill
- skill-creatorSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- tddSkill
- test-driven-developmentSkill
- verification-before-completionSkill
- workspace-automation-orchestratorSkill
- write-a-prdSkill
- writing-plansSkill
The file
We split this llms.txt into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 65
No LLM in the detection pipeline — same input, same output, reproducible in CI.
≈ “Common” is an estimate: at least 1 in 5 of the 1,484 llms.txt files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
# drift-analyzer > Catches what AI coding tools break silently — structural erosion across files that passes all your tests. Drift is a quality control layer for AI-generated Python code: pattern fragmentation, architecture violations, mutant duplicates, and 21 more structural signals. No LLM in the detection pipeline. Release status: v2.51.1 Package: drift-analyzer Install: pip install -q drift-analyzer (add -q for quiet output, hiding verbose dependency chains) Repository: https://github.com/mick-gsk/drift Documentation: https://mick-gsk.github.io/drift/ Command: drift analyze --repo . ## Two Modes — Same Engine Drift runs as CLI or MCP server. Both use the same analysis engine and signal set. CLI mode (terminals, CI): drift brief --task "refactor auth" → structural guardrails for agent prompts drift nudge --changed-files src/auth.py → real-time safe_to_commit check drift check --fail-on high → CI gate (exits 1 on violations) drift analyze --repo . --format json → full analysis report MCP mode (Cursor, Claude Code, Copilot): drift_brief → scope-aware guardrails injected into agent context drift_nudge → safe_to_commit: true/false after each edit drift_diff → before/after comparison before push drift_feedback → mark findings as TP/FP to calibrate signal weights drift_retrieve → BM25 search over drift's own verified fact sources (POLICY, ADRs, audits, signal rationale, benchmark evidence) with stable fact_ids drift_cite → expand a fact_id to its verbatim chunk with sha256 anchor for grounded agent citations ## Fact-Grounding Contract (ADR-091) Agents making claims about drift itself (policy, signals, ADR decisions, audit artefacts, benchmark evidence) MUST call drift_retrieve first and cite at least one fact_id. See .github/instructions/drift-rag-grounding.instructions.md. Retrieval is deterministic (lexical BM25, no LLM, no embeddings in MVP); the corpus_sha256 in every response anchors reproducibility. ## safe_to_commit drift nudge returns a safe_to_commit boolean with blocking reasons. Blocks on: - New critical/high-severity findings - Score degradation exceeding threshold - Expired baseline (full rescan needed) - Parse failures in changed files - Git change detection failure This gives AI coding agents an immediate go/no-go signal after each edit — no manual review needed. ## Use Cases - Detect pattern fragmentation: same concern implemented N different ways in one module - Find architecture violations: imports crossing layer boundaries, circular dependencies - Identify mutant duplicates: near-identical functions from copy-paste AI scaffolding - Measure explainability deficit: complex functions without documentation or types - Track temporal volatility: files changed by too many authors too fast - Detect system misalignment: novel import patterns foreign to their module - Detect phantom references: unresolvable function/class references (AI hallucination indicator) - CI gate: block PRs on high-severity architectural findings via GitHub Actions - Agent guardrails: inject structural constraints before AI coding sessions - Trend tracking: monitor drift score evolution over time ## Benchmarks Ground-truth precision: 100% (47 TP, 0 FP across 114 fixtures, 17 signals) Ground-truth recall: 100% (0 FN) Mutation recall: 100% (25/25 injected patterns detected) Wild-repo precision: 77% strict / 95% lenient (5 repos, historical v0.5 model) No LLM in the detection pipeline — same input, same output, reproducible in CI. Artifacts: benchmark_results/v2.7.0_precision_recall_baseline.json, benchmark_results/mutation_benchmark.json Full study: docs/STUDY.md ## Signals ### Scoring-active (19, contribute to composite drift score) - AVS: Architecture Violations (weight 0.16) - PFS: Pattern Fragmentation (weight 0.16) - MDS: Mutant Duplicates (weight 0.13) - EDS: Explainability Deficit (weight 0.09) - SMS: System Misalignment (weight 0.08) - BEM: Broad Exception Monoculture (weight 0.04) - DIA: Doc-Implementation Drift (weight 0.04) - NBV: Naming Contract Violation (weight 0.04) - TPD: Test Polarity Deficit (weight 0.04) - BAT: Bypass Accumulation (weight 0.03) - ECM: Exception Contract Drift (weight 0.03) - GCD: Guard Clause Deficit (weight 0.03) - MAZ: Missing Authorization (weight 0.02, CWE-862) - PHR: Phantom Reference (weight 0.02, AI hallucination indicator) - COD: Cohesion Deficit (weight 0.01) - HSC: Hardcoded Secret (weight 0.01, CWE-798) - ISD: Insecure Default (weight 0.01, CWE-1188) - CCC: Co-Change Coupling (weight 0.005) - FOE: Fan-Out Explosion (weight 0.005) ### Report-only (6, weight 0.0, findings shown but not scored) - CIR: Circular Import — circular dependency chains - CXS: Cognitive Complexity — deeply nested control flow - DCA: Dead Code Accumulation — unreferenced symbols - TSA: TypeScript Architecture — TS/JS layer leaks, cycles, cross-package imports - TSB: Type Safety Bypass — as any / @ts-ignore / double casts - TVS: Temporal Volatility (weight 0.0, report-only — excluded from composite score) ## Docs - [Documentation](https://mick-gsk.github.io/drift/) - [Quick Start](https://mick-gsk.github.io/drift/getting-started/quickstart/) - [Signal Reference](https://mick-gsk.github.io/drift/algorithms/signals/) - [Scoring Model](https://mick-gsk.github.io/drift/algorithms/scoring/) - [FAQ](https://mick-gsk.github.io/drift/faq/) - [Trust & Evidence](https://mick-gsk.github.io/drift/trust-evidence/) ## Optional - [Full Benchmark Study](https://github.com/mick-gsk/drift/blob/main/docs/STUDY.md): 100% ground-truth precision/recall on 114 fixtures (v2.7.0+), 77% strict wild-repo precision (v0.5 model on 5 repos) - [Changelog](https://github.com/mick-gsk/drift/blob/main/CHANGELOG.md): version history and signal improvements - [Case Studies](https://mick-gsk.github.io/drift/case-studies/): FastAPI, Pydantic, Django, Paramiko - [GitHub Action](https://github.com/mick-gsk/drift/blob/main/action.yml): CI integration with SARIF upload ## Keywords architectural drift detection, architecture erosion analysis, cross-file coherence detection, structural code quality, architectural linter, architecture degradation, technical debt detection, dependency cycle detection, import analysis, pattern fragmentation, static analysis, Python, monorepo, GitHub Copilot, AI coding tools, architecture enforcement
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

