Compressing onboarding files
Instruction files load every session, so every saved token compounds. Compress
prose aggressively while never touching the technical payload - and never trading
away clarity where ambiguity is dangerous.
Announce at start: "Using compress-onboarding on at level ."
Usage: compress-onboarding <file> [--level off|lite|full|ultra]
Default file: the repo's AGENTS.md. Works under any SKILL.md-compatible runtime.
Levels (sticky per repo)
Resolve the level from --level if given, else .aiboarding/config.json: compression_level, else full. When --level is given, persist it back to
config.json - the level is a per-repo decision, not per-run.
off - no rewriting. Still run the size report (step 5) so bloat is visible.
lite - remove filler, pleasantries, hedging, and restatement. Full sentences
kept. ("In order to build the project, you should run…" → "To build, run…")
full (default) - additionally drop articles, compress to fragments and
short synonyms, allow X → Y notation. ("The dev server can be started with
npm run dev" → "Dev server: npm run dev.")
ultra - telegraphic; every non-load-bearing word goes. Only for repos
pressed against the 32 KiB Codex cap; confirm with the user before first use.
Byte-preservation invariants (hard guarantees)
Compression must NEVER alter: fenced code blocks (including the fence lines),
inline backtick spans, shell commands, URLs, file paths, identifiers and symbol
names, quoted error strings, <!-- aiboarding-* --> markers, YAML frontmatter, and
table structure. If a protected span is wrong, fixing it is an update, not a
compression - route it through update-agent-onboarding.
While rewriting, keep commands/identifiers/paths/error strings backtick-quoted (add
backticks where the source lacks them - adding protection is allowed; removing it
is not). The checker treats backtick spans as protected.
Auto-clarity exemptions
Never compress below full sentences, regardless of level:
Agent Guardrails and Escalation - Ask the User When sections: cap at lite.
A misread guardrail costs more than its tokens.
- Security warnings and destructive/irreversible-action instructions.
- Multi-step sequences where fragment order creates ambiguity ("migrate table drop
column backup first" - unclear; keep explicit ordering words).
Procedure
- Snapshot. Copy the target file to a temp path (
before).
- Compress section by section at the resolved level, honoring the invariants
and exemptions above.
- Verify. Run
.aiboarding/tools/check-preservation <before> <after> (fall
back to the plugin's templates/tools/check-preservation if not installed).
Fix every reported span and re-run until clean. Never hand-wave this step.
- Approval gate. Show the user a diff of the compressed file against the
original. Write only after approval.
- Receipt. Measure before/after: exact bytes and lines always; token counts
with a real tokenizer if one is available in the environment (e.g. Python
tiktoken), otherwise tokens_approx = bytes / 4, explicitly labeled
approximate. Append to .aiboarding/state.json:receipts (one object per line,
keeping the file hook-readable):{ "file": "AGENTS.md", "level": "full", "bytes_before": 8123, "bytes_after": 4310, "lines_before": 190, "lines_after": 121, "tokens_before_approx": 2031, "tokens_after_approx": 1078, "measured_at": "2026-07-02" }
Report the saving to the user; since the file loads every session, note the
per-session saving - never claim unlabeled exact token numbers without a real
tokenizer.
- Size check. Run
.aiboarding/tools/check-size-budget <file>; if it still
WARNs after full, suggest moving detail to .claude/rules/ or nested
AGENTS.md files rather than jumping to ultra.
Writing into shared files
When compression output must land inside a file that also has user-owned content
(e.g. a hand-written CLAUDE.md), write only within the aiboarding marker fence
via .aiboarding/tools/inject-fenced - re-runs stay idempotent and uninstall stays
clean.
Source: hashgraph-online/awesome-codex-plugins → plugins/gustavo-meilus/aiboarding/skills/compress-onboarding/SKILL.md
1---2name: compress-onboarding3description: Use to compress any agent-instruction file (AGENTS.md, CLAUDE.md, .claude/rules/*.md, legacy AIBOARDING.md) into terse, high-signal prose without altering commands, code, URLs, or paths. Standalone compression engine with levels (off/lite/full/ultra), byte-preservation verification, and token receipts. Also invoked by the create/update onboarding skills.4---567# Compressing onboarding files89Instruction files load **every session**, so every saved token compounds. Compress10prose aggressively while never touching the technical payload - and never trading11away clarity where ambiguity is dangerous.1213**Announce at start:** "Using compress-onboarding on <file> at level <level>."1415**Usage:** `compress-onboarding <file> [--level off|lite|full|ultra]`16Default file: the repo's `AGENTS.md`. Works under any SKILL.md-compatible runtime.1718## Levels (sticky per repo)19Resolve the level from `--level` if given, else `.aiboarding/config.json:20compression_level`, else `full`. When `--level` is given, persist it back to21`config.json` - the level is a per-repo decision, not per-run.2223- **`off`** - no rewriting. Still run the size report (step 5) so bloat is visible.24- **`lite`** - remove filler, pleasantries, hedging, and restatement. Full sentences25 kept. ("In order to build the project, you should run…" → "To build, run…")26- **`full`** (default) - additionally drop articles, compress to fragments and27 short synonyms, allow `X → Y` notation. ("The dev server can be started with28 `npm run dev`" → "Dev server: `npm run dev`.")29- **`ultra`** - telegraphic; every non-load-bearing word goes. Only for repos30 pressed against the 32 KiB Codex cap; confirm with the user before first use.3132## Byte-preservation invariants (hard guarantees)33Compression must NEVER alter: fenced code blocks (including the fence lines),34inline backtick spans, shell commands, URLs, file paths, identifiers and symbol35names, quoted error strings, `<!-- aiboarding-* -->` markers, YAML frontmatter, and36table structure. If a protected span is wrong, fixing it is an *update*, not a37compression - route it through `update-agent-onboarding`.3839While rewriting, keep commands/identifiers/paths/error strings backtick-quoted (add40backticks where the source lacks them - adding protection is allowed; removing it41is not). The checker treats backtick spans as protected.4243## Auto-clarity exemptions44Never compress below full sentences, regardless of level:45- `Agent Guardrails` and `Escalation - Ask the User When` sections: cap at `lite`.46 A misread guardrail costs more than its tokens.47- Security warnings and destructive/irreversible-action instructions.48- Multi-step sequences where fragment order creates ambiguity ("migrate table drop49 column backup first" - unclear; keep explicit ordering words).5051## Procedure521. **Snapshot.** Copy the target file to a temp path (`before`).532. **Compress** section by section at the resolved level, honoring the invariants54 and exemptions above.553. **Verify.** Run `.aiboarding/tools/check-preservation <before> <after>` (fall56 back to the plugin's `templates/tools/check-preservation` if not installed).57 Fix every reported span and re-run until clean. Never hand-wave this step.584. **Approval gate.** Show the user a diff of the compressed file against the59 original. Write only after approval.605. **Receipt.** Measure before/after: exact bytes and lines always; token counts61 with a real tokenizer if one is available in the environment (e.g. Python62 `tiktoken`), otherwise `tokens_approx = bytes / 4`, explicitly labeled63 approximate. Append to `.aiboarding/state.json:receipts` (one object per line,64 keeping the file hook-readable):65 ```json66 { "file": "AGENTS.md", "level": "full", "bytes_before": 8123, "bytes_after": 4310, "lines_before": 190, "lines_after": 121, "tokens_before_approx": 2031, "tokens_after_approx": 1078, "measured_at": "2026-07-02" }67 ```68 Report the saving to the user; since the file loads every session, note the69 per-session saving - never claim unlabeled exact token numbers without a real70 tokenizer.716. **Size check.** Run `.aiboarding/tools/check-size-budget <file>`; if it still72 WARNs after `full`, suggest moving detail to `.claude/rules/` or nested73 `AGENTS.md` files rather than jumping to `ultra`.7475## Writing into shared files76When compression output must land inside a file that also has user-owned content77(e.g. a hand-written `CLAUDE.md`), write only within the aiboarding marker fence78via `.aiboarding/tools/inject-fenced` - re-runs stay idempotent and uninstall stays79clean.8081---8283**Source:** [`hashgraph-online/awesome-codex-plugins`](https://github.com/hashgraph-online/awesome-codex-plugins) → `plugins/gustavo-meilus/aiboarding/skills/compress-onboarding/SKILL.md`