/docx-format-replicator
Extract formatting from existing Word documents and generate new documents with the same format but different content. Use this skill when users need to create multiple documents with consistent formatting, replicate document templates, or maintain corporate document standards
$ npx -y skills add iamzhihuix/happy-claude-skills --skill docx-format-replicator --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/docx-format-replicator
Context preview
The summary Claude sees to decide when to auto-load this skill.
Extract formatting from existing Word documents and generate new documents with the same format but different content. Use this skill when users need to create multiple documents with consistent formatting, replicate document templates, or maintain corporate document standards
SKILL.md
docx-format-replicator.SKILL.mdname: docx-format-replicator
description: Extract formatting from existing Word documents and generate new documents with the same format but different content. Use this skill when users need to create multiple documents with consistent formatting, replicate document templates, or maintain corporate document standards across different content.
metadata:
author: iamzhihuix
version: "1.0.0"
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 numbering
- `paragraph` - Text paragraphs
- `table` - Tables with configurable rows and columns
- `page_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."
1. **Extract the format**:
python scripts/extract_format.py research_task_template.docx template_format.json
2. **Create content files** for each new document (content1.json, content2.json, etc.)
3. **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, outputRead more
name: docx-format-replicator description: Extract formatting from existing Word documents and generate new documents with the same format but different content. Use this skill when users need to create multiple documents with consistent formatting, replicate document templates, or maintain corporate document standards across different content. metadata: author: iamzhihuix version: "1.0.0"
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 numbering
- `paragraph` - Text paragraphs
- `table` - Tables with configurable rows and columns
- `page_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."
1. **Extract the format**:
python scripts/extract_format.py research_task_template.docx template_format.json
2. **Create content files** for each new document (content1.json, content2.json, etc.)
3. **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, outputA collection of practical skill plugins for AI coding agents. Works with Claude Code, Codex, Factory Droid, OpenClaw, Cursor, and 40+ agents.
Repo: iamzhihuix/happy-claude-skills
Other skills on happy-claude-skills.
- /1password
使用 1Password CLI (op) 管理密码和 API credentials。保存、查询、读取 API key/token,注入环境变量到脚本。当用户提到保存密码、保存 API key、查询密码、1password、op CLI、secret 管理时使用此 skill。
Open skill - /browser
Minimal Chrome DevTools Protocol tools for browser automation and scraping. Use when you need to start Chrome, navigate pages, execute JavaScript, take screenshots, or interactively pick DOM elements. Triggers include "browse website", "scrape page", "take screenshot", "automate
Open skill - /happy-app-audit
Audit a local macOS app's telemetry / reporting behavior using static analysis only. Reverse-engineers an .app bundle to identify embedded SDKs (AppLog/TEA, Parfait, TTNet, mars, MMKV, Sentry, Firebase, Bugly, Umeng, etc.), mapped upload endpoints, local on-disk queues, and
Open skill - /happy-audio-gen
Universal AI voice / text-to-speech skill supporting OpenAI TTS (gpt-4o-mini-tts, tts-1), ElevenLabs multilingual TTS with voice cloning, Bailian Qwen TTS (qwen-tts / qwen3-tts-vd with voice-design custom voices, long-text chunking built in), MiniMax speech-02-hd, SiliconFlow
Open skill - /happy-dreamina
ByteDance Jimeng (Dreamina) image and video generation via the official `dreamina` CLI. Use this skill whenever the user mentions 即梦, Dreamina, Jimeng, or asks to generate images or videos specifically through ByteDance's Jimeng service. Covers text2image, image2image,
Open skill - /happy-image-gen
Universal AI image generation supporting OpenAI DALL·E / gpt-image, Google Gemini Image / Imagen, Replicate (Flux / SDXL / any model), Stability AI, FAL, Ark (Seedream 4.5), Bailian (qwen-image / wanx), and SiliconFlow. Use this skill whenever the user asks to generate, create,
Open skill

