Convert Markdown files and strings into DOCX documents using @mohtasham/md-to-docx.

MITAuto-check passedDocuments & Office

Install Md To DOCX

skills CLI
$ npx skills add MohtashamMurshid/md-to-docx --skill md-to-docx -a claude-code

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

GitHub CLI
$ gh skill install MohtashamMurshid/md-to-docx md-to-docx --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/MohtashamMurshid/md-to-docx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/md-to-docx .claude/skills/md-to-docx && 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
md-to-docx
GitHub stars
106
Token cost
~1.7k tokens
SKILL.md length
561 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

Convert Markdown files and strings into DOCX documents using @mohtasham/md-to-docx.

  • Works in 5 steps: Decide the execution mode → Confirm input source (Markdown file or… → Confirm output target (.docx file path… → …
  • A user needs Markdown to Word conversion
  • SKILL.md covers Workflow, CLI Mode, Programmatic Mode and Reference DOCX Workflows, plus 6 more sections
  • Calls npx

What it does

Md To DOCX is an agent skill from MohtashamMurshid/md-to-docx. Convert Markdown files and strings into DOCX documents using @mohtasham/md-to-docx. Use when a user needs Markdown to Word conversion, CLI-based file conversion, reference-DOCX styles or placeholder patching, options-driven styling/alignment/font family, TOC/page break handling, underline/strikethrough formatting, multi-section documents with per-section headers/footers, or programmatic conversion in Node/browser code.

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Documents & Office, covering Word documents. It works with Microsoft Word. The repository describes itself as: TypeScript-first library and CLI that converts Markdown into production-ready Word documents in Node.js and the browser. The licence is MIT.

When your agent uses it

  • A user needs Markdown to Word conversion
  • CLI-based file conversion
  • Reference-DOCX styles
  • Placeholder patching

Example prompts

  • “/md-to-docx”

Requirements

  • Node.js

Workflow steps

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

  1. Decide the execution mode
  2. Confirm input source (Markdown file or Markdown string).
  3. Confirm output target (.docx file path or browser download).
  4. Apply options only when requested (alignment, sizes, direction, font family, replacements, template, sections, page numbering).
  5. Run conversion and report resulting output path or filename.

What it can do on your machine

Read from SKILL.md and the folder at commit f82aa23. 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

    Shell commands in SKILL.md call:

    • npx

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

  • Network

    No URLs in SKILL.md. Its commands use npx, which can reach the network depending on how they are called.

    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.

Context cost

Md To DOCX loads about 1.7k tokens when it runs. Until then it costs about 108 tokens; SKILL.md has 561 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~108
When it runs · the whole SKILL.md, loaded when a task matches
~1.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); files beside SKILL.md are not scanned.

SKILL.md

The full file from MohtashamMurshid/md-to-docx at commit f82aa23, republished under its MIT licence (© MohtashamMurshid). 561 words, ~1,711 tokens.

Download SKILL.mdSave it as .claude/skills/md-to-docx/SKILL.md (or your agent's skills folder).
name
md-to-docx
description
Convert Markdown files and strings into DOCX documents using @mohtasham/md-to-docx. Use when a user needs Markdown to Word conversion, CLI-based file conversion, reference-DOCX styles or placeholder patching, options-driven styling/alignment/font family, TOC/page break handling, underline/strikethrough formatting, multi-section documents with per-section headers/footers, or programmatic conversion in Node/browser code.

md-to-docx

Use this skill to reliably produce .docx output from Markdown.

Workflow

  1. Decide the execution mode:
    • CLI mode for file-to-file conversion.
    • Programmatic mode for app code integration.
  2. Confirm input source (Markdown file or Markdown string).
  3. Confirm output target (.docx file path or browser download).
  4. Apply options only when requested (alignment, sizes, direction, font family, replacements, template, sections, page numbering).
  5. Run conversion and report resulting output path or filename.

CLI Mode

Use these commands:

bash
npx @mohtasham/md-to-docx input.md output.docx
md-to-docx input.md output.docx
md-to-docx input.md output.docx --options options.json
md-to-docx input.md output.docx -o options.json
md-to-docx --help

CLI contract:

  • Required positional args: <input.md> <output.docx>
  • Optional options file: --options <options.json> or -o <options.json>
  • Options JSON can include the same shapes as the API: style, template, sections, and textReplacements
  • Help flags: -h or --help
  • On success, expect: DOCX created at: <absolute-path>
  • Reference DOCX modes require binary input and are programmatic APIs, not CLI flags.

Programmatic Mode

typescript
import { convertMarkdownToDocx, downloadDocx } from "@mohtasham/md-to-docx";

const markdown = "# Title\n\nHello **DOCX**.";
const blob = await convertMarkdownToDocx(markdown, {
  documentType: "report",
  style: {
    fontFamily: "Trebuchet MS",
    heading1Alignment: "CENTER",
    paragraphAlignment: "JUSTIFIED",
    codeBlockAlignment: "LEFT",
    direction: "LTR"
  }
});

downloadDocx(blob, "output.docx");

Use convertMarkdownToDocx(markdown, options?) to produce a DOCX Blob. Use downloadDocx(blob, filename?) only in browser environments.

Reference DOCX Workflows

Choose one explicitly:

  • convertMarkdownWithReferenceDocxToBuffer(markdown, referenceBytes, options?) creates a fresh Markdown-owned body and adopts reference named styles, theme/fonts, final-section page layout, and headers/footers.
  • patchMarkdownInDocxToBuffer(referenceBytes, patches, options?) preserves the existing body and replaces named placeholders such as {{body}}.

Reference-style generation never copies static reference body text. Prefer exact { id: "..." } selectors when style names are duplicated; use { name: "..." } for visible Word names. Treat uploaded references as untrusted and keep the default ZIP limits unless the caller has a justified larger bound.

Multi-Section Documents

Use options.template for shared defaults and options.sections for per-section markdown and overrides:

typescript
const blob = await convertMarkdownToDocx("", {
  template: {
    footers: {
      default: { pageNumberDisplay: "currentAndTotal", alignment: "CENTER" }
    }
  },
  sections: [
    {
      markdown: "# Cover Page\n\nIntroduction here.",
      titlePage: true,
      headers: { first: { text: "Confidential", alignment: "RIGHT" } },
      pageNumbering: { start: 1, display: "none" }
    },
    {
      markdown: "# Chapter 1\n\nBody content.",
      style: { paragraphAlignment: "JUSTIFIED" },
      pageNumbering: { start: 1, display: "currentAndTotal" }
    }
  ]
});

Each section can override: style, headers, footers, pageNumbering, page (margins/size/orientation), titlePage, and type (break type).

Merge precedence:

  • Global style applies first
  • template provides shared section defaults
  • Per-section options win last

Use pageNumbering.display for common footer numbering modes: none, current, currentAndTotal, or currentAndSectionTotal.

Figure and Table References

Place a Pandoc-style caption paragraph after a standalone image or table, with a blank line between the block and caption. Use [@fig:id] or [@tbl:id] in prose:

markdown
See [@fig:flow] and [@tbl:metrics].

![Accessible flow diagram](flow.png)

: Request *flow* {#fig:flow}

| Metric | Value |
| --- | --- |
| p95 | 120 ms |

: Performance metrics {#tbl:metrics}

Figure and table numbering continues across sections. Use options.captions for labels, placement, alignment, italics, size, and failureMode. Reference-DOCX patch mode rejects this syntax with a validation error.

Show full SKILL.md (217 more words)Show less

Text Replacements

Use textReplacements to rewrite text before conversion:

typescript
const blob = await convertMarkdownToDocx("# Hello oldText", {
  textReplacements: [
    { find: /oldText/g, replace: "newText" },
    { find: "Hello", replace: "Hi" }
  ]
});

Markdown Features to Expect

Support includes:

  • Headings # to #####
  • Ordered/unordered lists
  • Bold, italic, underline (++text++), strikethrough (~~text~~)
  • Custom font family via fontFamily style option
  • Blockquotes
  • Tables (with inline formatting: bold, italic, code, links, strikethrough in cells)
  • Code blocks and inline code (with configurable codeBlockAlignment)
  • Links and images
  • Automatically numbered figure/table captions and clickable cross-references
  • Text replacements before rendering via textReplacements
  • COMMENT: ...
  • [TOC] on its own line
  • \pagebreak on its own line
  • Markdown thematic breaks (---, ***, ___) render as native Word paragraph borders

Style Options Quick Reference

OptionValuesDefault
paragraphAlignmentLEFT, CENTER, RIGHT, JUSTIFIEDLEFT
headingAlignmentsameLEFT
heading1Alignment–heading5AlignmentsameLEFT
blockquoteAlignmentsameLEFT
codeBlockAlignmentsameLEFT
fontFamilyany font name stringCalibri
directionLTR, RTLLTR
tableLayoutautofit, fixedautofit
tocFontSizenumberlibrary default

Troubleshooting

  • If CLI fails with argument errors, re-check that exactly two positional paths are provided.
  • If options parsing fails, validate JSON syntax and ensure the root is an object.
  • If output is missing, verify destination directory permissions and path spelling.
  • If in Node and you need a file, write the returned Blob bytes to disk instead of using downloadDocx.
  • If sections produce unexpected numbering, ensure each section sets pageNumbering.start to reset counts.
  • If first-page headers or footers do not appear, set titlePage: true on that section.

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

Files

Just SKILL.md in skills/md-to-docx of MohtashamMurshid/md-to-docx.

Open the folder on GitHubat commit f82aa23

Compare with similar skills

Md To DOCX 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.

Md To DOCX compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Md To DOCX this skillMohtashamMurshid/md-to-docx106—~1.7kAutomated safety check: PassMIT
MarkitdownImCa0/just-laws78114 repos~3.2kAutomated safety check: NotesMIT
DOCXrvdbreemen/OTGW-firmware20733 repos~4.3kAutomated safety check: PassProprietary
Word Document Reader and WriterHKUDS/DeepTutor41k—~2.5kAutomated safety check: PassApache-2.0
Gzh Designisjiamu/gzh-design-skill4k—~2.2kAutomated safety check: PassAGPL-3.0
GenOffice Document CLIgenspark-ai/genoffice9.2k—~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.

    781 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
  • 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 3 days ago
    Documents & OfficeAuto-check passed
  • Gzh Design

    isjiamu/gzh-design-skill

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

    4k GitHub stars~2.2k tokensUpdated 2 days ago
    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.

    9.2k GitHub stars~19k tokensUpdated yesterday
    Documents & OfficeAuto-check passed
  • DOCX

    zai-org/ZCode

    Complete DOCX document creation, editing, and analysis capabilities with support for revisions, comments, formatting preservation, and text extraction.

    7.7k GitHub stars~4.9k tokensUpdated yesterday
    Documents & OfficeAuto-check: notes

Works with

Questions about Md To DOCX

What does Md To DOCX do?

Convert Markdown files and strings into DOCX documents using @mohtasham/md-to-docx. Md To DOCX is an agent skill from MohtashamMurshid/md-to-docx. Convert Markdown files and strings into DOCX documents using @mohtasham/md-to-docx.

When should I use Md To DOCX?

Md To DOCX fits situations like: A user needs Markdown to Word conversion; CLI-based file conversion; reference-DOCX styles; placeholder patching.

How do I install Md To DOCX in Claude Code?

Run `npx skills add MohtashamMurshid/md-to-docx --skill md-to-docx -a claude-code`. Or copy the skill folder (skills/md-to-docx in MohtashamMurshid/md-to-docx) into .claude/skills/md-to-docx in your project. Claude Code loads it when a task matches its description.

How do I install Md To DOCX in Codex?

Run `npx skills add MohtashamMurshid/md-to-docx --skill md-to-docx -a codex`. Or copy the skill folder (skills/md-to-docx in MohtashamMurshid/md-to-docx) into .agents/skills/md-to-docx in your project. Codex loads it when a task matches its description.

Can I use Md To DOCX 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 MohtashamMurshid/md-to-docx --skill md-to-docx -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/md-to-docx, .gemini/skills/md-to-docx, .github/skills/md-to-docx and .opencode/skills/md-to-docx in your project.

What does Md To DOCX need to run?

Going by SKILL.md and its folder, Md To DOCX needs the command-line tools its instructions call (npx). Our summary lists: Node.js.

Does Md To DOCX access the network?

SKILL.md contains no URLs. Its commands use npx, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Md To DOCX 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. Review the folder before installing.

What licence does Md To DOCX use?

Md To DOCX is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Md To DOCX use?

About 1.7k tokens (SKILL.md is roughly 6.8k 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 Md To DOCX?

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

Who maintains Md To DOCX?

MohtashamMurshid (a GitHub user) maintains it in MohtashamMurshid/md-to-docx, which has 106 GitHub stars. The repository was last updated on September 10, 2026.

Source: MohtashamMurshid/md-to-docx on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.