DOCX
Summary
Use this skill for .docx reports, memos, letters, meeting notes, proposals,
and other word-processing documents. Prefer python-docx for common document
structures and use an available local LibreOffice renderer for pagination and
visual review.
This skill does not imply complete support for every Word or OOXML feature.
When To Use
- Creating a structured document from notes, Markdown, or source material
- Inspecting paragraphs, headings, tables, images, styles, and metadata
- Making bounded edits to a conventional DOCX
- Converting a DOCX to PDF for review
- Checking document structure, pagination, and consistency
Safety Boundaries
- Preserve the source and write a new
.docx by default.
- Treat macros, links, fields, embedded files, OLE objects, comments, revisions,
and custom XML as untrusted input.
- Never execute macros, update external fields, open embedded objects, or follow
document links automatically.
- Ask before resolving external assets or uploading content.
- Do not claim lossless editing for content controls, complex fields, tracked
changes, equations, signatures, embedded objects, or package parts not modeled
by the selected library.
Use read-only analysis or create a new document when preserving unsupported
features is material to the request.
Backend Selection
- Use python-docx for common paragraphs, styles, lists, sections, tables,
headers, footers, and images.
- Use LibreOffice headless only when installed and approved as a local
renderer or converter. Record the actual backend.
- Use package-level XML inspection for risk inventory or verification, not as a
default editing strategy.
Do not silently install Python packages, fonts, LibreOffice, or converters.
Workflow
- Confirm the document type, audience, language, page or word target, style
guide, template, citations, output path, and whether comments or revisions
must be preserved.
- Inspect an existing package before editing. Record styles, sections, headers
and footers, tables, fields, links, comments, revisions, macros, signatures,
embedded objects, and unknown parts.
- Plan the heading hierarchy, sections, tables, figures, references, and page
furniture before generation.
- Select a backend and restrict changes to features it represents reliably.
- Write a new output file. Avoid raw OOXML edits unless the relationship and
namespace effects are fully understood.
- Reopen the result and verify expected headings, paragraph and table counts,
relationships, images, sections, headers, and footers.
- Render to PDF or pages when possible. Inspect page breaks, widows and orphans,
clipped tables, heading placement, list numbering, headers, footers, and font
substitution.
- Sample-check important facts, citations, figures, and tables against source
material.
Quality Rules
- Use semantic styles rather than formatting every paragraph independently.
- Maintain a coherent heading hierarchy and consistent spacing.
- Keep tables within page bounds and repeat header rows when appropriate.
- Do not fabricate quotations, citations, legal language, or factual claims.
- Record unresolved comments, revisions, fields, or links that remain.
- Treat automatic tables of contents and fields as needing an actual update
backend; writing field instructions alone does not prove displayed values.
Delivery
Report the output path, whether the source was unchanged, backend and fonts
used, structural and rendered checks, citation or data sampling, and any impact
on comments, revisions, fields, links, macros, signatures, or unsupported OOXML
features. If rendering was unavailable, state that pagination was not verified.
1---2name: docx3description: Create, inspect, edit, render, and validate Word documents with local open-source tools while preserving source files and making unsupported OOXML features explicit.4---56# DOCX78## Summary910Use this skill for `.docx` reports, memos, letters, meeting notes, proposals,11and other word-processing documents. Prefer `python-docx` for common document12structures and use an available local LibreOffice renderer for pagination and13visual review.1415This skill does not imply complete support for every Word or OOXML feature.1617## When To Use1819- Creating a structured document from notes, Markdown, or source material20- Inspecting paragraphs, headings, tables, images, styles, and metadata21- Making bounded edits to a conventional DOCX22- Converting a DOCX to PDF for review23- Checking document structure, pagination, and consistency2425## Safety Boundaries2627- Preserve the source and write a new `.docx` by default.28- Treat macros, links, fields, embedded files, OLE objects, comments, revisions,29 and custom XML as untrusted input.30- Never execute macros, update external fields, open embedded objects, or follow31 document links automatically.32- Ask before resolving external assets or uploading content.33- Do not claim lossless editing for content controls, complex fields, tracked34 changes, equations, signatures, embedded objects, or package parts not modeled35 by the selected library.3637Use read-only analysis or create a new document when preserving unsupported38features is material to the request.3940## Backend Selection4142- Use **python-docx** for common paragraphs, styles, lists, sections, tables,43 headers, footers, and images.44- Use **LibreOffice headless** only when installed and approved as a local45 renderer or converter. Record the actual backend.46- Use package-level XML inspection for risk inventory or verification, not as a47 default editing strategy.4849Do not silently install Python packages, fonts, LibreOffice, or converters.5051## Workflow52531. Confirm the document type, audience, language, page or word target, style54 guide, template, citations, output path, and whether comments or revisions55 must be preserved.562. Inspect an existing package before editing. Record styles, sections, headers57 and footers, tables, fields, links, comments, revisions, macros, signatures,58 embedded objects, and unknown parts.593. Plan the heading hierarchy, sections, tables, figures, references, and page60 furniture before generation.614. Select a backend and restrict changes to features it represents reliably.625. Write a new output file. Avoid raw OOXML edits unless the relationship and63 namespace effects are fully understood.646. Reopen the result and verify expected headings, paragraph and table counts,65 relationships, images, sections, headers, and footers.667. Render to PDF or pages when possible. Inspect page breaks, widows and orphans,67 clipped tables, heading placement, list numbering, headers, footers, and font68 substitution.698. Sample-check important facts, citations, figures, and tables against source70 material.7172## Quality Rules7374- Use semantic styles rather than formatting every paragraph independently.75- Maintain a coherent heading hierarchy and consistent spacing.76- Keep tables within page bounds and repeat header rows when appropriate.77- Do not fabricate quotations, citations, legal language, or factual claims.78- Record unresolved comments, revisions, fields, or links that remain.79- Treat automatic tables of contents and fields as needing an actual update80 backend; writing field instructions alone does not prove displayed values.8182## Delivery8384Report the output path, whether the source was unchanged, backend and fonts85used, structural and rendered checks, citation or data sampling, and any impact86on comments, revisions, fields, links, macros, signatures, or unsupported OOXML87features. If rendering was unavailable, state that pagination was not verified.