compress-skill
compress-skill shrinks a SKILL.md without changing what it means. A skill that
loads into every relevant session is a recurring tax on the context window โ this
skill pays that tax down, safely, while guaranteeing the behaviour the skill
encodes is untouched.
What it solves
Skills grow. A SKILL.md picks up redundant phrasing, repeated caveats, and prose
that could be half as long โ and every extra line is loaded again on every
activation. But compressing by hand is risky: itโs easy to drop the one sentence
that was load-bearing. compress-skill makes the shrink safe, so you get the
smaller footprint without gambling on the meaning.
How it works
It compresses in two passes, cheapest first:
- A deterministic cleanup pass removes mechanical bloat (whitespace, redundancy) with no model involved.
- An LLM rewrite pass runs only if the deterministic pass didnโt hit the size target โ so the model is spent only when itโs needed.
Throughout, the meaning is protected by hard invariants: test anchors extracted from the skillโs test file are preserved, and frontmatter, headings, and code blocks are never modified. It is dry-run by default โ you see the result before anything is written.
Usage & parameters
compress-skill <skill> [--apply]| Flag | What it does | Default |
|---|---|---|
--apply | Write the compressed result to the file. | dry-run (show only) |
When to use
When a SKILL.md has grown large enough to weigh on the context window, or as a
periodic pass over the skill catalogue. Pairs with context-budget โ both reclaim
the window, this one at the per-skill level.