| name | compartment-runtime-hygiene |
| description | Handle export, entrypoint, scaffolding, or deletion changes that can create dead runtime surface or Knip runtime drift in the compartment repo. |
Compartment Runtime Hygiene
Use this skill only for runtime-surface changes.
Source of truth
AGENTS.md
docs/layers/README.md
Workflow
- Treat code reachable only from tests as dead runtime surface.
- Remove, internalize, or move helpers that were exported only to satisfy tests.
- Keep runtime entrypoints explicit. Update
knip.runtime.jsonc only for real runtime entrypoints, not convenience exports.
- When
git commit runs, the repo-wide hook checks start automatically, so add narrow package checks for the touched surface and add special checks only when the diff needs more than that hook covers.
- When deletions or refactors expose implementation-mirror tests, delete or rewrite those tests instead of preserving dead runtime seams for them.
- Do not keep exports, wrappers, dependency seams, or compatibility glue alive solely because mock-heavy plumbing tests depend on them.
Common repo-specific smells
- package entry exports that nobody in runtime imports;
- helpers only referenced from tests;
- public type re-exports that widen a package entry surface with no runtime need;
- script helpers exported even though the file itself is the only caller.
- tests that only assert exact collaborator forwarding, ORM/query-builder choreography, or CLI/route plumbing rather than runtime behavior.