Converts Markdown documents into professionally styled, editable DOCX files with support for CJK characters, code blocks, and custom themes.
- GitHub stars
- 72
- Files
- 6
- Last commit
- Nov 10, 2026
- License
- MIT
- Allowed tools
- —
What does the lov-any2docx skill do?
lov-any2docx converts Markdown documents into professionally styled, editable DOCX files with support for CJK characters, code blocks, and custom themes.
Summary generated from the skill's SKILL.md.
About the lov-any2docx skill
Converting Markdown files into professionally styled, editable Word documents is the primary function of this skill. It is designed for developers and technical writers who need to transform .md files into high-quality DOCX reports, especially when those documents contain complex elements like fenced code blocks, markdown tables, or mixed CJK and Latin text. The tool uses the python-docx library to handle typesetting and ensures that Chinese characters are rendered correctly using system-specific fonts like Songti SC, SimSun, or Noto Serif CJK SC.
An agent should load this skill when a user requests an editable document rather than a PDF. The process involves using the AskUserQuestion tool to let the user select from various design themes, such as warm-academic, github-light, or ieee-journal, and to specify watermark text. The resulting DOCX file can include automated features like a table of contents, cover pages, and watermarks. It relies on the lov-branding-consistency dependency to maintain visual standards across different document generations.
What an agent can do with it
- 1Generate technical reportsTransform a markdown file containing code blocks and tables into a styled Word document for a technical audience.
- 2Create academic papersConvert markdown research notes into a formal document using a LaTeX-inspired theme.
- 3Produce branded business documentsGenerate a professional investment report with specific color themes and watermarks.
- 4Handle multilingual documentationConvert documents that mix Chinese and English characters without losing proper font formatting.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the lov-any2docx skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the lov-any2docx skill in Plugin
/plugin marketplace add lovstudio/skills /plugin install office-automation@lovstudio
Install the lov-any2docx skill in Claude Code
~/.claude/skills/lov-any2docx/SKILL.md
$ npx degit lovstudio/skills/skills/any2docx ~/.claude/skills/lov-any2docxInstall the lov-any2docx skill in Claude Code (project)
.claude/skills/lov-any2docx/SKILL.md
$ npx degit lovstudio/skills/skills/any2docx .claude/skills/lov-any2docxInstall the lov-any2docx skill in Codex
~/.agents/skills/lov-any2docx/SKILL.md
$ npx degit lovstudio/skills/skills/any2docx ~/.agents/skills/lov-any2docxInstall the lov-any2docx skill in Gemini CLI
~/.gemini/skills/lov-any2docx/SKILL.md
$ npx degit lovstudio/skills/skills/any2docx ~/.gemini/skills/lov-any2docxInstall the lov-any2docx skill in Claude.ai
npx degit lovstudio/skills/skills/any2docx lov-any2docx && zip -r lov-any2docx.zip lov-any2docx # claude.ai → Customize → Skills → + → Create skill → Upload a skill → lov-any2docx.zip
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the scripts before you let an agent run them. How checks work · What to fix for more points
- Source repository linked and reachablelovstudio/skills/skills/any2docx is public and reachablegithub.com/lovstudio/skills/tree/HEAD/skills/any2docx ↗Pass
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit 2026-11-10github.com/lovstudio/skills/commits ↗Pass
- No download-and-run or credential theft in scripts1 script read; no download-and-run, remote eval, base64 execution or credential uploadPass
- No hidden instructions in SKILL.mdNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/lovstudio/skills/blob/HEAD/skills/any2docx/SKILL. ↗Pass
- Pre-approved tools are scopedNo pre-approved tools; the agent asks before using onegithub.com/lovstudio/skills/blob/HEAD/skills/any2docx/SKILL. ↗Pass
- SKILL.md follows the Agent Skills formatname "lov-any2docx" differs from the folder "any2docx"github.com/lovstudio/skills/blob/HEAD/skills/any2docx/SKILL. ↗Finding
SKILL.md
View on GitHubWord 大师 · Word Master
This skill converts any Markdown file into a professionally styled Word document using Python's python-docx library. It shares the same theme palette as any2pdf and handles all CJK/Latin edge cases correctly.
When to Use
- User wants to convert
.md→.docx(Word) - User needs an editable document (not PDF)
- Document contains CJK characters mixed with Latin text
- Document has fenced code blocks, markdown tables, or lists
- User wants a cover page, table of contents, or watermark in their DOCX
Quick Start
python lov-any2docx/scripts/md2docx.py \
--input report.md \
--output report.docx \
--title "My Report" \
--author "Author Name" \
--theme warm-academic
All parameters except --input are optional — sensible defaults are applied.
Pre-Conversion Options (MANDATORY)
IMPORTANT: You MUST use the AskUserQuestion tool to ask these questions BEFORE
running the conversion. Do NOT list options as plain text — use the tool so the user
gets a proper interactive prompt. Ask all options in a SINGLE AskUserQuestion call.
Use AskUserQuestion with the following template:
开始转 Word!先帮你确认几个选项 👇
━━━ 📐 设计风格 ━━━
a) 暖学术 — 陶土色调,温润典雅,适合人文/社科报告
b) 经典论文 — 棕色调,灵感源自 LaTeX classicthesis,适合学术论文
c) Tufte — 极简留白,深红点缀,适合数据叙事/技术写作
d) 期刊蓝 — 藏蓝严谨,灵感源自 IEEE,适合正式发表风格
e) 精装书 — 咖啡色调,书卷气,适合长篇专著/技术书
f) 中国红 — 朱红配暖纸,适合中文正式报告/白皮书
g) 水墨 — 纯灰黑,素雅克制,适合文学/设计类内容
h) GitHub — 蓝白极简,程序员熟悉的风格
i) Nord 冰霜 — 蓝灰北欧风,清爽现代
j) 海洋 — 青绿色调,清新自然
k) 投资报告 — 楷体+深红,专业严谨,适合投资/尽调报告
━━━ 💧 水印 ━━━
1) 不加
2) 自定义文字(如 "DRAFT"、"内部资料")
示例回复:"a, 水印:仅供内部参考"
直接说人话就行,不用记编号 😄
Mapping User Choices to CLI Args
| Choice | CLI arg |
|---|---|
| Design style a-k | --theme with value from table below |
| Watermark text | --watermark "文字" |
Theme Name Mapping
| Choice | --theme value |
|---|---|
| a) 暖学术 | warm-academic |
| b) 经典论文 | classic-thesis |
| c) Tufte | tufte |
| d) 期刊蓝 | ieee-journal |
| e) 精装书 | elegant-book |
| f) 中国红 | chinese-red |
| g) 水墨 | ink-wash |
| h) GitHub | github-light |
| i) Nord | nord-frost |
| j) 海洋 | ocean-breeze |
| k) 投资报告 | invest-report |
Architecture
Markdown → Strip frontmatter → Preprocess (split merged headings) → Parse (code-fence-aware) → python-docx Document → .docx
Key components:
- CJK font switching:
_split_mixed()detects CJK runs and assigns Songti SC / SimSun / Noto CJK - Inline markdown:
_parse_inline()handles bold, italic,code, links - Images: Local paths (relative to .md) and remote URLs — auto-downloaded and embedded via
add_picture() - Code blocks: Shaded paragraph with monospace font and border
- Tables: Header row with accent background, alternating row shading
- Watermark: VML-based diagonal watermark in header (Word-native)
- TOC: Field code with static fallback entries;
updateFields=truetriggers auto-refresh on open - YAML frontmatter: Automatically stripped (won't leak
status: draftetc. into output) - Adaptive cover title: Font size scales down for long titles (36pt → 22pt)
Configuration Reference
| Argument | Default | Description |
|---|---|---|
--input |
(required) | Path to markdown file |
--output |
output.docx |
Output DOCX path |
--title |
From first H1 | Document title for cover page |
--subtitle |
"" |
Subtitle text |
--author |
"" |
Author name |
--date |
Today | Date string |
--version |
"" |
Version string for cover |
--watermark |
"" |
Watermark text (empty = none) |
--theme |
warm-academic |
Color theme name |
--cover |
true |
Generate cover page |
--toc |
true |
Generate table of contents |
--header-title |
"" |
Report title in page header |
--footer-left |
author | Brand/author in footer |
--stats-line |
"" |
Stats on cover |
--stats-line2 |
"" |
Second stats line |
--edition-line |
"" |
Edition line on cover |
--code-max-lines |
30 |
Max lines per code block |
Dependencies
pip install python-docx --break-system-packages
Runtime context (shared)
运行前读取本 Skill 包的 skill.yaml,由宿主提供 skill-runtime/v1 上下文。字段解析顺序为:当前请求、项目上下文、个人 Preferences、品牌 Profile、通用默认值。
- 只使用 Manifest 声明的字段;Profile 保存公开品牌事实,Preferences 保存个人工作偏好。
required: true字段缺失时,按 Manifest 的问题配置向用户提出一个聚焦问题;用户明确同意后再保存回答。- 报错提供可复制的
context_id、字段路径与来源,诊断内容避开秘密、完整私人路径和原始配置。
通用反馈闭环
用户在 Skill 驱动任务中提出修改意见时,继续当前产物前必须执行:
- 先判断意见是
task-specific(仅本次)还是reusable(可跨任务复用)。 task-specific只修改当前任务,不改 Skill。reusable先确定作用域:领域规则先更新对应 canonical Skill;适用于所有 Skill 的规则先更新共享规范。- 完成规则更新、版本、lint 与分发核验后,再把修改应用到当前任务。
reusable修改会使此前的“确认”“继续”“发吧”失效;完成当前产物修改和回读后必须停下,等待用户下一步指示,不自动进入发布、提交或其他外部写入。
Files in this skill
6lov-any2docx skill questions
How do I install the lov-any2docx skill in Claude Code?
Run npx degit lovstudio/skills/skills/any2docx ~/.claude/skills/lov-any2docx. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the lov-any2docx skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
What features are supported during Markdown to DOCX conversion?
The tool handles CJK/Latin mixed text, fenced code blocks, tables, blockquotes, cover pages, TOC fields, watermarks, and page numbers.
Can I customize the visual style of the generated Word document?
Yes, you can choose from multiple color themes such as Academic, Nord, GitHub Light, IEEE Journal, and more.
What are the system requirements for using this skill?
It requires Python 3.8+ and the python-docx library.