Skip to content
Agentmart
Submit a tool

docx-parser

DOCX 结构解析,构建统一 AST。

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-docx-parser

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

DOCX 结构解析,构建统一 AST。

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/docx-parser

What's inside

Skill name
docx-parser
Description
DOCX 结构解析,构建统一 AST。
License
GPL-3.0
Instructions
77 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (3)

  • SKILL.md
  • parser.py · scripts/
  • run_parser.py · scripts/

SKILL.md (first lines)

# DOCX Parser

解析 DOCX 文件结构,构建统一 AST。非破坏性,仅读取。

**输入**:`.docx` 文件
**输出**:`workspace/parsed/document_ast.json`

---

# 调用方式

```bash
python SKILLS/docx-parser/scripts/parser.py
```

```python
import sys
sys.path.insert(0, 'SKILLS/docx-parser/scripts')
from parser import DocxParser

parser = DocxParser('workspace/input/input.docx')
parser.run()
# 输出: workspace/parsed/document_ast.json
```

**参数**:
- `__init__(docx_path)` - DOCX 文件路径
- `run()` - 执行解析,输出到 `workspace/parsed/document_ast.json`

---

# 解析内容

必须解析:Paragraph、Run、Style、Heading、Table、Image、Formula、Section、Relationship

---

# AST 结构

```json
{
  "metadata": {},
  "paragraphs": [{"id": 0, "type": "paragraph", "text": "", "style": "", "section": "", "runs": []}],
  "tables": [],
  "images": [],
  "formulas": [],
  "section_regions": {"cover_end": 0, "toc_start": -1, "toc_end": -1}
}
```

---

# 段落解析

提取:id、text、style、alignment、runs

## Run 类型
1. **文字 run**:`{text, bold, italic, font_name, font_size}`
2. **图片 run**:`{type: "image", image_data: "<base64>", image_format: "png"}`

---

# 区域识别

| section | 含义 | 检测规则 |
|---------|------|----------|
| cover | 封面 | 第一个 Heading 1 之前 |
| toc | 目录 | 包含「目录」「Table of Contents」 |
| body | 正文 | 其余段落 |

---

# 错误处理

DOCX 损坏/异常 → 输出日志、保留原文件、中止解析

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)
Jun 5, 2026 (4 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

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