markdown-compressor/skills/markdown-compression/SKILL.md
This skill should be used when the user asks to 'compress markdown', 'shrink this file', 'optimize tokens', 'reduce file size', 'compress instructions', 'make this more concise', 'minimize this prompt', 'compress CLAUDE.md', 'compress ARCHITECTURE.md', 'optimize agent instructions', or wants to reduce token usage in LLM-facing markdown files. Covers lossless structural optimization and lossy semantic compression with section-by-section analysis.
npx skillsauth add oborchers/fractional-cto markdown-compressionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Markdown compression reduces token consumption in LLM-facing documentation — agent instructions, CLAUDE.md files, ARCHITECTURE.md files, system prompts, and skill definitions — while preserving the information an LLM needs to operate correctly.
Two modes address different risk tolerances:
| Mode | What Changes | Risk | Best For | |------|-------------|------|----------| | Lossless | Structure only — whitespace, formatting, redundant syntax | Zero semantic change | Safe first pass on any file | | Lossy | Semantics — rewriting for density, removing filler, consolidating | Information loss possible | Deep compression with review |
Section-by-section compression with user approval at each step is the recommended workflow. The /markdown-compressor:compress command provides a guided session; the skill also activates when compression-related work is detected mid-conversation.
LLM instructions are not prose for humans. Compression targets what LLMs ignore or process redundantly:
Always safe to remove:
Never remove:
Judgment required:
Lossless compression changes structure without altering semantics. Apply these transformations:
For detailed lossless transformation rules and before/after examples, consult references/lossless-techniques.md.
Lossy compression rewrites for semantic density. Apply the compressor-reviewer loop per section:
For each section:
The reviewer specifically checks for:
For detailed lossy techniques and worked examples, consult references/lossy-techniques.md.
Before compressing, analyze the file structure to determine section boundaries and identify problem areas:
## for most files, ### if ## sections are very largePresent the structural analysis as a table to the user before beginning compression. This gives the user a map of the document and sets expectations for where the biggest savings will come from.
After compression, report a summary so the user can assess the impact:
The words * 1.3 heuristic estimates tokens for typical English markdown. Actual token counts depend on the model's tokenizer, but relative reduction percentages are reliable for comparison.
For detailed techniques and patterns, consult:
references/lossless-techniques.md — Complete lossless transformation catalog with before/after examplesreferences/lossy-techniques.md — Lossy compression patterns, judgment heuristics, and information-density techniquesWorked compression sessions in examples/:
examples/before-after-lossless.md — CLAUDE.md file compressed with lossless modeexamples/before-after-lossy.md — Agent instruction file compressed with lossy modetools
This skill should be used when the user invokes any /plan-* command from the planning-tools plugin (/plan-context, /plan-master, /plan-open-questions, /plan-verify, /plan-tick, /plan-progress, /plan-delete), asks how Claude Code's plan files work, asks where plans are stored, asks to author or audit a multi-phase master planning document, asks how to walk through a plan's Open Questions interactively, asks how to write progress entries, or mentions ~/.claude/plans/ or .claude/planning-tools.local.md. Provides the index of planning-tools commands, the master-plan workflow lifecycle, the v0.3.0+ list-shape mandate (phases and questions as headings + bulleted scope items, never tables), the v0.3.2+ plain-bullet shape (no `- [ ]` checkboxes — heading emoji is the sole tick signal), the progress-entry methodology, and the mechanics of Claude Code's plan-mode file storage.
testing
This skill should be used by the plan-verifier agent and the /plan-verify command to audit a drafted master plan against a fixed checklist. Covers universal-core completeness, the v0.3.0+ no-tables-for-phases-or-questions rule, trigger-based section-coverage gaps, phase actionability (heading + per-phase TL;DR + bulleted scope + exit criteria), the v0.3.1+ per-phase TL;DR requirement, the v0.3.2+ plain-bullet scope shape (legacy `- [ ]`/`- [x]` accepted silently), the v0.3.3+ context-block shape (plan-level `**TL;DR:**` + bulleted metadata, legacy `>` blockquote accepted silently), integer phase numbering enforcement, dependency traceability, citation resolution, callout/evidence convention compliance, Open Questions placement, and the one-PR-per-master-plan rule. Single-owner of the audit checklist.
tools
This skill should be used when authoring, reviewing, or modifying a multi-phase master planning document via the planning-tools plugin (especially the /plan-master and /plan-verify commands). Codifies the universal core sections, trigger-based optional sections, integer-only phase numbering, Open Questions placement, one-PR-per-plan rule, status conventions, evidence attribution, callouts, cross-reference formats, the v0.3.0 list-shape mandate (phases and questions are heading + bulleted list, never markdown tables), the v0.3.1 per-phase TL;DR requirement (1–3 sentence what/why summary under each phase heading for glance-ability), the v0.3.2 plain-bullet scope shape (`- <action>` items, no `- [ ]` checkboxes — the phase status emoji is the sole tick signal), and the v0.3.3 context-block shape (a plan-level `**TL;DR:**` + a bulleted metadata list instead of a `>` blockquote; legacy blockquote blocks accepted silently). Project-agnostic — no ticket-prefix or plan-type taxonomy.
testing
This skill should be used when the user is adjusting spacing, padding, margins, content density, section gaps, vertical rhythm, or separation between elements. Also applies when reviewing whether a design feels cramped or too sparse, choosing between borders and whitespace for separation, or defining a spacing system. Covers the 4px/8px spacing system, macro vs micro whitespace, content density spectrum, separation techniques (whitespace > background shifts > borders), and vertical rhythm.