Skip to content
Agentmart
Submit a tool

doc-compatibility

.doc 格式兼容性转换。

Skill by Murchey

IndexedGPL-3.0★ 4
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/murchey-doc-compatibility

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

.doc 格式兼容性转换。

Use cases: documents

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Python package

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/doc-compatibility

What's inside

Skill name
doc-compatibility
Description
.doc 格式兼容性转换。
License
GPL-3.0
Instructions
100 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (2)

  • SKILL.md
  • doc_converter.py · scripts/

SKILL.md (first lines)

# DOC Compatibility

将旧版 .doc 格式文档转换为 .docx 格式,确保后续 Skill 能正常处理。

**输入**:`.doc` 文件路径
**输出**:转换后的 `.docx` 文件

---

# 调用方式

```bash
python SKILLS/doc-compatibility/scripts/doc_converter.py <input_doc_path> [output_docx_path]
```

```python
import sys
sys.path.insert(0, 'SKILLS/doc-compatibility/scripts')
from doc_converter import DocConverter

converter = DocConverter()
result = converter.convert('workspace/input/input.doc', 'workspace/input/input.docx')
# result: {'success': True, 'output_path': 'workspace/input/input.docx', 'method': 'win32com'}
```

**参数**:
- `convert(input_path, output_path=None)` - 转换 .doc 为 .docx
  - `input_path` - 输入 .doc 文件路径
  - `output_path` - 输出 .docx 文件路径(可选,默认覆盖输入路径)
- 返回:转换结果字典

---

# 转换方法

按优先级尝试:

| 优先级 | 方法 | 适用环境 | 依赖 |
|--------|------|----------|------|
| 1 | win32com | Windows + 已安装 Word | `pywin32` |
| 2 | LibreOffice | 跨平台 | LibreOffice 已安装 |
| 3 | Aspose.Words | 跨平台(备选) | `aspose-words` |

---

# 检测逻辑

```python
def is_doc_format(file_path):
    """检测文件是否为 .doc 格式(非 .docx)"""
    ext = Path(file_path).suffix.lower()
    if ext == '.doc':
        return True
    if ext == '.docx':
        return False
    # 尝试读取文件头魔数
    with open(file_path, 'rb') as f:
        header = f.read(8)
        # .doc 格式魔数: D0 CF 11 E0 A1 B1 1A E1
        if header[:4] == b'\xd0\xcf\x11\xe0':
            return True
    return False
```

---

# 输出

```json
{
  "success": true,
  "input_path": "workspace/input/input.doc",
  "output_path": "workspace/input/input.docx",
  "method": "win32com",
  "file_size": 123456
}
```

---

# AGENT 集成

在 AGENT.md 的 Step 1-2(初始化)后、Step 3(解析)前插入:

```
Step 2b: DOC 兼容性检查
- 检测输入文件是否为 .doc 格式
- 如果是 .doc,调用 doc-compatibility 转换为 .docx
- 更新 workspace/input/input.docx 路径
```

---

# 错误处理

- Word/LibreOffice 未安装 → 输出错误信息、提示用户安装
- 文件损坏 → 输出错误日志、保留原文件
- 转换失败 → 中止流程、输出详细错误信息

From Murchey/doc-form-master, GPL-3.0.

More from Murchey/doc-form-master

Signals

Stars
4
Forks
0
Open issues
0
Last commit (this folder)
May 30, 2026 (5 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
GPL-3.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Murchey

Cite this page

doc-compatibility skill. Agent Mart. https://agentmart.dev/skills/murchey-doc-compatibility (last updated 2026-10-24)