Text Compress
Remove words from LLM-facing text without removing meaning. Every instruction, constraint, number, and named entity in
the input must survive in the output.
When NOT to use
- User-facing copy, human documentation, marketing text
- Contracts, licenses, compliance text
- Changelogs, commit messages, quoted excerpts — anything attributed to someone
- Text where exact wording is the point: error-message catalogues, test fixtures, translations
Output contract
Produce exactly one of these:
- A target file is named → rewrite it in place. Then report original word count → new word count, and every
requirement you judged redundant and merged.
- Text is supplied inline, or no target is named → return the compressed text alone. No preamble, no summary of
what changed.
Never both. Never add content. Never reorder sections. Never drop a requirement — compression removes words, not rules.
Never modify
Copy these through byte for byte:
- Fenced code blocks (
...) — including comments, blank lines, line order, and command length
- Inline code (
`...`)
- URLs, links, file paths, environment variables
- Technical terms: library, API, protocol, algorithm, and product names
- Numbers, versions, thresholds, identifiers
Code blocks are read-only regions. Compress the prose around them; do not merge sections across them.
Compress
- Delete filler: just, really, basically, actually, simply, essentially, generally
- Delete pleasantries: "sure", "certainly", "of course", "happy to", "I'd recommend"
- Delete connective fluff: however, furthermore, additionally, in addition
- Delete articles (a, an, the) where the referent stays unambiguous
- Drop "you should", "make sure to", "remember to" — state the action
- Short synonyms: "big" not "extensive", "use" not "utilize", "fix" not "implement a solution for"
- "in order to" → "to"; "the reason is because" → "because"
- Fragments are fine: "Run tests before commit"
- Merge bullets that state one rule twice; keep one example where several show one pattern
- Delete implied context and duplicate semantics across lines
Compress with care
Two rules invert meaning when applied mechanically:
- Hedges. Drop hedging around an assertion: "it might be worth running the tests" → "run the tests". Keep the modal
where it grants permission or marks a real option: "you may skip the lint step" stays.
- Negatives. Convert to affirmative only when the affirmative states the same requirement: "do not forget to lock"
→ "lock". Keep the negative for prohibitions: "never edit files in place" stays — an affirmative restatement weakens
it.
Verify before returning
Read the original and the compressed text side by side. Confirm every instruction, constraint, number, named entity,
and code region survived. Restore words wherever meaning thinned. Compression that loses a rule is a failed
compression, not a tighter one.
Examples
Prose
Original:
You should always make sure to run the test suite before pushing any changes to the main branch. This is important
because it helps catch bugs early and prevents broken builds from being deployed to production.
Compressed:
Run tests before pushing to main. Catches bugs early, prevents broken production deploys.
Prose around code — the surrounding text compresses, the block does not.
Original:
Before you get started, you'll want to make sure that you have installed all of the project dependencies. You can do
this by simply running the following command in your terminal:
# install everything, including dev dependencies
npm install --include=dev
If that fails, it might be worth checking your Node version first.
Compressed:
Install dependencies:
# install everything, including dev dependencies
npm install --include=dev
On failure, check Node version.
1---2name: text-compress3description: Use when an LLM-facing document — a prompt, skill file, spec, or instruction set — is verbose and must fit a tighter token budget. Not for user-facing copy, legal text, changelogs, or quoted material.4---56# Text Compress78Remove words from LLM-facing text without removing meaning. Every instruction, constraint, number, and named entity in9the input must survive in the output.1011## When NOT to use1213- User-facing copy, human documentation, marketing text14- Contracts, licenses, compliance text15- Changelogs, commit messages, quoted excerpts — anything attributed to someone16- Text where exact wording is the point: error-message catalogues, test fixtures, translations1718## Output contract1920Produce exactly one of these:21221. **A target file is named** → rewrite it in place. Then report original word count → new word count, and every23 requirement you judged redundant and merged.242. **Text is supplied inline, or no target is named** → return the compressed text alone. No preamble, no summary of25 what changed.2627Never both. Never add content. Never reorder sections. Never drop a requirement — compression removes words, not rules.2829## Never modify3031Copy these through byte for byte:3233- Fenced code blocks (``` ... ```) — including comments, blank lines, line order, and command length34- Inline code (`` `...` ``)35- URLs, links, file paths, environment variables36- Technical terms: library, API, protocol, algorithm, and product names37- Numbers, versions, thresholds, identifiers3839Code blocks are read-only regions. Compress the prose around them; do not merge sections across them.4041## Compress4243- Delete filler: just, really, basically, actually, simply, essentially, generally44- Delete pleasantries: "sure", "certainly", "of course", "happy to", "I'd recommend"45- Delete connective fluff: however, furthermore, additionally, in addition46- Delete articles (a, an, the) where the referent stays unambiguous47- Drop "you should", "make sure to", "remember to" — state the action48- Short synonyms: "big" not "extensive", "use" not "utilize", "fix" not "implement a solution for"49- "in order to" → "to"; "the reason is because" → "because"50- Fragments are fine: "Run tests before commit"51- Merge bullets that state one rule twice; keep one example where several show one pattern52- Delete implied context and duplicate semantics across lines5354## Compress with care5556Two rules invert meaning when applied mechanically:5758- **Hedges.** Drop hedging around an assertion: "it might be worth running the tests" → "run the tests". Keep the modal59 where it grants permission or marks a real option: "you may skip the lint step" stays.60- **Negatives.** Convert to affirmative only when the affirmative states the same requirement: "do not forget to lock"61 → "lock". Keep the negative for prohibitions: "never edit files in place" stays — an affirmative restatement weakens62 it.6364## Verify before returning6566Read the original and the compressed text side by side. Confirm every instruction, constraint, number, named entity,67and code region survived. Restore words wherever meaning thinned. Compression that loses a rule is a failed68compression, not a tighter one.6970## Examples7172**Prose**7374Original:7576> You should always make sure to run the test suite before pushing any changes to the main branch. This is important77> because it helps catch bugs early and prevents broken builds from being deployed to production.7879Compressed:8081> Run tests before pushing to main. Catches bugs early, prevents broken production deploys.8283**Prose around code** — the surrounding text compresses, the block does not.8485Original:8687Before you get started, you'll want to make sure that you have installed all of the project dependencies. You can do88this by simply running the following command in your terminal:8990```bash91# install everything, including dev dependencies92npm install --include=dev93```9495If that fails, it might be worth checking your Node version first.9697Compressed:9899Install dependencies:100101```bash102# install everything, including dev dependencies103npm install --include=dev104```105106On failure, check Node version.