Skip to content

Destynova2/cli-code-skills / cli-audit-drift

cli-audit-drift

Verified

Detect silent semantic drift between intended behavior (CONTRACTS.md) and actual implementation. Scans code against functional contracts, invariants, and known drift history to catch behavioral changes that compile and run but violate the original intention. Use when reviewing code changes, before commits, auditing behavioral conformity, or saying 'check drift', 'contract check', 'intention vs implementation', 'semantic drift', 'is this still correct', 'does this match the spec', 'behavioral regression', 'silent bug', 'autophagy scan'. Also triggers on 'CONTRACTS.md', 'invariant check', 'intention audit', 'contract violation'.

references/drift-surveillance-template.md

View on GitHub
# Drift Surveillance Template — CONTRIBUTING.md Section

> **When to read:** During Bootstrap Mode (Step 4) to generate the drift surveillance instructions for the project's CONTRIBUTING.md.

---

## Template

```markdown
## Semantic Drift Surveillance (Autophagy)

This project uses CONTRACTS.md to record the intended behavior of critical functions.
Before any commit or code review touching a contracted function, scan for drift:

### Scan protocol

1. Read `CONTRACTS.md`
2. For each function that was modified (or that you're about to modify):
   - Check the implementation against ALL listed invariants
   - Search for red flag patterns listed in the contract
   - Verify that no conditional branch treats uniformly-expected parameters differently
   - Compare actual behavior against the stated intention
3. If drift detected:
   - **Name it precisely** ("mask treats field 'b' differently from field 'a' at line 47")
   - **Classify it**: miss (bug) vs evolution (intentional change) vs ambiguity (vague contract)
   - **If miss**: propose the minimal fix, do NOT auto-apply
   - **If evolution**: propose a CONTRACTS.md update AND the code change
   - **If ambiguity**: ask for clarification before proceeding
4. Never assume "it compiles, so it's correct" — the question is: **does it do what the intention says?**

### When to update CONTRACTS.md

- New function added to the public API → add a contract
- Existing behavior intentionally changed → update the contract FIRST, then change the code
- Drift found and fixed → add to "Known drifts" with date and status
- Contract found to be vague → refine invariants to be more precise

### What NOT to do

- Do not update CONTRACTS.md to match a bug — fix the code
- Do not auto-fix drift without asking — name it, classify it, propose
- Do not skip the scan because "it's a small change" — small changes cause the biggest drifts
```
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall