office-metadata-cleaner

Removes privacy and metadata fields from documents and media in one action, without altering text content or image pixels, and outputs a safe version ready to send externally. Metadata handled includes Office/PDF fields (author, creation/modification times, company name, last modifier, custom properties), image EXIF (GPS coordinates, camera, capture time), and file-system timestamps for plain text. Intended for scenarios like sending résumés, bids, contracts, reports, and photos. Example supported formats: .docx, .xlsx, .pptx, .pdf, .jpg/.jpeg, .png, .webp, .bmp, .gif, .tif/.tiff, .txt, .md, .csv, .tsv, .json, .log, etc.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "office-metadata-cleaner" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7a61e81f50ca550e5ac5eae7d8378d07756ed54214f9d28834b30f44e0d6a305. Verify the upstream source and version against https://skillhub.cn/skills/user_af5149c6/office-metadata-cleaner before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Removes privacy and metadata fields from documents and media in one action, without altering text content or image pixels, and outputs a safe version ready to send externally. Metadata handled includes Office/PDF fields (author, creation/modification times, company name, last modifier, custom properties), image EXIF (GPS coordinates, camera, capture time), and file-system timestamps for plain text. Intended for scenarios like sending résumés, bids, contracts, reports, and photos. Example supported formats: .docx, .xlsx, .pptx, .pdf, .jpg/.jpeg, .png, .webp, .bmp, .gif, .tif/.tiff, .txt, .md, .csv, .tsv, .json, .log, etc.

0 Downloads

Introduction source: third_party · user_af5149c6 · 1.1.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Audience
Translation pending; see source documentation.
Inputs and outputs
Translation pending; see source documentation.
Limits and differences
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: office-metadata-cleaner
description: 对外发送文件前,文档与媒体里常夹带着隐私字段,极易在无意中泄露内部信息:

办公文档 / 图片 / 文本 属性清理(去隐私元数据)

适用场景

对外发送文件前,文档与媒体里常夹带着隐私字段,极易在无意中泄露内部信息:

  • Office / PDF:作者、创建/修改时间、公司名称、最后修改者、自定义属性;
  • 图片(JPG/PNG/WebP 等):EXIF 元数据——GPS 定位坐标、拍摄设备、拍摄时间、软件版本,是比文档作者更隐蔽的隐私炸弹;
  • 纯文本:文件本身不含内嵌文档元数据,但 OS 会记录创建/修改时间。

本技能在不改动任何正文 / 像素内容的前提下,一键清除这些属性与个人信息字段,输出可直接发送的安全版本。发简历、发标书、发合同、对外分享报告与照片时尤其适用。

支持格式:.docx、.xlsx、.pptx、.pdf、.jpg/.jpeg、.png、.webp、.bmp、.gif、.tif/.tiff、.txt、.md、.csv、.tsv、.json、.log 等。

核心能力

  1. 多格式覆盖:
    • OOXML(docx/xlsx/pptx)走标准库直接改写 docProps/*,零依赖;
    • PDF 清 Info 字典 + XMP 元数据流 + 生成器戳;
    • 图片用 Pillow 重新封装剥离 EXIF / PNG 文本块 / ICC / Photoshop / XMP;
    • 纯文本原样复制(无内嵌元数据可剥离)。
    • 正文、排版、图表、公式、图像像素均不受影响。
  2. 隐私字段全清:
    • 核心属性:标题、主题、作者(dc:creator)、最后修改者、修订号、创建时间、修改时间;
    • 扩展属性:公司(Company)、经理(Manager)、模板、文档安全级别;
    • 自定义属性(custom.xml 全部移除);
    • PDF:作者、创建者、生产者、创建/修改日期、XMP 流;
    • 图片:EXIF(含 GPS、设备、时间戳)、PNG 文本块(Title/Author/Description 等)、ICC、Photoshop、XMP。
  3. 零内容风险:仅改写属性区或重新封装容器;清理后文件用原软件/原查看器照常打开。
  4. 批量 + 报告:支持一次传多个文件,输出结构化 JSON 报告(每个文件清了几项、是否验证无残留、输出路径),便于留痕审计。
  5. 文件系统时间戳重置(可选):--reset-fs-time 将输出文件的时间戳统一刷为固定值(2000-01-01),彻底抹掉 OS 记录的"创建/修改时间",对纯文本文件尤其有意义。

输入规范

向用户收集(任一缺失则主动引导,不臆测):

  • 文件:待清理的 Office / PDF / 图片 / 文本路径(可多个,逗号或空格分隔)。
  • 输出位置(可选):默认在同目录生成 <原名>_cleaned.<ext>;可指定 --output-dir 或 --overwrite 直接覆盖。
  • 是否覆盖(可选,默认不覆盖、生成新文件,避免误伤原件)。
  • 是否重置时间戳(可选):默认保留原文件系统时间;如需清除 OS 时间戳加 --reset-fs-time。

引导话术:「把要发的文件发我(Word/Excel/PPT/PDF、图片 JPG/PNG、或文本都行,多个一起发也可以)。默认会生成一份 _cleaned 副本、不动原件,也会把系统记录的时间戳一并清掉;如果你确认要直接覆盖原件,告诉我一声。」

处理流程

  1. 确认用户文件与期望输出方式(副本 / 覆盖 / 是否重置时间戳)。
  2. 调用脚本(OOXML 为零依赖标准库;PDF 需 pypdf;图片需 pillow,托管环境均已预装):
    python scripts/clean_metadata.py <文件1> [文件2 ...] \
        [--output-dir DIR] [--suffix _cleaned] [--overwrite] [--reset-fs-time]
    • 若报 ModuleNotFoundError: pypdf → 运行环境执行 pip install pypdf;
    • 若报 ModuleNotFoundError: Pillow → 运行环境执行 pip install pillow。
  3. 读取脚本返回的 JSON 报告,向用户汇报每个文件的清理结果与输出路径。

输出格式

脚本 stdout 输出一份 JSON 报告,示例如下(已对用户精简呈现):

✅ 已清理 3 个文件:
- 财报草案.docx → 财报草案_cleaned.docx(清除 15 项元数据:作者/公司/日期等)
- 旅游照.jpg     → 旅游照_cleaned.jpg(清除 6 项 EXIF,已验证无残留)
- 笔记.txt       → 笔记_cleaned.txt(纯文本无内嵌元数据;已重置文件系统时间戳)

⚠️ 说明:旧版 .doc(Word 97-2003)不支持,请另存为 .docx 再清理。

异常处理

  • 不支持的格式(如 .doc 老版二进制、.exe 等)→ 单文件标记 error 并说明,其余文件照常处理。
  • 文件不存在 / 无读取权限 → 标记 error,不中断其他文件。
  • 缺少 pypdf / Pillow → 明确提示安装命令,不静默失败。
  • 文档 / 图片本就无元数据 → 状态 no_metadata(文档)或 cleaned(图片,已验证无残留),仍产出副本(或覆盖),不报错。
  • 纯文本无内嵌元数据 → 状态 no_embedded_metadata,原样复制;若加了 --reset-fs-time 则同时重置 OS 时间戳。
  • 批量部分失败 → 报告 summary 区分 cleaned / no_metadata / no_embedded_metadata / error 计数,便于核查。

适用限制与免责声明

  • 仅清除文档属性与个人信息字段;文档可见正文(如页眉页脚里手填的姓名、正文中的署名)不在清理范围,需人工核对。
  • 旧版 .doc(Word 97-2003 二进制格式)不支持,请先在 Office / WPS 中另存为 .docx 再清理。
  • 图片经重新封装以剥离元数据:JPEG 会有极轻微重编码(默认 quality=95,损失可忽略),属业界通用做法;若要求像素级逐字节一致,请改用专业原址改写工具。
  • TIFF 因元数据以标签形式存在、重新封装无法保证清除,会自动转存为 PNG(扩展名随之变为 .png)以彻底剥离;如需保留 TIFF 格式需另行处理。
  • PDF 清理依赖 pypdf;其会生成一份新 PDF,原文件数字签名、注释锚点等随重组可能变化,敏感合规场景请提前确认。
  • 清理为不可逆操作(覆盖模式尤甚);默认生成 _cleaned 副本以保留原件,重要文件建议先备份。

Current listing version

1.1.0

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value95/100

Highlights

  • 解决用户对外发送文件前的隐私泄露核心痛点,覆盖 Office/PDF/图片/文本多格式
  • 适用于发简历、标书、合同等高频刚需场景,具备高实用价值
Trigger Precision95/100

Highlights

  • 触发描述完整清晰,支持格式列举详尽,边界明确无歧义
Structure and Standards85/100

Areas to improve

  • 缺少独立 When to Use 章节 Reported severity: Minor

    文档将使用场景融入'适用场景'章节,但未设置独立'When to Use'标题

    Recommendation: 建议增加独立'When to Use'章节以提升结构规范性

Highlights

  • 处理流程步骤清晰,包含输入规范、执行逻辑、输出格式与异常处理
  • 提供完整端到端示例与引导话术,frontmatter 完整
Execution Reliability95/100

Highlights

  • 工具依赖明确(pypdf、Pillow),异常处理覆盖全面
  • 默认生成副本避免误伤原件,不可逆操作有显式确认机制
  • 批量处理支持部分失败隔离,输出结构化报告便于审计
Evidence Verifiability (mean of the first four)93/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 56, 57

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.