Agent skill

DOCX Generator

by jwynia in jwynia/agent-skills

Create and manipulate Word DOCX files programmatically. An agent skill from jwynia/agent-skills.

MITAuto-check passedDocuments & Office

Install DOCX Generator

skills CLI
$ npx skills add jwynia/agent-skills --skill docx-generator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jwynia/agent-skills docx-generator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jwynia/agent-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/general/document-processing/word/docx-generator .claude/skills/docx-generator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
docx-generator
GitHub stars
169
Token cost
~2.7k tokens
SKILL.md length
636 words
Files
4 (incl. scripts)
Skills in repo
111
Repo updated
First seen
Licence
MIT

At a glance

Create and manipulate Word DOCX files programmatically. An agent skill from jwynia/agent-skills.

  • Works in 2 steps: Template Mode: Modify existing branded… → Scratch Mode: Create documents from…
  • The user needs to generate documents
  • SKILL.md covers When to Use This Skill, Prerequisites, Quick Start and Instructions, plus 6 more sections
  • Runs TypeScript scripts from its folder; calls deno

What it does

DOCX Generator is an agent skill from jwynia/agent-skills. Create and manipulate Word DOCX files programmatically. Use when the user needs to generate documents, modify DOCX templates, extract document content, or automate Word document workflows. Supports both template-based generation (for branding compliance) and from-scratch creation. Keywords: Word, DOCX, document, report, template, contract, letter, corporate, branding.

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `scripts/analyze-template.ts`, `scripts/generate-from-template.ts` and `scripts/generate-scratch.ts`). Compatibility notes: Requires Deno with --allow-read, --allow-write permissions

It sits in Documents & Office, covering Word documents. It works with Microsoft Word. The licence is MIT.

When your agent uses it

  • The user needs to generate documents
  • Modify DOCX templates
  • Extract document content
  • Automate Word document workflows

Example prompts

  • “/docx-generator”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Requires Deno with --allow-read, --allow-write permissions

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Template Mode: Modify existing branded templates
  2. Scratch Mode: Create documents from nothing using JSON specifications

What it can do on your machine

Read from SKILL.md and the folder at commit e02ec7e. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 3 files in scripts/ (TypeScript), which the agent can run.

    Shell commands in SKILL.md call:

    • deno

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • deno.land

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Requires Deno with --allow-read, --allow-write permissions

    From compatibility in the SKILL.md frontmatter.

Context cost

DOCX Generator loads about 2.7k tokens when it runs. Until then it costs about 96 tokens; SKILL.md has 636 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from jwynia/agent-skills at commit e02ec7e, republished under its MIT licence (© jwynia). 636 words, ~2,708 tokens.

Download SKILL.mdSave it as .claude/skills/docx-generator/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
docx-generator
description
Create and manipulate Word DOCX files programmatically. Use when the user needs to generate documents, modify DOCX templates, extract document content, or automate Word document workflows. Supports both template-based generation (for branding compliance) and from-scratch creation. Keywords: Word, DOCX, document, report, template, contract, letter, corporate, branding.
compatibility
Requires Deno with --allow-read, --allow-write permissions
license
MIT
metadata.author
agent-skills
metadata.version
1.0
metadata.type
generator
metadata.mode
generative
metadata.domain
documents

DOCX Generator

When to Use This Skill

Use this skill when:

  • Creating Word documents programmatically from data or specifications
  • Populating branded templates with dynamic content while preserving corporate styling
  • Extracting text, tables, and structure from existing DOCX files for analysis
  • Finding and replacing placeholder text like {{TITLE}} or ${author}
  • Automating document generation workflows (reports, contracts, letters)

Do NOT use this skill when:

  • User wants to open/view documents (use native Word or viewer)
  • Complex mail merge with data sources (use native Word mail merge)
  • Working with older .doc format (DOCX only)
  • PDF output is needed (use pdf-generator skill instead)

Prerequisites

  • Deno installed (https://deno.land/)
  • Input DOCX files for template-based operations
  • JSON specification for scratch generation

Quick Start

Two Modes of Operation
  1. Template Mode: Modify existing branded templates

    • Analyze template to find placeholders
    • Replace {{PLACEHOLDERS}} with actual content
  2. Scratch Mode: Create documents from nothing using JSON specifications

Instructions

Mode 1: Template-Based Generation
Step 1a: Analyze the Template

Extract text inventory to understand what can be replaced:

bash
deno run --allow-read scripts/analyze-template.ts corporate-template.docx > inventory.json

Output (inventory.json):

json
{
  "filename": "corporate-template.docx",
  "paragraphCount": 25,
  "tableCount": 2,
  "imageCount": 1,
  "paragraphs": [
    {
      "index": 0,
      "style": "Title",
      "fullText": "{{DOCUMENT_TITLE}}",
      "runs": [
        { "text": "{{DOCUMENT_TITLE}}", "bold": true, "fontSize": 28 }
      ]
    }
  ],
  "placeholders": [
    { "tag": "{{DOCUMENT_TITLE}}", "location": "paragraph", "paragraphIndex": 0 },
    { "tag": "{{AUTHOR}}", "location": "footer-default", "paragraphIndex": 0 },
    { "tag": "${date}", "location": "table", "tableIndex": 0, "cellLocation": "R1C2" }
  ]
}
Step 1b: Create Replacement Specification

Create replacements.json:

json
{
  "textReplacements": [
    { "tag": "{{DOCUMENT_TITLE}}", "value": "Q4 2024 Financial Report" },
    { "tag": "{{AUTHOR}}", "value": "Finance Department" },
    { "tag": "${date}", "value": "December 15, 2024" },
    { "tag": "{{COMPANY}}", "value": "Acme Corporation" }
  ],
  "includeHeaders": true,
  "includeFooters": true
}
Step 1c: Generate Output
bash
deno run --allow-read --allow-write scripts/generate-from-template.ts \
  corporate-template.docx replacements.json output.docx
Mode 2: From-Scratch Generation
Step 2a: Create Specification

Create spec.json:

json
{
  "title": "Quarterly Report",
  "creator": "Finance Team",
  "styles": {
    "defaultFont": "Calibri",
    "defaultFontSize": 11
  },
  "sections": [
    {
      "header": {
        "paragraphs": [
          { "text": "Acme Corporation", "alignment": "right" }
        ]
      },
      "footer": {
        "paragraphs": [
          { "text": "Confidential", "alignment": "center" }
        ]
      },
      "content": [
        {
          "text": "Q4 2024 Financial Report",
          "heading": 1,
          "alignment": "center"
        },
        {
          "runs": [
            { "text": "Executive Summary: ", "bold": true },
            { "text": "This report provides an overview of our financial performance for Q4 2024." }
          ]
        },
        { "pageBreak": true },
        {
          "text": "Revenue Breakdown",
          "heading": 2
        },
        {
          "rows": [
            {
              "cells": [
                { "content": [{ "text": "Category" }], "shading": "DDDDDD" },
                { "content": [{ "text": "Amount" }], "shading": "DDDDDD" },
                { "content": [{ "text": "Change" }], "shading": "DDDDDD" }
              ],
              "isHeader": true
            },
            {
              "cells": [
                { "content": [{ "text": "Product Sales" }] },
                { "content": [{ "text": "$1,250,000" }] },
                { "content": [{ "text": "+15%" }] }
              ]
            },
            {
              "cells": [
                { "content": [{ "text": "Services" }] },
                { "content": [{ "text": "$750,000" }] },
                { "content": [{ "text": "+8%" }] }
              ]
            }
          ],
          "width": 100,
          "borders": true
        }
      ]
    }
  ]
}
Step 2b: Generate Document
bash
deno run --allow-read --allow-write scripts/generate-scratch.ts spec.json output.docx

Examples

Example 1: Contract Generation

Scenario: Generate contracts from a branded template.

Steps:

bash
# 1. Analyze template for replaceable content
deno run --allow-read scripts/analyze-template.ts contract-template.docx --pretty

# 2. Create replacements.json with client data
# 3. Generate contract
deno run --allow-read --allow-write scripts/generate-from-template.ts \
  contract-template.docx replacements.json acme-contract.docx
Example 2: Report with Tables

Scenario: Generate a data report with tables and formatting.

spec.json:

json
{
  "title": "Sales Report",
  "sections": [{
    "content": [
      { "text": "Monthly Sales Report", "heading": 1 },
      { "text": "January 2025", "heading": 2 },
      {
        "runs": [
          { "text": "Total Sales: ", "bold": true },
          { "text": "$125,000", "color": "2E7D32" }
        ]
      }
    ]
  }]
}
Example 3: Letter with Headers/Footers

Scenario: Create a formal letter with letterhead.

spec.json:

json
{
  "sections": [{
    "header": {
      "paragraphs": [
        { "text": "ACME CORPORATION", "alignment": "center", "runs": [{"text": "ACME CORPORATION", "bold": true, "fontSize": 16}] },
        { "text": "123 Business Ave, City, ST 12345", "alignment": "center" }
      ]
    },
    "content": [
      { "text": "December 15, 2024", "alignment": "right" },
      { "text": "" },
      { "text": "Dear Valued Customer," },
      { "text": "" },
      { "text": "Thank you for your continued business..." },
      { "text": "" },
      { "text": "Sincerely," },
      { "text": "John Smith" },
      { "runs": [{ "text": "CEO", "italic": true }] }
    ],
    "footer": {
      "paragraphs": [
        { "text": "www.acme.com | contact@acme.com", "alignment": "center" }
      ]
    }
  }]
}

Script Reference

ScriptPurposePermissions
analyze-template.tsExtract text, tables, placeholders from DOCX--allow-read
generate-from-template.tsReplace placeholders in templates--allow-read --allow-write
generate-scratch.tsCreate DOCX from JSON specification--allow-read --allow-write

Specification Reference

Paragraph Options
PropertyTypeDescription
textstringSimple text content
runsarrayFormatted text runs (for mixed formatting)
heading1-6Heading level
alignmentstringleft, center, right, justify
bulletbooleanBulleted list item
numberingbooleanNumbered list item
spacingobjectbefore, after, line spacing
indentobjectleft, right, firstLine indentation
pageBreakBeforebooleanInsert page break before paragraph
Text Run Options
PropertyTypeDescription
textstringText content
boldbooleanBold formatting
italicbooleanItalic formatting
underlinebooleanUnderline formatting
strikebooleanStrikethrough
fontSizenumberFont size in points
fontstringFont family name
colorstringText color (hex, no #)
highlightstringHighlight color
superScriptbooleanSuperscript
subScriptbooleanSubscript
Show full SKILL.md (264 more words)Show less
Table Options
PropertyTypeDescription
rowsarrayArray of row specifications
widthnumberTable width as percentage
bordersbooleanShow table borders
PropertyTypeDescription
textstringLink text
urlstringTarget URL
boldbooleanBold formatting
italicbooleanItalic formatting

Common Issues and Solutions

Issue: Placeholders not being replaced

Symptoms: Output DOCX still contains {{PLACEHOLDER}} tags.

Solution:

  1. Run analyze-template.ts to verify exact tag text
  2. Tags may be split across XML runs - the script consolidates these automatically
  3. Ensure includeHeaders and includeFooters are true if placeholders are there
Issue: Formatting lost after replacement

Symptoms: Replaced text doesn't match original formatting.

Solution:

  • Text replacement preserves the formatting of the original placeholder
  • Ensure placeholder is formatted the way you want the final text to appear
Issue: Images not appearing

Symptoms: Image elements are blank in output.

Solution:

  1. Use paths relative to the spec.json file location
  2. Verify image file exists and is readable
  3. Check supported formats: PNG, JPEG, GIF
Issue: Table cell content incorrect

Symptoms: Table cells have wrong content or formatting.

Solution:

  • Each cell's content must be an array of paragraph specifications
  • Use shading for background color, verticalAlign for alignment

Limitations

  • DOCX only: Does not support legacy .doc format
  • No track changes: Cannot add or process track changes
  • No comments: Cannot add document comments
  • No macros: Cannot include VBA macros
  • Basic numbering: Limited support for complex numbering schemes
  • Text run splitting: Word may split text across XML elements; script handles common cases
  • pptx-generator: For creating PowerPoint presentations
  • xlsx-generator: For creating Excel spreadsheets
  • pdf-generator: For creating PDF documents

© jwynia, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts) in skills/general/document-processing/word/docx-generator of jwynia/agent-skills.

  • SKILL.md
  • scripts/analyze-template.ts
  • scripts/generate-from-template.ts
  • scripts/generate-scratch.ts

Open the folder on GitHubat commit e02ec7e

Compare with similar skills

DOCX Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

DOCX Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
DOCX Generator this skilljwynia/agent-skills169—~2.7kAutomated safety check: PassMIT
MarkitdownImCa0/just-laws78214 repos~3.2kAutomated safety check: NotesMIT
DOCXrvdbreemen/OTGW-firmware20733 repos~4.3kAutomated safety check: PassProprietary
Gzh Designisjiamu/gzh-design-skill3.9k1 repos~2.2kAutomated safety check: PassAGPL-3.0
Word Document Reader and WriterHKUDS/DeepTutor41k—~2.5kAutomated safety check: PassApache-2.0
GenOffice Document CLIgenspark-ai/genoffice9k—~19kAutomated safety check: PassApache-2.0

Similar skills

  • Markitdown

    ImCa0/just-laws

    Convert files and office documents to Markdown. An agent skill from ImCa0/just-laws.

    782 GitHub starsUsed in 14 repos~3.2k tokens
    Documents & OfficeAuto-check: notes
  • DOCX

    rvdbreemen/OTGW-firmware

    A skill your agent uses whenever the user wants to create, read, edit, or manipulate Word documents (.docx files).

    207 GitHub starsUsed in 33 repos~4.3k tokens
    Documents & OfficeAuto-check passed
  • Gzh Design

    isjiamu/gzh-design-skill

    微信公众号文章排版引擎,将 Markdown 转换为可直接粘贴到公众号编辑器的 HTML。主题风格从 references/theme-index.md 注册的自定义主题库中选取,自动章节编号、关键词下划线标记、引言卡片、目录导航、代码块、图片/GIF、作者签名。支持 Markdown / Word(.docx) / PDF / 纯文本输入(非 Markdown…

    3.9k GitHub starsUsed in 1 repo~2.2k tokens
    Documents & OfficeAuto-check passed
  • Reads, creates and edits Word .docx files with python-docx, and drops to raw OOXML for tracked changes, comments and byte-exact edits.

    41k GitHub stars~2.5k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • GenOffice Document CLI

    genspark-ai/genoffice

    Creates, converts, reads and edits real pptx, xlsx, docx and PDF files locally through the genoffice command line.

    9k GitHub stars~19k tokensUpdated today
    Documents & OfficeAuto-check passed
  • BiSheng DOCX Builder

    dataelement/bisheng

    Builds or edits Word .docx documents inside BiSheng's code executor with python-docx, handling Chinese fonts, tables of contents, page numbers and official-document layout.

    12k GitHub stars~2.6k tokensUpdated today
    Documents & OfficeAuto-check passed

More from jwynia/agent-skills

All 111 skills in this repo
  • Devcontainer

    jwynia/agent-skills

    Diagnose devcontainer configuration problems and guide development environment setup.

    169 GitHub stars~1.2k tokensUpdated 7 mo ago
    Auto-check: notes
  • Frontend Design

    jwynia/agent-skills

    Create distinctive, production-grade frontend interfaces with high design quality.

    169 GitHub stars~3.2k tokensUpdated 7 mo ago
    Auto-check passed
  • Gitea Workflow

    jwynia/agent-skills

    Orchestrate agile development workflows for Gitea repositories using the tea CLI.

    169 GitHub stars~3.8k tokensUpdated 7 mo ago
    Auto-check passed
  • Godot Asset Generator

    jwynia/agent-skills

    Generate game assets using AI image generation APIs (DALL-E, Replicate, fal.ai) and prepare them for Godot.

    169 GitHub stars~3.8k tokensUpdated 7 mo ago
    Auto-check passed
  • Mastra Hono

    jwynia/agent-skills

    Develop AI agents, tools, and workflows with Mastra v1 Beta and Hono servers.

    169 GitHub stars~2.9k tokensUpdated 7 mo ago
    Auto-check passed
  • PPTX Generator

    jwynia/agent-skills

    Create and manipulate PowerPoint PPTX files programmatically.

    169 GitHub stars~3.1k tokensUpdated 7 mo ago
    Auto-check passed

Works with

Questions about DOCX Generator

What does DOCX Generator do?

Create and manipulate Word DOCX files programmatically. An agent skill from jwynia/agent-skills. DOCX Generator is an agent skill from jwynia/agent-skills. Create and manipulate Word DOCX files programmatically.

When should I use DOCX Generator?

DOCX Generator fits situations like: the user needs to generate documents; modify DOCX templates; extract document content; automate Word document workflows.

How do I install DOCX Generator in Claude Code?

Run `npx skills add jwynia/agent-skills --skill docx-generator -a claude-code`. Or copy the skill folder (skills/general/document-processing/word/docx-generator in jwynia/agent-skills) into .claude/skills/docx-generator in your project. Claude Code loads it when a task matches its description.

How do I install DOCX Generator in Codex?

Run `npx skills add jwynia/agent-skills --skill docx-generator -a codex`. Or copy the skill folder (skills/general/document-processing/word/docx-generator in jwynia/agent-skills) into .agents/skills/docx-generator in your project. Codex loads it when a task matches its description.

Can I use DOCX Generator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jwynia/agent-skills --skill docx-generator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/docx-generator, .gemini/skills/docx-generator, .github/skills/docx-generator and .opencode/skills/docx-generator in your project.

What does DOCX Generator need to run?

Going by SKILL.md and its folder, DOCX Generator needs TypeScript for the scripts in its folder and the command-line tools its instructions call (deno). Our summary lists: Node.js. Compatibility (from SKILL.md): Requires Deno with --allow-read, --allow-write permissions.

Does DOCX Generator access the network?

SKILL.md names 1 domain. As links in the text: deno.land. This is read from the text; nothing was executed.

Is DOCX Generator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does DOCX Generator use?

DOCX Generator is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does DOCX Generator use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to DOCX Generator?

Skills that share tags, products or a category with DOCX Generator: Markitdown (ImCa0/just-laws, 782 stars), DOCX (rvdbreemen/OTGW-firmware, 207 stars), Gzh Design (isjiamu/gzh-design-skill, 3.9k stars) and Word Document Reader and Writer (HKUDS/DeepTutor, 41k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains DOCX Generator?

jwynia (a GitHub user) maintains it in jwynia/agent-skills, which has 169 GitHub stars. The repository holds 111 skills in this directory. The repository was last updated on February 24, 2026.

Source: jwynia/agent-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.