Docx logo

Docx

OrganizationPopular
TokenRhythm
docx

Read, inspect, edit, or create Microsoft Word `.docx` documents, including structured text extraction, style-preserving edits, tracked-change review, and generation from a brief.

Overview

PublisherTokenRhythm
Repositoryopensquilla
Skill namedocx
Stars
7K
Forks
566
Bundled files
6
LicenseApache-2.0
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.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by TokenRhythm 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.
  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/TokenRhythm/opensquilla.git /tmp/opensquilla
mkdir -p .claude/skills
cp -r /tmp/opensquilla/src/opensquilla/skills/bundled/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

Work with Microsoft Word .docx files. The format is OOXML — a zip container holding XML parts (word/document.xml, styles.xml, numbering.xml, headers, footers, relationships). Treat structure as primary; rendered text is a view.

Decide the path first

Pick one path up front. The right path depends only on what is on disk before you start.

You haveGoalPath
Existing .docxRead text/structureA. Inspect
Existing .docxModify content while keeping stylesB. Edit-in-place
Nothing or a briefBuild a new docC. Create from scratch

If the user hands you a doc and asks for changes, default to path B and treat the input as the visual style baseline. Only choose path C when the user says "start fresh" or there is no input.


Path A: Inspect

Dump structure as JSON for inspection without mutating anything.

bash
python {baseDir}/scripts/inspect_docx.py /path/to/doc.docx

Output schema:

json
{
  "paragraphs": [{"index": 0, "text": "...", "style": "Heading 1"}, ...],
  "tables": [[["row0,col0", "row0,col1"], ...], ...],
  "sections": 1,
  "has_tracked_changes": false
}

Use this whenever you need to see what is in the doc before deciding how to edit. The output is stable and machine-readable — diff two inspect outputs to verify a round-trip preserved everything you intended.


Path B: Edit in place

Two sub-strategies; pick by how invasive the edit is.

B1. Run-level text replacement (preferred)

When the change is "swap this string" or "fill these placeholders": mutate runs in place. This preserves all theme/style/font settings.

bash
python {baseDir}/scripts/edit_docx.py input.docx ops.json --out output.docx

ops.json is a list of operations:

json
[
  {"op": "replace_run", "para": 0, "run": 0, "text": "Q3 Review"},
  {"op": "replace_text", "find": "{{CLIENT}}", "with": "Acme Corp"}
]

Edit at the run level, not the paragraph level — replacing whole paragraph text drops formatting. If a placeholder spans multiple runs (often happens when the original template applied bold/italic mid-word), the helper script collapses runs into the first one and clears the rest.

B2. Structural edits (sections / page layout / numbering)

python-docx exposes paragraphs, tables, and runs but has limited support for page layout, numbering definitions, and tracked changes. For those, unzip the .docx, patch word/document.xml and adjacent parts, and repack:

bash
mkdir _unpacked && (cd _unpacked && unzip -q ../input.docx)
# edit _unpacked/word/document.xml
(cd _unpacked && zip -q -r ../output.docx . -x "*.DS_Store")

Rules when patching XML:

  • Use defusedxml.ElementTree or lxml, not stdlib xml.etree.ElementTree. ET drops or rewrites namespace prefixes (w:, r:) in ways Word refuses to load.
  • Preserve xml:space="preserve" on <w:t> elements that hold leading or trailing whitespace.
  • [Content_Types].xml must list every part type. Removing a header without also removing its override entry yields a "repair" prompt in Word.
  • Numbering definitions live in numbering.xml; bullet/number changes must patch the numbering ID, not just the visible text.

When done, validate by opening in LibreOffice headless before declaring success — silent failures are common.


Path C: Create from scratch

bash
python {baseDir}/scripts/create_docx.py spec.json --out out.docx

spec.json describes content declaratively:

json
{
  "metadata": {"title": "Q3 Review", "author": "Wei E."},
  "body": [
    {"kind": "heading", "level": 1, "text": "Q3 Review"},
    {"kind": "paragraph", "text": "Revenue +18% YoY."},
    {"kind": "table", "rows": [["Metric", "Value"], ["Revenue", "$2.1M"]]}
  ]
}

For programmatic use call python-docx directly:

python
from docx import Document
doc = Document()
doc.add_heading("Q3 Review", level=1)
doc.add_paragraph("Revenue +18% YoY.")
table = doc.add_table(rows=2, cols=2)
table.rows[0].cells[0].text = "Metric"
doc.save("out.docx")

See references/python_docx.md for paragraphs, styles, numbering, tables, headers/footers, and section breaks.


Tracked changes

Tracked changes are stored in word/document.xml as <w:ins> and <w:del> elements. python-docx does not expose them as first-class objects — the inspect helper sets has_tracked_changes: true when any w:ins or w:del element is found, and you must resolve them by patching XML directly. Treat docs with tracked changes as read-only until reviewers accept or reject the revisions.


Common pitfalls

SymptomCauseFix
Word reports "needs repair"Removed a header part but left override in [Content_Types].xmlStrip the override entry too
Text replacement drops bold/italicReplaced paragraph.text instead of editing runsUse op: replace_run
Numbering restarts unexpectedlyEdited a list item across two abstractNum definitionsPatch numbering.xml; rebuild numbering IDs
Smart-quote characters render as garbageXML read with stdlib ET dropped namespacesSwitch to defusedxml or lxml
Long string overflowsCell width is fixed in the templateEither shorten or compute auto-fit before save

Boundaries

  • This skill is for .docx (OOXML WordprocessingML). It does not handle .doc (legacy binary) or Google Docs. Convert via LibreOffice or Word export first.
  • Do not run macro-enabled .docm / VBA. The runtime sandbox does not execute embedded code, and security scanners flag mixed content.
  • For PDF generation from a .docx, hand off to LibreOffice headless or a separate PDF skill. This skill stops at .docx.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Docx AI skill do?

Read, inspect, edit, or create Microsoft Word `.docx` documents, including structured text extraction, style-preserving edits, tracked-change review, and generation from a brief.

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/TokenRhythm/opensquilla/tree/main/src/opensquilla/skills/bundled/docx. TypingMind reads its SKILL.md and bundles its files 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 TokenRhythm under the Apache-2.0 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 👇