Refactor skills
skill dump
npx -y skills add usrrname/agent-skills --skill refactor-skillsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Reviews the markdown and template files changed in the current session and tightens them for agent performance — sharper trigger descriptions, progressive disclosure, imperative voice, one-claim-per-bullet, fewer redundant rules — while preserving every workflow step, constraint, and trigger condition. Use when the user has just edited one or more skill or prompt files (`SKILL.md`, `references/*.md`, `recipes/*.md`, agent templates, slash-command prompts) and wants a tightening pass before committing, or invokes "/refactor-skills", "refactor this skill", "tighten the skill", "polish SKILL.md", "make this skill leaner". Behaviour-preserving only — never use this to add features, expand scope, or remove rules.
SKILL.md
4.9 KB, as published. Nobody here has run it
Refactor Skills — agent performance ↑, behaviour =
Tightens the markdown / template / skill files touched in the current session. Every edit must make the file cheaper or clearer for an agent to load and act on, without changing what the skill does.
Inputs
- Default: every uncommitted
.md,.tmpl,.txt, and.promptfile under.claude/,~/.claude/,docs/, or any path the session has been editing. Discover withgit status --porcelainplus the Edit/Write tool history of the current conversation. - If the user names specific files or a directory, restrict to those.
- Skip files outside
.claude/,docs/, or the user-specified scope; this skill is not a general prose editor.
Agent-performance heuristics
Apply in this order. Each is a no-behaviour-change edit:
- Sharper trigger description. The frontmatter
descriptionis the only thing the harness sees when ranking skills. Lead with the capability in 1 sentence; follow with "Use when …" listing concrete phrases the user actually says. Drop hedging ("might be helpful for …") and synonyms that add no discoverability. Keep ≤ 1024 chars. - Progressive disclosure.
SKILL.mdstays under 100 lines. Anything longer, domain-heavy, or rarely needed → move toreferences/<topic>.mdand link from SKILL.md. The agent only loads SKILL.md by default. - Imperative voice. "Run X" > "You should run X" > "It is recommended to run X". Cut auxiliaries.
- Concrete over abstract. Replace "use appropriate tools" with the actual tool name; replace placeholder code with code that runs.
- One claim per bullet. Split bullets that say "do A and B and C" — the agent skims faster and misses less.
- Cut dead weight. Repeated rules, restated context, "let me know if you need anything else", filler intros — gone.
- Co-locate constraints. Rules buried in a trailing "Notes" section get missed. Move them next to the step they constrain.
- Examples match the description. If the description claims "use when X", an example must contain X verbatim.
What you must NOT change
These are behaviour. Touching them changes what the skill does:
- The set of workflow steps (rename or reorder for clarity, but never drop, add, or merge).
- Any explicit
must/do not/neverrule — the user codified those deliberately. - The
allowed-tools:list in frontmatter. - Required artefact paths, file naming conventions, output formats.
- Trigger scope in the description (sharpen wording, never narrow or broaden which situations match).
- Examples that document edge cases — those are tests of the description's contract.
If unsure whether a change is performance or behaviour, ask the user before applying.
Workflow
- Inventory.
git status --porcelain+ the Edit/Write tool history. List candidate files with line counts. Filter to.md/.tmpl/.promptunder in-scope paths. - Read each file in full. Note its frontmatter purpose and structural divisions.
- Per-file diff plan. For each file, list heuristic violations as
heuristic → location → proposed change. One bullet per violation. Do not write the rewrite yet. - Confirm with the user. Show the diff plan; ask whether any item crosses the behaviour line. Wait for approval before any edit.
- Apply via Edit. Use the Edit tool, not Write — minimal diffs are reviewable; full rewrites hide regressions.
- Verify behaviour preserved. Re-read each file end-to-end. Workflow steps, rules, allowed-tools, and trigger conditions must read the same.
- Report. Per file:
<path>: <before> → <after> lines. Key wins: <2-3 bullets>.
Final assistant-message summary
Refactored N file(s).
- <path>: <before> → <after> lines. <one-line headline change>
- <path>: <before> → <after> lines. <one-line headline change>
Behaviour preserved: workflow steps, rules, allowed-tools, triggers unchanged.
If any file was left untouched (already tight, or change would cross the behaviour line), say so explicitly with the reason.
Gives 0 of the 12 instructions most refactoring skills give
Counted across 521 of the 525 authors here whose files we hold, read 2026-08-06
- run tests after each changein 59 of 521, across 56 files
- write tests before refactoringin 27 of 521, across 24 files
- preserve external behaviorin 26 of 521, across 22 files
- remove dead codein 25 of 521, across 24 files
- make small incremental changesin 20 of 521, across 17 files
- break the implementation into tiny commitsin 18 of 521, across 5 files
- ask the user about alternative optionsin 17 of 521, across 4 files
- create a GitHub issue with the planin 17 of 521, across 4 files
- explore the repository to verify assertionsin 17 of 521, across 4 files
- interview the user about the refactorin 16 of 521, across 3 files
- check the codebase for test coveragein 16 of 521, across 3 files
- refactor one thing at a timein 16 of 521, across 12 files
Said here and by no other author read
- Inventory uncommitted session files
- Create a per-file diff plan
- Confirm the diff plan with the user
- Verify behaviour preservation end-to-end
- Lead description with capability and usage
- Keep SKILL.md under 100 lines
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.