SkillsAggSubmit Skill

docugenius-converter

Clean

双向文档转换工具,将 Word (.docx)、Excel (.xlsx)、PowerPoint (.pptx) 和 PDF (.pdf) 转换为 AI 友好的 Markdown 格式,或将 Markdown (.md) 转换为 Word (.docx) 格式。当用户请求以下操作时使用:(1) 明确请求文档转换,包括任何包含"转换"、"转为"、"转成"、"convert"、"导出"、"export"等词汇的请求(例如:"转换文档"、"把这个文件转为docx"、"convert to markdown"、"导出为Word");(2) 需要 AI 理解文档内容("帮我分析这个 Word 文件"、"读取这个 PDF"、"总结这个 Excel");(3) 上传文档文件并询问内容("这是什么"、"帮我看看");(4) 任何涉及 .docx、.xlsx、.pptx、.pdf、.md 文件格式转换的请求。

16 stars🍴 0 forks0 installs

Install Command

npx skills add brucevanfdm/docugenius-converter-skill
Author
brucevanfdm
Repository
brucevanfdm/docugenius-converter-skill
Discovered via
github topic
Weekly installs
0
Quality score
50/100
Last commit
2/11/2026

SKILL.md

---
name: docugenius-converter
description: 双向文档转换工具,将 Word (.docx)、Excel (.xlsx)、PowerPoint (.pptx) 和 PDF (.pdf) 转换为 AI 友好的 Markdown 格式,或将 Markdown (.md) 转换为 Word (.docx) 格式。当用户请求以下操作时使用:(1) 明确请求文档转换,包括任何包含"转换"、"转为"、"转成"、"convert"、"导出"、"export"等词汇的请求(例如:"转换文档"、"把这个文件转为docx"、"convert to markdown"、"导出为Word");(2) 需要 AI 理解文档内容("帮我分析这个 Word 文件"、"读取这个 PDF"、"总结这个 Excel");(3) 上传文档文件并询问内容("这是什么"、"帮我看看");(4) 任何涉及 .docx、.xlsx、.pptx、.pdf、.md 文件格式转换的请求。
---
# DocuGenius Document Converter

双向文档转换工具,将 Word (.docx)、Excel (.xlsx)、PowerPoint (.pptx) 和 PDF (.pdf) 转换为 AI 友好的 Markdown 格式,或将 Markdown (.md) 转换为 Word (.docx) 格式。

## Quick Reference

**Linux/macOS:**

| 操作                   | 命令                              | 输出位置             |
| ---------------------- | --------------------------------- | -------------------- |
| Office/PDF → Markdown | `bash convert.sh <file>`        | 同目录 `Markdown/` |
| Markdown → Word       | `bash convert.sh <file.md>`     | 同目录 `Word/`     |
| 批量转换               | `bash convert.sh --batch <dir>` | 同上                 |

**Windows:** 见下方 [跨平台执行方式](#跨平台执行方式)

## 工作流程

```
用户请求转换 → 直接运行 bash convert.sh → 解析 JSON 输出 → 处理结果
```

**关键原则**:

1. **不要预先检查任何依赖**(Python 库、Node.js 等)
2. 直接执行转换命令
3. 只在转换失败(`success: false`)时才根据错误信息处理

## 执行命令

### 跨平台执行方式

**重要**:根据运行环境选择正确的执行方式:

| 环境                         | 推荐命令                                                                 | 说明                           |
| ---------------------------- | ------------------------------------------------------------------------ | ------------------------------ |
| **Linux/macOS**        | `bash convert.sh <file>`                                               | 使用 bash 执行(无需执行权限) |
| **Windows PowerShell** | `powershell.exe -Command "cd '<skill-dir>' && .\convert.ps1 '<file>'"` | 推荐方式,支持 UTF-8 编码      |
| **Windows Git Bash**   | `powershell.exe -Command "cd '<skill-dir>' && .\convert.ps1 '<file>'"` | 在 Git Bash 中调用 PowerShell  |
| **Windows CMD**        | `convert.bat <file>`                                                   | 传统方式,可能有编码问题       |

**Claude Code 中的最佳实践**:

- 在 Windows 环境(包括 Git Bash)中,始终使用 PowerShell 执行:
  ```bash
  powershell.exe -Command "Set-Location '<skill-dir>'; .\convert.ps1 'c:\path\to\file.docx'"
  ```
- 路径中包含空格时,使用单引号包裹
- 使用 `Set-Location` 而不是 `cd`,避免 PowerShell 语法错误
- `<skill-dir>` 替换为实际的 skill 目录路径(例如 `C:\Users\<YourName>\.claude\skills\docugenius-converter-skill`)

### 命令示例

```bash
# 单文件转换(依赖自动安装)
bash convert.sh /path/to/document.docx

# 自定义输出目录
bash convert.sh /path/to/file.pdf true /custom/output

# 批量转换
bash convert.sh --batch /path/to/documents
```

## 解析输出

脚本返回 JSON,关键字段:

```json
{
  "success": true,
  "output_path": "/path/to/output.md",
  "markdown_content": "# 转换后的内容..."
}
```

- `success`: 转换是否成功
- `output_path`: 输出文件路径
- `markdown_content`: Markdown 内容(方便直接分析)
- `error`: 错误信息(失败时)

## 错误处理

**仅在转换失败时(返回 `success: false`)才处理错误**:

| 错误类型                   | 处理方法                                                                                       |
| -------------------------- | ---------------------------------------------------------------------------------------------- |
| Python 依赖缺失            | 脚本会自动安装,如失败则运行 `pip install --user xxx`                                        |
| `未找到 Node.js`         | 仅在 MD→DOCX 转换失败且报此错误时,才提示安装 Node.js                                         |
| `Node.js 依赖未安装`     | 脚本会自动安装到用户级共享目录;失败时在 `scripts/md_to_docx` 或共享目录运行 `npm install` |
| `文件不存在`             | 提示用户验证文件路径                                                                           |
| `不支持的文件格式: .doc` | 提示用户先转换为 .docx                                                                         |
| `文件过大`               | 提示超过 100MB 限制                                                                            |

## 支持的格式

| 格式  | 转换方向 | 质量            |
| ----- | -------- | --------------- |
| .docx | ↔       | 优秀            |
| .xlsx | →       | 优秀            |
| .pptx | →       | 良好            |
| .pdf  | →       | 取决于 PDF 类型 |
| .md   | ↔       | 优秀            |

## 注意事项

**重要:**

- **绝对不要在执行转换前检查任何依赖**(包括 Python、Node.js、npm 包等)
- 直接执行转换命令,让脚本自己检测和处理依赖
- 只在转换失败时才根据返回的错误信息采取行动

其他:

- Python 依赖会自动安装到用户目录
- Node.js 依赖会自动安装到用户级共享目录(可用 `DOCUGENIUS_NODE_HOME` 指定)
- 默认共享目录:macOS/Linux `~/.docugenius/node/md_to_docx`,Windows `%LOCALAPPDATA%\DocuGenius\node\md_to_docx`
- .doc/.xls/.ppt 旧格式需先转换为对应的新格式

Similar Skills

Convert Markdown text to DOCX, PPTX, XLSX, PDF, PNG, HTML, IPYNB, MD, CSV, JSON, JSONL, XML files, and extract code blocks in Markdown to Python, Bash,JS and etc files.

npx skills add bowenliang123/markdown-exporter

智能简历助手,通过五个AI代理提供全流程求职支持:(1)故事挖掘-发现经历亮点;(2)职位推荐-匹配合适岗位;(3)简历优化-针对JD定制内容;(4)模拟面试-实战演练与反馈;(5)能力提升-差距分析与计划。适用于简历创建、优化、面试准备、职业规划等求职相关任务。

npx skills add Y1fe1-Yang/resume-assistant-skill

系統化除錯流程:根據使用者描述推定最可能的錯誤原因,對相關程式碼加入額外日誌,提供使用者重現步驟並請其回報日誌,依日誌修復並反覆確認直到問題解決,最後移除所有額外日誌。用於需要迭代式除錯與使用者回報日誌的情境。

npx skills add LaiTszKin/systematic-debug
content-wandClean

Transforms content between formats and platforms. Use when user says 'turn this into', 'repurpose this as', 'make this a', 'atomize this', or 'reformat for'. Creates Twitter/X threads, LinkedIn posts, email newsletters, Instagram carousels, YouTube Shorts scripts, TikTok scripts, Threads posts, Bluesky posts, podcast talking points from any source (pasted text, URL, transcript, rough notes, or topic idea). Also converts between content types: podcast→blog, thread→article, notes→newsletter, case study→template. Includes Writing Style matching that learns your style once and applies it automatically. Ends with a humanizer pass that removes AI writing patterns from every output.

npx skills add baagad-ai/content-wand
docugenius-converter | SkillsAgg