docx

Generate and edit professional Word documents using the docx-js npm package.

3|1|Updated Nov 19, 2025
One-click install
npx skills add https://github.com/lukaskellerstein/claude-my-marketplace --skill docx-lukaskellerstein
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: docx
Source: https://github.com/lukaskellerstein/claude-my-marketplace/tree/main/plugins/office-plugin/skills/docx
Command: npx skills add https://github.com/lukaskellerstein/claude-my-marketplace --skill docx-lukaskellerstein

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires docx, sharp, markitdown, Pillow, and includes scripts (resource) and references (resource) components.

What problem does it solve? Creating polished Word documents programmatically is error-prone — wrong units, broken tables, missing page numbers, and corrupt files are common. This Skill provides a complete workflow for generating, editing, and validating .docx files with consistent professional design. ## Core Features & Use Cases - Document Generation: Build Word documents from scratch with the docx-js npm package, including cover pages, styled headings, tables with shaded headers, images, charts, headers/footers, and tables of contents. - Editing Existing DOCX: Unpack DOCX files into XML, modify content, add tracked changes and comments, then repack with schema validation. - Multi-Stage QA: Verify output with page thumbnail visual inspection, OOXML XSD schema validation, and placeholder-text checks. - Use Case: Ask for a quarterly business report and receive a .docx with a branded cover page, styled data tables, embedded charts, page numbers, and a table of contents — validated against Word's XML schemas. ## Quick Start Create a Word document report summarizing our Q3 sales data with a cover page, styled tables, and page numbers.

Frequently Asked Questions about docx

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Word document programmatically with JavaScript?▼

Use the docx npm package (docx-js) to build documents from Paragraph, Table, and ImageRun objects, then write the output with Packer.toBuffer. Define page size in DXA units (US Letter is 12240 x 15840) and set styles for headings and body text.

How to add tracked changes and comments to an existing DOCX file?▼

Unpack the DOCX into its XML parts, then insert w:ins and w:del elements for tracked changes or commentRangeStart/commentRangeEnd markers for comments. Repack the directory into a .docx and validate it against OOXML schemas.

Does docx-js support tables of contents and page numbers?▼

Yes. Use the TableOfContents element with a heading style range, and PageNumber.CURRENT with PageNumber.TOTAL_PAGES inside a Footer. Headings need outlineLevel set for the TOC to populate when opened in Word.

Why does my generated DOCX have broken tables or layout issues?▼

Common causes are missing WidthType.DXA on tables, not setting both columnWidths and per-cell widths, or using newline characters instead of separate Paragraph elements. Validate the file against OOXML XSD schemas to catch structural errors.

Can I embed charts and images in a generated Word document?▼

Yes. Read the image file into a buffer and add it with ImageRun, always specifying the type parameter such as png. Size full-width images at about 468 pixels wide to fit 6.5 inches between standard one-inch margins.