standman61

Document Format Skills

Officev1.0.0
By standman61Updated 2026-05-11document-format-skills@clawhub_standman61/document-format-skills
DocumentsPDF#Document#文档

According to AlphaMoat, as of 2026-09, Document Format Skills has 1,376 downloads and 2 stars — ranked #4,851 of 5,078 AI skills overall, and #400 of 435 in Office.

Installs
115
Downloads
1.4K
Stars
2
Overall Rank
#4,851
Top 96% overall · Top 92% in Office
PlatformInstallsDownloadsStarsComments
ClawHub ↗311.2K--
SkillHub ↗1151.4K2—

Platforms count differently and update at different times.

What this skill does

It can diagnose formatting, correct mixed Chinese and English punctuation, and apply preset styles. It supports .docx files only. Back up the original and review the output before replacing it, since formatting changes can affect appearance or meaning. Some options may not take effect; check important choices manually and pin python-docx.

Profile published 2026-10-29

What you can do with it

  • Diagnose document formatting issues
  • Fix mixed Chinese and English punctuation
  • Apply official, academic, or legal style presets

When to use it

  • When you need to inspect or standardize a DOCX file
  • Before correcting punctuation or applying a format preset

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Diagnose formatting issues in this DOCX and create a report without overwriting the original.
Fix punctuation and apply the requested style to a copy, then list changes that need manual review.

Monthly Trend

Downloads1.4K
2208411.5K2026-03 · Downloads 3062026-05 · Downloads 6552026-06 · Downloads 7952026-07 · Downloads 1.0K2026-08 · Downloads 1.1K2026-09 · Downloads 1.4K26-0326-09
Stars2
0122026-03 · Stars -2026-05 · Stars 12026-06 · Stars 22026-07 · Stars 22026-08 · Stars 22026-09 · Stars 226-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change. Other skills share this name; figures from before the change are attributed to this one, which currently has the most downloads.

MonthDownloadsMoMStars
2026-091.4K—2
2026-081.1K+9.5%2
2026-071.0K+26.9%2
2026-06795+21.4%2
2026-05655—1
2026-03306—-

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

5.2 KB · ClawHub v1.0.0
---
name: document-format-skills
description: 文档格式处理工具。支持格式诊断、标点符号修复、格式统一。输入杂乱的文档,输出规范整洁的docx。
---

# 文档格式处理工具

处理文档格式问题:诊断格式错误、修复标点符号、统一文档样式。

## 功能概览
Show all (189 lines)

| 功能 | 说明 | 脚本 |
|------|------|------|
| 格式诊断 | 分析文档存在的格式问题 | `analyzer.py` |
| 标点修复 | 修复中英文标点混用 | `punctuation.py` |
| 格式统一 | 应用预设格式规范 | `formatter.py` |

## 使用方法

### 格式诊断

分析文档存在的问题,输出诊断报告:

```bash
uv run --with python-docx python3 scripts/analyzer.py input.docx
```

输出示例:
```
=== 格式诊断报告 ===

【标点问题】共 5 处
  - 第2段: 英文括号 () 建议改为 ()
  - 第3段: 英文引号 "" 建议改为 ""

【序号问题】共 2 处
  - 序号格式不统一: 同时存在 "1、" 和 "1." 
  - 第5段: 层级跳跃,从 "一、" 直接到 "1."

【段落问题】共 3 处
  - 第2、4、7段: 缺少首行缩进
  - 行距不统一: 存在单倍、1.5倍混用

【字体问题】共 2 处
  - 正文字号不统一: 12pt、14pt 混用
  - 检测到 4 种字体混用
```

### 标点符号修复

```bash
# 智能模式(根据上下文判断)
uv run --with python-docx python3 scripts/punctuation.py input.docx output.docx

# 强制全部转中文标点
uv run --with python-docx python3 scripts/punctuation.py input.docx output.docx --mode chinese

# 强制全部转英文标点
uv run --with python-docx python3 scripts/punctuation.py input.docx output.docx --mode english

# 只修复特定类型
uv run --with python-docx python3 scripts/punctuation.py input.docx output.docx --fix brackets,quotes
```

### 格式统一

```bash
# 应用公文格式
uv run --with python-docx python3 scripts/formatter.py input.docx output.docx --preset official

# 应用学术论文格式
uv run --with python-docx python3 scripts/formatter.py input.docx output.docx --preset academic

# 应用法律文书格式
uv run --with python-docx python3 scripts/formatter.py input.docx output.docx --preset legal
```

### 组合使用

```bash
# 先诊断
uv run --with python-docx python3 scripts/analyzer.py messy.docx

# 修复标点 + 应用格式
uv run --with python-docx python3 scripts/punctuation.py messy.docx temp.docx
uv run --with python-docx python3 scripts/formatter.py temp.docx clean.docx --preset official
```

---

## 标点符号处理规则

### 修复范围

| 类型 | 错误 | 正确(中文) | 正确(英文) |
|------|------|-------------|-------------|
| 括号 | 中英混用 | () | () |
| 引号 | 直引号 "" | ""'' | "" '' |
| 冒号 | 中英混用 | : | : |
| 逗号 | 中英混用 | , | , |
| 句号 | 中英混用 | 。 | . |
| 分号 | 中英混用 | ; | ; |
| 问号 | 中英混用 | ? | ? |
| 叹号 | 中英混用 | ! | ! |
| 省略号 | ... | …… | ... |
| 破折号 | -- 或 — | —— | -- |

### 智能判断逻辑

1. **中文环境**:前后都是中文字符 → 用中文标点
2. **英文环境**:前后都是英文/数字 → 用英文标点
3. **混合环境**:默认用中文标点(可配置)

### 特殊处理

- 数字与单位之间:`100%` 保持英文
- 英文缩写:`e.g.` `i.e.` 保持英文句点
- 网址邮箱:保持原样不处理
- 代码块:跳过不处理

---

## 格式预设

### 公文格式(GB/T 9704-2012)

```
页面:A4,上边距37mm,下边距35mm,左边距28mm,右边距26mm
标题:方正小标宋简体,二号(22pt),居中
一级标题:黑体,三号(16pt),顶格,"一、"
二级标题:楷体_GB2312,三号(16pt),顶格,"(一)"
三级标题:仿宋_GB2312,三号(16pt),首行缩进,"1."
正文:仿宋_GB2312,三号(16pt),首行缩进2字符,行距固定值28pt
```

### 学术论文格式

```
页面:A4,边距25mm
标题:黑体,小二(18pt),居中
一级标题:黑体,小三(15pt),"1"
二级标题:黑体,四号(14pt),"1.1"
正文:宋体/Times New Roman,小四(12pt),首行缩进2字符,行距1.5倍
```

### 法律文书格式

```
页面:A4,上边距30mm,下边距25mm,左边距30mm,右边距25mm
标题:宋体加粗,二号(22pt),居中
条款标题:黑体,四号(14pt),"第一条"
正文:宋体,四号(14pt),首行缩进2字符,行距1.5倍
```

---

## 文件结构

```
document-format-skills/
├── SKILL.md
├── README.md
├── scripts/
│   ├── analyzer.py      # 格式诊断
│   ├── punctuation.py   # 标点修复
│   └── formatter.py     # 格式统一
└── presets/
    ├── official.yaml    # 公文格式
    ├── academic.yaml    # 学术论文
    └── legal.yaml       # 法律文书
```

---

## 依赖

- python-docx

使用 `uv run --with python-docx` 自动安装。

---

## 注意事项

1. **只支持 .docx**:不支持旧版 .doc 格式
2. **备份原文件**:修改前建议备份
3. **字体依赖**:输出文件需要系统安装对应字体才能正确显示
4. **表格内容**:会自动处理表格内的文字

Popular in Office

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.