Install
openclaw skills install @liyi-ai/skill-debloaterDebloats bloated, flaky Agent Skills into a lean, stable version. Classifies content on four axes: WHAT (nature), WHERE (layer), HOW (prose vs script) are automatic and lossless; ALIVE (still used?) requires user confirmation before deletion, defaulting to keep. Never auto-deletes.
openclaw skills install @liyi-ai/skill-debloaterRefactor a skill that's both bloated (too many tokens) and flaky (inconsistent) into a lean, stable version.
This skill is self-contained and platform-agnostic (works generically across Hermes / openclaw / Claude, etc.): all methodology lives in references/, no external knowledge required.
Replace these placeholders below with what applies to your platform:
<SKILL_DIR> — the install directory of this skill. Hermes: ~/.hermes/skills/skill-debloater; Claude: ~/.claude/skills/skill-debloater; substitute the equivalent path for openclaw etc.execute_code or terminal; use the equivalent tool on other platforms).clarify; use the equivalent user-interaction mechanism on other platforms).| Axis | Question | Who answers | Action |
|---|---|---|---|
| WHAT | What is this piece's nature? (Core / Background / Example / Template / Redundant) | Automatic | — |
| WHERE | Which layer should it live in? (body / references / scripts) | Automatic | Lossless reorganization |
| HOW | Prose or script? (deterministic logic should be externalized into a script) | Automatic | Lossless reorganization |
| ALIVE | Is it still in use? (stale version leftovers / orphans / empty shells) | User | Lossy deletion |
Iron rule: if the first three axes don't lose information and are reversible → do them automatically. The fourth axis destroys information, is irreversible, and only the user knows whether it's still alive → must ASK for confirmation, default to keep, never auto-delete.
Note: pushing content down under WHERE is reversible for information, but not neutral for behavior — under progressive disclosure, the model may fail to read layer 3 exactly when it should. Misjudging a Core Rule as Background and pushing it down is a textbook way to cause "works sometimes, fails other times." So content near the Core/Background boundary defaults to staying in the body, even if that means staying a bit heavier; every file that gets pushed down must leave a trigger condition in the body for "when to read it" (see the "Files" list) so the model can reliably pull it back. Three-way verification (Step 4) is a backstop, not a substitute.
There's a third category of operation: compression/rewriting (rewriting verbose prose to be shorter). Unlike push-down/externalize, it doesn't preserve content verbatim — it can lose detail, introduce ambiguity, and the original isn't recoverable. Default to asking the user; only auto-compress when losslessness can be verified. "Verified" doesn't rely on the model self-reporting confidence (models don't have calibrated confidence — telling it "only proceed at 95% confidence" just gets rationalized away) — it relies on all four hard conditions being met: ① no loss of load-bearing information (conditions/causality/constraints/order/numbers); ② no new interpretations introduced, no added ambiguity; ③ doesn't touch the "keep verbatim" list; ④ contains no subtext or domain-specific meaning the model might miss. If any condition is uncertain → treat it as unverified → show the user a before/after: "any information lost? any ambiguity?" The original is backstopped by the Step 4 snapshot; details and templates are in
references/interaction-and-verify.md.
In one line: operations are sorted into three tiers by reversibility — lossless reorganization (automatic) < lossy compression (automatic only when verified, otherwise ask) < lossy deletion (must ask, item by item).
For the full methodology (five-category definitions, four-axis derivation, root causes of instability) see references/methodology.md.
A skill's body has grown too long / burns too many tokens / behaves inconsistently / has accumulated a pile of stale version files, and the user asks to debloat, slim down, or clean up.
Use RUN:
python3 <SKILL_DIR>/scripts/audit_skill.py "<path to target skill>"
Output: estimated body token count, line count, frontmatter compliance (name ≤ 64 chars & matches folder name, description ≤ 1024 chars with no < >), and a list of layer-3 files. Flags items over threshold (body should ideally be < 5000 tokens / < 500 lines).
ALIVE axis — run triage.py to find orphans, stale version numbers, empty shells, and version mismatches:
python3 <SKILL_DIR>/scripts/triage.py "<path to target skill>"
Outputs a keep bucket (referenced + current version, kept automatically) and a review bucket (suspected deletable, each with signals + suggestion) → feeds into Step 3's interaction.
HOW axis (AIP) — the core of AIP is compiling prose that describes a deterministic process into a script/pseudocode. Run scan_how.py:
python3 <SKILL_DIR>/scripts/scan_how.py "<path to target skill>"
It gives two kinds of signal:
Both kinds get externalized into scripts: it saves tokens + makes execution deterministic (fixes flakiness). Only externalize deterministic steps — steps needing judgment or interaction stay as prose. This is lossless reorganization, done automatically.
WHAT / WHERE axes — you (the agent) read the body and, per the five categories (see references/methodology.md), push background/examples/templates down into references. Lossless reorganization, done automatically — but WHERE has one discipline: content whose boundary is uncertain (could be Core, could be Background) defaults to staying in the body; only push down content you're confident is background, examples (keep one per concept), or templates. Every file pushed down needs a "when to read it" sentence left in the body.
The three automatic axes (WHAT/WHERE/HOW) only reorganize information, never destroy it, so they run automatically. Only ALIVE deletes information, which is left to Step 3 to ask the user. WHERE's information is reversible but its behavior isn't neutral (see the iron rule above) — pushing content to the wrong layer can hurt stability on its own, backstopped by Step 4 verification.
For the review bucket, use ASK to ask the user in one batch, defaulting to keep everything:
ASK: The following files are suspected deletable. Please check which ones to delete (default: keep all):
[ ] references/upgrade-recipe.md
Basis: not referenced by SKILL.md + a v1→v2 migration guide, now at v2.2.0
Suggestion: deletable
[ ] references/v2.1.8-sla-cases.md
Basis: filename has stale version tag v2.1.8 < current 2.2.0 (but still referenced in the body)
Suggestion: your call — deletable if you no longer need to reference old-version metrics
[ ] changelog section v2.1.0~v2.1.6
Basis: content is already an empty shell ("(omitted, see git)")
Suggestion: deletable
Only what the user explicitly checks gets deleted. If the user doesn't respond, says "keep it all," or hesitates → keep everything.
cp -r "<path to target skill>" "<path to target skill>.bak"; if under git, git stash or a commit works too). Reason: deletion is irreversible, and even with user confirmation there should be a rollback path. Don't delete anything without a usable backup.original skill / debloated skill / no skill. If the debloated version does worse on any task → add the content that caused the failure back into the body. It's best to ask the user for "cases that previously misfired or that you care about most" as test tasks (only the user knows which cases are flaky — same logic as ALIVE). Templates in references/interaction-and-verify.md..bak path, which can be deleted by the user once everything checks out).references/methodology.md — the self-contained four-axis methodology: five-category definitions, why the four axes are split this way, four root causes of instability, sourcesreferences/interaction-and-verify.md — ASK interaction templates + compression before/after confirmation template + three-way verification template + bucket-judgment detailsscripts/audit_skill.py — health check: token / frontmatter / file listingscripts/triage.py — ALIVE axis: buckets orphans/stale versions/empty shells (read-only)scripts/scan_how.py — HOW axis (AIP): scans the body for large code blocks and flags what should be externalized into a script (read-only)