DOCX Report Generator Skill
Fill templated DOCX with data to produce reports, invoices, and formatted documents. Generate professional Word documents programmatically with python-docx or use Jinja2 templates with docxtpl for dynamic content insertion. Support tables, images, headers, footers, and custom styling.
Open the source and read safety notes before installing.
Prerequisites
- Python 3.11+
- docxtpl
- docx2pdf or libreoffice for PDF
- File system read/write access for template files and generated DOCX documents
- Python environment with pip for installing python-docx and docxtpl packages
- Optional: LibreOffice or docx2pdf for PDF conversion (requires system installation of LibreOffice for cross-platform PDF export)
Schema details
- Install type
- package
- Reading time
- 5 min
- Difficulty score
- 100
- Troubleshooting
- Yes
- Breaking changes
- No
- Download URL
- /downloads/skills/docx-report-generator.zip
- Package verified
- Yes
- SHA-256
- 97c1f763257656b21679a7b0158c6a5f70e4f9feae1722c8674242498e39d462
- Skill type
- general
- Skill level
- advanced
- Verification
- draft
- Verified at
- 2025-10-15
| Platform | Support | Install path |
|---|---|---|
| claude-code | Native | .claude/skills/<skill-name>/SKILL.md |
| codex | Native | .agents/skills/<skill-name>/SKILL.md |
| windsurf | Native | .windsurf/skills/<skill-name>/SKILL.md |
| gemini | Native | .gemini/skills/<skill-name>/SKILL.md or .agents/skills/<skill-name>/SKILL.md |
| cursor | Adapter | .cursor/rules/<skill-name>.mdc |
| cli | Manual | AGENTS.md or tool-specific context file |
Full copyable content
from docxtpl import DocxTemplate
doc = DocxTemplate('template.docx')
context = { 'client': 'Acme', 'items': [{'name': 'Widget', 'price': 9.99}] }
doc.render(context)
doc.save('invoice.docx')About this resource
What This Skill Enables
Claude can create, edit, and format Microsoft Word documents (.docx) programmatically. Generate professional reports, proposals, documentation, and formatted documents with tables, charts, headers, and custom styling.
Compatibility
Native
- Claude Code / Claude: native skill usage via
SKILL.md. - Codex/OpenAI workflows: compatible with Agent Skills-style
SKILL.mdcontent as reusable workflow instructions.
Manual Adaptation
- Gemini CLI: native skill usage via
.gemini/skills/<skill-name>/SKILL.mdor.agents/skills/<skill-name>/SKILL.mdwhere supported. - Cursor: use the generated
.cursor/rules/*.mdcadapter for project rules. - OpenClaw and similar agents: use the same skill content as a reusable prompt/workflow file when native skill import is unavailable.
Prerequisites
Required:
- Claude Pro subscription
- Code Interpreter feature enabled
- Template document uploaded (optional, for editing existing docs)
What Claude handles:
- Installing python-docx and document libraries
- Document structure and formatting
- Table generation and styling
- Page layout and sections
- Converting between formats (Markdown → DOCX)
How to Use This Skill
Create a New Document
Prompt: "Create a professional business proposal document with:
- Title page with company logo placeholder
- Executive summary section
- 3-column pricing table
- Terms and conditions Save as proposal.docx"
Claude will:
- Create document structure
- Add formatted sections
- Generate styled tables
- Apply professional formatting
- Export as .docx file
Edit Existing Document
Prompt: "Open this contract template and:
- Replace all [COMPANY_NAME] with 'Acme Corp'
- Update the pricing table in section 3
- Add a new clause about termination
- Save as acme_contract.docx"
Claude will:
- Load the existing document
- Find and replace text
- Modify tables
- Insert new content
- Preserve original formatting
Generate Report from Data
Prompt: "Create a monthly sales report from this CSV data:
- Executive summary with key metrics
- Sales by region table
- Top performers list
- Month-over-month comparison chart
- Save as sales_report_october.docx"
Claude will:
- Analyze the CSV data
- Calculate metrics
- Generate formatted sections
- Create tables with data
- Add visual elements
Format Conversion
Prompt: "Convert this Markdown document to a formatted Word document with:
- Headings styled with built-in heading styles
- Code blocks in monospace font
- Bullet lists properly formatted
- Save as documentation.docx"
Claude will:
- Parse Markdown structure
- Map to Word styles
- Apply formatting
- Generate DOCX
Common Workflows
Meeting Minutes Template
"Create a meeting minutes template with:
1. Header: Date, Time, Location, Attendees
2. Agenda items section
3. Discussion notes table (Topic | Discussion | Decision)
4. Action items table (Task | Owner | Due Date | Status)
5. Next meeting section
Use professional formatting with the 'Office' built-in style."
Invoice Generation
"Generate an invoice document:
1. Company header (name, address, logo placeholder)
2. Invoice details (number, date, due date)
3. Bill to / Ship to sections
4. Line items table (Description, Qty, Rate, Amount)
5. Subtotal, tax, total calculations
6. Payment terms footer
Make it look professional with borders and shading."
Technical Documentation
"Create technical documentation:
1. Cover page with title and version
2. Table of contents (auto-generated)
3. Multiple sections with heading hierarchy
4. Code examples in monospace with syntax highlighting
5. Tables for API endpoints
6. Numbered figures with captions
Use consistent styling throughout."
Resume/CV Formatting
"Format this resume data into a professional document:
1. Header with name and contact info
2. Professional summary
3. Work experience (company, role, dates, bullets)
4. Education section
5. Skills table (2 columns)
6. Use modern, clean formatting
Save as resume.docx"
Tips for Best Results
- Be Specific About Formatting: Mention fonts, sizes, colors, alignment
- Reference Built-in Styles: Use Word's built-in styles ("Heading 1", "Title", "Intense Quote")
- Table Formatting: Specify headers, borders, shading, column widths
- Page Layout: Mention margins, orientation, page size if non-standard
- Images: Provide image files or describe placeholder dimensions
- Consistent Style: Ask for style guides ("use Arial 11pt throughout")
- Sections: Use section breaks for different headers/footers
Advanced Features
Headers & Footers
- Different first page headers
- Page numbers with custom formatting
- Chapter/section titles in headers
- Watermarks and background
Table Enhancements
- Merged cells
- Repeating header rows
- Conditional formatting
- Auto-width columns
Document Automation
- Mail merge from data files
- Template-based generation
- Batch document creation
- Variable substitution
Troubleshooting
Issue: Formatting doesn't look right Solution: Be more specific about styles. Reference Word's built-in style names or describe exact formatting (font, size, color, alignment)
Issue: Tables break across pages poorly Solution: Ask Claude to set "keep rows together" or adjust table properties
Issue: Images not appearing Solution: Upload images separately and reference them in your prompt, or describe placeholder dimensions
Issue: Headers/footers not updating Solution: Specify which sections need different headers/footers and where section breaks should go
Issue: Lost formatting when editing Solution: Ask Claude to preserve existing styles: "Keep all original formatting except..."
Learn More
- python-docx Documentation - Comprehensive API guide
- Word Document Structure - Understanding .docx internals
- Office Open XML Spec - DOCX file format details
- Simon Willison's DOCX Analysis - Claude's DOCX capabilities
Features
- Template placeholders and loops
- Image and table insertion
- Page layout control
- Optional PDF export pipeline
- Jinja2 template engine for dynamic content insertion
- Rich text formatting with inline styles and formatting
- Batch document generation from data sources
- Header and footer customization with page numbers, dynamic content insertion, different first page headers, and section-based header/footer variations
Use Cases
- Invoices and statements
- Client reports
- Batch document generation
- Automated invoice and billing statement generation
- Personalized client reports and proposals
- Technical documentation with code examples and diagrams
- What This Skill Enables
- Compatibility
- Native
- Manual Adaptation
- Prerequisites
- How to Use This Skill
- Create a New Document
- Edit Existing Document
- Generate Report from Data
- Format Conversion
- Common Workflows
- Meeting Minutes Template
- Invoice Generation
- Technical Documentation
- Resume/CV Formatting
- Tips for Best Results
Source citations
Signals
Loading live community signals…
A short, calm digest of reviewed Claude resources. Unsubscribe any time.