Catalog
openai/doc

openai

doc

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.

global
0installs0uses~738
v1.0Saved Apr 5, 2026

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.
Files5
5 files · 23.1 KB

Select a file to preview

Overall Score

82/100

Grade

B

Good

Safety

78

Quality

88

Clarity

85

Completeness

79

Summary

A skill for reading, creating, and editing DOCX documents with professional formatting and visual layout validation. It guides agents to use python-docx for structured edits and provides a bundled rendering script (render_docx.py) to convert DOCX → PDF → PNG for visual inspection before delivery.

Static Analysis Findings

1 finding

Patterns detected by deterministic static analysis before AI scoring. Hover over any finding code for detailed information and remediation guidance.

Destructive Operation
SEC-002Privilege Escalation

Privilege escalation (sudo)

SKILL.mdsudo a

Detected Capabilities

Read and parse DOCX file structure via python-docxCreate and modify DOCX documents (headings, styles, tables, lists)Convert DOCX to PDF using LibreOffice (soffice)Rasterize PDF to PNG images using Poppler (pdftoppm)Parse OOXML page dimensions from document.xmlCalculate DPI for rendering based on page sizeManage temporary files and intermediate outputsExecute system commands for document conversion

Trigger Keywords

Phrases that MCP clients use to match this skill to user intent.

edit docxreview word documentformat docxvalidate document layoutrender docx to imagescreate professional docdocx stylingcheck document pagination

Risk Signals

INFO

sudo apt-get install (Debian/Ubuntu package installation with privilege escalation)

SKILL.md, Dependencies section
INFO

LibreOffice (soffice) command execution with temporary user profile

scripts/render_docx.py, convert_to_pdf() function
WARNING

Subprocess execution without input validation (subprocess.run with check=False)

scripts/render_docx.py, run_cmd_no_check() function
INFO

XML parsing from untrusted DOCX files (ElementTree.fromstring on document.xml)

scripts/render_docx.py, calc_dpi_via_ooxml_docx() function
INFO

Temporary directory creation and cleanup (makedirs, tempfile.TemporaryDirectory)

scripts/render_docx.py, multiple locations

Referenced Domains

External domains referenced in skill content, detected by static analysis.

schemas.openxmlformats.orgwww.apache.org

Use Cases

  • Review DOCX content with layout fidelity (tables, diagrams, pagination)
  • Create professional DOCX files with consistent formatting and styles
  • Validate visual layout and render pages before final delivery
  • Edit DOCX structure (headings, lists, tables) with python-docx
  • Convert DOCX to images for visual quality assurance

Quality Notes

  • Strong documentation: clear workflow, dependencies section with platform-specific instructions, and explicit quality expectations
  • Good scoping: skill is narrowly focused on DOCX operations with defined temp/output conventions (tmp/docs/, output/doc/)
  • Fallback mechanisms: script includes fallback from direct DOCX→PDF to DOCX→ODT→PDF conversion
  • Error handling: render_docx.py validates system tools (ensure_system_tools), checks file existence, and raises meaningful exceptions
  • Edge case coverage: handles missing Poppler/LibreOffice gracefully and provides user guidance
  • Visual inspection emphasis: workflow prioritizes rendered page review to catch layout defects before delivery
  • Python script is well-structured: type hints, proper temp directory isolation, and concurrent-safe user profile creation
  • OOXML parsing is robust: script extracts page dimensions from document.xml with namespace awareness and fallback to PDF-based DPI calculation
  • One minor concern: subprocess.run with check=False may mask conversion failures silently — relies on downstream file existence checks
Model: claude-haiku-4-5-20251001Analyzed: Apr 5, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Add openai/doc to your library

Command Palette

Search for a command to run...