askill
optimizing-instructions

optimizing-instructionsSafety 95Repository

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".

4 stars
1.2k downloads
Updated 3/15/2026

Package Files

Loading files...
SKILL.md

Instruction Optimizer

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

Inputs

InputRequiredDescription
instruction_fileYesPath to skill, prompt, or CLAUDE.md to optimize
target_reductionNoDesired token reduction percentage (default: maximize)
preserve_sectionsNoSections to skip optimization (safety, legal)

Outputs

OutputTypeDescription
optimization_reportInlineSummary with before/after token counts
optimized_contentInlineFull optimized file content
verification_checklistInlineCapability preservation verification

Declarative Principles

PrincipleApplication
Semantic deduplicationSame meaning stated N times -> state once
Example consolidationMultiple examples of same pattern -> one with variants noted
Verbose phrase elimination"In order to" -> "To"; "It is important to note that" -> [delete]
Section collapseOverlapping sections -> merge under single heading
Implicit context removalObvious-from-title content -> delete
Conditional flatteningNested 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

  1. Read file completely
  2. Estimate tokens (words * 1.3)
  3. Identify safety-critical sections (skip these)
  4. Apply compression patterns
  5. Draft optimized version
  6. Verify capability preservation
  7. Calculate savings, present diff

Large File Strategy (>500 lines)

For files exceeding 500 lines, use parallelization:

  1. Split into sections: Identify logical boundaries (phases, categories)
  2. Dispatch parallel subagents: Each analyzes one section for compression opportunities
    Task: "Analyze lines 1-200 of [file] for compression. Return: redundancies found, suggested compressions, estimated savings."
    Task: "Analyze lines 201-400 of [file] for compression. Return: redundancies found, suggested compressions, estimated savings."
    
  3. Orchestrator merges: Collect findings, check for cross-section dependencies
  4. Resolve conflicts: If Section A references Section B's content, coordinate changes
  5. Apply atomically: Make all changes in single edit to maintain consistency

Verification Protocol

Before declaring optimization complete, verify NO capability loss:

  1. Identify 3 representative use cases from original instructions
  2. Mentally trace each use case through the optimized instructions
  3. Compare: Does optimized produce equivalent behavior?
Use CaseOriginal Handles?Optimized Handles?Status
[Case 1]Yes?
[Case 2]Yes?
[Case 3]Yes?

If ANY use case degrades: revert that specific optimization.

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.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/24/2026

High-quality, comprehensive skill for optimizing LLM instruction files. Well-structured with clear triggers, detailed process steps, concrete compression patterns, verification protocol, and explicit safety guardrails. Not tied to any specific repository - applies universally to skill/prompt/CLAUDE.md optimization. The use of tables, boxed sections, and consistent formatting makes it highly readable and actionable."

95
95
90
95
95

Metadata

Licenseunknown
Version1.0.0
Updated3/15/2026
Publisheraxiomantic

Tags

llmprompting