semantic-compression

Installation
SKILL.md

Semantic Compression

Compression is re-encoding, not word deletion. Filtering function words out of an English sentence leaves a damaged English sentence (System design: efficient process incoming data, multiple sources). Instead re-frame each claim in a register whose grammar is punctuation and layout — then the function words have no work left and drop out on their own.

Target texts are load-bearing: tool descriptions, system prompts, skills. A model executes them cold, with no author present to disambiguate. Compression that forces a guess is a bug, not a saving.

Procedure

  1. Density gate — check before touching anything. Two signals, in order: (a) are articles and copulas already near-absent? (b) compress one representative section and measure the token delta. Already in this register (house-style prompt, tool doc, spec) or delta under ~10%? STOP. Report that it is already dense and keep the original. Bullet length alone is a weak signal — API literals and enumerations inflate it. Measured on a real house-style tool prompt: 853 → 778 tokens (8.8%), while that pass silently dropped a NEVER assume … rule, a throw condition, and a full-res detail. On already-dense text the remaining words are the payload, and the expected saving is smaller than the expected loss.
  2. Split the source into atomic claims: one definition, obligation, default, or fact each.
  3. Inventory the payload first, before deleting anything. List every load-bearing token: identifiers, error/exception names, throw conditions, defaults with their units, bounds, and every MUST/NEVER/PREFER line. Anything you then drop is a loss you declare deliberately rather than discover later.
  4. Cut what the model already knows. "JSON is a text format", "tests catch regressions" → delete. Keep only what is specific to this tool, repo, or domain.
  5. Cut restatements. Merge every duplicate of one rule into a single canonical line, placed where it is needed. Two statements of one rule with different scope are not duplicates.
  6. Frame each claim — definition · obligation · default · condition→consequence · enumeration · verdict. The frame picks the construction.
  7. Hoist repeated qualifiers into one scope line: three mentions of "relative to the repo root" → All paths repo-relative. once, up top.
  8. Re-encode, then run Verification.

Frames

Installs
42
GitHub Stars
37.9K
First Seen
Apr 7, 2026