/office-plugin:docxfrom office-plugin
This skill should be activated when the user asks to create a Word document, report, memo, letter, proposal, whitepaper, or anything involving .docx output. Also triggers when the user says 'write a report', 'create a document', 'make a Word file', 'draft a proposal', 'generate a whitepaper', or mentions .docx. Creates polished Word documents (.docx) using the docx npm package (docx-js) for all document generation. Can also edit existing DOCX files. Activates even for simple requests like 'write a one-page memo' — the skill ensures professional output every time.
Ships in office-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Create professional Word documents using docx (docx-js npm package) for all document generation.
This skill works on its own. If media-plugin is installed, use its skills for better visuals — they are optional, never required.
| Visual | If media-plugin is installed | Otherwise |
|---|---|---|
| Document-wide visual plan | Run visual-planning FIRST when you decide the visuals yourself — it picks which concepts deserve a visual and binds them to one style | Plan the visuals in Step 2 |
| Charts, data viz | graph-generation (D3), embedded as PNG | A styled data table (header shading, alternating rows) |
| Diagrams, flows, architecture | graph-generation (Mermaid / Draw.io), embedded as PNG | A numbered list or table that walks through the steps — tell the user a rendered diagram needs media-plugin |
| Photos | image-sourcing (Unsplash) | Photos the user provides; otherwise leave them out |
| Illustrations | image-generation | Leave them out |
Never use AI image generation for charts or diagrams — it mangles labels and layout. AI images are only for photos, illustrations, backgrounds, and mockups.
| Task | Go To |
|---|---|
| Create from scratch | Creating from Scratch below |
| Edit existing DOCX | editing.md |
| Read content from DOCX | Reading Content below |
# Install dependencies (first time only)
npm install -g docx sharp
pip install "markitdown[docx]" Pillow --break-system-packages
# Verify LibreOffice is available (for thumbnail generation and PDF export)
which soffice || echo "LibreOffice not installed — install with: sudo apt install libreoffice"
# Verify pdftoppm is available (for thumbnail generation)
which pdftoppm || echo "pdftoppm not installed — install with: sudo apt install poppler-utils"
If LibreOffice or poppler-utils are not installed, tell the user they are needed for visual QA and ask if they'd like to install them. If the user declines or installation is not possible, skip visual QA and rely on structural checks.
Define the document outline — sections, headings, and purpose of each. Output: an ordered list of sections with their role.
Example:
This step is about the skeleton — no content details yet.
For each section, define:
Read the Design System in references/design.md. Key requirements:
Gather all planned images and charts BEFORE writing any code.
For each image and each chart/diagram, follow the route in Visuals:
| Placement | Width (inches) | DXA Width | Notes |
|---|---|---|---|
| Full-width | 6.5 | 9360 | Between 1" margins on US Letter |
| Half-width (text wrap) | 3.0-3.25 | 4320-4680 | Float left/right alongside text |
| Quarter-width | 1.5-2.0 | 2160-2880 | Inline icon/thumbnail |
| Header/cover banner | 6.5 x 3.0 | 9360 x 4320 | Wide banner for cover page |
Read references/docx-js-api.md for the full docx-js API reference.
Write a Node.js script that generates the .docx:
const docx = require("docx");
const fs = require("fs");
const { Document, Packer, Paragraph, TextRun, HeadingLevel, Table,
TableRow, TableCell, WidthType, ImageRun, PageBreak,
AlignmentType, BorderStyle, ShadingType, Header, Footer,
PageNumber, NumberFormat, TableOfContents } = docx;
async function main() {
const doc = new Document({
creator: "Claude",
title: "Document Title",
styles: {
default: {
document: {
run: { font: "Calibri", size: 24 }, // 12pt
},
heading1: {
run: { font: "Georgia", size: 36, bold: true, color: "1B3A5C" },
paragraph: { spacing: { before: 360, after: 120 } },
},
heading2: {
run: { font: "Georgia", size: 28, bold: true, color: "2C5F8A" },
paragraph: { spacing: { before: 240, after: 80 } },
},
},
},
sections: [{
properties: {
page: {
size: { width: 12240, height: 15840 }, // US Letter
margin: { top: 1440, right: 1440, bottom: 1440, left: 1440 }, // 1" margins
},
},
headers: {
default: new Header({
children: [new Paragraph({ text: "Document Title", alignment: AlignmentType.RIGHT })],
}),
},
footers: {
default: new Footer({
children: [new Paragraph({
alignment: AlignmentType.CENTER,
children: [
new TextRun("Page "),
new TextRun({ children: [PageNumber.CURRENT] }),
new TextRun(" of "),
new TextRun({ children: [PageNumber.TOTAL_PAGES] }),
],
})],
}),
},
children: [
new Paragraph({
heading: HeadingLevel.HEADING_1,
text: "Section Title",
}),
new Paragraph({
children: [new TextRun("Body text content here.")],
}),
// ... more content
],
}],
});
const buffer = await Packer.toBuffer(doc);
fs.writeFileSync("output.docx", buffer);
console.log("Done: output.docx");
}
main().catch(console.error);
\n for line breaks — use separate Paragraph elementsWidthType.DXA, set both columnWidths on Table and width on each cellLevelFormat.BULLET for bullets, never manual bullet charactersPageBreak inside a Paragraph's children arraytype parameter (e.g., ImageRun with explicit dimensions)outlineLevel for TOC compatibilityAfter generating the .docx, verify with a rigorous QA process.
Generate page thumbnails and visually inspect via a subagent:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/docx/scripts/thumbnail.py output.docx thumbnails
Then launch a subagent to inspect the generated page images. Check for:
Validate the DOCX against OOXML XSD schemas:
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/office/validate.py output.docx -v
If validation fails, use --auto-repair to fix common issues, or inspect errors and fix the generation script.
Check for placeholder text and structural issues:
python -m markitdown output.docx
Review for:
python -m markitdown output.docx | grep -iE "(lorem|ipsum|placeholder|todo|tbd|insert|example|sample text)"
If QA reveals issues:
For editing existing DOCX files (updating content, tracked changes, comments), see editing.md.
To extract text content from an existing DOCX:
python -m markitdown output.docx
To generate visual page thumbnails:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/docx/scripts/thumbnail.py input.docx thumbnails
Embed a chart or diagram PNG (see Visuals) with ImageRun:
// After you have the chart PNG
const chartData = fs.readFileSync("chart.png");
new Paragraph({
children: [
new ImageRun({
data: chartData,
transformation: { width: 468, height: 300 }, // ~6.5" x ~4.2" at 72 DPI
type: "png",
}),
],
alignment: AlignmentType.CENTER,
});
| Script | Purpose | Usage |
|---|---|---|
soffice.py | LibreOffice integration (convert, env) | python3 ${CLAUDE_PLUGIN_ROOT}/scripts/office/soffice.py input.docx output.pdf |
validate.py | XSD schema + structural validation | python3 ${CLAUDE_PLUGIN_ROOT}/scripts/office/validate.py input.docx [-v] [--auto-repair] [--original orig.docx] |
unpack.py | Extract DOCX ZIP, pretty-print XML | python3 ${CLAUDE_PLUGIN_ROOT}/scripts/office/unpack.py input.docx [output_dir] [--merge-runs] [--simplify-redlines] |
pack.py | Repack directory into DOCX ZIP | python3 ${CLAUDE_PLUGIN_ROOT}/scripts/office/pack.py unpacked_dir [output.docx] [--validate] |
| Script | Purpose | Usage |
|---|---|---|
thumbnail.py | DOCX → labeled page grid image | python3 ${CLAUDE_PLUGIN_ROOT}/skills/docx/scripts/thumbnail.py input.docx [output_prefix] [--cols N] |
comment.py | Add comments to unpacked DOCX | python3 ${CLAUDE_PLUGIN_ROOT}/skills/docx/scripts/comment.py unpacked_dir "text" --author "Name" |
accept_changes.py | Accept all tracked changes | python3 ${CLAUDE_PLUGIN_ROOT}/skills/docx/scripts/accept_changes.py input.docx [output.docx] |
| File | When to Read |
|---|---|
| references/docx-js-api.md | Always — full API reference for docx-js |
| references/design.md | Always — document design system, colors, fonts, spacing |
| editing.md | When editing existing DOCX files |
Read the reference files before generating any document.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub lukaskellerstein/claude-my-marketplace --plugin office-plugin3 skills in this plugin
/pptxThis skill should be activated when the user asks to make a presentation, slide deck, pitch deck, or anything involving .pptx output. Also triggers when the user says 'make me slides', 'create a deck', 'presentation about X', or mentions PowerPoint. Creates polished PowerPoint (.pptx) presentations using PptxGenJS for all slide generation. Can also edit existing PPTX templates. Activates even for simple 'make a quick 3-slide deck' requests — the skill ensures quality output every time./xlsxThis skill should be activated when the user asks to create, edit, read, or analyze Excel spreadsheet files (.xlsx, .xlsm, .csv, .tsv). Triggers for: building financial models, creating data tables, formatting spreadsheets, adding formulas, cleaning tabular data, converting between tabular formats. Also triggers when user mentions 'spreadsheet', 'Excel', 'workbook', or references an .xlsx file. Do NOT trigger when the primary deliverable is a document, presentation, or visualization.Other plugins' skills for the same job