compress-skills
Skill8 starsChanged 2 months agoMITView on GitHub
Compress one or more SKILL.md files so they consume less context on load while preserving 100% of their value — same triggers, capabilities, guardrails, thresholds, and output. Use when the user says 'compress this skill', 'optimize skills for context', 'make skills use less context', 'slim down the skills', 'reduce skill token usage', 'shrink SKILL.md', or wants a skill or whole skill suite trimmed without losing behavior.
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Verify: every result (checklist below) — centrally, don't trust a subagent's self-report.
- Distinctive: line 21
Report: before/after bytes and % per file and total, what was cut, and any risk.
- Very specific: line 30
Keep all frontmatter keys valid (--- delimited) and every trigger phrase in description.
- Distinctive: line 31
No new features, no behavior change, no restyling beyond compression.
- Distinctive: line 43
Read through any file cut > ~30% to confirm no capability was dropped.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Compress Skills
Shrink the tokens a skill costs when loaded, with zero loss of value: every trigger, step, guardrail, tool name, threshold, and output spec survives. This is compression, not redesign — never add features or change behavior.
How skills spend context (optimize the right layer)
- Frontmatter
description— loads into every session; drives auto-invocation. Keep all trigger phrases/keywords/scenarios. You may tighten wording, never drop a trigger. Editing it is high-risk; touch it last and least. - SKILL.md body — loads on every invocation. Primary target.
- Reference files (
references/*.md,REFERENCE.md, recipes) — load only when opened. Move occasionally-needed detail here to shrink the mandatory body.
Process
- Scope. List the target skills.
wc -ceach file for a baseline. Skip files gitignored as private unless the user names them. Skip already-minimal files (< ~1 KB with no redundancy) — report "already minimal" rather than risk value. - Optimize. One skill → do it inline with the rulebook below. Many → fan out one subagent per skill (or small group), run in parallel.
- Verify every result (checklist below) — centrally, don't trust a subagent's self-report.
- Report before/after bytes and % per file and total, what was cut, and any risk.
Optimization rulebook (also the subagent brief)
- Cut redundancy, repetition, restatement, filler. Same instruction/guardrail twice → keep once.
- Collapse near-duplicate examples to the single most instructive one. Long worked examples are the biggest waste — trim hard, keep one.
- Prose → tight imperative bullets/steps. Drop hedging and obvious explanation.
- PRESERVE EVERY actionable step, guardrail, tool/function name, exact command/flag/syntax, code/CSS/design-token value, ordering constraint, output-format spec, edge case, and threshold/number. When in doubt, keep it.
- Move genuinely-optional detail from the body into a reference file the skill points to — never fragment tightly-coupled instructions.
- Keep all frontmatter keys valid (
---delimited) and every trigger phrase indescription. Keep markdown well-formed. Match the author's voice. - No new features, no behavior change, no restyling beyond compression.
Fan-out for a suite
Give each subagent: the rulebook above, the "how skills spend context" note, its assigned absolute file paths, and the report format. Run them in parallel. Then aggregate and verify centrally.
Verify (every skill, deterministically)
- Frontmatter still opens/closes with
---and hasname+description. git diffthedescription:lines — expect byte-identical except intentional, trigger-preserving rewordings.grepthe load-bearing tokens (tool names, enums, thresholds, output-section headers, commands) — all still present.- Re-
wc -c; confirm a real drop. - Read through any file cut > ~30% to confirm no capability was dropped.
Guardrails
- Triggers are sacred. A dropped trigger phrase silently breaks discovery. Diff descriptions to prove they're intact.
- Don't touch protected literals — code, HogQL/SQL, CSS/color/radius/shader values, exact commands/flags/paths stay byte-for-byte.
- Leave already-tight files alone. Trimming a 500 B skill risks value for no real saving.
- Respect
.gitignore. Private, local-only skills stay untouched unless the user names them. - Report honestly. Give per-file numbers, flag anything uncertain, and don't inflate the reduction.
Report format
Per file: <path>: <before>B → <after>B (−XX%), a TOTAL line, 3–6 bullets on what was cut/moved and why value survives, and a RISK line. A shareable summary (e.g. display.dev) is optional — only when asked.
In this repository20 other files it gives its agents.
- autonomous-maintainerSkill
- commitSkill
- competitive-ads-extractorSkill
- extract-design-systemSkill
- fix-ciSkill
- flesch-kincaid-proofreaderSkill
- frontendSkill
- get-pr-commentsSkill
- gogSkill
- grillingSkill
- grill-meSkill
- hairline-createSkill
- image-generationSkill
- posthogSkill
- shipSkill
- signoz-investigating-alertsSkill
- teachSkill
- thermo-nuclear-code-quality-reviewSkill
- update-agents-mdSkill
- visualizeSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

