docx-generator

Generate and modify DOCX documents from templates or JSON specs.

Updated Jan 6, 2026
One-click install
npx skills add https://github.com/jwynia/teach --skill docx-generator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: docx-generator
Source: https://github.com/jwynia/teach/tree/main/.claude/skills/docx-generator
Command: npx skills add https://github.com/jwynia/teach --skill docx-generator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires jszip, @xmldom/xmldom, docx, and includes scripts (resource) components.

What problem does it solve?

Word DOCX workflows often require manual edits, repetitive formatting, and error-prone template customization. This Skill provides programmatic DOCX generation and manipulation to automate branding-compliant documents, from template-based contracts to from-scratch reports.

Core Features & Use Cases

  • Template-based generation: modify branded templates by replacing placeholders while preserving styling.
  • From-scratch generation: build documents from JSON specs including sections, tables, images, and headers/footers.
  • Common use cases: contract generation, branded reports, letters, and templates for corporate communications.

Quick Start

Use generate-from-template.ts with a DOCX template and a replacements.json or generate-scratch.ts with a spec.json to generate the output DOCX.

Frequently Asked Questions about docx-generator

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

FAQPage Schema
How do I automate Word document generation from templates?

Automate Word document generation by replacing placeholders in a DOCX template while preserving the original styling. This approach fills branded contracts and letters programmatically, avoiding repetitive manual formatting and customization errors.

Can I build a DOCX file from scratch using a JSON spec?

Build a DOCX file from scratch using a JSON specification that defines sections, tables, images, and headers. This approach assembles complete reports and documents programmatically without requiring a pre-existing base template.

Does DOCX automation work with Deno and JSZip?

DOCX automation works with Deno as the runtime and JSZip for ZIP-based template handling. This combination manipulates the underlying XML structure of Word files to apply modifications and generate documents programmatically.

What is the best way to generate branded corporate reports as DOCX?

Generate branded corporate reports using template-based DOCX generation to replace placeholders while preserving styling. This maintains brand consistency across documents while automating the data injection process for repetitive communications.

Do I need XML parsing libraries to modify Word documents programmatically?

XML parsing libraries like @xmldom/xmldom are required to modify Word documents programmatically because DOCX files are ZIP archives containing XML. These libraries serialize and parse the internal XML to apply template modifications.