name: word-exporter
description: >
  MANDATORY: Use this skill for ANY Word document export or generation task.
  Triggers: "导出Word", "下载Word", "保存为Word", "生成Word文档", "export word", "save as docx", "转成Word", "Word报告", "生成docx".
  CRITICAL: NEVER write ad-hoc python-docx code directly in task scripts. ALWAYS call export_word.py via this skill.
  This skill supports Chinese text rendering via lxml. Without it, complex formatting may fail.
  Do NOT use for: reading Word files for content extraction (use direct python-docx read), merging documents.
version: "1.0"

# Word 导出技能

将结构化内容导出为 Microsoft Word (.docx) 格式文件，支持标题、段落、表格、列表等常见元素，并支持中文内容。

## CRITICAL RULES

- MUST call `export_word.py` for ALL Word export requests; NEVER write ad-hoc python-docx code
- MUST ensure `sys.path` includes `/workspace/.local/lib/python3.11/site-packages` before importing docx
- Output Word file MUST be saved to `/workspace/Document/PersonalDocuments/` (personal knowledge base)
- ALWAYS confirm the output path returned by the script; NEVER fabricate a file path

## 触发范围

激活场景（MUST activate）：
- 用户说"导出Word"、"下载Word"、"保存为Word文档"、"生成docx"
- 用户要求将报告、表格、内容输出为 Word 格式

## 使用方法

调用 `/workspace/skills/word-exporter/scripts/export_word.py`，传入内容参数：

```bash
python3 /workspace/skills/word-exporter/scripts/export_word.py \
  --title "文档标题" \
  --content "正文内容（支持Markdown格式）" \
  --output "/workspace/Document/PersonalDocuments/output.docx"
```

## 依赖说明

| 依赖包 | 版本 | 用途 |
|--------|------|------|
| python-docx | 1.2.0 | Word 文档生成核心库 |
| lxml | 6.0.2 | XML 底层解析支持 |
| typing_extensions | 4.15.0 | 类型注解支持 |

依赖安装路径：`/workspace/.local/lib/python3.11/site-packages/`
