generate-word

Generate real .docx Word documents programmatically with python-docx, including headings, tables, and embedded images.

Updated Jul 24, 2026
One-click install
npx skills add https://github.com/gweone/agent-plugins --skill generate-word-gweone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-word
Source: https://github.com/gweone/agent-plugins/tree/main/plugin/sharpps-work/skills/generate-word
Command: npx skills add https://github.com/gweone/agent-plugins --skill generate-word-gweone

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-docx.

What problem does it solve? Producing a genuine Word document deliverable — with styled headings, tables, embedded screenshots, and captions — normally requires Word or LibreOffice and manual formatting. This Skill builds real OpenXML .docx files programmatically and headlessly, so formatted manuals and guideline documents can be generated and verified entirely from code. ## Core Features & Use Cases - Programmatic .docx generation: Build title pages, styled headings, bullet lists, and branded colors using python-docx with no Office installation required. - Tables, images, and callouts: Add tables with bold header rows, embed screenshots with italic captions, and approximate note/callout boxes with bold colored label prefixes. - Output verification: Re-open the generated file to confirm heading structure and paragraph/table counts before handing it over, catching silent corruption. - Use Case: Pair with a screen-capture workflow to produce a user manual: capture UI screenshots, then generate a branded .docx with a title page, section headings, captioned images, and note callouts saved into the project's docs/ folder. ## Quick Start Generate a Word document named setup-guide.docx with a title page, three headed sections, a comparison table, and embedded screenshots with captions.

Frequently Asked Questions about generate-word

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a Word document in Python without Microsoft Word?

Use python-docx, a pure-Python library that manipulates OpenXML inside a zip archive, so no Word or LibreOffice install is needed. Install with pip install python-docx, then build headings, paragraphs, tables, and images and save a real .docx file.

How do I add images with captions to a docx using python-docx?

Add the image in a centered paragraph using add_run().add_picture with an explicit width in inches, then add a following centered paragraph with italic, smaller gray text as the caption. A width of about 6.3 inches fits standard Letter/A4 margins.

Does python-docx work on Windows, macOS, and Linux?

Yes, python-docx is pure Python with no native or OS-specific dependencies, so the same code runs identically on Windows, macOS, and Linux. It works fully headless since it only manipulates XML inside the docx zip archive.

Why is my generated docx file corrupted or won't open in Word?

A malformed image embed or bad raw OOXML element can silently produce an unreadable file even when the script exits successfully. Always re-open the output with Document(path) and check paragraph counts, table counts, and the heading list before delivering it.

Can python-docx create callout boxes or shaded table cells?

python-docx has no native callout element, so approximate one with an indented paragraph using a bold colored label prefix. Cell background shading also lacks a high-level API and requires raw OOXML via OxmlElement and the w:shd element.