[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7C4AT8MGPFTJDX8H0TTBX4P":3,"skill-same:01M7C4AT8MGPFTJDX8H0TTBX4P":43},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":13,"repositoryHtmlUrl":26,"repositoryHomepageUrl":6,"ownerHtmlUrl":27,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":28,"install":29,"resources":42},"01M7C4AT8MGPFTJDX8H0TTBX4P","semantic-compression",null,"Re-encode verbose prose into a dense telegraphic register — punctuation as connectives, label frames, verbless assertions — without losing normativity or precision. Use when compressing system prompts, tool\u002Ffunction descriptions, skill bodies, or agent instructions; reducing token count or context bloat; making documentation token-efficient for LLM input; or rewriting text in compressed notation.","fengwhang\u002Fmercury","fengwhang","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F325040254?v=4","01M7C3K54Y41KVGPHEMKEP9X70","01M7C3K55NTZ4B36YP2JY1NMJ0",0,"MIT","https:\u002F\u002Fgithub.com\u002Ffengwhang\u002Fmercury\u002Fblob\u002Fmain\u002Fomp\u002F.omp\u002Fskills\u002Fsemantic-compression\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: semantic-compression\ndescription: Re-encode verbose prose into a dense telegraphic register — punctuation as connectives, label frames, verbless assertions — without losing normativity or precision. Use when compressing system prompts, tool\u002Ffunction descriptions, skill bodies, or agent instructions; reducing token count or context bloat; making documentation token-efficient for LLM input; or rewriting text in compressed notation.\n---\n\n# Semantic Compression\n\nCompression 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.\n\nTarget 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.\n\n## Procedure\n\n0. **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.\n1. **Split** the source into atomic claims: one definition, obligation, default, or fact each.\n2. **Inventory the payload first, before deleting anything.** List every load-bearing token: identifiers, error\u002Fexception names, throw conditions, defaults with their units, bounds, and every MUST\u002FNEVER\u002FPREFER line. Anything you then drop is a loss you declare deliberately rather than discover later.\n3. **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.\n4. **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.\n5. **Frame each claim** — definition · obligation · default · condition→consequence · enumeration · verdict. The frame picks the construction.\n6. **Hoist repeated qualifiers** into one scope line: three mentions of \"relative to the repo root\" → `All paths repo-relative.` once, up top.\n7. **Re-encode**, then run Verification.\n\n## Frames\n\n| frame | English | compressed |\n|---|---|---|\n| definition | \"The `name` field is the stable launch identifier.\" | `name: stable launch id.` |\n| obligation | \"You must call open before you can run code.\" | `MUST open before run.` |\n| default | \"If no value is given, the timeout defaults to 30 seconds.\" | `Default 30s.` |\n| condition→consequence | \"Because navigation re-renders the page, refs become stale, so you should snapshot again.\" | `Navigation invalidates refs → re-snapshot.` |\n| property chain | \"z' is an integer because z divides x²+y², and it is positive because x²+y²>0.\" | `z' integer since z divides x²+y²; positive since x²+y²>0.` |\n| enumeration | \"The action may be open, close, or run.\" | `action: open, close, run.` |\n| exclusion | \"any triple that is neither (1,1,1) nor (1,1,2)\" | `triple ≠ (1,1,1),(1,1,2)` |\n| verdict | \"Claim A is true, and claim B is false as stated.\" | `A true; B false as stated.` |\n| precondition | \"This requires that the branch has already been checked out.\" | `Requires prior checkout.` |\n\nConstructions behind them:\n\n- **Verbless assertion** — `X true` \u002F `X false` \u002F `X required` \u002F `X unsupported`. Copula deleted; the predicate carries.\n- **Label frame** — `X: value` for \"the X is \u002F means \u002F consists of\". One colon per line, never nested.\n- **Subject elision across a run** — name the subject once, chain bare predicates: `Integer since …; positive since …; unique.`\n- **Asyndeton** — parallel items, no conjunction: `articles, copulas, expletives`.\n- **Scope declaration** — one line retypes everything after it: `All paths repo-relative.` · `Times in ms.` · `All congruences mod 4.`\n- **Lazy specification** — state only enough to decide: `3·13·34-1 big` (over the bound; exact value irrelevant). Name the bound somewhere the reader can see it.\n- **Metonymy** — an object stands for the proposition about it: `y=z implies (1,1,1)`. Only where exactly one reading exists.\n\n## Operators\n\nPunctuation carries the connective:\n\n- `:` — announce, name, define (\"is\", \"means\", \"the following\")\n- `→` — yields, produces, becomes (\"which results in\")\n- `⇒` — therefore, concludes\n- `—` — gloss, or \"therefore\"\n- `\u002F` — equivalently, i.e.\n- `;` — next step, same topic (\"Then,\", \"After that,\")\n- `,` — inference chain (\"and so\")\n- `≠` — neither\u002Fnor, distributed over a list\n- `✓` — verified, obligation discharged\n- `>` — precedence (\"arg > env > default\")\n- `|` — alternatives within an enum (\"open | close | run\")\n\nAmbiguity is the only disqualifier, never unfamiliarity. Where a glyph takes a second reading *in its slot* — `—` as a parenthetical dash, `\u002F` as a path separator or \"per\", `,` as a list comma — write the word instead.\n\n**Symbols do not save tokens; structure does.** Measured (cl100k_base; Claude's tokenizer differs, but BPE arity for rare glyphs is similar): `→` `⇒` `≤` `·` `✓` cost 1 token each, `≡` costs 2, ` -> ` costs 2, and ` gives` costs 1. So a one-for-one word→glyph swap saves nothing and costs clarity. Substitute a glyph only where it eats a *multi-word phrase*. Superscripts do pay: `x²+y²` = 4 tokens, `x^2+y^2` = 6.\n\nNever invent private glyphs — a bespoke one needs a legend that costs more than it saves.\n\n## Deletion\n\n**Always delete:** articles; copulas (is\u002Fare\u002Fwas\u002Fbe\u002Fbeen); expletive there\u002Fit; complementizer `that`; relative pronouns; intensifiers (very, quite, really, extremely); filler (\"in order to\"→to, \"due to the fact that\"→because, \"it is important to note that\"→∅, \"in terms of\"→∅); politeness (\"please\", \"feel free to\"); hedged framing (\"you may want to consider\").\n\n**Delete unless load-bearing:** auxiliaries (have\u002Fdo\u002Fwill); pronouns with an obvious referent; prepositions of\u002Ffor\u002Fto\u002Fin\u002Fon\u002Fat\u002Fby; conjunctions where the list is obvious; adverbs already implied by the verb (\"shout loudly\").\n\n**Never delete — this is the payload:**\n\n- Normative modals: MUST, NEVER, SHOULD, MAY. The RFC 2119 word *is* the instruction.\n- Negation and exception: not, no, never, without, none, except, unless.\n- Numbers, units, bounds, quantifiers: \"at least 5\", \"≤100\", \"max 1 MiB\", \"1-indexed\".\n- Conditionals and causality: if, unless, because, since, so.\n- True hedges: \"approximately\", \"usually\", \"appears\" — deleting one asserts certainty the source did not have.\n- Exact strings: identifiers, API names, flags, paths, regexes, format literals, error text.\n- Examples that demonstrate a shape. Compressing an example destroys the thing it demonstrates.\n- Prepositions where the relation flips meaning: \"read from X\" ≠ \"read to X\".\n- Throw\u002Ffailure conditions, and warnings about silent failure (\"never assume it landed because no error appeared\"). They read like padding and are behavioral.\n- Scar tissue: a line that exists because someone already made that mistake. It looks redundant *because* it now prevents the error. `git blame` before cutting anything that looks obvious.\n\n## Private register — never ship\n\nThe scratchpad style that generates this register carries features that work only while writer and reader are the same person, minutes apart. Strip all of them:\n\n- **External deixis** — `A`, `B`, `C`, `G`, \"the equation\", \"the claim above\". Shipped text is self-contained: name the thing.\n- **Scratchpad residue** — `Hmm`, `Actually`, `Wait`, `just`, `fine`, `Good`; goals revised mid-line; abandoned clauses.\n- **Layered corrections** — a wrong value left standing beside its fix. A cold reader cannot tell which pass won. Delete the loser.\n- **Dead branches** — an abandoned approach left beside the chosen one. A model may execute the abandoned one.\n- **Ambiguous `...` and `?`** — in notes they mean omitted \u002F abandoned \u002F infinite, and conjecture \u002F check-this. In shipped text they mean nothing. Drop both.\n- **Nested colons** — `Step: from X: cases: a,b=1: 3-c:` is unparseable cold. One colon per line.\n- **Unmarked instruction vs data** — a bare line like `Word limit 1200 - write concisely` sitting in content is indistinguishable from content. Keep instructions in a marked channel: heading, tag, or MUST line.\n- **Revisiting instead of rewriting** — fine while thinking, fatal in a prompt. One canonical statement per rule.\n\n## Tool and skill descriptions\n\nThe body compresses hard. The trigger does not.\n\n- A tool's or skill's `description` field is **retrieval surface**, not documentation: it is matched against the user's own phrasing. Keep natural, keyword-redundant alternatives (\"compress prompt\", \"reduce token count\", \"token-efficient\") even though a reader needs only one. Compress the body; NEVER compress the trigger.\n- Params — drop type, enum, or default from the prose ONLY when the *wire* schema the model actually sees exposes it, and (if you ran the `tool-prompt-optimization` probe) the probe recovered it from schema alone. Otherwise keep it. **Defaults are the trap:** wire schemas frequently omit `default` entirely, and even when present it carries no direction or semantics — `gitignore: true` does not say \"respects gitignore\" — which is why `tool-prompt-optimization` classes defaults-and-their-direction as content no model recovers. Absent that evidence, preserve the default, its unit, and any precedence rule (arg > env > default). Prose always keeps what no schema can express: interaction, precedence, failure mode.\n- Imperative for actions (`open before run`); label frames for facts (`Default 30s.`).\n- Scope split — this skill owns the *re-encoding mechanics* only. What belongs in a tool prompt at all (anatomy, surface-not-machinery, what stays out) → `tool-prompt-optimization`, which also measures schema\u002Fprose overlap before you cut. House style (tag vocabulary, RFC 2119 keywords, positioning) → `system-prompts`. Compress after those two have decided *what* ships.\n\n## Worked example\n\nSource (55 words, 63 tok):\n\n> The `timeout` parameter controls how long the tool will wait for the process to become ready. If you do not provide a value, it defaults to 30 seconds. Note that if you have specified both a log pattern and a port, then both of these conditions must be satisfied before the process is considered ready.\n\nCompressed (14 words, 20 tok):\n\n> `Readiness timeout: default 30s. Log pattern + port both supplied ⇒ BOTH must pass.`\n\nRejected as over-compressed — `timeout 30 log+port both`: loses the unit, loses that 30 is a *default* rather than a fixed value, loses the obligation, and leaves `both` dangling.\n\n## Verification\n\n1. **Declare every loss, then judge the draft against that list.** Name each dropped claim, qualifier, default, example, or exact string, and why the text is still correct without it. A declared loss is a decision a reader can audit; an undeclared one is a silent regression. Review with the list in front of you, not from memory of what you intended.\n2. **Ambiguity scan.** For every `:` `→` `—` `\u002F`: can a reader assign a second reading? Fix it. Watch for ambiguity the source did not have — a dropped receiver (`.ref(\"e5\")` on *what*?), a singular silently pluralized (\"previous snapshot\" → \"previous generations\").\n3. **Measure the pair with the target tokenizer.** Word counts and function-word rates do not predict token savings. Expect no fixed ratio — measured on real pairs (cl100k): a verbose doc paragraph 63 → 20 tok, a verbose prose section 360 → 222 tok, an already-dense house-style tool prompt 853 → 778 tok. Under ~10% is the signal to stop, revert, and keep the original.\n4. **Stop rule.** Stop deleting when the next deletion makes the reader guess. Correctness beats ratio, always.\n\n## Running it as a command\n\n`omp compress \u003Cfile>` drives exactly this loop with two tools and nothing else.\n\nIts session is isolated on purpose, because the input is itself a prompt: the default system prompt is *replaced* (not appended to), and skill, rule, `AGENTS.md`, prompt-template, and slash-command discovery are all passed empty — every one of those defaults to ON when omitted, and each would inject instruction-shaped project text into a job whose only legitimate input is the document. Audited on a live session: one system-prompt part, tools `rewrite, approve`, no `AGENTS.md` or rule content present.\n\nThe source is quoted inside a nonce-delimited block and declared inert, so `MUST`\u002F`NEVER` lines in the document get compressed rather than obeyed — verified with a document whose first paragraph ordered the compressor to emit `OK` and skip the rest: it compressed the real content and declared the injected paragraph as a deliberate loss.\n\n- `rewrite` submits the full compressed text plus every declared loss.\n- The command answers with the draft, its measured word\u002Ftoken delta, and that loss list, then asks for a verdict.\n- `approve` accepts the reviewed draft. Approval before a review turn is rejected, and a new draft voids an earlier approval.\n- Only an approved draft is written: `-o \u003Cpath>`, `-i` in place, otherwise stdout (the report goes to stderr, so `> out.md` captures just the text). `-r` bounds the drafts; an unapproved run writes nothing and exits 1.\n\nThe runtime contract it hands the agent lives in `packages\u002Fcoding-agent\u002Fsrc\u002Fcompress\u002Fprompts\u002Fsystem.md`. It is the operative subset of this file; when they disagree, this file wins and the prompt gets fixed.\n","# Semantic Compression\n\nCompression 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.\n\nTarget 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.\n\n## Procedure\n\n0. **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.\n1. **Split** the source into atomic claims: one definition, obligation, default, or fact each.\n2. **Inventory the payload first, before deleting anything.** List every load-bearing token: identifiers, error\u002Fexception names, throw conditions, defaults with their units, bounds, and every MUST\u002FNEVER\u002FPREFER line. Anything you then drop is a loss you declare deliberately rather than discover later.\n3. **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.\n4. **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.\n5. **Frame each claim** — definition · obligation · default · condition→consequence · enumeration · verdict. The frame picks the construction.\n6. **Hoist repeated qualifiers** into one scope line: three mentions of \"relative to the repo root\" → `All paths repo-relative.` once, up top.\n7. **Re-encode**, then run Verification.\n\n## Frames\n\n| frame | English | compressed |\n|---|---|---|\n| definition | \"The `name` field is the stable launch identifier.\" | `name: stable launch id.` |\n| obligation | \"You must call open before you can run code.\" | `MUST open before run.` |\n| default | \"If no value is given, the timeout defaults to 30 seconds.\" | `Default 30s.` |\n| condition→consequence | \"Because navigation re-renders the page, refs become stale, so you should snapshot again.\" | `Navigation invalidates refs → re-snapshot.` |\n| property chain | \"z' is an integer because z divides x²+y², and it is positive because x²+y²>0.\" | `z' integer since z divides x²+y²; positive since x²+y²>0.` |\n| enumeration | \"The action may be open, close, or run.\" | `action: open, close, run.` |\n| exclusion | \"any triple that is neither (1,1,1) nor (1,1,2)\" | `triple ≠ (1,1,1),(1,1,2)` |\n| verdict | \"Claim A is true, and claim B is false as stated.\" | `A true; B false as stated.` |\n| precondition | \"This requires that the branch has already been checked out.\" | `Requires prior checkout.` |\n\nConstructions behind them:\n\n- **Verbless assertion** — `X true` \u002F `X false` \u002F `X required` \u002F `X unsupported`. Copula deleted; the predicate carries.\n- **Label frame** — `X: value` for \"the X is \u002F means \u002F consists of\". One colon per line, never nested.\n- **Subject elision across a run** — name the subject once, chain bare predicates: `Integer since …; positive since …; unique.`\n- **Asyndeton** — parallel items, no conjunction: `articles, copulas, expletives`.\n- **Scope declaration** — one line retypes everything after it: `All paths repo-relative.` · `Times in ms.` · `All congruences mod 4.`\n- **Lazy specification** — state only enough to decide: `3·13·34-1 big` (over the bound; exact value irrelevant). Name the bound somewhere the reader can see it.\n- **Metonymy** — an object stands for the proposition about it: `y=z implies (1,1,1)`. Only where exactly one reading exists.\n\n## Operators\n\nPunctuation carries the connective:\n\n- `:` — announce, name, define (\"is\", \"means\", \"the following\")\n- `→` — yields, produces, becomes (\"which results in\")\n- `⇒` — therefore, concludes\n- `—` — gloss, or \"therefore\"\n- `\u002F` — equivalently, i.e.\n- `;` — next step, same topic (\"Then,\", \"After that,\")\n- `,` — inference chain (\"and so\")\n- `≠` — neither\u002Fnor, distributed over a list\n- `✓` — verified, obligation discharged\n- `>` — precedence (\"arg > env > default\")\n- `|` — alternatives within an enum (\"open | close | run\")\n\nAmbiguity is the only disqualifier, never unfamiliarity. Where a glyph takes a second reading *in its slot* — `—` as a parenthetical dash, `\u002F` as a path separator or \"per\", `,` as a list comma — write the word instead.\n\n**Symbols do not save tokens; structure does.** Measured (cl100k_base; Claude's tokenizer differs, but BPE arity for rare glyphs is similar): `→` `⇒` `≤` `·` `✓` cost 1 token each, `≡` costs 2, ` -> ` costs 2, and ` gives` costs 1. So a one-for-one word→glyph swap saves nothing and costs clarity. Substitute a glyph only where it eats a *multi-word phrase*. Superscripts do pay: `x²+y²` = 4 tokens, `x^2+y^2` = 6.\n\nNever invent private glyphs — a bespoke one needs a legend that costs more than it saves.\n\n## Deletion\n\n**Always delete:** articles; copulas (is\u002Fare\u002Fwas\u002Fbe\u002Fbeen); expletive there\u002Fit; complementizer `that`; relative pronouns; intensifiers (very, quite, really, extremely); filler (\"in order to\"→to, \"due to the fact that\"→because, \"it is important to note that\"→∅, \"in terms of\"→∅); politeness (\"please\", \"feel free to\"); hedged framing (\"you may want to consider\").\n\n**Delete unless load-bearing:** auxiliaries (have\u002Fdo\u002Fwill); pronouns with an obvious referent; prepositions of\u002Ffor\u002Fto\u002Fin\u002Fon\u002Fat\u002Fby; conjunctions where the list is obvious; adverbs already implied by the verb (\"shout loudly\").\n\n**Never delete — this is the payload:**\n\n- Normative modals: MUST, NEVER, SHOULD, MAY. The RFC 2119 word *is* the instruction.\n- Negation and exception: not, no, never, without, none, except, unless.\n- Numbers, units, bounds, quantifiers: \"at least 5\", \"≤100\", \"max 1 MiB\", \"1-indexed\".\n- Conditionals and causality: if, unless, because, since, so.\n- True hedges: \"approximately\", \"usually\", \"appears\" — deleting one asserts certainty the source did not have.\n- Exact strings: identifiers, API names, flags, paths, regexes, format literals, error text.\n- Examples that demonstrate a shape. Compressing an example destroys the thing it demonstrates.\n- Prepositions where the relation flips meaning: \"read from X\" ≠ \"read to X\".\n- Throw\u002Ffailure conditions, and warnings about silent failure (\"never assume it landed because no error appeared\"). They read like padding and are behavioral.\n- Scar tissue: a line that exists because someone already made that mistake. It looks redundant *because* it now prevents the error. `git blame` before cutting anything that looks obvious.\n\n## Private register — never ship\n\nThe scratchpad style that generates this register carries features that work only while writer and reader are the same person, minutes apart. Strip all of them:\n\n- **External deixis** — `A`, `B`, `C`, `G`, \"the equation\", \"the claim above\". Shipped text is self-contained: name the thing.\n- **Scratchpad residue** — `Hmm`, `Actually`, `Wait`, `just`, `fine`, `Good`; goals revised mid-line; abandoned clauses.\n- **Layered corrections** — a wrong value left standing beside its fix. A cold reader cannot tell which pass won. Delete the loser.\n- **Dead branches** — an abandoned approach left beside the chosen one. A model may execute the abandoned one.\n- **Ambiguous `...` and `?`** — in notes they mean omitted \u002F abandoned \u002F infinite, and conjecture \u002F check-this. In shipped text they mean nothing. Drop both.\n- **Nested colons** — `Step: from X: cases: a,b=1: 3-c:` is unparseable cold. One colon per line.\n- **Unmarked instruction vs data** — a bare line like `Word limit 1200 - write concisely` sitting in content is indistinguishable from content. Keep instructions in a marked channel: heading, tag, or MUST line.\n- **Revisiting instead of rewriting** — fine while thinking, fatal in a prompt. One canonical statement per rule.\n\n## Tool and skill descriptions\n\nThe body compresses hard. The trigger does not.\n\n- A tool's or skill's `description` field is **retrieval surface**, not documentation: it is matched against the user's own phrasing. Keep natural, keyword-redundant alternatives (\"compress prompt\", \"reduce token count\", \"token-efficient\") even though a reader needs only one. Compress the body; NEVER compress the trigger.\n- Params — drop type, enum, or default from the prose ONLY when the *wire* schema the model actually sees exposes it, and (if you ran the `tool-prompt-optimization` probe) the probe recovered it from schema alone. Otherwise keep it. **Defaults are the trap:** wire schemas frequently omit `default` entirely, and even when present it carries no direction or semantics — `gitignore: true` does not say \"respects gitignore\" — which is why `tool-prompt-optimization` classes defaults-and-their-direction as content no model recovers. Absent that evidence, preserve the default, its unit, and any precedence rule (arg > env > default). Prose always keeps what no schema can express: interaction, precedence, failure mode.\n- Imperative for actions (`open before run`); label frames for facts (`Default 30s.`).\n- Scope split — this skill owns the *re-encoding mechanics* only. What belongs in a tool prompt at all (anatomy, surface-not-machinery, what stays out) → `tool-prompt-optimization`, which also measures schema\u002Fprose overlap before you cut. House style (tag vocabulary, RFC 2119 keywords, positioning) → `system-prompts`. Compress after those two have decided *what* ships.\n\n## Worked example\n\nSource (55 words, 63 tok):\n\n> The `timeout` parameter controls how long the tool will wait for the process to become ready. If you do not provide a value, it defaults to 30 seconds. Note that if you have specified both a log pattern and a port, then both of these conditions must be satisfied before the process is considered ready.\n\nCompressed (14 words, 20 tok):\n\n> `Readiness timeout: default 30s. Log pattern + port both supplied ⇒ BOTH must pass.`\n\nRejected as over-compressed — `timeout 30 log+port both`: loses the unit, loses that 30 is a *default* rather than a fixed value, loses the obligation, and leaves `both` dangling.\n\n## Verification\n\n1. **Declare every loss, then judge the draft against that list.** Name each dropped claim, qualifier, default, example, or exact string, and why the text is still correct without it. A declared loss is a decision a reader can audit; an undeclared one is a silent regression. Review with the list in front of you, not from memory of what you intended.\n2. **Ambiguity scan.** For every `:` `→` `—` `\u002F`: can a reader assign a second reading? Fix it. Watch for ambiguity the source did not have — a dropped receiver (`.ref(\"e5\")` on *what*?), a singular silently pluralized (\"previous snapshot\" → \"previous generations\").\n3. **Measure the pair with the target tokenizer.** Word counts and function-word rates do not predict token savings. Expect no fixed ratio — measured on real pairs (cl100k): a verbose doc paragraph 63 → 20 tok, a verbose prose section 360 → 222 tok, an already-dense house-style tool prompt 853 → 778 tok. Under ~10% is the signal to stop, revert, and keep the original.\n4. **Stop rule.** Stop deleting when the next deletion makes the reader guess. Correctness beats ratio, always.\n\n## Running it as a command\n\n`omp compress \u003Cfile>` drives exactly this loop with two tools and nothing else.\n\nIts session is isolated on purpose, because the input is itself a prompt: the default system prompt is *replaced* (not appended to), and skill, rule, `AGENTS.md`, prompt-template, and slash-command discovery are all passed empty — every one of those defaults to ON when omitted, and each would inject instruction-shaped project text into a job whose only legitimate input is the document. Audited on a live session: one system-prompt part, tools `rewrite, approve`, no `AGENTS.md` or rule content present.\n\nThe source is quoted inside a nonce-delimited block and declared inert, so `MUST`\u002F`NEVER` lines in the document get compressed rather than obeyed — verified with a document whose first paragraph ordered the compressor to emit `OK` and skip the rest: it compressed the real content and declared the injected paragraph as a deliberate loss.\n\n- `rewrite` submits the full compressed text plus every declared loss.\n- The command answers with the draft, its measured word\u002Ftoken delta, and that loss list, then asks for a verdict.\n- `approve` accepts the reviewed draft. Approval before a review turn is rejected, and a new draft voids an earlier approval.\n- Only an approved draft is written: `-o \u003Cpath>`, `-i` in place, otherwise stdout (the report goes to stderr, so `> out.md` captures just the text). `-r` bounds the drafts; an unapproved run writes nothing and exits 1.\n\nThe runtime contract it hands the agent lives in `packages\u002Fcoding-agent\u002Fsrc\u002Fcompress\u002Fprompts\u002Fsystem.md`. It is the operative subset of this file; when they disagree, this file wins and the prompt gets fixed.\n",{"name":5,"description":7},"main","94a12cab2ce32e2020d179b5d579d0cbcbd0f206","omp\u002F.omp\u002Fskills\u002Fsemantic-compression","https:\u002F\u002Fgithub.com\u002Ffengwhang\u002Fmercury","https:\u002F\u002Fgithub.com\u002Ffengwhang","2026-10-09 08:26:42",{"source":8,"skillName":5,"commands":30,"prompt":40,"zipAvailable":41},[31,34,37],{"tool":32,"command":33},"npx","npx skills add fengwhang\u002Fmercury --skill semantic-compression",{"tool":35,"command":36},"bunx","bunx skills add fengwhang\u002Fmercury --skill semantic-compression",{"tool":38,"command":39},"pnpm","pnpm dlx skills add fengwhang\u002Fmercury --skill semantic-compression","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Ffengwhang\u002Fmercury\u002Fblob\u002Fmain\u002Fomp\u002F.omp\u002Fskills\u002Fsemantic-compression\u002FSKILL.md",true,[],[44,51,58,65,71,78],{"skillNo":45,"name":46,"nameZh":6,"description":47,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":48,"categories":49,"keywords":50,"publishedAt":18},"01M7C4BTY3ND38CN200ZCTH6NV","greet","A greeting skill for testing","https:\u002F\u002Fgithub.com\u002Ffengwhang\u002Fmercury\u002Fblob\u002Fmain\u002Fomp\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Fmarketplace\u002Ffixtures\u002Fvalid-marketplace\u002Fplugins\u002Fhello-plugin\u002Fskills\u002Fgreet\u002FSKILL.md",[],[],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":18},"01M7C4BSNZTPW8JR5NGCQXGSEZ","valid-skill","A valid skill for testing purposes.","https:\u002F\u002Fgithub.com\u002Ffengwhang\u002Fmercury\u002Fblob\u002Fmain\u002Fomp\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fvalid-skill\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":18},"01M7C4BRA7J8C06KSVW100F1W1","unknown-field","A skill with an unknown frontmatter field.","https:\u002F\u002Fgithub.com\u002Ffengwhang\u002Fmercury\u002Fblob\u002Fmain\u002Fomp\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Funknown-field\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":68,"categories":69,"keywords":70,"publishedAt":18},"01M7C4BNB04KQGCJ835JE8AR13","no-frontmatter","https:\u002F\u002Fgithub.com\u002Ffengwhang\u002Fmercury\u002Fblob\u002Fmain\u002Fomp\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fno-frontmatter\u002FSKILL.md",[],[],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":18},"01M7C4BM38TZFYT1AJ6SKHPZZ2","child-skill","A nested skill in a subdirectory.","https:\u002F\u002Fgithub.com\u002Ffengwhang\u002Fmercury\u002Fblob\u002Fmain\u002Fomp\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fnested\u002Fchild-skill\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":18},"01M7C4BJDN7RFFCM28CGX15Q97","different-name","A skill with a name that doesn't match the directory.","https:\u002F\u002Fgithub.com\u002Ffengwhang\u002Fmercury\u002Fblob\u002Fmain\u002Fomp\u002Fpackages\u002Fcoding-agent\u002Ftest\u002Ffixtures\u002Fskills\u002Fname-mismatch\u002FSKILL.md",[],[]]