compartment-runtime-hygiene

Identify and remediate dead runtime surfaces and Knip runtime drift in the Compartment repo.

229|5|Updated May 25, 2026
One-click install
npx skills add https://github.com/compartmentdev/compartment --skill compartment-runtime-hygiene
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: compartment-runtime-hygiene
Source: https://github.com/compartmentdev/compartment/tree/main/.codex/skills/compartment-runtime-hygiene
Command: npx skills add https://github.com/compartmentdev/compartment --skill compartment-runtime-hygiene

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Handle export, entrypoint, scaffolding, or deletion changes that can create dead runtime surface or Knip runtime drift in the compartment repo.

Core Features & Use Cases

  • Identify and flag exports that are no longer used at runtime or that contribute to dead runtime surfaces.
  • Recommend and apply internalization or relocation of helpers that tests rely on but should not be part of the runtime surface.
  • Ensure runtime entrypoints remain explicit and update knip.runtime.json only for real runtime entrypoints; avoid accidental or convenience exports.
  • Provide guidance to maintain a clean surface during deletions or refactors to prevent exposure of implementation-mirror tests.

Quick Start

Run the hygiene workflow to detect and fix dead runtime surfaces in the repository.

Frequently Asked Questions about compartment-runtime-hygiene

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect unused exports causing dead runtime surface in my repository?

To detect unused exports causing dead runtime surface, run the hygiene workflow which identifies and flags exports no longer used at runtime across modules. It automates this detection and flags drift for repository maintenance.

What is runtime drift in repository maintenance and how does it happen?

Runtime drift occurs when export, entrypoint, scaffolding, or deletion changes create dead runtime surfaces or misalign Knip configuration. It happens when code alterations accidentally expose convenience exports or alter real runtime entrypoints without proper configuration updates.

How do I update knip.runtime.json without exposing accidental convenience exports?

To update knip.runtime.json safely, ensure runtime entrypoints remain explicit and update the configuration only for real runtime entrypoints. The hygiene workflow avoids accidental convenience exports by internalizing helpers that tests rely on but should remain outside the runtime surface.

Can I use this to clean up runtime surfaces during module deletions or refactoring?

Yes, you can clean up runtime surfaces during deletions or refactoring. The workflow provides guidance to maintain a clean surface and prevent exposure of implementation-mirror tests, ensuring deletions respect runtime entrypoints and do not leave dead code.

What's the best way to relocate test helpers that bloat the runtime surface?

The best way to relocate test helpers that bloat the runtime surface is to use the workflow's internalization recommendations. It identifies helpers that tests rely on but should not be part of the runtime surface and applies internalization or relocation to keep surfaces clean.

Why does Knip report runtime drift after refactoring entrypoints?

Knip reports runtime drift after refactoring entrypoints because configuration like knip.runtime.json may still reference old paths or fail to recognize new real entrypoints. The workflow ensures configuration updates only for real runtime entrypoints to prevent this drift.