home / skills / ntaksh42 / agents / docx-processor

docx-processor skill

/.claude/skills/docx-processor

This skill generates and edits Word documents (.docx) with headers, footers, styles, tables, images, and Markdown conversion.

npx playbooks add skill ntaksh42/agents --skill docx-processor

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
1.2 KB
---
name: docx-processor
description: Process and generate Word documents with formatting, tables, and images. Use when working with Word documents or generating reports.
---

# Word Document Processor Skill

Word文書(.docx)の作成・編集を行うスキルです。

## 主な機能

- **文書作成**: ヘッダー、フッター、段落
- **スタイル**: フォント、色、書式
- **テーブル**: 表作成
- **画像**: 画像挿入
- **変換**: Markdown → DOCX

## Python (python-docx)

```python
from docx import Document
from docx.shared import Inches, Pt, RGBColor

doc = Document()

# タイトル
title = doc.add_heading('レポートタイトル', 0)
title.alignment = WD_ALIGN_PARAGRAPH.CENTER

# 段落
p = doc.add_paragraph('これは本文です。')
p.add_run(' 太字テキスト').bold = True
p.add_run(' 斜体テキスト').italic = True

# テーブル
table = doc.add_table(rows=3, cols=3)
table.style = 'Light Grid Accent 1'

hdr_cells = table.rows[0].cells
hdr_cells[0].text = '名前'
hdr_cells[1].text = '年齢'
hdr_cells[2].text = '職業'

# 画像
doc.add_picture('image.png', width=Inches(4))

doc.save('report.docx')
```

## バージョン情報
- Version: 1.0.0

Overview

This skill processes and generates Microsoft Word (.docx) documents with rich formatting, tables, and images. It streamlines creating reports, invoices, and formatted deliverables from code or templates. The skill supports headers, footers, paragraph styling, tables, image insertion, and Markdown-to-DOCX conversion.

How this skill works

The skill programmatically builds .docx files by composing document elements: headings, paragraphs with runs (bold/italic), styled tables, and embedded images. It applies font, size, color, and preset table styles, and can convert Markdown content into Word structure. Documents are saved as standard .docx files compatible with Word and other editors.

When to use it

  • Automatically generate formatted reports from data or analysis
  • Create templated documents like invoices, proposals, or summaries
  • Convert Markdown notes or content into a Word document
  • Add tables and images to programmatically produced deliverables
  • Apply consistent styling across multiple documents

Best practices

  • Define a reusable template for headers, footers, and styles to ensure consistency
  • Keep image sizes controlled (use inches or points) to avoid large files
  • Use table styles and explicit column counts to preserve layout across viewers
  • Separate content generation from styling logic for easier maintenance
  • Validate generated documents in Word or LibreOffice to confirm formatting

Example use cases

  • Generate a weekly project report with centered title, styled paragraphs, and embedded charts as images
  • Produce an invoice template populated from a database, with a formatted items table and footer notes
  • Convert Markdown meeting notes into a polished DOCX file for distribution
  • Create employee summaries with a table of details and profile images
  • Batch-produce branded proposals using a header/footer template and consistent fonts

FAQ

Which elements can the skill include in a document?

Headers, footers, headings, paragraphs with bold/italic runs, font and color settings, styled tables, and inserted images are supported.

Can I convert Markdown to DOCX reliably?

Yes. The skill supports converting Markdown content into Word structures, mapping headings, paragraphs, lists, and code blocks to appropriate DOCX elements.