instruction-optimizer
БесплатноБез исполняемых скриптовНе проверенUse when instruction files (skills, prompts, CLAUDE.md) are too long or need token reduction while preserving capability. Triggers: "optimize instructions"…
от majiayu000★ 31 звезда на GitHubОб этом скилле
Instruction Optimizer
Invariant Principles
- Smarter AND smaller - Compression that loses capability is regression, not optimization
- Evidence over claims - Show token counts before/after; verify no capability loss
- Unique value preservation - Deduplicate redundancy, keep distinct behaviors
- Clarity at critical points - Brevity yields to clarity for safety/compliance sections
Reasoning Schema
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) |
preserve_sections |
No | Sections to skip optimization (safety, legal) |
Outputs
| Output | Type | Description |
|---|---|---|
optimization_report |
Inline | Summary with before/after token counts |
optimized_content |
Inline | Full optimized file content |
verification_checklist |
Inline | Capability preservation verification |
Declarative Principles
| Principle | Application |
|---|---|
| Semantic deduplication | Same meaning stated N times -> state once |
| Example consolidation | Multiple examples of same pattern -> one with variants noted |
| Verbose phrase elimination | "In order to" -> "To"; "It is important to note that" -> [delete] |
| Section collapse | Overlapping sections -> merge under single heading |
| Implicit context removal | Obvious-from-title content -> delete |
| Conditional flattening | Nested if-chains -> single compound condition |
Compression Patterns
"In order to" -> "To"
"Make sure to" -> [delete]
"You should always" -> "Always"
"Prior to doing X" -> "Before X"
"In the event that" -> "If"
"Due to the fact that" -> "Because"
"At this point in time" -> "Now"
"For the purpose of" -> "To"
Process
- Read file completely
- Estimate tokens (words * 1.3)
- Identify safety-critical sections (skip these)
- Apply compression patterns
- Draft optimized version
- Verify capability preservation
- Calculate savings, present diff
Output Format
## Optimization Report: [filename]
### Summary
- Before: ~X tokens | After: ~Y tokens | Savings: Z (N%)
### Changes
1. [Technique]: [Description] (-N tokens)
### Verification
- [ ] Triggers preserved
- [ ] Edge cases handled
- [ ] Outputs specified
- [ ] Clarity maintained
### Optimized Content
[full content]
Skip Optimization When
- Already minimal (<500 tokens)
- Safety-critical content
- Legal/compliance requirements
- Recently written (let stabilize)
Self-Check
Before completing:
- Token count reduced (show numbers)
- All triggers from original still work
- All edge cases still handled
- No safety sections compressed
- Terminology consistent throughout
- Structured formats preserved exactly
If ANY unchecked: STOP and fix before presenting result.
Установить instruction-optimizer в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл instruction-optimizer?
Use when instruction files (skills, prompts, CLAUDE.md) are too long or need token reduction while preserving capability. Triggers: "optimize instructions", "reduce tokens", "compress skill", "make this shorter", "too verbose".
Как установить скилл instruction-optimizer?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл instruction-optimizer запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic