chi111i/word-power-tools
Overview
This skill is a command-line toolkit for reliable, reproducible processing of Microsoft Word documents (.docx/.doc/.rtf). It provides conversion (PDF/Markdown/HTML/TXT), extraction (text/tables/images), batch replacements, merge/split, template application and format linting with report output. Designed for local use on Linux, macOS, and Windows, it treats Word files as programmable documents for repeatable workflows.
How this skill works
All operations are exposed as subcommands of a single script (scripts/word_tool.py) so tasks are repeatable and testable. Typical commands inspect file metadata, outline and content, extract components, run lint/format checks against YAML rules, then produce non-destructive outputs to specified files or folders. Complex workflows are encoded as rule/config files (YAML) so formatting, replacements and templating can be applied consistently across batches.
When to use it
- Convert Word files to PDF, Markdown, HTML or plain text for publishing or archiving
- Extract all tables, images or full text for analysis or data reuse
- Perform batch find-and-replace using structured YAML rules
- Standardize thesis or report formatting and generate lint reports before applying fixes
- Merge multiple documents or split a large document by headings into components
- Create new document skeletons from templates for consistent project starts
Best practices
- Always run operations with an explicit output (-o/--output); do not overwrite originals by default
- Run lint first to generate a format report, then apply format to avoid unexpected changes
- Encode batch rules and formatting policies as YAML to keep processes reproducible
- Use the provided script (scripts/word_tool.py) rather than ad-hoc scripts to ensure stability
- Run the environment self-check (doctor) after installing in a new environment
Example use cases
- A student converts a thesis.docx to PDF and checks margins, fonts and heading levels against a university style YAML before final submission
- A researcher extracts tables to XLSX and images to a folder for further data analysis and figure assembly
- An editor batch-applies replacement rules across many files to fix institutional name changes and then merges final chapters
- A documentation team converts Word drafts to Markdown for a static site, using metadata and template skeletons to preserve structure
- A project automates splitting a long report by Heading 1 into separate files for parallel review
FAQ
No. By default operations write to a new output path specified with -o/--output to avoid accidental data loss.
How do I check formatting rules before applying them?
Run the lint subcommand with a YAML config to produce a report (e.g., report.md). Review the report, then run format with the same config to apply fixes.