agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
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.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill word-documents --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/word-documentsContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
name: word-documents description: 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. metadata: category: documents version: 1.0.0 tags: [docx, word, documents, templates, reports]
Produce and manipulate `.docx` files programmatically, with real styles and structure rather than a wall of manually formatted paragraphs.
1. **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. 2. **Start from a template when the house style matters** — Load the organization's `.dotx` or a reference `.docx` and write into its styles rather than recreating them. 3. **Structure before content** — Headings, then the body. The outline is what makes a long document usable. 4. **Preserve formatting when editing** — A naive find-and-replace on the XML destroys runs. Replace within runs, and handle text split across runs. 5. **Verify the output** — Open it. A `.docx` that a library writes without error can still be malformed in ways Word will complain about.
**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 = ""A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…