面向长文本场景的语义压缩工具,通过迭代验证与锚点校验机制,在保证关键信息完整的前提下大幅缩减Token占用。核心能力:,可自发提升工作效率. 适用于需要file compressor相关能力的开发场景,包含结构化的工作流程和可复用的模板,帮助用户快速完成任务并保持代码质量. 适用于需要file compressor相关能力的开发场景,包含结构化的工作流程和配置指引.
编程
Text Compressor
试用Compress and decompress text files using smart abbreviation and whitespace normalization. Use when user asks to compress, shrink, reduce, or optimize text fi...
它能做什么
Compress and decompress text files using smart abbreviation and whitespace normalization. Use when user asks to compress, shrink, reduce, or optimize text file size while preserving readability. Also use for batch text processing, file size reduction, or text cleanup.
技能文档
Text Compressor Skill
Compress text files using configurable levels of text abbreviation while keeping content readable.
Usage
Basic Compression
python scripts/compress.py [output_file] [--level 1-3]
Decompress (restore approximation)
python scripts/compress.py [output_file] --decompress [--level 1-3]
Levels
- Level 1 — Clean whitespace, normalize line breaks, preserve all words
- Level 2 — + Smart phrase contractions (that is -> that's, you are -> ur, etc.)
- Level 3 — + Aggressive abbreviations (because -> bc, through -> thru, etc.)
Examples
compress.py report.txt— compress report.txt → report.txt.compressedcompress.py input.txt output.txt --level 2— medium compression to specific outputcompress.py compressed.txt --decompress— attempt to restore (approximate)
Output
Shows bytes saved and percentage reduction.
Notes
- Compression is one-way by default. Use
--decompressto attempt restoration (approximate only). - Level 1 is safe for all content. Higher levels may affect readability.
- Always preserves line break structure.
相关技能
Text processing toolkit - format, clean, convert, analyze text. Includes markdown formatting, text cleaning, word count, case conversion, find/replace, text...
Count words, characters, lines, and estimate reading time for any text. Use when you need quick text analytics on a file or pasted content.
Semantic conversation compressor — intelligently summarize long chat history while preserving key decisions, facts, and context.
Reduce PDF size while preserving quality.
对图片进行智能压缩优化。支持本地路径、文件夹和远程 URL,直传 NX API 压缩后返回 CDN 地址和压缩率。适用于用户提到图片压缩、图片优化、减小图片体积、TinyPNG、JPG/PNG/WebP 压缩的场景。