Manipulate .docx files with high layout fidelity using Python-based tools and visual rendering checks.

Install

mkdir -p .claude/skills/doc-cdrguru && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/18707" && unzip -o skill.zip -d .claude/skills/doc-cdrguru && rm skill.zip

Installs to .claude/skills/doc-cdrguru

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Use when the task involves reading, creating, or editing `.docx` documents, especially when formatting or layout fidelity matters; prefer `python-docx` plus the bundled `scripts/render_docx.py` for visual checks.
212 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Read or review DOCX content with layout fidelity
  • Create or edit DOCX files with professional formatting
  • Validate visual layout before delivery
  • Convert DOCX to PDF and PNGs for visual checks
  • Use `python-docx` for structured editing
  • Extract text from DOCX as a fallback

How it works

The workflow prioritizes visual review by converting DOCX to PDF and then to PNGs. It uses `python-docx` for structured edits and re-renders after each change to inspect pages, falling back to text extraction if visual review is not possible.

Inputs & outputs

You give it
DOCX file or content for a new DOCX file
You get back
Edited DOCX file, rendered PDF/PNGs, or extracted text

When to use doc

  • Edit professional documentation
  • Create docx reports from code
  • Validate document layout
  • Extract text from Word files

About this skill

DOCX Skill

When to use

  • Read or review DOCX content where layout matters (tables, diagrams, pagination).
  • Create or edit DOCX files with professional formatting.
  • Validate visual layout before delivery.

Workflow

  1. Prefer visual review (layout, tables, diagrams).
    • If soffice and pdftoppm are available, convert DOCX -> PDF -> PNGs.
    • Or use scripts/render_docx.py (requires pdf2image and Poppler).
    • If these tools are missing, install them or ask the user to review rendered pages locally.
  2. Use python-docx for edits and structured creation (headings, styles, tables, lists).
  3. After each meaningful change, re-render and inspect the pages.
  4. If visual review is not possible, extract text with python-docx as a fallback and call out layout risk.
  5. Keep intermediate outputs organized and clean up after final approval.

Temp and output conventions

  • Use tmp/docs/ for intermediate files; delete when done.
  • Write final artifacts under output/doc/ when working in this repo.
  • Keep filenames stable and descriptive.

Dependencies (install if missing)

Prefer uv for dependency management.

Python packages:

uv pip install python-docx pdf2image

If uv is unavailable:

python3 -m pip install python-docx pdf2image

System tools (for rendering):

# macOS (Homebrew)
brew install libreoffice poppler

# Ubuntu/Debian
sudo apt-get install -y libreoffice poppler-utils

If installation isn't possible in this environment, tell the user which dependency is missing and how to install it locally.

Environment

No required environment variables.

Rendering commands

DOCX -> PDF:

soffice -env:UserInstallation=file:///tmp/lo_profile_$$ --headless --convert-to pdf --outdir $OUTDIR $INPUT_DOCX

PDF -> PNGs:

pdftoppm -png $OUTDIR/$BASENAME.pdf $OUTDIR/$BASENAME

Bundled helper:

python3 scripts/render_docx.py /path/to/file.docx --output_dir /tmp/docx_pages

Quality expectations

  • Deliver a client-ready document: consistent typography, spacing, margins, and clear hierarchy.
  • Avoid formatting defects: clipped/overlapping text, broken tables, unreadable characters, or default-template styling.
  • Charts, tables, and visuals must be legible in rendered pages with correct alignment.
  • Use ASCII hyphens only. Avoid U+2011 (non-breaking hyphen) and other Unicode dashes.
  • Citations and references must be human-readable; never leave tool tokens or placeholder strings.

Final checks

  • Re-render and inspect every page at 100% zoom before final delivery.
  • Fix any spacing, alignment, or pagination issues and repeat the render loop.
  • Confirm there are no leftovers (temp files, duplicate renders) unless the user asks to keep them.

When not to use it

  • When formatting or layout fidelity is not important
  • When working with plain text files
  • When visual review is not possible and text extraction is sufficient

Limitations

  • Requires `soffice` and `pdftoppm` (or `pdf2image` and Poppler) for visual rendering
  • If visual review is not possible, layout risk must be called out
  • Delivers a client-ready document with specific quality expectations

How it compares

This skill emphasizes visual validation and structured editing with `python-docx`, ensuring layout fidelity and professional formatting, unlike simple text-based document processing that ignores visual presentation.

Compared to similar skills

doc side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
doc (this skill)04moReviewIntermediate
pdf-creator028dReviewIntermediate
docstring89moNo flagsBeginner
pr-draft-summary34moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

pdf-creator

seaworld008

Create PDF documents from markdown with proper Chinese font support using weasyprint. This skill should be used when converting markdown to PDF, generating formal documents (legal, trademark filings, reports), or when Chinese typography is required. Triggers include "convert to PDF", "generate PDF",

00

docstring

pytorch

Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.

891

pr-draft-summary

openai

Create a PR title and draft description after substantive code changes are finished. Trigger when wrapping up a moderate-or-larger change (runtime code, tests, build config, docs with behavior impact) and you need the PR-ready summary block with change summary plus PR draft text.

326

business-document-generator

ailabs-393

This skill should be used when the user requests to create professional business documents (proposals, business plans, or budgets) from templates. It provides PDF templates and a Python script for generating filled documents from user data.

316

releasenote

DataDog

Create or update release notes for changes in the current branch using Reno, following dd-trace-py's conventions and the guidelines in docs/releasenotes.rst.

15

report-research

numerai

Write a complete Numerai experiment report in experiment.md (abstract, methods, results tables, decisions, next steps) and generate/link the standard show_experiment plot(s). Use after running any Numerai research experiments, or when a user asks for a “full report”, “write up”, “experiment.md update”, or “generate the standard plot”.

10

Search skills

Search the agent skills registry