Install
openclaw skills install safe-shrinkSafeShrink - Document compression, desensitization, SSD conversion, and OCR. Triggers: document compression, file shrink, desensitize, sensitive info masking...
openclaw skills install safe-shrink密小件 帮您让文档变得更轻、更安全、更 AI 友好。
它一键完成三件事:
- 压缩 文档体积,去除冗余 — 减小 30%-85%
- 脱敏 敏感信息(手机号、证件号、银行卡、金额)— 分享前保护隐私
- 转换 为 .ssd 格式 — AI Token 减少约 70%
所有处理 完全离线 — 数据不会离开您的电脑。无需安装,下载 EXE 双击即用。
SafeShrink helps you make documents lighter, safer, and more AI-friendly.
It does three things in one click:
- Compress document size, removing redundancy — 30%-85% smaller
- Sanitize sensitive info (phone numbers, IDs, bank cards, amounts) — privacy protected before sharing
- Convert to .ssd format — ~70% fewer AI tokens
All processing is fully offline — your data never leaves your computer. No installation needed, just download the EXE and double-click.
| 能力 / Capability | 说明 / Description | 适用场景 / Use Case |
|---|---|---|
| 🗜️ 文档减肥 / Document Slimming | 压缩 docx/xlsx/pptx/pdf/md/txt 等,去除冗余 / Compress docx/xlsx/pptx/pdf/md/txt, remove redundancy | AI 对话前预处理大文件 / Pre-process large files before AI conversation |
| 🔒 安全脱敏 / Secure Sanitization | 识别并替换敏感信息(手机号、邮箱、姓名、金额等)/ Detect and replace sensitive info (phone, email, name, amount, etc.) | 文档外部分享前 / Before sharing documents externally |
| 📝 SSD 转换 / SSD Conversion | Office/PDF → SSD(Markdown 增强格式),支持 OCR / Office/PDF → SSD (enhanced Markdown), OCR support | 扫描版 PDF 转可编辑文本 / Scan PDF to editable text |
| 📦 批量处理 / Batch Processing | 文件夹一键批量处理,多线程并行 / One-click folder batch processing, multi-threaded | 大量文档集中优化 / Batch optimize many documents |
| 🖼️ OCR 识别 / OCR Recognition | 扫描件 PDF / 图片自动 OCR,输出可搜索文本 / Auto OCR for scanned PDFs/images | 扫描件转可编辑文本 / Scan to searchable text |
基于方案 F 实测(原文字符×3 vs SSD Markdown token 估算),真实测试数据 Based on Scheme F actual testing (original chars ×3 vs SSD Markdown token estimate)
| 文档类型 / Document Type | 原始 Token / Original | 转换后 Token / After SSD | 节省 / Saved |
|---|---|---|---|
| DOCX → SSD(实测)/ DOCX → SSD (tested) | 5,520 | 1,784 | 67% |
| 合同.docx (5 页) / Contract.docx (5 pages) | ~4,000 | ~1,200 | ~70% |
| 报告.pptx (20 页) / Report.pptx (20 pages) | ~10,000 | ~3,000 | ~70% |
| 手册.pdf (50 页) / Manual.pdf (50 pages) | ~18,000 | ~5,400 | ~70% |
| 含图片文档 / Image-heavy docs | ~15,000 | ~4,500 | ~70% |
| 激进压缩 / Aggressive | ~5,520 | ~800 | ~85% |
节省原理 / Why so high:
按 GPT-4o 价格 ¥0.10/1K tokens 计算 / Calculated at GPT-4o price ¥0.10/1K tokens
SSD 转换效果 / SSD Conversion: \📄 合同.docx → 📄 合同.ssd
| 模式 / Mode | 输出格式 / Output Format | 特点 / Features | Token 节省 / Token Saved |
|---|---|---|---|
| 标准减肥 / Standard Slimming | 保留原格式(.slim.docx / _减肥.docx)/ Preserve original format | 保留文档结构,轻度清理 / Preserve structure, light cleanup | 40%-50% |
| 激进压缩 / Aggressive Compression | .txt(文本)/ .txt (text) | 深度去重,输出纯文本 / Deep deduplication, pure text output | ~85% |
| 深度清理 / Deep Clean | 预览模式(临时文件,手动保存)/ Preview mode (temp file, manual save) | 最大压缩,需用户确认 / Maximum compression, requires user confirmation | ~70% |
| SSD 转换 / SSD Conversion | .ssd(Markdown 增强格式)/ .ssd (enhanced Markdown) | 保留结构,LLM 友好 / Preserve structure, LLM-friendly | ~70% |
{原名}_减肥.{ext}{原名}_脱敏.{ext}{原名}.ssd{原名}_减肥.{ext}.ssd(SafeShrink Document) 是 Markdown 增强格式:
.ssd (SafeShrink Document) is an enhanced Markdown format:
read 工具读取 / Essentially Markdown, readable with read tool--embed-images)/ Supports Base64 image embedding (--embed-images)读取方式 / Reading:
用户 / User: [上传 data.ssd / Upload data.ssd]
AI: [直接用 read 工具读取,按 Markdown 语法解析 / Read directly with read tool, parse as Markdown]
SafeShrink slim -i <输入文件 / input file> -o <输出文件 / output file> -m <模式 / mode> [SSD子选项 / SSD options]
模式参数 -m / Mode -m`:
standard — 标准减肥(保留格式)/ Standard slimming (preserve format)aggressive — 激进压缩(输出 .txt)/ Aggressive compression (output .txt)deep-clean — 深度清理(预览模式)/ Deep clean (preview mode)ssd — 转换为 SSD 格式 / Convert to SSD formatSSD 子选项 / SSD Options:
--embed-images — 嵌入图片为 Base64 / Embed images as Base64--ocr-images — 对图片中的文字进行 OCR / OCR text in images--ocr-pdf — PDF 扫描件启用 OCR(需 Tesseract)/ OCR for scanned PDFs (requires Tesseract)示例 / Examples:
SafeShrink slim -i report.docx -o report_减肥.docx -m standard
SafeShrink slim -i scan.pdf -o scan.ssd -m ssd --ocr-pdf
SafeShrink batch-slim <输入文件夹 / input folder> -o <输出文件夹 / output folder> -m <模式 / mode> [SSD子选项 / SSD options]
示例 / Examples:
SafeShrink batch-slim C:\docs -o C:\output -m standard
SafeShrink batch-slim C:\pdfs -o C:\ssd -m ssd --ocr-pdf
SafeShrink sanitize -i <输入文件 / input file> -o <输出文件 / output file> [--format original|ssd|txt]
示例 / Examples:
SafeShrink sanitize -i contract.docx -o contract_脱敏.docx
SafeShrink sanitize -i contract.docx -o contract_脱敏.ssd --format ssd
SafeShrink batch-sanitize <输入文件夹 / input folder> -o <输出文件夹 / output folder> [--format original|ssd|txt]
示例 / Examples:
SafeShrink batch-sanitize C:\contracts -o C:\output -f ssd
SafeShrink convert -i <输入文件 / input file> -f <目标格式 / target format> [-o <输出文件 / output file>]
**目标格式 -f / Target format -f:** ssd|txt|md`
示例 / Examples:
SafeShrink convert -i report.docx -f ssd
SafeShrink convert -i scan.pdf -f md -o scan.md
SafeShrink batch-convert <输入文件夹 / input folder> -f <目标格式 / target format> -o <输出文件夹 / output folder>
示例 / Examples:
SafeShrink batch-convert C:\docs -f ssd -o C:\ssd
SafeShrink batch-convert C:\reports -f md -o C:\markdown
SafeShrink compress-image -i <输入图片 / input image> -o <输出图片 / output image> [--quality <1-100>] [--max-width <px>] [--max-height <px>]
示例 / Examples:
SafeShrink compress-image -i photo.jpg -o photo_减肥.jpg --quality 70
SafeShrink compress-image -i screenshot.png -o screenshot_减肥.png --max-width 1920
SafeShrink batch-compress-image <输入文件夹 / input folder> -o <输出文件夹 / output folder> [--quality <1-100>] [--max-width <px>] [--max-height <px>]
示例 / Examples:
SafeShrink batch-compress-image C:\screenshots -o C:\compressed --quality 60 --max-width 1920
| 参数 / Parameter | 说明 / Description |
|---|---|
-i / --input | 输入文件路径 / Input file path |
-o / --output | 输出文件/文件夹路径 / Output file/folder path |
-m / --mode | 压缩模式(standard/aggressive/deep-clean/ssd)/ Compression mode |
--format | 输出格式(original/ssd/txt)/ Output format |
--json | JSON 格式输出(供脚本调用)/ JSON output (for scripting) |
--help | 显示帮助信息 / Show help |
| 场景 / Scenario | 推荐方式 / Recommended |
|---|---|
| 单文件快速处理 / Single-file quick processing | CLI(一行命令 / one-liner) |
| 批量处理 / Batch processing | CLI(batch-* 命令) |
| 复杂参数调试 / Complex parameter debugging | GUI(可视化配置 / visual config) |
| 首次使用 / First time use | GUI(引导式操作 / guided operation) |
用户 / User: [上传 report.docx / Upload report.docx]
AI:检测到您上传了 Word 文档。建议先用 SafeShrink 优化:
Detected Word document. Suggest optimizing with SafeShrink first:
- 文档减肥(减少 token 消耗)/ Document slimming (reduce token usage)
- 自动脱敏敏感信息 / Auto-sanitize sensitive info
是否先优化再处理?/ Optimize first then process?
用户 / User: 好的,先脱敏 / OK, sanitize first
AI:[调用 SafeShrink sanitize] → 生成脱敏版本,继续处理
[Call SafeShrink sanitize] → Generate sanitized version, continue processing
用户 / User: 帮我把这个 PDF 转成 SSD 格式 / Convert this PDF to SSD format
AI:[调用 SafeShrink slim -m ssd] → 输出 .ssd 文件
[Call SafeShrink slim -m ssd] → Output .ssd file
用户 / User: [上传 data.ssd / Upload data.ssd]
AI:[直接用 read 工具读取,按 Markdown 语法解析]
[Read directly with read tool, parse as Markdown]
用户 / User: 帮我把这个文件夹里的所有文档批量压缩 / Batch compress all documents in this folder
AI:[调用 SafeShrink batch-slim] → 输出所有 _减肥 文件
[Call SafeShrink batch-slim] → Output all _减肥 files
| 用户选择 / User selects | AI 推荐命令 / AI recommends |
|---|---|
| "标准减肥 / Standard" | slim -i {file} -o {out}_减肥.{ext} -m standard |
| "激进压缩 / Aggressive" | slim -i {file} -o {out}_减肥.txt -m aggressive |
| "深度清理 / Deep Clean" | slim -i {file} -o {out}.txt -m deep-clean |
| "转 SSD / To SSD" | slim -i {file} -o {out}.ssd -m ssd |
| "脱敏 / Sanitize" | sanitize -i {file} -o {out}_脱敏.{ext} |
| "批量减肥 / Batch Slim" | batch-slim {folder} -o {out_dir} -m standard |
--ocr-pdf 参数,需要安装 Tesseract OCR 引擎--ocr-pdf parameter, requires Tesseract OCR engine installed首次使用时,AI 会自动从 GitHub 下载最新 EXE 并缓存到本地:
On first use, AI auto-downloads latest EXE from GitHub and caches locally:
https://github.com/JinwaTech/safeshrink/releases/download/v1.2.1/SafeShrink-v1.2.1.zipv1.2.1 起,11 个核心模块已编译为 Cython .pyd 二进制文件,源码不公开。
As of v1.2.1, 11 core modules are compiled to Cython .pyd binaries, source code not public.
运行 SafeShrink 前,请确保已安装 Visual C++ Redistributable。如果启动时提示"找不到 VCRUNTIME140_1.dll"或"MSVCP140.dll 丢失",请下载并安装:
⚠️ 重要 / Important: SafeShrink 的
_internal文件夹已包含所有第三方依赖,但仍需要您电脑安装 VC++ 运行时。这是因为 DLL 文件本身依赖微软的系统库,这部分无法打包进 EXE。
Before running SafeShrink, please ensure Visual C++ Redistributable is installed. If you see an error like "VCRUNTIME140_1.dll not found" or "MSVCP140.dll missing", please download and install:
⚠️ Important: SafeShrink's
_internalfolder contains all third-party dependencies, but your system still needs the VC++ runtime. DLL files depend on Microsoft's system libraries, which cannot be packaged into the EXE.
⚠️ 如果 SafeShrink 被杀毒软件拦截,这是误报。
SafeShrink 是纯本地的文件预处理工具,不联网、不连接任何服务端、不上传任何数据,不存在数据泄露风险。它不会修改系统文件、不会安装驱动、不会驻留后台,不会对电脑造成任何损害。
被拦截的原因是:SafeShrink 使用 PyInstaller 打包成独立 EXE,这类"单文件可执行程序"在杀毒软件中属于低信誉类别,容易被误判。
⚠️ 特别提醒 / Special Notice: 杀毒软件可能会逐个扫描
_internal文件夹中的数百个 DLL 文件,隔离其中任何一个关键 DLL 都会导致 EXE 启动失败或功能异常。解决方法 / Solution: 将 SafeShrink 整个文件夹(包括
_internal)加入杀毒软件白名单/排除项。如有疑虑,可用 VirusTotal 上传检测验证。
⚠️ If SafeShrink is blocked by your antivirus, it is a false positive.
SafeShrink is a fully offline file preprocessing tool — no internet, no server connection, no data upload. Zero risk of data leakage. It does not modify system files, install drivers, or run in the background.
Special Notice: Antivirus software may scan hundreds of DLL files in the
_internalfolder one by one. Isolating any critical DLL will cause the EXE to fail to start or malfunction.Solution: Add the entire SafeShrink folder (including
_internal) to your antivirus whitelist/exclusions. For verification, upload to VirusTotal.
| 问题 / Problem | 原因 / Cause | 解决方法 / Solution |
|---|---|---|
| 双击 EXE 没反应 / EXE does nothing | 杀毒软件静默隔离了 _internal 中的某个 DLL / Antivirus silently isolated a DLL in _internal | 检查杀毒软件隔离区,恢复所有 SafeShrink 相关文件,并将整个文件夹加入白名单 / Check quarantine, restore all SafeShrink files, add folder to whitelist |
| 提示"找不到 xxx.dll" / "xxx.dll not found" | VC++ 运行时未安装 / VC++ runtime not installed | 安装 VC++ Redistributable / Install VC++ Redistributable |
| 提示"api-ms-win-core-.dll 丢失" / "api-ms-win-core-.dll missing" | Windows 版本过低 / Windows version too old | SafeShrink 需要 Windows 8 或更高版本 / Requires Windows 8 or later |
| "转换结果为空" / "Conversion result is empty" | _internal 中的某个依赖 DLL 被杀毒软件隔离 / A dependency DLL in _internal was isolated | 检查杀毒软件隔离区,恢复文件并加入白名单 / Check quarantine, restore files and add to whitelist |
| 批量处理中途崩溃 / Batch processing crashes | 杀毒软件在处理过程中隔离了关键 DLL / Antivirus isolated a critical DLL during processing | 将 SafeShrink 文件夹加入白名单后重试 / Add folder to whitelist and retry |