doc

Edit DOCX documents with python-docx to preserve formatting and layout.

1|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/cdrguru/portable-agent-kit --skill doc-cdrguru
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: doc
Source: https://github.com/cdrguru/portable-agent-kit/tree/main/.codex/skills/doc
Command: npx skills add https://github.com/cdrguru/portable-agent-kit --skill doc-cdrguru

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires python-docx, pdf2image, and includes scripts (resource) components.

What problem does it solve?

Edit DOCX documents to preserve professional formatting and layout, reducing manual rework and inconsistencies across reports and templates.

Core Features & Use Cases

  • Programmatic Editing: Create, update, and format headings, lists, tables, and styles using python-docx.
  • Layout & Rendering Guidance: Validate visual fidelity and render DOCX to PDFs or PNGs with the bundled rendering script for quick reviews.
  • Use Case: Automate the assembly of client reports by applying consistent templates, styles, and reusing content blocks.

Quick Start

Render a sample DOCX to PNG pages using the bundled helper by running python3 scripts/render_docx.py /path/to/file.docx --output_dir /tmp/doc_pages.

Frequently Asked Questions about doc

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

FAQPage Schema
How do I edit DOCX documents while preserving formatting and layout?

To edit DOCX documents while preserving formatting, use python-docx to programmatically update headings, lists, tables, and styles without breaking the original layout. This ensures professional fidelity across reports and templates.

Can I render DOCX files to PDF or PNG for visual review?

Yes, you can render DOCX files to PDF or PNG for visual review using the bundled scripts/render_docx.py helper. Run it with python3 to output rendered pages to a specified directory.

Does python-docx support updating existing document templates?

Yes, python-docx supports updating existing document templates by applying consistent styles and reusing content blocks. This allows you to automate template assembly for client reports and admin workflows.

What's the best way to automate assembling client reports in DOCX?

The best way to automate assembling client reports in DOCX is using python-docx to apply consistent templates, format tables, and reuse content blocks programmatically. This reduces manual rework and inconsistencies.

Do I need pdf2image to validate DOCX layout fidelity?

Yes, you need the pdf2image dependency alongside python-docx to validate visual fidelity by rendering DOCX files to images. This combination enables quick visual checks of your formatting and layout.