docx2md

docx2md is a skill for Claude Code, Codex from gonzalopezgil/docx2md-cli. It costs 87 tokens per session (874 once invoked), scanned A, original, MIT.

A converter that turns Word documents (.docx) into Markdown while retaining document structure. Markdown is plain-text formatting commonly used for technical documents and websites.

In plain words
What is it for?
Use it to convert Word files, extract embedded images, keep or remove frontmatter, skip cover material, pipe input and output, and produce conversion statistics.
Why use it?
It reduces the loss of tables, footnotes, lists, images, references, and document metadata during conversion.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to convert Word files, extract embedded images, keep or remove frontmatter, skip cover material, pipe input and output, and produce conversion statistics.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gonzalopezgil/docx2md-cli/skill
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add gonzalopezgil/docx2md-cli --skill skill
Clone the repo
git clone --depth 1 https://github.com/gonzalopezgil/docx2md-cli

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docx2md

README.md
[![agentmods](https://agentmods.dev/badge/skills/gonzalopezgil/docx2md-cli/skill/github.svg)](https://agentmods.dev/skills/gonzalopezgil/docx2md-cli/skill)
Your own site
<a href="https://agentmods.dev/skills/gonzalopezgil/docx2md-cli/skill"><img src="https://agentmods.dev/badge/skills/gonzalopezgil/docx2md-cli/skill/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for docx2md

Your own site · 80×15
<a href="https://agentmods.dev/skills/gonzalopezgil/docx2md-cli/skill"><img src="https://agentmods.dev/badge/skills/gonzalopezgil/docx2md-cli/skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 874 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00087 $0.00874
Opus 5.5 $0.00035 $0.00350
Sonnet 5.5 $0.00017 $0.00175
Haiku 4.5 $0.00009 $0.00087

Measured 1mo ago against content hash ad8aade58e98, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

docx2md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skill/SKILL.md · 98 lines

How it starts

The opening of the file, as written. The whole thing — 98 lines — stays where its author put it; the contents beside it link to each section on GitHub.

docx2md-cli

High-fidelity Word (.docx) to Markdown converter. Built for documents where structure matters — normative texts, policies, technical specs, government docs.

Install

pip install docx2md-cli

For custom YAML frontmatter loading:

pip install "docx2md-cli[frontmatter]"

CLI Usage

# Basic conversion
docx2md input.docx

# Full-featured
docx2md input.docx -o output.md --extract-images images/ --skip-before-heading

# Agent-friendly (machine-readable)
docx2md input.docx --json-stats -q -o output.md

# Stdin/stdout piping
cat input.docx | docx2md - -o -

Flags

Flag Description
-o PATH Output path. Use - for stdout.
--extract-images DIR Extract embedded images and link them in Markdown.
--skip-before-heading Skip content before the first Word heading (cover pages, TOC).
--frontmatter FILE Prepend custom YAML frontmatter from a file.
--no-frontmatter Disable all frontmatter (auto and custom).
-q, --quiet Suppress stats output.
--json-stats Emit stats as JSON to stderr.

Python API

from docx2md_cli import convert

result = convert(
    "input.docx",            # str path, bytes, or BinaryIO
    output_path="output.md", # optional
    images_dir="images",     # optional
    skip_before_heading=True,
    no_frontmatter=False,
    print_stats=False,
)

# result is list-like (backward compatible) with extras
lines = result.lines          # list of Markdown lines
stats = result.stats          # dict with counts
json_str = result.as_json()   # JSON string of stats

Stats dict keys

lines, bytes, headings, table_rows, figures, bold, footnotes, refs, tables_inserted, tables_total, underlined, ordered_list_items, nested_items

What It Preserves (that others don't)

  • Field-code references: [N] citation refs from Word's field code state machine
  • Bibliography SDT: Extracts bibliography content controls as [^rN] definitions
  • Vertical merge (vMerge): Grouped table rendering for merged cells
  • Split table detection: Merges 1-row header + data table pairs
  • Inline footnotes: At their original Word position, not end-of-document
  • Numbered vs bullet lists: Reads numbering.xml directly, preserves nesting
  • Image extraction: Embedded images with caption-derived filenames
  • Multi-language captions: ES, EN, FR, DE, PT, IT

Read the full file on GitHub · 98 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 98 lines · 87 tokens per session scan A ad8aade58e98

Subscribe to this mod's changes

docx2md is a skill published in the GitHub repository gonzalopezgil/docx2md-cli (6 stars, last pushed 7mo ago), licensed MIT. It adds 87 tokens to every session and 874 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

all2md

Convert, read, generate, search, and compare documents with the all2md CLI and Python library. Use whenever a task involves reading or extracting text/tables from a document (PDF, Word, PowerPoint, Excel, HTML, email, EPUB, Jupyter, images, or 100+ source-code and text file types); converting between formats…

thomas-villani/all2md · 181 tokens

document-processing

Use when the deliverable is a document's bytes or its literal content — text/tables out of PDFs, AcroForm fill and flatten, page merge/split, PDF/DOCX from templates, OCR of image-only scans. NOT schema-typed fields pulled from text (that is structured-extraction), NOT signature routing (e-signature) or spreadsheet…

ericrisco/rsc-harness · 84 tokens

zotkit

Use when the user wants to add, create, upload/attach, download/fetch, search, tag, look up by item key, export BibTeX for, or organize references (papers, PDFs) in their Zotero library via the zotkit CLI — headless Zotero management through the Web API + WebDAV, no desktop app. Covers task recipes and safety rules.…

oldantique/zotkit · 93 tokens

deckprobe

Inspect PDF, Microsoft Office (docx/xlsx/pptx and legacy doc/xls/ppt), and Apple iWork (key/numbers/pages) files without opening or rendering them. Use for page and slide and sheet counts, title/author/created metadata, encryption and macro and digital-signature and JavaScript risk signals, sheet and table structure…

deckflow/deckprobe · 130 tokens

docx-template-translator

Adaptive conversion of LaTeX, PDF, or Markdown sources into a complete Word .docx that follows a user-supplied .docx template. Use when pandoc --reference-doc alone is not enough — for thesis, dissertation, report, or institutional Word formatting that needs cover pages, declarations, TOC, heading numbering, captions…

zouchenzhen/docx-template-translator-skill · 87 tokens

sign-draft

Author a new SIGN document from a concept, notes, or requirements — interactively and spec-compliant. Use when an operator asks Claude Code to write, draft, or create a SIGN document (a std / pol / ref / proc / xwalk doc), produce a Layer 1 index entry, or hand-write SIGN structure. For converting an EXISTING source…

sign-protocol/sign-tools · 86 tokens