$npx -y skills add comol/ai_rules_1c --skill md-to-docxConvert a Markdown file to DOCX (Word). Use when the user asks to convert .md to .docx, generate a Word document from Markdown, or export Markdown notes to Word.
| 1 | # md-to-docx — Markdown to DOCX conversion |
| 2 | |
| 3 | Converts a Markdown file to a Word document (`.docx`) preserving headings, tables, lists, code blocks, links and inline images. |
| 4 | |
| 5 | ## Usage |
| 6 | |
| 7 | ``` |
| 8 | /md-to-docx <input.md> [output.docx] [--author "Name"] [--title "Title"] [--no-shading] |
| 9 | ``` |
| 10 | |
| 11 | | Parameter | Required | Description | |
| 12 | |-----------|:--------:|-------------| |
| 13 | | `input.md` | yes | Path to the source Markdown file | |
| 14 | | `output.docx` | no | Path to the output file (default: alongside source, `.md` → `.docx`) | |
| 15 | | `--author` | no | Document author. Written to core properties (`dc:creator` + `cp:lastModifiedBy`). Also accepts the `--author=Name` form | |
| 16 | | `--title` | no | Document title in core properties and in the header. Default: input file name without extension | |
| 17 | | `--no-shading` | no | Disables the grey background for inline `code` and fenced ``` code blocks. Alias: `--shading=off`. On by default. Does not affect the table header (it keeps its structural fill) | |
| 18 | |
| 19 | If the path is not provided — ask the user. The `--author`, `--title`, `--no-shading` flags are optional — pass them only when the user explicitly asks for an author, a custom title, or removal of code shading. |
| 20 | |
| 21 | ## Dependencies |
| 22 | |
| 23 | - **Node.js** — to run the script |
| 24 | - **npm package `docx`** — pinned by this skill's `package-lock.json`; install locally with `npm ci --prefix "<skill-dir>"` |
| 25 | |
| 26 | ## Command |
| 27 | |
| 28 | `<skill-dir>` below is the directory of this skill: `content/skills/md-to-docx/` in the `1c-rules` source repo, or `<tool>/skills/md-to-docx/` after installation (e.g. `.cursor/skills/md-to-docx/`, `.claude/skills/md-to-docx/`). |
| 29 | |
| 30 | PowerShell (Windows, default for this project): |
| 31 | |
| 32 | ```powershell |
| 33 | npm ci --prefix "<skill-dir>" |
| 34 | node "<skill-dir>/scripts/md_to_docx.js" "<input.md>" "[output.docx]" |
| 35 | |
| 36 | # With author and title |
| 37 | node "<skill-dir>/scripts/md_to_docx.js" "<input.md>" "[output.docx]" --author "I. Ivanov" --title "Analytical note" |
| 38 | |
| 39 | # Without the grey code background |
| 40 | node "<skill-dir>/scripts/md_to_docx.js" "<input.md>" "[output.docx]" --no-shading |
| 41 | ``` |
| 42 | |
| 43 | Bash (macOS / Linux): |
| 44 | |
| 45 | ```bash |
| 46 | npm ci --prefix "<skill-dir>" |
| 47 | node "<skill-dir>/scripts/md_to_docx.js" "<input.md>" "[output.docx]" |
| 48 | ``` |
| 49 | |
| 50 | ## Supported Markdown features |
| 51 | |
| 52 | - Headings (H1–H6) with styles and colors |
| 53 | - Tables with header row |
| 54 | - Code blocks (monospace font, gray background) |
| 55 | - Lists: bulleted and numbered (with nesting) |
| 56 | - Inline formatting: **bold**, *italic*, `code`, [links](url) |
| 57 | - Internal anchor links: `<a id="name"></a>` before a heading becomes a bookmark; `[text](#name)` links resolve to it (external `http(s)` / `mailto:` links stay external) |
| 58 | - Images (``) — resolved relative to the source MD folder |
| 59 | - Horizontal rules (`---`) |
| 60 | - Headers/footers: title in the top, page number in the bottom |
| 61 | - Core properties: author and title (via `--author` / `--title`) |
| 62 | |
| 63 | If an image is not found — a red text placeholder is inserted. |
| 64 | |
| 65 | ## Output example |
| 66 | |
| 67 | ``` |
| 68 | Created: output.docx (45231 bytes, 42 blocks) |
| 69 | ``` |