docx-format-replicator

Extract Word document formatting into JSON and generate new .docx files.

1|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/xxih/ai-harness-zh --skill docx-format-replicator-xxih
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx-format-replicator
Source: https://github.com/xxih/ai-harness-zh/tree/main/references/translations/happy-claude-skills/skills/docx-format-replicator
Command: npx skills add https://github.com/xxih/ai-harness-zh --skill docx-format-replicator-xxih

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-docx, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Many organizations need to create multiple Word documents that share the exact same formatting, such as templates, reports, or specification sheets. Manually copying styles is error‑prone and time‑consuming.

Core Features & Use Cases

  • Extract Format: Pulls style definitions, numbering, tables, headers, and footers from a source .docx file into a reusable JSON configuration.
  • Generate Document: Combines the extracted format with a JSON content file to produce a new .docx that looks identical to the template but contains different information.
  • Batch Processing: Script can be looped to create dozens of documents from a single template, ideal for corporate report generation, technical specifications, or batch contract creation.

Quick Start

Use the docx-format-replicator to produce a new document from "Company Template.docx" using the content file "new_report.json".

Frequently Asked Questions about docx-format-replicator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I clone Word styles to generate uniform docx files from a template?

To clone Word styles, this Skill extracts formatting from a source .docx file into a JSON configuration, then applies it to new content data to generate uniform docx files. It pulls style definitions, numbering, tables, headers, and footers for exact replication.

Can I use python-docx to batch process multiple Word documents from a single template?

Yes, you can use python-docx to batch process Word documents by looping the generation script. This Skill combines an extracted format JSON with multiple content JSON files to produce dozens of identical .docx files for corporate reports or specifications.

What do I need to extract formatting from an existing Word document into a reusable configuration?

You need Python 3.7+ and the python-docx library to extract formatting from a Word document. This Skill pulls style definitions, headers, footers, and tables into a reusable JSON file, requiring only the source .docx file to begin the extraction process.

Does python-docx support extracting headers, footers, and tables for document format replication?

Yes, python-docx supports extracting headers, footers, tables, and style definitions for document format replication. This Skill leverages the library to pull these elements from a source .docx file into a JSON configuration for generating new uniform documents.

What's the best way to automate generating multiple Word reports with identical formatting but different content?

The best way to automate generating uniform Word reports is extracting the template format into a JSON file and combining it with content JSON data. This Skill uses python-docx to merge the extracted styles with new data, producing identical .docx files without manual copying.

When should I not use JSON configurations for Word document generation?

You should not use JSON configurations for Word document generation if your formatting requirements change dynamically per document or require complex macros. This Skill relies on static format extraction from a single source .docx, making it unsuitable for highly variable or interactive document structures.