{"id":"32c6c2ef-0f3a-479d-9fcd-b5dfef4355fe","shortId":"yNcHnU","kind":"skill","title":"lovstudio:any2docx","tagline":"Convert Markdown documents to professionally styled DOCX (Word) files with python-docx. Handles CJK/Latin mixed text, fenced code blocks, tables, blockquotes, cover pages, TOC field, watermarks, and page numbers. Supports multiple color themes matching any2pdf (Warm Academic, Nor","description":"# any2docx — Markdown to Professional DOCX\n\nThis skill converts any Markdown file into a professionally styled Word document using\nPython's python-docx library. It shares the same theme palette as any2pdf and handles\nall CJK/Latin edge cases correctly.\n\n## When to Use\n\n- User wants to convert `.md` → `.docx` (Word)\n- User needs an **editable** document (not PDF)\n- Document contains CJK characters mixed with Latin text\n- Document has fenced code blocks, markdown tables, or lists\n- User wants a cover page, table of contents, or watermark in their DOCX\n\n## Quick Start\n\n```bash\npython lovstudio-any2docx/scripts/md2docx.py \\\n  --input report.md \\\n  --output report.docx \\\n  --title \"My Report\" \\\n  --author \"Author Name\" \\\n  --theme warm-academic\n```\n\nAll parameters except `--input` are optional — sensible defaults are applied.\n\n## Pre-Conversion Options (MANDATORY)\n\n**IMPORTANT: You MUST use the `AskUserQuestion` tool to ask these questions BEFORE\nrunning the conversion. Do NOT list options as plain text — use the tool so the user\ngets a proper interactive prompt. Ask all options in a SINGLE `AskUserQuestion` call.**\n\nUse `AskUserQuestion` with the following template:\n\n```\n开始转 Word！先帮你确认几个选项 👇\n\n━━━ 📐 设计风格 ━━━\n a) 暖学术    — 陶土色调，温润典雅，适合人文/社科报告\n b) 经典论文  — 棕色调，灵感源自 LaTeX classicthesis，适合学术论文\n c) Tufte     — 极简留白，深红点缀，适合数据叙事/技术写作\n d) 期刊蓝    — 藏蓝严谨，灵感源自 IEEE，适合正式发表风格\n e) 精装书    — 咖啡色调，书卷气，适合长篇专著/技术书\n f) 中国红    — 朱红配暖纸，适合中文正式报告/白皮书\n g) 水墨      — 纯灰黑，素雅克制，适合文学/设计类内容\n h) GitHub    — 蓝白极简，程序员熟悉的风格\n i) Nord 冰霜 — 蓝灰北欧风，清爽现代\n j) 海洋      — 青绿色调，清新自然\n k) 投资报告  — 楷体+深红，专业严谨，适合投资/尽调报告\n\n━━━ 💧 水印 ━━━\n 1) 不加\n 2) 自定义文字（如 \"DRAFT\"、\"内部资料\"）\n\n示例回复：\"a, 水印:仅供内部参考\"\n直接说人话就行，不用记编号 😄\n```\n\n### Mapping User Choices to CLI Args\n\n| Choice | CLI arg |\n|--------|---------|\n| Design style a-k | `--theme` with value from table below |\n| Watermark text | `--watermark \"文字\"` |\n\n### Theme Name Mapping\n\n| Choice | `--theme` value |\n|--------|----------------|\n| a) 暖学术 | `warm-academic` |\n| b) 经典论文 | `classic-thesis` |\n| c) Tufte | `tufte` |\n| d) 期刊蓝 | `ieee-journal` |\n| e) 精装书 | `elegant-book` |\n| f) 中国红 | `chinese-red` |\n| g) 水墨 | `ink-wash` |\n| h) GitHub | `github-light` |\n| i) Nord | `nord-frost` |\n| j) 海洋 | `ocean-breeze` |\n| k) 投资报告 | `invest-report` |\n\n## Architecture\n\n```\nMarkdown → Strip frontmatter → Preprocess (split merged headings) → Parse (code-fence-aware) → python-docx Document → .docx\n```\n\nKey components:\n1. **CJK font switching**: `_split_mixed()` detects CJK runs and assigns Songti SC / SimSun / Noto CJK\n2. **Inline markdown**: `_parse_inline()` handles **bold**, *italic*, `code`, [links](url)\n3. **Images**: Local paths (relative to .md) and remote URLs — auto-downloaded and embedded via `add_picture()`\n4. **Code blocks**: Shaded paragraph with monospace font and border\n5. **Tables**: Header row with accent background, alternating row shading\n6. **Watermark**: VML-based diagonal watermark in header (Word-native)\n7. **TOC**: Field code with static fallback entries; `updateFields=true` triggers auto-refresh on open\n8. **YAML frontmatter**: Automatically stripped (won't leak `status: draft` etc. into output)\n9. **Adaptive cover title**: Font size scales down for long titles (36pt → 22pt)\n\n## Configuration Reference\n\n| Argument | Default | Description |\n|----------|---------|-------------|\n| `--input` | (required) | Path to markdown file |\n| `--output` | `output.docx` | Output DOCX path |\n| `--title` | From first H1 | Document title for cover page |\n| `--subtitle` | `\"\"` | Subtitle text |\n| `--author` | `\"\"` | Author name |\n| `--date` | Today | Date string |\n| `--version` | `\"\"` | Version string for cover |\n| `--watermark` | `\"\"` | Watermark text (empty = none) |\n| `--theme` | `warm-academic` | Color theme name |\n| `--cover` | `true` | Generate cover page |\n| `--toc` | `true` | Generate table of contents |\n| `--header-title` | `\"\"` | Report title in page header |\n| `--footer-left` | author | Brand/author in footer |\n| `--stats-line` | `\"\"` | Stats on cover |\n| `--stats-line2` | `\"\"` | Second stats line |\n| `--edition-line` | `\"\"` | Edition line on cover |\n| `--code-max-lines` | `30` | Max lines per code block |\n\n## Dependencies\n\n```bash\npip install python-docx --break-system-packages\n```","tags":["any2docx","skills","lovstudio","agent-skills","ai-coding-assistant","cjk","claude-code","cursor","gemini-cli","markdown-to-docx","markdown-to-pdf"],"capabilities":["skill","source-lovstudio","skill-any2docx","topic-agent-skills","topic-ai-coding-assistant","topic-cjk","topic-claude-code","topic-cursor","topic-gemini-cli","topic-markdown-to-docx","topic-markdown-to-pdf"],"categories":["skills"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/lovstudio/skills/any2docx","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add lovstudio/skills","source_repo":"https://github.com/lovstudio/skills","install_from":"skills.sh"}},"qualityScore":"0.470","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 40 github stars · SKILL.md body (4,234 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:56:33.894Z","embedding":null,"createdAt":"2026-04-18T22:18:51.357Z","updatedAt":"2026-04-22T00:56:33.894Z","lastSeenAt":"2026-04-22T00:56:33.894Z","tsv":"'/scripts/md2docx.py':135 '1':279,395 '2':281,411 '22pt':513 '3':422 '30':615 '36pt':512 '4':440 '5':450 '6':460 '7':472 '8':488 '9':501 'a-k':303 'academ':40,149,326,562 'accent':455 'adapt':502 'add':438 'altern':457 'any2docx':2,42,134 'any2pdf':38,73 'appli':159 'architectur':375 'arg':297,300 'argument':516 'ask':173,198 'askuserquest':170,204,207 'assign':405 'author':143,144,542,543,588 'auto':433,484 'auto-download':432 'auto-refresh':483 'automat':491 'awar':387 'b':222,327 'background':456 'base':464 'bash':130,622 'block':22,110,442,620 'blockquot':24 'bold':417 'book':344 'border':449 'brand/author':589 'break':629 'break-system-packag':628 'breez':369 'c':229,332 'call':205 'case':79 'charact':101 'chines':348 'chinese-r':347 'choic':294,298,319 'cjk':100,396,402,410 'cjk/latin':17,77 'classic':330 'classic-thesi':329 'classicthesi':227 'cli':296,299 'code':21,109,385,419,441,475,612,619 'code-fence-awar':384 'code-max-lin':611 'color':35,563 'compon':394 'configur':514 'contain':99 'content':122,576 'convers':162,179 'convert':3,49,87 'correct':80 'cover':25,118,503,537,553,566,569,597,610 'd':235,335 'date':545,547 'default':157,517 'depend':621 'descript':518 'design':301 'detect':401 'diagon':465 'document':5,58,95,98,106,391,534 'docx':9,15,46,64,89,127,390,392,528,627 'download':434 'draft':284,497 'e':241,340 'edg':78 'edit':94,605,607 'edition-lin':604 'eleg':343 'elegant-book':342 'embed':436 'empti':557 'entri':479 'etc':498 'except':152 'f':247,345 'fallback':478 'fenc':20,108,386 'field':28,474 'file':11,52,524 'first':532 'follow':210 'font':397,447,505 'footer':586,591 'footer-left':585 'frontmatt':378,490 'frost':364 'g':252,350 'generat':568,573 'get':193 'github':259,356,358 'github-light':357 'h':258,355 'h1':533 'handl':16,75,416 'head':382 'header':452,468,578,584 'header-titl':577 'ieee':239,338 'ieee-journ':337 'imag':423 'import':165 'ink':353 'ink-wash':352 'inlin':412,415 'input':136,153,519 'instal':624 'interact':196 'invest':373 'invest-report':372 'ital':418 'j':267,365 'journal':339 'k':271,305,370 'key':393 'latex':226 'latin':104 'leak':495 'left':587 'librari':65 'light':359 'line':594,603,606,608,614,617 'line2':600 'link':420 'list':114,182 'local':424 'long':510 'lovstudio':1,133 'lovstudio-any2docx':132 'mandatori':164 'map':292,318 'markdown':4,43,51,111,376,413,523 'match':37 'max':613,616 'md':88,428 'merg':381 'mix':18,102,400 'monospac':446 'multipl':34 'must':167 'name':145,317,544,565 'nativ':471 'need':92 'none':558 'nord':263,361,363 'nord-frost':362 'noto':409 'number':32 'ocean':368 'ocean-breez':367 'open':487 'option':155,163,183,200 'output':138,500,525,527 'output.docx':526 'packag':631 'page':26,31,119,538,570,583 'palett':71 'paragraph':444 'paramet':151 'pars':383,414 'path':425,521,529 'pdf':97 'per':618 'pictur':439 'pip':623 'plain':185 'pre':161 'pre-convers':160 'preprocess':379 'profession':7,45,55 'prompt':197 'proper':195 'python':14,60,63,131,389,626 'python-docx':13,62,388,625 'question':175 'quick':128 'red':349 'refer':515 'refresh':485 'relat':426 'remot':430 'report':142,374,580 'report.docx':139 'report.md':137 'requir':520 'row':453,458 'run':177,403 'sc':407 'scale':507 'second':601 'sensibl':156 'shade':443,459 'share':67 'simsun':408 'singl':203 'size':506 'skill':48 'skill-any2docx' 'songti':406 'source-lovstudio' 'split':380,399 'start':129 'stat':593,595,599,602 'static':477 'stats-lin':592 'stats-line2':598 'status':496 'string':548,551 'strip':377,492 'style':8,56,302 'subtitl':539,540 'support':33 'switch':398 'system':630 'tabl':23,112,120,310,451,574 'templat':211 'text':19,105,186,313,541,556 'theme':36,70,146,306,316,320,559,564 'thesi':331 'titl':140,504,511,530,535,579,581 'toc':27,473,571 'today':546 'tool':171,189 'topic-agent-skills' 'topic-ai-coding-assistant' 'topic-cjk' 'topic-claude-code' 'topic-cursor' 'topic-gemini-cli' 'topic-markdown-to-docx' 'topic-markdown-to-pdf' 'trigger':482 'true':481,567,572 'tuft':230,333,334 'updatefield':480 'url':421,431 'use':59,83,168,187,206 'user':84,91,115,192,293 'valu':308,321 'version':549,550 'via':437 'vml':463 'vml-base':462 'want':85,116 'warm':39,148,325,561 'warm-academ':147,324,560 'wash':354 'watermark':29,124,312,314,461,466,554,555 'won':493 'word':10,57,90,213,470 'word-nat':469 'yaml':489 '不加':280 '不用记编号':291 '专业严谨':275 '中国红':248,346 '书卷气':244 '仅供内部参考':289 '先帮你确认几个选项':214 '内部资料':285 '冰霜':264 '咖啡色调':243 '如':283 '尽调报告':277 '开始转':212 '技术书':246 '技术写作':234 '投资报告':272,371 '文字':315 '暖学术':217,323 '期刊蓝':236,336 '朱红配暖纸':249 '极简留白':231 '棕色调':224 '楷体':273 '水印':278,288 '水墨':253,351 '海洋':268,366 '深红':274 '深红点缀':232 '清新自然':270 '清爽现代':266 '温润典雅':219 '灵感源自':225,238 '白皮书':251 '直接说人话就行':290 '示例回复':286 '社科报告':221 '程序员熟悉的风格':261 '精装书':242,341 '素雅克制':255 '纯灰黑':254 '经典论文':223,328 '自定义文字':282 '蓝灰北欧风':265 '蓝白极简':260 '藏蓝严谨':237 '设计类内容':257 '设计风格':215 '适合中文正式报告':250 '适合人文':220 '适合学术论文':228 '适合投资':276 '适合数据叙事':233 '适合文学':256 '适合正式发表风格':240 '适合长篇专著':245 '陶土色调':218 '青绿色调':269","prices":[{"id":"84878b0a-ecc1-4a08-94ff-35248b4c72c8","listingId":"32c6c2ef-0f3a-479d-9fcd-b5dfef4355fe","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"lovstudio","category":"skills","install_from":"skills.sh"},"createdAt":"2026-04-18T22:18:51.357Z"}],"sources":[{"listingId":"32c6c2ef-0f3a-479d-9fcd-b5dfef4355fe","source":"github","sourceId":"lovstudio/skills/any2docx","sourceUrl":"https://github.com/lovstudio/skills/tree/main/skills/any2docx","isPrimary":false,"firstSeenAt":"2026-04-18T22:18:51.357Z","lastSeenAt":"2026-04-22T00:56:33.894Z"}],"details":{"listingId":"32c6c2ef-0f3a-479d-9fcd-b5dfef4355fe","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"lovstudio","slug":"any2docx","github":{"repo":"lovstudio/skills","stars":40,"topics":["agent-skills","ai-coding-assistant","cjk","claude-code","cursor","gemini-cli","markdown-to-docx","markdown-to-pdf"],"license":"mit","html_url":"https://github.com/lovstudio/skills","pushed_at":"2026-04-21T15:57:51Z","description":"Agent skills for AI coding assistants — Markdown to PDF/DOCX with 14 themes, CJK support","skill_md_sha":"705b7a74a01f38237609bc0f179cea8108246254","skill_md_path":"skills/any2docx/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/lovstudio/skills/tree/main/skills/any2docx"},"layout":"multi","source":"github","category":"skills","frontmatter":{"name":"lovstudio:any2docx","license":"MIT","description":"Convert Markdown documents to professionally styled DOCX (Word) files with python-docx. Handles CJK/Latin mixed text, fenced code blocks, tables, blockquotes, cover pages, TOC field, watermarks, and page numbers. Supports multiple color themes matching any2pdf (Warm Academic, Nord, GitHub Light, etc.) and is battle-tested for Chinese technical reports. Use this skill whenever the user wants to turn a .md file into a styled Word document, generate an editable report from markdown, or create a DOCX from markdown content — especially if CJK characters, code blocks, or tables are involved. Also trigger when the user mentions \"markdown to docx\", \"md2docx\", \"any2docx\", \"md转word\", \"md转docx\", \"生成word\", or asks for an \"editable document\" from markdown source.","compatibility":"Requires Python 3.8+ and python-docx (`pip install python-docx`). Cross-platform: macOS, Windows, Linux. CJK fonts: macOS uses Songti SC, Windows uses SimSun, Linux uses Noto Serif CJK SC."},"skills_sh_url":"https://skills.sh/lovstudio/skills/any2docx"},"updatedAt":"2026-04-22T00:56:33.894Z"}}