11ai Compression
Overview
Use this skill to reduce token-heavy guidance files with local deterministic scripts. Compress prose only. Keep structure and technical artifacts stable enough that the result stays usable by humans and agents.
Workflow
- Confirm the file is natural-language guidance, not code or config.
- Run the local compressor.
- Validate preserved regions.
- Review the diff. Keep the compressed file only if meaning still holds.
Commands
Compress in place and keep a backup:
python3 ./scripts/compress_markdown.py path/to/file.md --in-place --backup
Preview to stdout:
python3 ./scripts/compress_markdown.py path/to/file.md
Validate a compressed file against its backup or source:
python3 ./scripts/validate_markdown.py path/to/original.md path/to/compressed.md
Preserve Exactly
- YAML frontmatter
- markdown headings
- fenced code blocks
- inline code
- markdown links and raw URLs
- file paths and commands
- list markers and numbered list structure
If unsure whether text is prose or technical content, leave it unchanged.
Compression Rules
- Drop filler, hedging, and repeated framing.
- Prefer short verbs and direct statements.
- Merge repeated ideas.
- Keep one example when many examples teach the same pattern.
- Compress paragraphs harder than commands or labels.
- Preserve meaning; do not rewrite the file into a different policy.
Safe Targets
SKILL.mdCLAUDE.md- prompt libraries
- runbooks
- checklists
- notes and instruction files
Avoid
- source code
- JSON, YAML, TOML,
.env, lockfiles - docs where exact prose is legally or contractually important
- files where headings or surrounding text are part of tests
Scripts
Use scripts/compress_markdown.py for local compression and scripts/validate_markdown.py for preservation checks.