Chuyển đến nội dung
Skillpedia
Prompt và LLM38k · #7492

semantic-compression

Skill này làm gì

Skill này chỉ cho agent cách làm chỉ dẫn ngắn hơn trong khi vẫn giữ mọi yêu cầu nguyên vẹn. Skill dành cho người viết prompt, mô tả công cụ hoặc chỉ dẫn agent và muốn cắt bớt văn bản thừa.

Khi nào nên dùng

  • ✓Khi bạn muốn rút gọn một system prompt, mô tả công cụ hoặc chỉ dẫn agent.
  • ✓Khi các chỉ dẫn dài đang chiếm quá nhiều bộ nhớ làm việc của AI.
  • ✓Khi bạn muốn tài liệu được viết dưới dạng gọn mà AI vẫn làm theo chính xác.

Liên kết skill

https://github.com/can1357/oh-my-pi/blob/main/.omp/skills/semantic-compression/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/can1357/oh-my-pi/blob/main/.omp/skills/semantic-compression/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“System prompt này rất dài. Bạn có thể rút gọn nó mà không làm mất quy tắc nào không?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent trước hết kiểm tra xem văn bản đã đủ gọn để đáng rút gọn chưa. Nếu đã gọn, nó giữ nguyên bản gốc. Nếu chưa, nó tách văn bản thành từng khẳng định đơn lẻ, viết lại mỗi cái dưới dạng chặt chẽ hơn, rồi đo xem đã tiết kiệm được bao nhiêu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

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: value for "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"
  • /
Câu hỏi thường gặp

Nó có xóa quy tắc quan trọng để tiết kiệm chỗ không?

Không có ý làm vậy. Mỗi quy tắc được giữ lại, và agent kiểm tra không có gì bị bỏ sót trước khi hoàn tất.

Nếu văn bản đã ngắn thì sao?

Agent dừng lại và giữ bản gốc, vì viết lại văn bản đã cô đọng thường mất nhiều hơn là tiết kiệm.

Nó có thay đổi ý nghĩa của chỉ dẫn không?

Mục tiêu là giữ nguyên ý nghĩa, bằng cách dùng cách trình bày chặt chẽ hơn thay vì chỉ xóa từ.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
38k
Vị trí xếp hạng
#7492
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự