skills/md-to-docx/SKILL.md
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, 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.
npx skillsauth add mohtashammurshid/md-to-docx md-to-docxInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill to reliably produce .docx output from Markdown.
.docx file path or browser download).Use these commands:
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:
<input.md> <output.docx>--options <options.json> or -o <options.json>style, template, sections, and textReplacements-h or --helpDOCX created at: <absolute-path>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.
Use options.template for shared defaults and options.sections for per-section markdown and overrides:
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:
style applies firsttemplate provides shared section defaultsUse pageNumbering.display for common footer numbering modes: none, current, currentAndTotal, or currentAndSectionTotal.
Use textReplacements to rewrite text before conversion:
const blob = await convertMarkdownToDocx("# Hello oldText", {
textReplacements: [
{ find: /oldText/g, replace: "newText" },
{ find: "Hello", replace: "Hi" }
]
});
Support includes:
# to #####++text++), strikethrough (~~text~~)fontFamily style optioncodeBlockAlignment)textReplacementsCOMMENT: ...[TOC] on its own line\pagebreak on its own line---) are skipped during DOCX generation| Option | Values | Default |
|---|---|---|
| paragraphAlignment | LEFT, CENTER, RIGHT, JUSTIFIED | LEFT |
| headingAlignment | same | LEFT |
| heading1Alignment–heading5Alignment | same | LEFT |
| blockquoteAlignment | same | LEFT |
| codeBlockAlignment | same | LEFT |
| fontFamily | any font name string | Calibri |
| direction | LTR, RTL | LTR |
| tableLayout | autofit, fixed | autofit |
| tocFontSize | number | library default |
Blob bytes to disk instead of using downloadDocx.pageNumbering.start to reset counts.titlePage: true on that section.tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.