word-documents
Skill33 starsChanged 36 days agoMITView on GitHub
Use when creating, reading, or editing Word documents (.docx). Covers document generation with styles and structure, extracting content, find-and-replace, tracked changes, and templates. Trigger on "generate a word document", "find and replace in this docx", "fill this word template", "accept the tracked changes". Do not use for converting a docx to Markdown or PDF — see the document-conversion skill.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- JeffreyFerreiras/ai-skillstheir own version, first seen Oct 5, 2026
- naingthet/tidebreaktheir own version, first seen Sep 25, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- JeffreyFerreiras/ai-skills★ 1same name
- naingthet/tidebreak★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository137 other files it gives its agents.
- agent-instructionsSkill
- agent-memorySkill
- hooksSkill
- plugin-developmentSkill
- skill-authoringSkill
- skill-reviewSkill
- slash-commandsSkill
- subagentsSkill
- agent-designSkill
- context-engineeringSkill
- fine-tuningSkill
- llm-cost-optimizationSkill
- llm-evaluationSkill
- llm-integrationSkill
- mcp-serverSkill
- ml-pipelineSkill
- model-selectionSkill
- prompt-engineeringSkill
- ragSkill
- structured-outputSkill
- api-designSkill
- background-jobsSkill
- cachingSkill
- djangoSkill
- event-driven-architectureSkill
- fastapiSkill
- graphqlSkill
- microservicesSkill
- nestjsSkill
- realtime-websocketsSkill
- spring-bootSkill
- competitive-analysisSkill
- lead-researchSkill
- product-analysisSkill
- resumeSkill
- user-researchSkill
- database-performanceSkill
- data-modelingSkill
- data-qualitySkill
- pandasSkill
- postgresSkill
- sparkSkill
- brand-guidelinesSkill
- generative-artSkill
- themingSkill
- ui-reviewSkill
- visual-designSkill
- architecture-decisionsSkill
- bug-fix-protocolSkill
- cli-developmentSkill
- code-reviewSkill
- debuggingSkill
- design-patternsSkill
- domain-modelingSkill
- git-workflowSkill
- legacy-modernizationSkill
- refactoringSkill
- repository-explorationSkill
- simple-designSkill
- system-designSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
Document generation with headings, tables, images, headers, and footers.
- Distinctive: line 130
If the output will be converted to PDF, verify the conversion — fonts that are not embedded will be substituted, and the layout will shift.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Word Documents
Purpose
Produce and manipulate .docx files programmatically, with real styles and structure rather than a wall of manually formatted paragraphs.
When to Use
- Generating a report, memo, letter, or contract as a Word document.
- Extracting text, tables, or comments from an existing
.docx. - Performing find-and-replace across a document while preserving formatting.
- Filling a template with data.
- Working with tracked changes or comments.
Capabilities
- Document generation with headings, tables, images, headers, and footers.
- Style application and modification.
- Content extraction, including tables and embedded objects.
- Find-and-replace preserving runs and formatting.
- Template filling.
- Tracked changes and comments.
Inputs
- The content and its structure.
- A template or style reference, if the output must match a house style.
- The source document, when reading or editing.
Outputs
- A valid
.docxwith a proper style hierarchy. - Extracted content in a structured form.
- An edited document that preserves the formatting it should preserve.
Workflow
- Use styles, never direct formatting — A heading is
Heading 1, not 18pt bold. Styles produce a navigable document, a working table of contents, and a document that can be restyled in one operation. - Start from a template when the house style matters — Load the organization's
.dotxor a reference.docxand write into its styles rather than recreating them. - Structure before content — Headings, then the body. The outline is what makes a long document usable.
- Preserve formatting when editing — A naive find-and-replace on the XML destroys runs. Replace within runs, and handle text split across runs.
- Verify the output — Open it. A
.docxthat a library writes without error can still be malformed in ways Word will complain about.
Best Practices
- Direct formatting (bold, a font size, a colour applied by hand) makes a document unmaintainable. Every visual property should come from a style.
- Text in Word is stored in runs, and a single sentence is frequently split across several. A replace that only handles single-run text will silently miss matches where formatting changes mid-word.
- Tables need a table style, or they render with no borders and are unreadable when printed.
- Images need explicit dimensions. Without them, Word inserts at native resolution, which is usually enormous.
- A table of contents field must be marked for update, and Word will prompt the user on open. This is expected behavior, not a bug.
- For a document that will be edited by humans, keep the structure simple. Deeply nested tables and text boxes are fragile.
Examples
Generating a structured document:
from docx import Document
from docx.shared import Pt, Inches
from docx.enum.text import WD_ALIGN_PARAGRAPH
# Start from the house template so styles already exist and match.
doc = Document("templates/report-template.docx")
doc.add_heading("Quarterly Operations Review", level=0) # Title style
p = doc.add_paragraph()
p.alignment = WD_ALIGN_PARAGRAPH.CENTER
run = p.add_run("Q2 2026")
run.italic = True
doc.add_heading("Summary", level=1)
doc.add_paragraph(
"Availability met the 99.9% target in each month of the quarter. "
"Two incidents exceeded the 30-minute recovery objective; both are covered below."
)
doc.add_heading("Incidents", level=1)
table = doc.add_table(rows=1, cols=4)
table.style = "Light Grid Accent 1" # a real table style, not hand-drawn borders
for cell, heading in zip(table.rows[0].cells, ["Date", "Duration", "Impact", "Cause"]):
cell.paragraphs[0].add_run(heading).bold = True
for incident in incidents:
row = table.add_row().cells
row[0].text = incident.date.isoformat()
row[1].text = f"{incident.minutes} min"
row[2].text = incident.impact
row[3].text = incident.cause
doc.add_page_break()
doc.save("output/q2-review.docx")Find-and-replace that survives split runs:
def replace_text(paragraph, old: str, new: str) -> None:
"""Word splits text across runs at formatting boundaries. A naive
run-by-run replace misses any match that spans a boundary — which is
most of them, in a real document."""
full_text = "".join(run.text for run in paragraph.runs)
if old not in full_text:
return
replaced = full_text.replace(old, new)
# Write the result into the first run and clear the rest, preserving the
# first run's formatting for the whole paragraph.
paragraph.runs[0].text = replaced
for run in paragraph.runs[1:]:
run.text = ""Notes
- The split-run problem is the most common source of "my find-and-replace only worked sometimes". A placeholder like
{{name}}is frequently stored as{{,nam,e}}across three runs because of an autocorrect or a spellcheck boundary. .dotxtemplates preserve styles, headers, footers, and page setup. Loading one is nearly always better than building a document's styling from scratch.- If the output will be converted to PDF, verify the conversion — fonts that are not embedded will be substituted, and the layout will shift.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

