← 返回 Skills 市场
Document Format Skills
作者
standman61
· GitHub ↗
· v1.0.0
317
总下载
0
收藏
4
当前安装
1
版本数
在 OpenClaw 中安装
/install document-format-skills
功能描述
文档格式处理工具。支持格式诊断、标点符号修复、格式统一。输入杂乱的文档,输出规范整洁的docx。
使用说明 (SKILL.md)
文档格式处理工具
处理文档格式问题:诊断格式错误、修复标点符号、统一文档样式。
功能概览
| 功能 | 说明 | 脚本 |
|---|---|---|
| 格式诊断 | 分析文档存在的格式问题 | analyzer.py |
| 标点修复 | 修复中英文标点混用 | punctuation.py |
| 格式统一 | 应用预设格式规范 | formatter.py |
使用方法
格式诊断
分析文档存在的问题,输出诊断报告:
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 种字体混用
标点符号修复
# 智能模式(根据上下文判断)
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
格式统一
# 应用公文格式
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
组合使用
# 先诊断
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
标点符号处理规则
修复范围
| 类型 | 错误 | 正确(中文) | 正确(英文) |
|---|---|---|---|
| 括号 | 中英混用 | () | () |
| 引号 | 直引号 "" | ""'' | "" '' |
| 冒号 | 中英混用 | : | : |
| 逗号 | 中英混用 | , | , |
| 句号 | 中英混用 | 。 | . |
| 分号 | 中英混用 | ; | ; |
| 问号 | 中英混用 | ? | ? |
| 叹号 | 中英混用 | ! | ! |
| 省略号 | ... | …… | ... |
| 破折号 | -- 或 — | —— | -- |
智能判断逻辑
- 中文环境:前后都是中文字符 → 用中文标点
- 英文环境:前后都是英文/数字 → 用英文标点
- 混合环境:默认用中文标点(可配置)
特殊处理
- 数字与单位之间:
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 自动安装。
注意事项
- 只支持 .docx:不支持旧版 .doc 格式
- 备份原文件:修改前建议备份
- 字体依赖:输出文件需要系统安装对应字体才能正确显示
- 表格内容:会自动处理表格内的文字
安全使用建议
This package appears coherent and local-only: it reads a .docx you provide, modifies formatting, and writes an output .docx. Before running: (1) back up any important documents (the README also advises this), (2) review the scripts yourself if processing sensitive files (they operate on text and runs but contain no networking or secret-access code), (3) be aware that `uv run --with python-docx` or pip will fetch python-docx from PyPI (network access required to install dependencies), and (4) test on a sample copy to confirm formatting and fonts meet your needs. If you need higher assurance, run the tools in an isolated environment (VM/container) and scan the code for anything unexpected.
功能分析
Type: OpenClaw Skill
Name: document-format-skills
Version: 1.0.0
The skill bundle is a legitimate utility for processing and formatting Word documents (.docx) according to Chinese standards (e.g., GB/T 9704-2012). The Python scripts (analyzer.py, formatter.py, punctuation.py) use the standard 'python-docx' library to perform document diagnostics, punctuation correction, and style application without any evidence of network access, data exfiltration, or malicious execution.
能力评估
Purpose & Capability
The name/description (document formatting, punctuation fixes, presets) match the included Python scripts (analyzer.py, punctuation.py, formatter.py, spacing fixes). There are no extra binaries or credentials requested that would be unrelated to formatting DOCX files.
Instruction Scope
SKILL.md instructs running the included scripts against local .docx files; the runtime steps reference only input/output .docx paths and the python-docx dependency. The instructions do not ask the agent to read unrelated system files, environment variables, or send data to external endpoints.
Install Mechanism
No install spec is provided (instruction-only), but the SKILL.md and READMEs recommend using `uv run --with python-docx` to ensure the python-docx dependency is available. Installing python-docx pulls from PyPI (network), which is expected for Python scripts but worth noting; there are no downloads from untrusted URLs or archive extraction steps in the skill package itself.
Credentials
The skill requests no environment variables, no credentials, and no config paths. The code operates on files supplied by the user and does not access external secrets or service tokens.
Persistence & Privilege
The skill does not request permanent presence (always:false) and does not modify other skills or system-wide agent settings. It performs local file read/write operations only on documents the user supplies.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install document-format-skills - 安装完成后,直接呼叫该 Skill 的名称或使用
/document-format-skills触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of document-format-skills: a toolset for DOCX document formatting
- Features include format analysis, punctuation correction (smart or by type), and batch style unification
- Provides preset formatting for official documents, academic papers, and legal texts
- Fixes mixed punctuation, inconsistent indents, list numbering, font sizes, and more
- Command-line usage instructions and config examples included
- Requires python-docx; only supports .docx files
元数据
常见问题
Document Format Skills 是什么?
文档格式处理工具。支持格式诊断、标点符号修复、格式统一。输入杂乱的文档,输出规范整洁的docx。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 317 次。
如何安装 Document Format Skills?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install document-format-skills」即可一键安装,无需额外配置。
Document Format Skills 是免费的吗?
是的,Document Format Skills 完全免费(开源免费),可自由下载、安装和使用。
Document Format Skills 支持哪些平台?
Document Format Skills 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Document Format Skills?
由 standman61(@standman61)开发并维护,当前版本 v1.0.0。
推荐 Skills