Pre-run prompt compression for iterative AI dev loops.
Goal: reduce input tokens every iteration by compressing prompt files before your loop runs.
Works with Ralph-style loops, agent/skill directories, and most token-billed providers.
Runs as a local script (no model calls).
Creates .bak backups and supports instant undo.
What it installs into a repo
trinity-compress.config.json — rules + targets
scripts/trinity-compress.sh — compression script
Makefile snippet (optional): optimize-prompts, optimize-undo, etc.
.gitignore snippet: ignore *.bak
Installers:
scripts/install.ps1 (Windows)
scripts/install.sh (bash)
Requirements
bash 4+
jq
bc
Use
Install into your repo (copy assets or use the included installer scripts)
Run:
bash scripts/trinity-compress.sh balanced
or via Makefile target
Undo
Restores all *.bak backups from the last run.
Notes
This tool does not rewrite code blocks, URLs, file paths, or variable names.
Aggressive mode may reduce clarity; review before committing.
1---2name: compression3description: Trinity Compress (Skill)4---5# Trinity Compress (Skill)67Pre-run prompt compression for iterative AI dev loops.89**Goal:** reduce input tokens every iteration by compressing prompt files *before* your loop runs.1011- Works with Ralph-style loops, agent/skill directories, and most token-billed providers.12- Runs as a **local script** (no model calls).13- Creates **.bak** backups and supports instant undo.1415## What it installs into a repo16- `trinity-compress.config.json` — rules + targets17- `scripts/trinity-compress.sh` — compression script18- Makefile snippet (optional): `optimize-prompts`, `optimize-undo`, etc.19- `.gitignore` snippet: ignore `*.bak`20- Installers:21 - `scripts/install.ps1` (Windows)22 - `scripts/install.sh` (bash)2324## Requirements25- bash 4+26- `jq`27- `bc`2829## Use301) Install into your repo (copy assets or use the included installer scripts)312) Run:32 - `bash scripts/trinity-compress.sh balanced`33 - or via Makefile target3435## Undo36- Restores all `*.bak` backups from the last run.3738## Notes39- This tool does not rewrite code blocks, URLs, file paths, or variable names.40- Aggressive mode may reduce clarity; review before committing.
Run npx skillmds@latest add javimosch/compression in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Trinity Compress (Skill) It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
javimosch (@javimosch) published this skill. Their other Agent Skills are listed on their SkillMD profile.