DOCX
When to use
- Read or review DOCX content where layout matters.
- Create or edit DOCX files with professional formatting.
- Validate visual layout before delivery.
Workflow
If this skill is installed under DeepAgents, replace ~/.cline/skills in the examples below with ~/.deepagents/agent/skills.
- Prefer visual review for layout, tables, diagrams, and pagination.
- Use
python-docxfor edits and structured creation. - If the current Cline model cannot inspect images well enough, route rendered pages or the DOCX itself through
onprem-document-vision. - Re-render and inspect after meaningful changes.
- If visual review is not possible, extract text as a fallback and call out layout risk.
Rendering helper
Bundled helper:
python "$HOME/.cline/skills/doc/scripts/render_docx.py" /path/to/file.docx --output_dir /tmp/docx_pages
The helper renders DOCX through LibreOffice and rasterizes the resulting PDF with pypdfium2.
If the active model lacks vision, use the shared on-prem document vision helper directly:
python "$HOME/.cline/skills/onprem-document-vision/scripts/document_vision_review.py" `
review "C:\path\to\file.docx" `
--instructions "Extract visible text, explain diagrams, and call out layout issues." `
--markdown
Dependencies
Python packages:
python -m pip install python-docx pypdfium2 pillow
Required system tools for rendering:
# macOS
brew install libreoffice
# Ubuntu or Debian
sudo apt-get install -y libreoffice
Quality expectations
- Deliver a polished document with consistent typography, spacing, margins, and hierarchy.
- Avoid clipped text, broken tables, unreadable characters, or placeholder styling.
- Re-render and inspect every page before final delivery when possible.
- If only text fallback was available, say that screenshots, diagrams, or layout-sensitive issues may remain.