Check drift
Claude Code plugin: represent a project as a tree of documented modules with boundary contracts, so an agent stays oriented in large codebases and makes boundary changes a deliberate preserve-vs-cascade decision.
npx -y skills add nicolasapr/contract-tree --skill check-driftAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 21 days oldThe repository was created 21 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Use when auditing whether a contract tree still matches the code — e.g. after a large merge or when a `CONTRACT.md` is suspected stale. Checks that entrypoints still exist, signatures match declared I/O, and declared upstreams match real imports; reports suspected-stale contracts and code modules missing a contract. Report-only, never auto-fixes.
SKILL.md
3.4 KB, 713 tokens by cl100k_base, as published. Nobody here has run it
Check Drift
Audit a contract tree against the real code. Contracts that drift out of sync become lies the other flows trust — this skill finds them.
Hard rule: this skill is report-only. It lists suspected problems and suggests fixes. It does not edit contracts or code. Fixing is a separate, deliberate step (usually via change-with-contracts or map-modules).
The canonical format is ../map-modules/references/contract-format.md.
What to check
Read .contract-tree/tree.md, then for each CONTRACT.md:
- Entrypoints exist — every
file:symbolinentrypointsresolves to a real file and a real exported symbol. A missing one is the strongest staleness signal (the boundary moved or was renamed). - Signatures match declared I/O — the entrypoint's actual parameter and
return types are consistent with
io.input(precondition) /io.output(postcondition). Flag mismatches (e.g. contract says outputaltin meters but the type/comment now says feet). A downstream module's declared consumption is effectively a consumer contract on this output; a mismatch that would violate what a downstream relies on is high severity — the provider silently stopped satisfying a consumer. - Upstream matches real imports — the module's actual cross-module imports
match its declared
upstream. Flag both directions: a declared upstream that isn't imported anymore, and a real cross-module import that isn't declared. - Invariants still plausible — where cheaply checkable, note invariants the code visibly contradicts. (Deep verification isn't expected; flag the obvious.)
Tree-level checks
- Contract-less modules (tree holes) — directories that look like modules
(cohesive code behind a public surface, imported by others) but have no
CONTRACT.md. Report them as gaps to map. - Index vs contracts —
tree.mdedges that no longer match the contracts' invertedupstream. Since the index is regenerable, the fix is to regenerate; report the divergence.
Output
Produce a report grouped by severity:
- Stale (high): entrypoint missing, or I/O clearly contradicted.
- Suspect (medium): upstream/import mismatch, index/contract divergence.
- Gaps: code modules without a contract.
For each item: the module id, what looks wrong, and the suggested corrective flow
(change-with-contracts to fix a moved boundary, map-modules to fill a gap or
regenerate the index). Do not apply the fixes — hand the report to the user.
Scope caveat
This audit sees only declared static dependencies. It cannot detect implicit coupling
— shared formats, global state, a shared database, event ordering, duplicated constants —
which drifts invisibly because no upstream edge records it. When a contract's I/O carries
strong connascence (a unit/meaning, a wire format, a magic value), say so in the report: the
real drift surface may be wider than the graph. See
../contract-tree/references/principles.md.
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.