docx-format-replicator▌
iamzhihuix/happy-claude-skills · updated Apr 8, 2026
MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.
Extract formatting information from existing Word documents (.docx) and use it to generate new documents with identical formatting but different content. This skill enables creating document templates, maintaining consistent formatting across multiple documents, and replicating complex Word document structures.
DOCX Format Replicator
Overview
Extract formatting information from existing Word documents (.docx) and use it to generate new documents with identical formatting but different content. This skill enables creating document templates, maintaining consistent formatting across multiple documents, and replicating complex Word document structures.
When to Use This Skill
Use this skill when the user:
- Wants to extract formatting from an existing Word document
- Needs to create multiple documents with the same format
- Has a template document and wants to generate similar documents with new content
- Asks to "replicate", "copy format", "use the same style", or "create a document like"
- Mentions document templates, corporate standards, or format consistency
Workflow
Step 1: Extract Format from Template
Extract formatting information from an existing Word document to create a reusable format configuration.
python scripts/extract_format.py <template.docx> <output.json>
Example:
python scripts/extract_format.py "HY研制任务书.docx" format_template.json
What Gets Extracted:
- Style definitions (fonts, sizes, colors, alignment)
- Paragraph and character styles
- Numbering schemes (1, 1.1, 1.1.1, etc.)
- Table structures and styles
- Header and footer configurations
Output: JSON file containing all format information (see references/format_config_schema.md for details)
Step 2: Prepare Content Data
Create a JSON file with the actual content for the new document. The content must follow the structure defined in references/content_data_schema.md.
Content Structure:
{
"metadata": {
"title": "Document Title",
"author": "Author Name",
"version": "1.0",
"date": "2025-01-15"
},
"sections": [
{
"type": "heading",
"content": "Section Title",
"level": 1,
"number": "1"
},
{
"type": "paragraph",
"content": "Paragraph text content."
},
{
"type": "table",
"rows": 3,
"cells": [
["Header 1", "Header 2"],
["Data 1", "Data 2"]
]
}
]
}
Supported Section Types:
heading- Headings with optional numberingparagraph- Text paragraphstable- Tables with configurable rows and columnspage_break- Page breaks
See assets/example_content.json for a complete example.
Step 3: Generate New Document
Generate a new Word document using the extracted format and prepared content.
python scripts/generate_document.py <format.json> <content.json> <output.docx>
Example:
python scripts/generate_document.py format_template.json new_content.json output_document.docx
Result: A new .docx file with the format from the template applied to the new content.
Complete Example Workflow
User asks: "I have a research task document. I need to create 5 more documents with the same format but different content."
- Extract the format:
python scripts/extract_format.py research_task_template.docx template_format.json
-
Create content files for each new document (content1.json, content2.json, etc.)
-
Generate documents:
python scripts/generate_document.py template_format.json content1.json document1.docx
python scripts/generate_document.py template_format.json content2.json document2.docx
# ... repeat for all documents
Common Use Cases
Corporate Document Templates
Extract format from a company template and generate reports, proposals, or specifications with consistent branding.
# One-time: Extract company template
python scripts/extract_format.py "Company Template.docx" company_format.json
# For each new document:
python scripts/generate_document.py company_format.json new_report.json "Monthly Report.docx"
Technical Documentation Series
Create multiple technical documents (specifications, test plans, manuals) with identical formatting.
# Extract from specification template
python scripts/extract_format.py spec_template.docx spec_format.json
# Generate multiple specs
python scripts/generate_document.py spec_format.json product_a_spec.json "Product A Spec.docx"
python scripts/generate_document.py spec_format.json product_b_spec.json "Product B Spec.docx"
Research Task Documents
The included example template (assets/hy_template_format.json) demonstrates a complete research task document format with:
- Approval/review table in header
- Multi-level numbering (1, 1.1, 1.1.1)
- Technical specification tables
- Structured sections
Use this as a starting point for similar technical documents.
Advanced Usage
Customizing Extraction
Modify scripts/extract_format.py to extract additional properties not covered by default:
- Custom XML elements
- Advanced table features (merged cells, borders)
- Embedded objects
- Custom properties
Extending Content Types
Add new section types in scripts/generate_document.py:
- Images with captions
- Bulleted or numbered lists
- Footnotes and endnotes
- Custom content blocks
See references/content_data_schema.md for extension guidelines.
Batch Processing
Create a wrapper script to generate multiple documents:
import json
import subprocess
format_file = "template_format.json"
content_files = ["content1.json", "content2.json", "content3.json"]
for i, content_file in enumerate(content_files, 1):
output = f"document_{i}.docx"
subprocess.run([
"python", "scripts/generate_document.py",
format_file, content_file, output
])
Dependencies
The scripts require:
- Python 3.7+
python-docxlibrary:pip install python-docx
No additional dependencies are needed for the core functionality.
Resources
scripts/
- extract_format.py - Extract formatting from Word documents
- generate_document.py - Generate new documents from format + content
Both scripts include built-in help:
python scripts/extract_format.py --help
python scripts/generate_document.py --help
references/
- format_config_schema.md - Complete schema for format configuration files
- content_data_schema.md - Complete schema for content data files
Read these for detailed information on file structures and available options.
assets/
- hy_template_format.json - Example extracted format from a technical research task document
- example_content.json - Example content data showing all section types
Use these as references when creating your own format and content files.
Troubleshooting
Missing styles in output: Ensure style IDs in content data match those in format config. Check format.json for available style IDs.
Table formatting issues: Verify table dimensions (rows/columns) match between content data and format config. See format_config_schema.md for table structure.
Font not displaying correctly: Some fonts may not be available on all systems. Check that referenced fonts are installed.
Dependencies missing: Install required Python packages:
pip install python-docx
Tips
-
Test with examples first: Use the included
hy_template_format.jsonandexample_content.jsonto understand the workflow before extracting your own formats. -
Start simple: Begin with basic headings and paragraphs, then add tables and complex formatting.
-
Validate JSON: Use a JSON validator to check content data files before generating documents.
-
Keep format configs: Store extracted format configurations for reuse across multiple projects.
-
Version control: Track both format configs and content data in version control for reproducible document generation.
How to use docx-format-replicator on Cursor
AI-first code editor with Composer
Prerequisites
Before installing skills in Cursor, ensure your development environment meets these requirements:
- ›Cursor installed and configured on your development machine
- ›Node.js version 16.0+ with npm package manager (verify with
node --version) - ›Active project directory or workspace where you want to add docx-format-replicator
Execute installation command
Execute the skills CLI command in your project's root directory to begin installation:
The skills CLI fetches docx-format-replicator from GitHub repository iamzhihuix/happy-claude-skills and configures it for Cursor.
Select Cursor when prompted
The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:
Verify installation
Confirm successful installation by checking the skill directory location:
Reload or restart Cursor to activate docx-format-replicator. Access the skill through slash commands (e.g., /docx-format-replicator) or your agent's skill management interface.
Security & Verification Notice
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.
List & Monetize Your Skill
Submit your Claude Code skill and start earning
Use Cases▌
Task Automation & Efficiency
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Knowledge Enhancement
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Quality Improvement
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
Implementation Guide▌
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Installation Steps
- 1.Install skill using provided installation command
- 2.Test with simple use case relevant to your work
- 3.Evaluate output quality and relevance
- 4.Iterate on prompts to improve results
- 5.Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices▌
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This▌
✓ Use When
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid When
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path▌
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.4★★★★★71 reviews- ★★★★★Dhruvi Jain· Dec 20, 2024
I recommend docx-format-replicator for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
- ★★★★★Carlos Srinivasan· Dec 20, 2024
docx-format-replicator is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Min Martinez· Dec 16, 2024
Registry listing for docx-format-replicator matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Charlotte Martinez· Dec 12, 2024
docx-format-replicator fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Sophia Martinez· Dec 12, 2024
We added docx-format-replicator from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Charlotte Gill· Dec 8, 2024
Solid pick for teams standardizing on skills: docx-format-replicator is focused, and the summary matches what you get after install.
- ★★★★★Sophia Bansal· Dec 8, 2024
docx-format-replicator has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Jin Huang· Dec 8, 2024
Useful defaults in docx-format-replicator — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Aarav Gill· Nov 27, 2024
docx-format-replicator has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Ishan Srinivasan· Nov 27, 2024
Solid pick for teams standardizing on skills: docx-format-replicator is focused, and the summary matches what you get after install.
showing 1-10 of 71