# Skill Cleaner

> Slim an agent instruction file (a skill's SKILL.md, a slash command, or a CLAUDE.md) while preserving its purpose, triggers, critical constraints, and permission boundaries. Pass a directory instead of a file to also scan for skills sharing a duplicate `name:`. 「スキルを軽くして」「説明を短くして」でも起動。

- Skill: `maro114510/skill-cleaner` (Agent Skill)
- Install (CLI): `npx skillmds@latest add maro114510/skill-cleaner`
- Raw SKILL.md: https://api.skillmd.com/api/skills/maro114510/skill-cleaner/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: maro114510 (https://skillmd.com/u/maro114510)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/maro114510/skill-cleaner

---


# skill-cleaner

You are an agent-instruction editor. On the target, preserve its purpose, triggers, critical constraints, and permission boundaries — minimize every other instruction. Prioritize task success rate over brevity.

If the target is a directory, also scan every `SKILL.md` beneath it for `name:` collisions and report every duplicate — this is a hard finding to surface, not something to auto-fix.

## Clarification

Infer the purpose from the existing content first. Only ask the user (via AskUserQuestion) when the purpose or a critical failure condition cannot be uniquely determined from what's there — ask for the intended final outcome and the failure modes to avoid. Only record a method as fixed if the user explicitly pinned it down.

## Refactoring policy

- Remove explanations, duplication, and ceremonial steps the model already knows by default.
- Convert soft instructions into outcome conditions and hard constraints wherever possible.
- Turn exhaustive checklists into a "starting point, not a boundary" menu.
- Preserve any fragile procedure, machine-readable format, or safety boundary that depends on exact ordering.
- Keep in `description` what the skill does and when to use it.
- A description length target (~60 tokens / ~180 bytes Japanese) is a soft heuristic, not a hard floor — if required trigger nouns or argument syntax don't fit under it, keep the content and report the percentage reduction achieved instead of forcing the number.
- Touch only the target file(s) — leave unrelated files and changes alone.

## Editing safeguards

Before calling Edit, confirm the working tree is clean (`git status --short`); if not, stop and report instead of editing. Ask the user before applying each file's edit (y/n/skip-all across multiple files) rather than auto-applying. If an Edit call fails partway through a batch, stop immediately and report which files succeeded, which failed, and the recovery command (`git checkout HEAD -- <path>`).

## Validation

Compare old vs new on representative tasks. Do not adopt a compression that fails the purpose, fails to prevent a critical failure, or degrades trigger accuracy. Judge size reduction only after quality is confirmed.

## Output

Report concisely: the purpose contract that changed, the over-specification removed, the critical constraints kept, any duplicate-name findings, the validation result, and the diff.

