| name | cavekit-check |
| description | Read-only Cavekit drift detector. Use when users invoke /ck:check, ask whether code matches SPEC.md, check invariants, audit interfaces, or inspect §T status evidence. |
cavekit-check — drift report
Pure diagnostic workflow. Read SPEC.md, compare it to code, report evidence. Write nothing.
Read bundled ../../FORMAT.md before interpreting SPEC.md structure and addresses.
Load
- Read project-root
SPEC.md. If missing, report no SPEC.md, nothing to check and stop.
- Parse invocation args:
§V or no args → check invariants
§I → check interfaces
§T → audit task status against code evidence
--all → check §V, §I, and §T
Check §V — invariants
For each V<n>:
- Translate invariant into a verifiable claim about code/tests/config.
- Search and read relevant files.
- Classify: HOLD / VIOLATE / UNVERIFIABLE.
- Cite file:line evidence when possible.
Check §I — interfaces
For each interface item:
- Locate implementation.
- Classify:
- MATCH — implemented shape matches spec.
- DRIFT — implementation exists but shape differs.
- MISSING — spec surface absent from code.
- EXTRA — code exposes related surface absent from spec.
- Cite file:line evidence.
Check §T — tasks
For each task row:
- If status
x, verify claimed work appears present.
- If status
~, note as in-progress.
- If status
., note as pending.
- Flag
x rows with no supporting evidence as STALE.
Report format
Use concise grouped output:
## §V drift
V2 VIOLATE: auth/mw.go:47 uses `<` not `≤`. see §B.1.
V5 UNVERIFIABLE: no test covers req path.
## §I drift
I.api DRIFT: POST /x returns `{result}` not `{id}`. route.go:112.
I.cmd MISSING: `foo bar` absent from cli/*.go.
## §T drift
T3 STALE: status `x`, no middleware file exists.
## summary
2 violate. 1 missing. 1 stale. 1 unverifiable.
next: /ck:spec bug: <cause>, /ck:build <task>, or amend spec.
Remedy hints only
End with one-line hints:
- VIOLATE / DRIFT → use
/ck:spec bug: <cause> or fix code.
- MISSING → use
/ck:build §T.n if a task exists; otherwise /ck:spec amend §T.
- STALE → use
/ck:spec amend §T to uncheck or revise.
- EXTRA → document with
/ck:spec amend §I or remove code.
Boundaries
- Zero writes.
- No
SPEC.md edits.
- No code edits.
- No commits.
- No scores or grades; classify by evidence.