cli-audit-drift — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited cli-audit-drift (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Optimization: This skill uses on-demand loading. Heavy content lives in references/ and is loaded only when needed.Language rule: Skill instructions are written in English. When generating user-facing output (reports, files, documentation), detect the project's primary language (from README, comments, docs, commit messages) and produce the output in that language. If the project is bilingual, ask the user which language to use before proceeding.
Detect silent behavioral drift between what code was supposed to do (intention) and what it actually does (implementation). The most dangerous bugs are not crashes — they are functions that still run, still return values, but no longer honor their original contract.
"The New Caledonian crow does not merely endure its environment — it identifies the mismatch between what it intended to do and what actually happened. Not a noisy error. A result that does not match the intention."
| Organism / mechanism | What it does in nature | What it does in this skill |
|---|---|---|
| New Caledonian crow | Detects the gap between intention and result | Compares CONTRACTS.md (intention) against code (behavior). Names the gap precisely. Asks if intentional or accidental |
| Cellular autophagy | Continuous surveillance, isolates damaged components | Scans all contracted functions, isolates non-conforming code, proposes minimal correction or contract update |
| Protein folding + chaperones | A 1D amino-acid sequence folds into a 3D functional structure; chaperones (HSP60/70) detect misfolds and force a clean re-fold from scratch | Contract (intent, 1D) "folds" into code (behavior, 3D); detected drift triggers a minimal re-derivation from the contract, never a patch on top of the drifted state. Removed contracts trigger explicit code deletion (ubiquitin tag) |
A protein's amino-acid sequence is its intention (linear, source-of-truth). What the protein does in the cell depends on its folded structure (3D, emergent). The two are linked by physical laws but the link is not automatic — proteins can misfold and still exist. A misfolded protein takes up space, consumes ATP, and silently fails to do its job. It does not crash. It does not throw. It just no longer matches its intent.
That is exactly what semantic drift looks like in code. The contract (CONTRACTS.md) is the sequence. The implementation is the folded structure. Drift is misfolding — and like misfolding, it is invisible to compilation, type checking, and "the tests still pass".
The cell handles misfolding with two mechanisms that map directly onto this skill:
The deep takeaway: a working protein matches its sequence's intent; a working function matches its contract's intent. Drift is misfolding, and the only sustainable response is the cell's response — detect early, reset cleanly, mark explicitly. Patching never works in biology, and it does not work in code either.
| Scope | Tier | Behavior |
|---|---|---|
| Single function | S | Scan that function against its contract only |
| File or small directory (<10 contracted functions) | M | Full scan, all contracts in scope |
| Entire project (>10 contracted functions) | L | Sample top 15-20 highest-risk contracts (most recent changes, most dependencies) |
For tier L: prioritize contracts whose implementation files appear in git log --since="2 weeks ago".
$ARGUMENTS is the target to scan:
mask, calculate_price): scan that specific function against its contractsrc/core/, lib.rs): scan all contracted functions found in that scopeCONTRACTS.md at project root, then docs/CONTRACTS.md, then contracts/Step 0b — Verify drift surveillance instructions:
CONTRIBUTING.md, .claude/settings.json, or project docsCONTRIBUTING.mdFor each contracted function/endpoint, extract:
Read references/invariant-patterns.md for common invariant categories.
For each contracted function:
For each contracted function, check:
Invariant violations:
Red flag detection:
Behavioral divergence:
Read references/drift-detection-rules.md for detailed detection heuristics.
For each detected drift:
| Classification | Meaning | Action |
|---|---|---|
| Miss | Unintentional deviation from contract | Propose minimal fix (re-fold from contract, do not patch) |
| Evolution | Intentional change, contract not updated | Propose contract update + alert stakeholders |
| Ambiguity | Contract is vague, implementation chose one interpretation | Propose contract clarification |
| Stale contract | Contract references code that no longer exists | Propose contract cleanup |
| Orphan code | Code implements behavior whose contract has been removed (the contract was deleted from CONTRACTS.md but the implementation lingers) | Propose explicit deletion — the ubiquitin tag. If the code is still load-bearing, the contract must be re-introduced; otherwise it is dead protein and must be digested |
Use the output format below.
If drifts were found, propose additions to the "Known drift history" section of each affected contract.
When no CONTRACTS.md exists, the skill switches from audit to generation:
references/contracts-template.md for the template. Generate contracts for the top 5-10 critical functions.references/drift-surveillance-template.md for the drift surveillance instructions to add to the project's CONTRIBUTING.md (section "Drift Surveillance").# Semantic Drift Audit — {project-name}
**Date:** {date}
**Scope:** {what was scanned}
**Contracts loaded:** {N} functions from CONTRACTS.md
**Drifts detected:** {N} ({misses} misses, {evolutions} evolutions, {ambiguities} ambiguities)
## Drift Report
### {function-name} — {drift-classification}
**Contract says:** {quoted intention from CONTRACTS.md}
**Implementation does:** {observed behavior}
**Gap:** {precise description of the divergence}
**Evidence:** `{file}:{line}` — {code snippet showing the drift}
**Invariant violated:** {which invariant, if applicable}
**Recommendation:**
- {action: fix / update contract / clarify / ask PO}
- {minimal code change if miss}
---
(repeat for each drift)
## Contract Health Summary
| Function | Status | Last verified | Drifts found |
|----------|--------|--------------|-------------|
| mask(data, fields) | DRIFT | {date} | 1 miss |
| calculate_price() | CLEAN | {date} | 0 |
| ... | | | |
## Proposed CONTRACTS.md Updates
(diff-style additions to the drift history section)
## Drift Surveillance Status
**Instructions in CONTRIBUTING.md:** {PRESENT / MISSING / OUTDATED}
{if MISSING or OUTDATED: proposed additions below}
### Proposed CONTRIBUTING.md additions
(copy-pasteable block with drift surveillance instructions)| Condition detected | Recommend | Why |
|---|---|---|
| Contract or review exposes optimization intent but no semantic candidate has been mapped | /cli-audit-xray | X-Ray names candidate rewrites and the invariants they would require |
| Contracted functions have god-level complexity | /cli-audit-tangle | Topology suggests extraction before contract can be enforced |
| Drift caused by dependency update | /cli-forge-infra | Check version compatibility |
| No tests covering contracted behavior | /cli-audit-test | Test the invariants |
| Performance invariant present in CONTRACTS.md (« p95 < 100 ms ») but no bench enforces it | /cli-forge-perf | Translate the perf invariant into an executable A/B bench gate via the protocol catalogue + native harness routing |
Rule: Recommend, don't auto-execute.
git diff and git log on contracted functions are the first place drift appears.process() calls mask() and mask() has drifted, process() is also affected. Report the chain.../gotchas.md before producing output to avoid known mistakes.| Skill | Relationship |
|---|---|
cli-audit-xray | Extracts missing invariants from optimization candidates. cli-audit-drift verifies or records them as behavioral contracts |
cli-audit-test | D13 audits whether drift detection tools exist. cli-audit-drift is the drift detection |
cli-audit-code | Scores code quality. cli-audit-drift checks behavioral conformity to intentions |
cli-audit-sync | Checks doc-code coherence. cli-audit-drift checks contract-code coherence |
cli-forge-doc | Can generate documentation. cli-audit-drift generates CONTRACTS.md (a different artifact) |
cli-cycle | Should call cli-audit-drift as part of the full project review; emit .claude/cli-audit-drift.json per ../shared/result-schema.md for orchestrator aggregation |
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.