semantic-compression
できること
このスキルは、要件をすべて保ったまま指示を短くする方法をエージェントに示します。プロンプト、ツールの説明、エージェントへの指示を書き、無駄な文章を減らしたい人向けです。
使う場面
- ✓システムプロンプト、ツールの説明、エージェントの指示を短くしたいとき。
- ✓長い指示が、AIの作業メモリを多く使いすぎているとき。
- ✓AIが正確に従える、コンパクトな形でドキュメントを書きたいとき。
スキルのリンク
https://github.com/can1357/oh-my-pi/blob/main/.omp/skills/semantic-compression/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“このシステムプロンプトはとても長いです。ルールを1つも失わずに短くしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、まずテキストがすでに十分に簡潔で、短くする価値があるかを確認します。簡潔なら元のまま残します。そうでなければ、テキストを1つずつの主張に分け、それぞれをより引き締まった形に書き直し、どれだけ削減できたかを測ります。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
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
- 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 afull-resdetail. On already-dense text the remaining words are the payload, and the expected saving is smaller than the expected loss. - Split the source into atomic claims: one definition, obligation, default, or fact each.
- 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.
- 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.
- 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.
- Frame each claim — definition · obligation · default · condition→consequence · enumeration · verdict. The frame picks the construction.
- Hoist repeated qualifiers into one scope line: three mentions of "relative to the repo root" →
All paths repo-relative.once, up top. - Re-encode, then run Verification.
Frames
| frame | English | compressed |
|---|---|---|
| definition | "The name field is the stable launch identifier." |
name: stable launch id. |
| obligation | "You must call open before you can run code." | MUST open before run. |
| default | "If no value is given, the timeout defaults to 30 seconds." | Default 30s. |
| condition→consequence | "Because navigation re-renders the page, refs become stale, so you should snapshot again." | Navigation invalidates refs → re-snapshot. |
| 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. |
| enumeration | "The action may be open, close, or run." | action: open, close, run. |
| exclusion | "any triple that is neither (1,1,1) nor (1,1,2)" | triple ≠ (1,1,1),(1,1,2) |
| verdict | "Claim A is true, and claim B is false as stated." | A true; B false as stated. |
| precondition | "This requires that the branch has already been checked out." | Requires prior checkout. |
Constructions behind them:
- Verbless assertion —
X true/X false/X required/X unsupported. Copula deleted; the predicate carries. - Label frame —
X: valuefor "the X is / means / consists of". One colon per line, never nested. - Subject elision across a run — name the subject once, chain bare predicates:
Integer since …; positive since …; unique. - Asyndeton — parallel items, no conjunction:
articles, copulas, expletives. - Scope declaration — one line retypes everything after it:
All paths repo-relative.·Times in ms.·All congruences mod 4. - 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. - Metonymy — an object stands for the proposition about it:
y=z implies (1,1,1). Only where exactly one reading exists.
Operators
Punctuation carries the connective:
:— announce, name, define ("is", "means", "the following")→— yields, produces, becomes ("which results in")⇒— therefore, concludes—— gloss, or "therefore"/
よくある質問
重要なルールを、容量を節約するために削りますか?
いいえ。そうしないよう設計されています。各ルールは残り、終える前に何も失われていないかを確認します。
テキストがすでに短い場合はどうなりますか?
エージェントは止まり、元のテキストを残します。すでに密な文章を書き直すと、節約より多くを失うことが多いためです。
指示の意味は変わりますか?
目標は同じ意味を保つことです。単に単語を削るのではなく、より引き締まった形にします。
詳細
作者による元の説明
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/function 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.
repo: can1357/oh-my-pi
人気
- GitHubのスター
- 38k
- ランキング
- #7492
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
似ているスキル
writing-skills
311k新しいスキルを書き、それぞれをまず試すようエージェントに教えます。そのスキルが実際にエージェントの動作を変えることを確認します。
writing-for-agents
310kスキル、AGENTS.md、CLAUDE.mdを含め、AIエージェントのための明確な指示の書き方を説明し、エージェントが予測可能に動くようにします。
bengali-nlp
280kエージェントがベンガル語のテキストを処理できるようにします。テキストの正規化など、ベンガル語特有の性質に対応しながら、言語を理解して扱えるようにします。