caveman-compress
Trigger: /caveman:compress <filepath>, compress memory file. Compress prose files while preserving technical content and backups.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-15
- Stars
- ★ 3
- Forks
- 0
01 前言 Front Matter
- name
- caveman-compress
- license
- Apache-2.0
- metadata
- { "author": "manuel-retamozo-garcia", "version": "1.0" }
- description
- Trigger: /caveman:compress <filepath>, compress memory file. Compress prose files while preserving technical content and backups.
02 资源文件 10
- 参考文档README.md5.1 KB
- 脚本scripts/__init__.py224 B
- 脚本scripts/__main__.py30 B
- 脚本scripts/benchmark.py2.2 KB
- 脚本scripts/cli.py1.6 KB
- 脚本scripts/compress.py6.8 KB
- 脚本scripts/detect.py4.1 KB
- 脚本scripts/test_caveman.py5.2 KB
- 脚本scripts/validate.py4.9 KB
- 参考文档SECURITY.md1.5 KB
03 SKILL.md 正文
Activation Contract
Load only when the user explicitly asks to compress a natural-language file or invokes /caveman:compress <filepath>.
Hard Rules
- Compress only prose files:
.md,.txt, or extensionless memory files. - Never compress source, config, lock, env, SQL, shell, HTML, XML, JSON, YAML, TOML, CSS, or generated files.
- Preserve exactly: fenced code blocks, inline code, URLs, markdown links, file paths, commands, technical names, proper nouns, dates, versions, numbers, and frontmatter.
- Preserve markdown heading text, list nesting, table structure, and numbering.
- Back up the original beside the file as
<filename>.original.mdbefore overwriting. - Never compress an
.original.mdbackup. - If unsure whether text is code or prose, leave it unchanged.
Decision Gates
| Condition | Action |
|---|---|
| Supported prose file | Compress prose outside protected regions. |
| Unsupported file type | Stop and report unsupported file. |
Existing .original.md target |
Stop unless user explicitly confirms overwrite. |
| Validation fails | Report failure; leave original untouched. |
Execution Steps
- Resolve the target path from the user command.
- Validate file type and backup path.
- Prefer the local script in
skills/caveman-compress/scripts/when available: runpython -m scripts <absolute_filepath>fromskills/caveman-compress. - Compress by removing filler, hedging, pleasantries, redundant phrasing, and duplicate examples.
- Validate protected regions stayed byte-identical before writing.
Output Contract
Return the target path, backup path, compression status, and any validation failures.
References
README.md- usage details and examples.SECURITY.md- safety model for subprocess and file I/O.
04 同仓库更多 Skills
work-unit-commits
Plan commits as reviewable work units. Trigger: implementation, commit splitting, chained PRs, or keeping tests and docs with code.
stack-webmcp
Trigger: WebMCP, document.modelContext, web tools, AI browser agent. Web Model Context Protocol client-side tool standard.
stack-vite
Vite frontend build tool — configuration, plugins, asset loading
stack-starlight
Astro Starlight documentation framework — setup, sidebar navigation, frontmatter, built-in components, asides, theming, i18n, search
stack-sqlserver
Microsoft SQL Server database — indexing, RCSI, set-based operations, SARGable queries, transaction scopes
stack-springboot
Spring Boot architecture patterns — REST API design, layered services, JPA, caching, Spring Security, TDD with MockMvc and Testcontainers, and pre-release verification