Back to Skills

docx-format-replicator

verified

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.

View on GitHub

Marketplace

happy-claude-skills

iamzhihuix/happy-claude-skills

Plugin

browser

Repository

iamzhihuix/happy-claude-skills
240stars

skills/docx-format-replicator/SKILL.md

Last Verified

January 23, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/iamzhihuix/happy-claude-skills/blob/main/skills/docx-format-replicator/SKILL.md -a claude-code --skill docx-format-replicator

Installation paths:

Claude
.claude/skills/docx-format-replicator/
Powered by add-skill CLI

Instructions

# 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.

```bash
python scripts/extract_format.py <template.docx> <output.json>
```

**Example**:
```bash
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**:
```json
{
  "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."
    },
    {

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
7517 chars