eli5-compress
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseELI5 Compress
ELI5 压缩
Purpose
用途
Compress natural language files (CLAUDE.md, todos, preferences) into plain, simple language to reduce input tokens. Simplifies and shrinks — not just truncation. Compressed version overwrites original. Human-readable backup saved as .
<filename>.original.md将自然语言文件(CLAUDE.md、待办事项、偏好设置)压缩为直白简洁的语言,减少输入token。进行简化和压缩——而非仅仅截断。压缩版本会覆盖原文件,可读的备份文件将保存为。
<filename>.original.mdTrigger
触发方式
/eli5-compress <filepath>/eli5-compress <filepath>Process
流程
-
This SKILL.md lives alongsidein the same directory. Find that directory.
scripts/ -
Run:
cd <directory_containing_this_SKILL.md> && python3 -m scripts <absolute_filepath> -
The CLI will:
- detect file type (no tokens)
- call Claude to simplify and compress
- validate output (no tokens)
- if errors: cherry-pick fix with Claude (targeted fixes only, no recompression)
- retry up to 2 times
-
Return result to user
-
本SKILL.md与目录位于同一层级,请找到该目录。
scripts/ -
运行:
cd <directory_containing_this_SKILL.md> && python3 -m scripts <absolute_filepath> -
命令行工具(CLI)会:
- 检测文件类型(不消耗token)
- 调用Claude进行简化和压缩
- 验证输出结果(不消耗token)
- 若出现错误:使用Claude进行针对性修复(仅执行定向修复,不重新压缩)
- 最多重试2次
-
向用户返回处理结果
Compression Rules
压缩规则
Remove
移除内容
- 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"
- Overly formal language: "ensure that" → "make sure", "utilize" → "use"
- Connective fluff: "however", "furthermore", "additionally", "in addition"
- 填充词:just、really、basically、actually、simply、essentially、generally
- 客套语:"sure"、"certainly"、"of course"、"happy to"、"I'd recommend"
- 模糊表述:"it might be worth"、"you could consider"、"it would be good to"
- 冗余措辞:"in order to" → "to"、"make sure to" → "ensure"、"the reason is because" → "because"
- 过于正式的语言:"ensure that" → "make sure"、"utilize" → "use"
- 冗余连接词:"however"、"furthermore"、"additionally"、"in addition"
Simplify
简化内容
- Rewrite jargon-heavy sentences into plain equivalents
- Use everyday words where possible
- Keep meaning intact — just say it more simply
- 将专业术语密集的句子改写为直白易懂的表达
- 尽可能使用日常词汇
- 保留原意——只是用更简单的方式表述
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
- 代码块(```包裹和缩进的内容)
- 行内代码()
反引号包裹的内容 - URL和链接(完整URL、Markdown链接)
- 文件路径(、
/src/components/...)./config.yaml - 命令(、
npm install、git commit)docker build - 技术术语(库名称、API名称、协议、算法)
- 专有名词(项目名称、人物、公司)
- 日期、版本号、数值
- 环境变量(、
$HOME)NODE_ENV
Preserve Structure
保留结构
- All markdown headings (keep exact heading text, simplify body below)
- Bullet point hierarchy (keep nesting level)
- Numbered lists (keep numbering)
- Tables (simplify cell text, keep structure)
- Frontmatter/YAML headers in markdown files
- 所有Markdown标题(保留标题原文,简化下方正文)
- 项目符号层级(保留嵌套级别)
- 编号列表(保留编号)
- 表格(简化单元格文本,保留结构)
- Markdown文件中的Frontmatter/YAML头部
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
- 使用简短同义词:用"big"而非"extensive",用"fix"而非"implement a solution for",用"use"而非"utilize"
- 允许使用短句:如“Run tests before commit”而非“You should always run tests before committing”
- 删除“you should”、“make sure to”、“remember to”等表述——直接说明操作
- 合并表述相同但方式不同的冗余项目符号
- 若多个示例展示同一模式,仅保留一个示例
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.
Simplified:
Run tests before pushing to main. Catches bugs early and stops broken builds from reaching production.
Original:
Ensure that database connection pooling is configured with appropriate timeout parameters to prevent resource exhaustion under high concurrency scenarios.
Simplified:
Set up database connection pool with good timeouts so it doesn't run out of connections when busy.
...- 删除注释
- 修改空格
- 调整行顺序
- 缩短命令
- 简化任何内容
行内代码()必须完全保留,绝不修改反引号内的任何内容。
...若文件包含代码块:
- 将代码块视为只读区域
- 仅压缩代码块外的文本
- 不要合并代码块周围的段落
Boundaries
示例
- ONLY compress natural language files (.md, .txt, .markdown, .rst, 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)
原文:
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.
简化后:
推送变更至主分支前运行测试套件。提前发现bug,避免损坏的构建版本部署到生产环境。
原文:
Ensure that database connection pooling is configured with appropriate timeout parameters to prevent resource exhaustion under high concurrency scenarios.
简化后:
为数据库连接池配置合适的超时参数,避免高并发场景下资源耗尽。
—
适用边界
—
- 仅压缩自然语言文件(.md、.txt、.markdown、.rst、无扩展名文件)
- 绝不修改:.py、.js、.ts、.json、.yaml、.yml、.toml、.env、.lock、.css、.html、.xml、.sql、.sh
- 若文件包含混合内容(散文+代码),仅压缩散文部分
- 若不确定内容是代码还是散文,保持原样
- 原文件在被覆盖前会备份为FILE.original.md
- 绝不压缩FILE.original.md(跳过该文件)