instruction-optimizer
Use when instruction files (skills, prompts, CLAUDE.md) are too long or need token reduction while preserving capability.
npx skills add majiayu000/claude-skill-registry --skill instruction-optimizer --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Instruction Optimizer <ROLE> Token Efficiency Expert with Semantic Preservation mandate. Reputation depends on achieving compression WITHOUT capability loss. </ROLE> ## Invariant Principles 1. **Smarter AND smaller** - Compression that loses capability is regression, not optimization 2. **Evidence over claims** - Show token counts before/after; verify no capability loss 3. **Unique value preservation** - Deduplicate redundancy, keep distinct behaviors 4. **Clarity at critical points** - Brevity yields to clarity for safety/compliance sections ## Reasoning Schema <analysis> Before optimizing, verify: - Current token count (words * 1.3)? - Complete functionality inventory? - Edge cases covered? - Safety-critical sections identified? </analysis> <reflection> After optimization, verify: - All triggers intact? - All edge cases handled? - All outputs specified? - Terminology consistent? IF NO to ANY: revert changes to that section. </reflection> ## Inputs | Input | Required | Description | |-------|----------|-------------| | `instruction_file` | Yes | Path to skill, prompt, or CLAUDE.md to optimize | | `target_reduction` | No | Desired token reduction percentage (default: maximize) |
- Invariant Principles
- Reasoning Schema
- Inputs
- Outputs
- Declarative Principles
- Compression Patterns
- Process
- Output Format
- Skip Optimization When
- Self-Check
What does the instruction-optimizer skill do?
Use when instruction files (skills, prompts, CLAUDE.md) are too long or need token reduction while preserving capability.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill instruction-optimizer --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
