Compress verbose skills to reduce context window usage. This skill is self-compressed using formula notation (~400 tokens, ~90% functionality, LLM-estimated). Full reference version: SKILL.reference.md.
Note: This skill uses formula notation — the LLM executes these operations directly. You don't need to understand the math. For prose explanation, see SKILL.reference.md.
text
S = {TRIGGER, CORE, CONSTRAINT, OUTPUT, EXAMPLE, EDGE, EXPLAIN, VERBOSE}
I(s) ∈ [0,1] # importance score
P = {yaml.name, yaml.desc, N-count, task-create, checkpoint, BEFORE/AFTER} # protected
θ ∈ [0,1] # threshold (default 0.9)
n ∈ ℕ # target tokens
text
∀s ∈ skill: type(s) → S, score(s) → I(s)
s ∈ P ⇒ I(s) := max(I(s), 0.85)
keep = {s | I(s) ≥ θ ∨ s ∈ P}
output = (skill[keep], Σ I(keep)/|S|, |skill| - |keep|)
# Score divides by |S| (8 types), not |keep| — rewards diverse section coverage
text
min_tokens = |{s | type(s) ∈ {TRIGGER, CORE}}|
n < min_tokens ⇒ summarize(skill) → n
n ≥ min_tokens ⇒ compress(skill, θ) where |output| ≤ n
text
output = "TRIGGER: " + extract(skill, TRIGGER) +
"\nACTION: " + extract(skill, CORE) +
"\nRESULT: " + extract(skill, OUTPUT)
text
scored = [(e, pattern_coverage(e), uniqueness(e)) | e ∈ examples]
selected = top(scored, n=2, by=coverage × uniqueness)
coverage(selected) ≥ 0.8 ⇒ phase1
output = selected ∪ {trigger(e) → result(e) | e ∈ examples \ selected}
coverage(selected) < 0.8 ⇒ phase2
output = synthesize(examples) → single_example
text
∀phrase ∈ section:
self_info(phrase) = -log(P(phrase|context))
high_info ⇒ KEEP, low_info ⇒ PRUNE
prune while preserving sentence structure
>50% low_info ⇒ remove entire section
SymbolMeaning→results in, maps to⇒implies, therefore∈element of, in∀for all¬not∧and∨or:=assign
text
/skill-distiller path --threshold=0.9 → compress(skill, 0.9)
/skill-distiller path --tokens=500 → compress_tokens(skill, 500)
/skill-distiller path --mode=oneliner → oneliner(skill)
ConditionResponseskill = ∅"No content"¬∃ yaml.name"Add frontmatter"n < min_tokens"Summarizing..."
VariantTokensFunctionalitymain (this)40090% (formula)compressed97590% (prose)oneliner10070%
Full reference: SKILL.reference.md (~2,500 tokens, ~90%)
Token counts use 4 chars/token heuristic (+/-20%). Functionality scores are LLM-estimated.