Docx logo

Docx

Community
ur-grue
docx

Use this skill whenever the user wants to create or edit .docx (Microsoft Word) files. This includes creating new Word documents from scratch, editing existing Word documents, extracting content from Word files, converting between formats, adding images or other content to Word files, or manipulating Word file structure. If the user mentions .docx, Word, DOCX, or wants to produce a Word document, use this skill.

Overview

Publisherur-grue
Repositoryautopunk-media-skills
Skill namedocx
Stars
45
Forks
3
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by ur-grue on GitHub. Read the source before you install it.

Installation

Install the Docx AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/ur-grue/autopunk-media-skills/tree/main/.claude/skills/docx
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ur-grue/autopunk-media-skills.git /tmp/autopunk-media-skills
mkdir -p .claude/skills
cp -r /tmp/autopunk-media-skills/.claude/skills/docx .claude/skills/docx
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Docx in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Docx on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Docx is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

DOCX Processing Guide

Overview

This guide covers creating, editing, and analyzing Word documents (.docx files). Use this skill when you need to programmatically create new Word documents, make targeted edits to existing files, or extract content.

Creating Documents

Use the docx JavaScript library for programmatic document creation. The library provides a powerful API for building Word documents with full formatting control.

Page Sizing

Always explicitly set page size — docx-js defaults to A4 (11,906 × 16,838 DXA), not US Letter. Specify dimensions using DXA units, where 1 inch = 1440 DXA.

For US Letter (8.5" × 11"):

  • Width: 12,240 DXA
  • Height: 15,840 DXA
  • With standard 1" margins: content area is 10,240 × 13,840 DXA

For landscape orientation, pass portrait dimensions with landscape: true — the library handles internal conversion:

javascript
const doc = new Document({
  sections: [{
    properties: {
      pageHeight: 15840,  // Portrait height
      pageWidth: 12240,   // Portrait width
      landscape: true,    // Library rotates internally
    }
  }]
});

Tables

Tables require dual width specifications. Always specify both columnWidths array AND individual cell width properties, with all values using WidthType.DXA (percentage widths break in Google Docs).

Table width must equal the sum of column widths:

javascript
const columnWidths = [3000, 4000, 3000];  // Total: 10000
const table = new Table({
  columnWidths: columnWidths,
  width: { size: 10000, type: WidthType.DXA },  // Match total
  rows: [
    new TableRow({
      cells: [
        new TableCell({
          children: [...],
          width: { size: 3000, type: WidthType.DXA }
        }),
        // ... more cells
      ]
    })
  ]
});

Use ShadingType.CLEAR for cell background colors to avoid rendering issues.

Bullets and Lists

Never insert bullet points using manual Unicode characters. Instead, use the numbering system with LevelFormat.BULLET:

javascript
new Paragraph({
  text: "Item 1",
  bullet: {
    level: 0
  }
})

Smart Typography

Maintain professional typography with smart quotes and apostrophes via XML entities in the underlying document:

  • “ — Left double quote (")
  • ” — Right double quote (")
  • ’ — Apostrophe/Right single quote (')

These are handled automatically when using standard string methods, but when editing raw XML, use these entities explicitly.

Editing Existing Documents

Use the three-step workflow: unpack → edit → pack.

Step 1: Unpack

Extract the .docx archive into editable XML:

bash
unzip -q input.docx -d unpacked/

Step 2: Edit

Edit files in unpacked/word/document.xml directly. Prefer the Edit tool for transparent string replacement rather than writing custom Python scripts.

When applying tracked changes (revision marks), copy the original run's formatting block (<w:rPr>) to the new run to maintain style consistency:

xml
<!-- Original run with formatting -->
<w:r>
  <w:rPr>
    <w:b/>
    <w:color w:val="FF0000"/>
  </w:rPr>
  <w:t>Original text</w:t>
</w:r>

<!-- New run with revision mark — copy the <w:rPr> block -->
<w:r>
  <w:ins w:id="0" w:author="Editor" w:date="2024-01-15T10:00:00Z"/>
  <w:rPr>
    <w:b/>
    <w:color w:val="FF0000"/>
  </w:rPr>
  <w:t>Edited text</w:t>
</w:r>

When deleting entire paragraphs, mark both the paragraph content AND the paragraph element itself as deleted to prevent empty rows from persisting after change acceptance:

xml
<!-- Mark paragraph deletion at both content and element level -->
<w:del w:id="0" w:author="Editor" w:date="2024-01-15T10:00:00Z">
  <w:p>
    <w:pPr>
      <w:pStyle w:val="Normal"/>
    </w:pPr>
    <w:r>
      <w:annotationStart w:id="0"/>
      <w:t>Deleted paragraph</w:t>
      <w:annotationEnd w:id="0"/>
    </w:r>
  </w:p>
</w:del>

Step 3: Pack

Repack the XML back into a .docx file with validation:

bash
cd unpacked/
zip -r -q ../output.docx word/ _rels/ '[Content_Types].xml' customXml/ 2>/dev/null
cd ..

If validation errors occur, the library has auto-repair capabilities — repack and try again.

Reading Documents

Extract Text

Use pandoc to extract plain text while preserving document structure:

bash
pandoc input.docx -t plain -o output.txt

Access Raw XML

For programmatic content analysis, access the document's underlying XML structure directly via the unpacking method above.

Important Constraints

Line breaks — Never use \n for line breaks within a paragraph. Instead, create separate Paragraph elements or use explicit line break elements.

Page breaks — PageBreak elements must nest within Paragraph containers; they cannot exist at document root level.

ImageRun — When adding images, always specify the explicit type parameter (e.g., type: "picture").

Heading styles — Heading elements require outlineLevel attributes for table-of-contents generation:

javascript
new Paragraph({
  text: "Section Title",
  style: "Heading1",
  outlineLevel: 0
})

Built-in style overrides — Override built-in Word styles using exact identifiers (e.g., "Heading1", "Normal"), not custom names.


See REFERENCE.md for advanced techniques, more examples, and JavaScript library details.

Frequently asked questions

What does the Docx AI skill do?

Use this skill whenever the user wants to create or edit .docx (Microsoft Word) files. This includes creating new Word documents from scratch, editing existing Word documents, extracting content from Word files, converting between formats, adding images or other content to Word files, or manipulating Word file structure. If the user mentions .docx, Word, DOCX, or wants to produce a Word document, use this skill.

Why use Docx on TypingMind?

Because you install it once and use it with any model. Docx is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Docx in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/ur-grue/autopunk-media-skills/tree/main/.claude/skills/docx. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Docx?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Docx?

As many as you like. As long as a model supports skills, you can use Docx with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Docx AI skill free?

Yes. It is published on GitHub by ur-grue under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇