From word-agent
Central coordinator for all Word document operations. Routes user requests to specialist modules, manages Token budget, and orchestrates multi-module workflows. Activates as the default entry point when a Word/docx task doesn't clearly map to a single specialist, or when multiple operations are needed in sequence. Triggers: any ambiguous Word request, multi-step operations, "排版并检查", "full preparation", "全流程".
How this skill is triggered — by the user, by Claude, or both
Slash command
/word-agent:word-orchestrateThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
The orchestrator is the entry point and coordinator for all word-agent operations. It does not perform document operations itself — it analyzes user intent, selects the right module(s), ensures Document Map availability, and enforces Token budget rules.
The orchestrator is the entry point and coordinator for all word-agent operations. It does not perform document operations itself — it analyzes user intent, selects the right module(s), ensures Document Map availability, and enforces Token budget rules.
list_available_documents or confirm file pathIF request mentions "对比/compare/diff"
→ word-read (compare mode)
ELIF request mentions "排版/格式/format" AND "检查/check/verify"
→ Pipeline: word-read → word-format → word-check
ELIF request mentions "排版/格式/format"
→ Pipeline: word-read → word-format
ELIF request mentions "修改内容/edit/改写"
→ Pipeline: word-read → word-edit
ELIF request mentions "投稿/submit/清理/clean"
→ Pipeline: word-read → word-check → word-submit
ELIF request mentions "审稿/review/revision"
→ Pipeline: word-read → word-review
ELIF request clearly maps to one module
→ Route to that module directly
ELSE
→ Ask user: "您具体需要对这个文档做什么操作?"
Before routing to any module:
File format check — Is the input file .doc (legacy binary format)?
a. Verify LibreOffice available: `which soffice`
- Not found → tell user: "需要 LibreOffice 来转换 .doc 文件。请安装后重试。"
b. Convert: `soffice --headless --convert-to docx --outdir "{dir}" "{file.doc}"`
- If same-name .docx exists → save as `{name}-converted.docx`
c. Post-fix ALL conversion artifacts (MANDATORY):
python3 scripts/fix_libreoffice.py "{converted.docx}"
This single command fixes: compatibilityMode, Liberation fonts,
semicolon fallback fonts, style chain, tables, spacing, page setup,
AND runs normalize_fonts.py --unify automatically.
d. Report to user: "已将 {name}.doc 转换为 .docx 并修复格式兼容性问题。后续操作基于转换后的文件。"
e. Update file_path to point to the new .docx
See references/doc_conversion.md for details.Document Map check — 先查落盘的 map 文件(不依赖对话上下文):
a. Glob: {文档所在目录}/.word-agent/{文档名去扩展名}.map.md
b. 文件存在 → 比较 mtime(Bash 测试 map 是否比 docx 新):
if [ "{dir}/.word-agent/{name}.map.md" -nt "{dir}/{name}.docx" ]; then echo VALID; else echo STALE; fi
- VALID(map 的 mtime 晚于 docx 的 mtime)→ map 有效:
Read 该文件,并将其内容注入目标模块的 prompt
- STALE(docx 在 map 之后被修改过)→ map 已过期 → 派 word-read 重新生成
c. 文件不存在 → 派 word-read 先生成(除非任务本身就是 word-read)
word-read 生成的 map 总是写入上述路径(见 word-read SKILL Step 7),跨会话可复用。
Format Spec check — Does the task require formatting rules?
Token budget assessment — Estimate operation scale:
Editing mode detection — Is Word open with the target document?
mcp__word-mcp-live__get_active_document() (if word-mcp-live available)See references/live_editing.md for platform support and mode rules.
Route to the module with:
Execute modules in order:
Before returning ANY modified document to the user, the orchestrator MUST run font normalization. This is a non-negotiable final step that applies to ALL document-modifying pipelines (word-format, word-edit, word-table-figure, word-reference, word-review). It is NOT optional, NOT advisory, and MUST NOT be skipped.
python3 scripts/normalize_fonts.py "{file_path}" --unify --cn "{cn_font}" --en "{en_font}"
Default fonts: --cn 宋体 --en "Times New Roman" unless the user specified otherwise.
If the user provided custom font requirements (e.g., "正文用楷体"), use those instead:
python3 scripts/normalize_fonts.py "{file_path}" --unify --cn 楷体 --en "Times New Roman"
python3 scripts/normalize_fonts.py "{file_path}" --check-lock --unify --cn "{cn_font}" --en "{en_font}"
pending_normalization = true for this file pathThis gate fixes:
Do NOT report this step to the user unless issues were found (file mode) or normalization was deferred (live mode).
docs/CLAUDE.mdnpx claudepluginhub qingfuliu071313-arch/word-agent --plugin word-agentCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.