Optimizes markdown documents for token efficiency, clarity, and LLM consumption. Use when (1) a markdown file needs streamlining for use as LLM context, (2) reducing token count in documentation without losing meaning, (3) converting verbose docs into concise reference material, (4) improving structure and scannability of markdown files, or (5) preparing best-practices or knowledge docs for agent consumption.
Read, optimize, and rewrite markdown documents for token efficiency, structural clarity, and LLM parseability. The target file is provided as a file path argument.
$ARGUMENTS. If no path is provided, ask for oneOriginal: [N] lines → Optimized: [N] lines ([N]% reduction) Changes: [comma-separated list of key changes]
Evaluate each sentence for token value. Remove content that restates common knowledge, repeats itself, or adds no actionable value.
Remove decorative language. No "please note", "it's worth mentioning", "remember that", "importantly".
Eliminate filler transitions. "Additionally", "furthermore", "in other words", "as mentioned above".
Remove hedging. "Consider", "try to", "when possible", "generally speaking", "it depends".
| Technique | Apply When |
|---|---|
| Convert prose to tables | Comparing options, listing attributes, or mapping inputs to outputs |
| Convert prose to lists | Content contains discrete, parallel, independent items |
| Keep prose | Explaining relationships, conditional logic, or rationale |
| Merge sections | Multiple sections cover the same concept |
| Remove sections | Content restates framework docs or common knowledge |
Flatten unnecessary nesting. Collapse single-item subsections into their parent.
Place critical information first within each section. Most important content at the top.
End sections decisively. No trailing "etc.", "and so on", or "and more".
Remove filler words and passive voice:
Combine related statements:
Remove redundant qualifiers:
Use language-labeled code blocks. Never use unlabeled fences.
Use consistent heading hierarchy. No skipped levels (h2 -> h4).
Remove excessive emphasis. Bold only for hard constraints where violation causes failure. Limit to 10% of content.
Use one blank line between sections. Remove consecutive blank lines.
Standardize list markers within each list (all - or all *, not mixed).
Identify synonyms used for the same concept. Choose the most precise term and use it throughout.
Do not use for: