Office Document Redaction
Paste the following prompt into your AI chat to install this skill:
Please follow https://skillhub.cn/install/skillhub.md to install @user_4d625638/doc-desensitize.
About this skill
Problem
Office files often contain names, phone numbers, ID numbers, addresses, employers, and other sensitive fields. Manual copying can miss comments, headers, footers, and document properties, while hand redaction is slow and can change layout. doc-desensitize targets .docx and .xlsx files, reads the ZIP-based XML using the Python standard library, and replaces matched values with asterisks of the same length, helping preserve formatting during batch redaction.
How It Works
- Rule-first workflow: preview hit types and counts with
--dry-run, then enable keys such asname,phone,id_card,email,school,company, andaddress_*, or restrict processing with--rules. - Directory batch mode: processes Word and Excel files without copying PDFs, images, or other assets;
--move-originalcan move original documents into an original-documents subfolder and produce a redaction report. - Coverage: body text, headers and footers, comments, TOC fields, hyperlinks, text boxes, revisions, and document properties.
Boundaries
- Supports
.docx/.xlsxonly; it does not handle legacy formats, encrypted files, embedded OLE objects, or files over500MB. - If Excel stores ID numbers as numeric values shown in scientific notation, convert the column to text first.
- Files open in Word or Excel cannot be processed, and regex matches may over-redact; preview first and review results manually.
Use Cases
- Before sending a customer feedback summary, replace names, phone numbers, and ID numbers in .docx/.xlsx files using selected rules and equal-length asterisks.
- Before contractor handoff, batch-process a folder of Word and Excel files, preview detected hits with --dry-run, then generate redacted copies.
- When archiving clinical records, mask only selected fields such as names, case numbers, WeChat, and QQ to avoid over-redacting entire passages.
- When collecting outgoing documents from a shared folder, move originals into a subfolder with --move-original and leave only redacted versions in the output directory.
Best For
- Operations staff handling customer data compliance who need to batch-redact names, phone numbers, and contact details before sending spreadsheets.
- Administrative staff processing medical or archival records who want to mask only selected fields such as names, case numbers, and WeChat IDs.
- Project owners delivering documents to contractors who need redacted copies without copying unrelated files from shared folders.
- Automation engineers maintaining workflows who need a zero-dependency .docx/.xlsx redaction script with dry-run preview and rule filtering.
Related Skills
Organizes files by extension into subfolders like Documents, Code, and Archives, then outputs a report.
Extract tables, formulas, charts, and layout from invoices, reports, papers, and multi-column documents.
Generates a multi-sheet Excel report containing only structured data tables from byteplan-analysis results.
Automatically sort directory files into type-based folders, with dry-run preview, reports, and JSON custom rules.