Caveman Compress
Purpose
Compress natural language files (CLAUDE.md, todos, preferences) into caveman-speak to reduce input tokens. Compressed version overwrites original. Human-readable backup saved as <filename>.original.md.
Trigger
/caveman-compress <filepath> or when user asks to compress a memory file.
Process
The compression scripts live in scripts/ (adjacent to this SKILL.md). If the path is not immediately available, search for scripts/__main__.py next to this SKILL.md.
From the directory containing this SKILL.md, run:
python3 -m scripts
- The CLI will:
- detect file type (no tokens)
- call Claude to compress
- validate output (no tokens)
- if errors: cherry-pick fix with Claude (targeted fixes only, no recompression)
- retry up to 2 times
- if still failing after 2 retries: report error to user, leave original file untouched
- Return result to user
Compression Rules
Remove
- Articles: a, an, the
- Filler: just, really, basically, actually, simply, essentially, generally
- Pleasantries: "sure", "certainly", "of course", "happy to", "I'd recommend"
- Hedging: "it might be worth", "you could consider", "it would be good to"
- Redundant phrasing: "in order to" → "to", "make sure to" → "ensure", "the reason is because" → "because"
- Connective fluff: "however", "furthermore", "additionally", "in addition"
Preserve EXACTLY (never modify)
- Code blocks (fenced ``` and indented)
- Inline code (
backtick content)
- URLs and links (full URLs, markdown links)
- File paths (
/src/components/..., ./config.yaml)
- Commands (
npm install, git commit, docker build)
- Technical terms (library names, API names, protocols, algorithms)
- Proper nouns (project names, people, companies)
- Dates, version numbers, numeric values
- Environment variables (
$HOME, NODE_ENV)
Preserve Structure
- All markdown headings (keep exact heading text, compress body below)
- Bullet point hierarchy (keep nesting level)
- Numbered lists (keep numbering)
- Tables (compress cell text, keep structure)
- Frontmatter/YAML headers in markdown files
Compress
- Use short synonyms: "big" not "extensive", "fix" not "implement a solution for", "use" not "utilize"
- Fragments OK: "Run tests before commit" not "You should always run tests before committing"
- Drop "you should", "make sure to", "remember to" — just state the action
- Merge redundant bullets that say the same thing differently
- Keep one example where multiple examples show the same pattern
CRITICAL RULE:
Anything inside ... must be copied EXACTLY.
Do not:
- remove comments
- remove spacing
- reorder lines
- shorten commands
- simplify anything
Inline code (...) must be preserved EXACTLY.
Do not modify anything inside backticks.
If file contains code blocks:
- Treat code blocks as read-only regions
- Only compress text outside them
- Do not merge sections around code
Pattern
Original:
You should always make sure to run the test suite before pushing any changes to the main branch. This is important because it helps catch bugs early and prevents broken builds from being deployed to production.
Compressed:
Run tests before push to main. Catch bugs early, prevent broken prod deploys.
Original:
The application uses a microservices architecture with the following components. The API gateway handles all incoming requests and routes them to the appropriate service. The authentication service is responsible for managing user sessions and JWT tokens.
Compressed:
Microservices architecture. API gateway route all requests to services. Auth service manage user sessions + JWT tokens.
Boundaries
- ONLY compress natural language files (.md, .txt, .typ, .typst, .tex, extensionless)
- NEVER modify: .py, .js, .ts, .json, .yaml, .yml, .toml, .env, .lock, .css, .html, .xml, .sql, .sh
- If file has mixed content (prose + code), compress ONLY the prose sections
- If unsure whether something is code or prose, leave it unchanged
- Original file is backed up as FILE.original.md before overwriting
- Never compress FILE.original.md (skip it)
Output Report
After all main skill tasks complete, write a propose draft to the wiki.
Steps
1. Build the filename:
- Format:
DDMMYY-<ten>.md
DDMMYY = today (e.g., 020626 for 2 June 2026)
<ten> = 2–4 kebab-case words summarising what was done (e.g., landing-page-coteccons, brand-kit-fintech, ingest-auth-spec)
2. Write llmwiki/wiki/draft/cave/DDMMYY-<ten>.md:
# DDMMYY-<ten>
**Type:** draft
**Status:** proposed
**Tags:** <skill-name>, output-report
**Proposed:** YYYY-MM-DD
## What
<One sentence — what this skill invocation produced or decided>
## Output
<Key artefacts, files created/modified, or decisions made>
## Files
| File | Action |
|------|--------|
| `path/to/file` | created / modified |
## Notes
- Invoked via: `/<skill-name>` skill
## Origin
- **Draft:** `wiki/draft/cave/DDMMYY-<ten>.md`
- **Commit:** _(filled by verify-before-commit)_
- **Date promoted:** _(filled by verify-before-commit)_
3. Update wiki index & log:
llmwiki/wiki/index.md — append one row: | [DDMMYY-<ten>](draft/cave/DDMMYY-<ten>.md) | draft | YYYY-MM-DD |
llmwiki/wiki/log.md — append: ## YYYY-MM-DD — <skill-name> — <ten>
Skip only when the skill produces zero artefacts and zero decisions (e.g., a pure display mode like /caveman-stats).
1---2name: caveman-compress3description: Compress natural language memory files (CLAUDE.md, todos, preferences) into caveman format to save input tokens. Preserves all technical substance, code, URLs, and structure. Compressed version overwrites the original file. Human-readable backup saved as FILE.original.md. Trigger: /caveman-compress FILEPATH or "compress memory file"4---56# Caveman Compress78## Purpose910Compress natural language files (CLAUDE.md, todos, preferences) into caveman-speak to reduce input tokens. Compressed version overwrites original. Human-readable backup saved as `<filename>.original.md`.1112## Trigger1314`/caveman-compress <filepath>` or when user asks to compress a memory file.1516## Process17181. The compression scripts live in `scripts/` (adjacent to this SKILL.md). If the path is not immediately available, search for `scripts/__main__.py` next to this SKILL.md.19202. From the directory containing this SKILL.md, run:2122python3 -m scripts <absolute_filepath>23243. The CLI will:25- detect file type (no tokens)26- call Claude to compress27- validate output (no tokens)28- if errors: cherry-pick fix with Claude (targeted fixes only, no recompression)29- retry up to 2 times30- if still failing after 2 retries: report error to user, leave original file untouched31324. Return result to user3334## Compression Rules3536### Remove37- Articles: a, an, the38- Filler: just, really, basically, actually, simply, essentially, generally39- Pleasantries: "sure", "certainly", "of course", "happy to", "I'd recommend"40- Hedging: "it might be worth", "you could consider", "it would be good to"41- Redundant phrasing: "in order to" → "to", "make sure to" → "ensure", "the reason is because" → "because"42- Connective fluff: "however", "furthermore", "additionally", "in addition"4344### Preserve EXACTLY (never modify)45- Code blocks (fenced ``` and indented)46- Inline code (`backtick content`)47- URLs and links (full URLs, markdown links)48- File paths (`/src/components/...`, `./config.yaml`)49- Commands (`npm install`, `git commit`, `docker build`)50- Technical terms (library names, API names, protocols, algorithms)51- Proper nouns (project names, people, companies)52- Dates, version numbers, numeric values53- Environment variables (`$HOME`, `NODE_ENV`)5455### Preserve Structure56- All markdown headings (keep exact heading text, compress body below)57- Bullet point hierarchy (keep nesting level)58- Numbered lists (keep numbering)59- Tables (compress cell text, keep structure)60- Frontmatter/YAML headers in markdown files6162### Compress63- Use short synonyms: "big" not "extensive", "fix" not "implement a solution for", "use" not "utilize"64- Fragments OK: "Run tests before commit" not "You should always run tests before committing"65- Drop "you should", "make sure to", "remember to" — just state the action66- Merge redundant bullets that say the same thing differently67- Keep one example where multiple examples show the same pattern6869CRITICAL RULE:70Anything inside ``` ... ``` must be copied EXACTLY.71Do not:72- remove comments73- remove spacing74- reorder lines75- shorten commands76- simplify anything7778Inline code (`...`) must be preserved EXACTLY.79Do not modify anything inside backticks.8081If file contains code blocks:82- Treat code blocks as read-only regions83- Only compress text outside them84- Do not merge sections around code8586## Pattern8788Original:89> You should always make sure to run the test suite before pushing any changes to the main branch. This is important because it helps catch bugs early and prevents broken builds from being deployed to production.9091Compressed:92> Run tests before push to main. Catch bugs early, prevent broken prod deploys.9394Original:95> The application uses a microservices architecture with the following components. The API gateway handles all incoming requests and routes them to the appropriate service. The authentication service is responsible for managing user sessions and JWT tokens.9697Compressed:98> Microservices architecture. API gateway route all requests to services. Auth service manage user sessions + JWT tokens.99100## Boundaries101102- ONLY compress natural language files (.md, .txt, .typ, .typst, .tex, extensionless)103- NEVER modify: .py, .js, .ts, .json, .yaml, .yml, .toml, .env, .lock, .css, .html, .xml, .sql, .sh104- If file has mixed content (prose + code), compress ONLY the prose sections105- If unsure whether something is code or prose, leave it unchanged106- Original file is backed up as FILE.original.md before overwriting107- Never compress FILE.original.md (skip it)108109---110111## Output Report112113After all main skill tasks complete, write a propose draft to the wiki.114115### Steps116117**1. Build the filename:**118- Format: `DDMMYY-<ten>.md`119- `DDMMYY` = today (e.g., `020626` for 2 June 2026)120- `<ten>` = 2–4 kebab-case words summarising what was done (e.g., `landing-page-coteccons`, `brand-kit-fintech`, `ingest-auth-spec`)121122**2. Write** `llmwiki/wiki/draft/cave/DDMMYY-<ten>.md`:123124```125# DDMMYY-<ten>126**Type:** draft127**Status:** proposed128**Tags:** <skill-name>, output-report129**Proposed:** YYYY-MM-DD130131## What132<One sentence — what this skill invocation produced or decided>133134## Output135<Key artefacts, files created/modified, or decisions made>136137## Files138| File | Action |139|------|--------|140| `path/to/file` | created / modified |141142## Notes143- Invoked via: `/<skill-name>` skill144145## Origin146- **Draft:** `wiki/draft/cave/DDMMYY-<ten>.md`147- **Commit:** _(filled by verify-before-commit)_148- **Date promoted:** _(filled by verify-before-commit)_149```150151**3. Update wiki index & log:**152- `llmwiki/wiki/index.md` — append one row: `| [DDMMYY-<ten>](draft/cave/DDMMYY-<ten>.md) | draft | YYYY-MM-DD |`153- `llmwiki/wiki/log.md` — append: `## YYYY-MM-DD — <skill-name> — <ten>`154155> Skip only when the skill produces zero artefacts and zero decisions (e.g., a pure display mode like `/caveman-stats`).