Skills

Skill Shortener

Refactor a too-long SKILL.md by progressive disclosure: measure token cost, classify...

Install

npx skills add luongnv89/asm --skill skill-shortener -g -a claude-code -y
Repository
luongnv89/asm962
Category
Engineering
Updated
3d ago
License
MIT
Context cost
Mediumabout 3,000 tokens
Runs scripts
Yes, review before use

What it does

Refactor a too-long SKILL.md by progressive disclosure: measure token cost, classify every section KEEP/CUT/MOVE, shorten the body into references/ and scripts/, verify nothing was lost. Don't use for authoring new skills, eval retrofits, or prose.

Skill Shortener

Shrink an over-long SKILL.md by progressive disclosure: what the agent needs on every activation stays in the body, everything else moves behind a pointer that says when to load it, or is cut outright.

Three load layers decide where a piece of content belongs:

LayerHoldsCosts
always-loadedfrontmatter name + descriptionevery turn
on-triggerthe SKILL.md bodyevery activation
on-demandreferences/, scripts/, assets/only when read

The bar is behavior-preserving: the shortened skill drives the same process as the long one. Line count is the score, not the goal, a run that reaches 400 lines by deleting a loop's stop condition has failed, however good the number looks.

Two modes

Pick one before Phase 0; they diverge at Phase 2.

  • Mode 1, shorten (default). Phases 0, 4: measure, classify, plan, apply on approval, verify. Every "shorten this", "this SKILL.md is too long", "cut its token cost", "apply progressive disclosure" request is Mode 1.
  • Mode 2, audit only. Phases 0, 2, then stop and hand over the plan. Nothing outside the workdir is written, so the repo sync and snapshot in Phase 0 are skipped. Use when the user wants to know what would move, or will apply the split themselves.

Run variables

Every snippet below uses these four. Bash tool calls do not share shell state, so re-declare them at the top of each call that needs them, an empty $SKILL_PATH turns cp -R "$SKILL_PATH/." into a copy of the filesystem root. Capture RUN_EPOCH once and reuse the number; never re-stamp it.

Read the whole SKILL.md on GitHub

More in Engineering