SuperAPI AI Directory

docx-generator

Office & productivity

View repository

Updated 10-15 21:02

About this skill

Word Document Generator (DOCX Generator)

Overview

Python python-docx Library-based DOCX generation + Claude brand-tone modern design system. It supports Korean official documents, corporate reports, contracts, and proposals, so that the result is not "clichéd design that looks AI-made" but a professional draft, with color palette, typographic hierarchy, spacing, and structural patterns built in.

Trigger Keywords

Word, docx, Word document, contract, official document, report generation, document editing, draft document, proposal, official letter, cooperation letter, plan

Design System — Claude Modern Doc Theme

references/modern-design-system.mddefines detailed colors, typography, spacing, and heading hierarchy.

Color Palette (Claude Brand Tone)

Role 색 hex Use
Primary Anthropic Orange #d97757 Emphasis headings, chart highlight, dividers
Secondary Anthropic Blue #6a9bcc Secondary emphasis, quotes, table headers
Background Light Beige #faf9f5 Body background (#ffffff also possible)
Surface White #ffffff Table and code block background
Text Primary Dark #141413 Body text (replaces #000)
Text Secondary Mid Gray #b0aea5 Captions and meta information
Border Light Gray #e8e6dc Table borders and dividers

Typography — Korean/English Pairing

Hierarchy Korean Font English Font Size weight
Body cover Pretendard Inter 28pt Bold
H1 Pretendard Inter 22pt Bold
H2 Pretendard Inter 18pt SemiBold
H3 Pretendard Inter 14pt SemiBold
Body Pretendard Inter / Lora* 11pt Regular
Caption Pretendard Inter 9pt Regular
Code/mono D2Coding JetBrains Mono 10pt Regular

* Lora is Anthropic's official body font. Recommended for quotes and excerpt areas.

Spacing and Margins

  • Page: A4 (210×297 mm)
  • Margins: top/bottom 30 mm · left/right 25 mm (official document standard) / top/bottom 25 mm · left/right 22 mm (modern report)
  • Line spacing: body 1.5× · caption 1.2×
  • Heading spacing: H1 top 24 pt bottom 12 pt · H2 top 18 pt bottom 9 pt · H3 top 12 pt bottom 6 pt
  • Paragraph spacing: 6 pt
  • Table cell padding: left/right 6 pt, top/bottom 4 pt

Workflow

Step 1: Determine Document Type

Type Design Tone Recommended Palette Variation
Korean official document Formal/traditional Classic Mono (Dark + White만)
Corporate report Trust/data-centered Claude Classic (Orange + Beige + Dark)
Contract Formal/neutral Mono Strict (Dark + White)
Proposal Assertive/visual Claude Coral (Crail + Pampas)
Plan Creative/exploratory Claude Blue (Blue + Beige)
Business plan Impact/confidence Claude Bold (Orange Highlight + Dark)

Step 2: Collect and Structure Content

Standard structure by document type (see references/modern-templates.md):

Official document: Recipient · Subject · Body (numbered) · Issuing Organization Name · Person in Charge · Contact Information · Date Contract: Indication of Party A and Party B · Purpose of Contract · Scope · Term · Payment · Intellectual Property Rights · Confidentiality · Termination · Dispute Resolution · Signature Block Proposal: Cover · Executive Summary · Current Status · Proposal · Expected Outcomes · Schedule · Budget · Team Report: Summary · Background · Analysis · Conclusion · Recommendations · Appendix Planning Document: Background · Objectives · Strategy · Action Plan · KPI · Risks

Step 3: Generate the document with python-docx

from docx import Document
from docx.shared import Pt, Cm, RGBColor
from docx.enum.text import WD_ALIGN_PARAGRAPH
from docx.oxml.ns import qn
from docx.oxml import OxmlElement

doc = Document()

# 페이지 설정 — A4 + 모던 여백
section = doc.sections[0]
section.page_height = Cm(29.7)
section.page_width = Cm(21.0)
section.top_margin = Cm(2.5)
section.bottom_margin = Cm(2.5)
section.left_margin = Cm(2.2)
section.right_margin = Cm(2.2)

# Claude 톤 색
CLAUDE_ORANGE = RGBColor(0xD9, 0x77, 0x57)
CLAUDE_DARK = RGBColor(0x14, 0x14, 0x13)
CLAUDE_MID = RGBColor(0xB0, 0xAE, 0xA5)

# H1 스타일
h1 = doc.styles['Heading 1']
h1.font.name = 'Pretendard'
h1.font.size = Pt(22)
h1.font.bold = True
h1.font.color.rgb = CLAUDE_DARK

# 강조 헤딩 (Primary Orange 사용)
title = doc.add_heading('2026 Q1 사업 보고서', level=0)
for run in title.runs:
    run.font.color.rgb = CLAUDE_ORANGE
    run.font.size = Pt(28)

For the full code pattern, see references/modern-templates.md .

Step 4: Apply formatting and output the file

  • Paragraph styles (Heading 1-3 · Body · Quote · Caption)
  • Tables (Header shading Light Beige, borders Light Gray, zebra striping on row changes)
  • Images (logo · charts · signature) + automatic caption placement
  • Header/Footer (page number at bottom right, publisher at bottom left)
  • Batch replacement of placeholders ({변수명} → actual values)

Step 5: Review (10-step checklist)

references/qa-checklist.mdAutomatically/semi-automatically check the 10 steps of:

  1. No empty placeholders ({변수명} pattern remaining check)
  2. Page numbers shown on every page
  3. Consecutive heading hierarchy (no skipping from H1 → H3)
  4. Consistent table borders (unified border color and thickness)
  5. No font corruption (verify Pretendard · Malgun Gothic system fonts)
  6. Color contrast of at least 4.5:1 (Body Dark on Light Beige = 13.5:1 PASS)
  7. Consistent image captions (position · format)
  8. Consistent spacing between paragraphs (do not use manual blank lines)
  9. Table cell text wraps properly (no overflow)
  10. No AI slop expressions (innovative · next-generation · redefining, etc. — moai-design:claude-design-slop-check chaining recommended)

6 modern design patterns

Pattern 1 — Executive Summary Box

A 1-page summary box on the first page of reports and proposals.

┌────────────────────────────────────────┐
│ Executive Summary                      │  ← Orange 강조선
│ ──────────────────────────────────     │
│ [4-5줄 핵심 요약 — 본문보다 약간 큰   ]│
│ [폰트, 좌측 Orange 강조선 4pt]         │
└────────────────────────────────────────┘

Pattern 2 — Pull Quote

Quote emphasis in the middle of the body.

        ┃ "[인용문 — Lora 세리프 16pt 이탤릭]"
        ┃   — 출처 (Mid Gray, 11pt)

Anthropic Blue #6a9bcc 4pt left border + Lora italic.

Pattern 3 — Stat Callout

Number emphasis area.

   [37%]          [2.4배]          [₩1.2억]
   매출 증가      ROI 개선         예상 절감

Number: Orange 36pt Bold · Label: Mid Gray 11pt.

Pattern 4 — Comparison Table

Good/Bad · Existing/Proposed comparison.

| 기준        | 기존        | 제안         |
| ---        | ---        | ---         |
| Beige 헤더 | White cell | Orange tint |

Pattern 5 — Sidebar Note

Memo/annotation box beside the body text (Light Beige background).

Pattern 6 — Section Divider

Visual separation between sections.

─── ⬢ ────────────────────────────────
      Section 2 — 시장 분석

Small Orange shape + Mid Gray horizontal line + section number.

Usage examples

  • "Create a DOCX for a service contract (Party A: Company A, Party B: Company B, contract amount 10 million KRW)" → Mono Strict palette
  • "Create the Q1 quarterly report in a modern tone" → Claude Classic palette + Executive Summary Box + Stat Callout 3
  • "30-page startup business plan" → Claude Bold palette + use of 6 patterns
  • "Official cooperative document for an administrative agency" → Classic Mono palette + standard official document format
  • "Make an internal planning document usable for presentations as well" → Claude Blue palette + Pull Quote + Stat Callout

Output format

  • File format: .docx (Microsoft Word 2007+ compatible)
  • Page Setup: A4 (210mm × 297mm)
  • Margins: top/bottom 25-30mm, left/right 22-25mm (by document type)
  • Font: Pretendard (Korean) + Inter/Lora (English) · For official documents, Gulim/Malgun Gothic
  • Color Encoding: sRGB
  • Encoding: UTF-8

Precautions

Claude tone color usage rules

  • Primary Orange only for emphasis — do not plaster it across the entire body text
  • In one document, Primary + Secondary + Background = 3 colors + Dark/Light achromatic only
  • Use color only when it has meaning (not for decoration)

Using the HWPX Alternative

In an environment without Hancom Office, official documents can be replaced with DOCX. If Hancom conversion is needed, moai-office:hwpx-writer refer to the skill.

Compliance with Official Document Regulations

Comply with the format based on the Ministry of the Interior and Safety's "Regulations on the Preparation of Official Documents." For formal official documents, do not use Orange/Blue accent colors and prepare using Mono Strict (Dark + White only).

Fonts and Distribution

When distributing, embedding fonts or converting to PDF is recommended. Pretendard is open source, so embedding is unrestricted. Lora is free from Google Fonts.

Digital Signature

Insertion of digital signature fields is supported. We recommend converting to an Adobe Acrobat-compatible PDF and then applying a digital signature.

Security

For sensitive documents such as contracts, password protection is recommended. You can set a document open password and an editing password separately.

Troubleshooting

Situation Solution
File creation fails pip install python-docx Retry after installation
Colors do not appear Check whether RGBColor is used (docx.shared.RGBColor)
Fonts are broken Install Pretendard on the system or convert to PDF
Heading style does not apply doc.styles['Heading 1'] edit directly
Korean compatibility Gulim/Malgun Gothic fallback recommended
Table cell color does not change _tc.get_or_add_tcPr() + OxmlElement('w:shd') use
Page numbers are not inserted In the header/footer area, field insert the object

For detailed troubleshooting and code examples, see references/modern-templates.md .

Related Skills / Self-Review

After document generation is complete, reopen the produced .docx file and check for remaining placeholders, insufficient pages/length, Korean fonts, encoding corruption, and table corruption through self-review, and if there are problems, automatically fix and regenerate, then report the final PASS/FAIL result (for review items, see references/qa-checklist.md ).

Skill When to Use
moai-office:pptx-designer Create presentation slides (shares the same Claude tone design system)
moai-office:hwpx-writer Create Hancom Hangul documents (HWPX)
moai-office:xlsx-creator Excel data sheets
moai-office:pdf-writer PDF conversion/multilingual PDF
moai-content:humanize-korean Naturalize copy AI slop
moai-core:ai-slop-reviewer Review text deliverables for slop
moai-design:claude-design-slop-check Claude Design tone and consistency review

Technical references

  • python-docx official: https://python-docx.readthedocs.io/
  • Ministry of the Interior and Safety official document drafting regulations: https://www.mois.go.kr/
  • Anthropic Brand Guidelines: The colors and typography of this skill are based on the official Anthropic brand guide
  • Microsoft Word file format: ECMA-376 Office Open XML

References

  • references/modern-design-system.md — Full design tokens for color, typography, and spacing
  • references/modern-templates.md — Modern template structures for 6 major document types
  • references/qa-checklist.md — 10-step review checklist
  • references/document-generator.md — Korean business document creation guide (existing material, retained)