
Docx Format
Precise Word (.docx) formatting toolkit for analyzing, batch-editing, and standardizing fonts, indents, and spacing via python-docx.
- skills.sh installs
- 263
- GitHub stars
- 51
- last updated
- Jun 3, 2026
Own this skill? Claim it
What it does
- Covers format analysis, batch formatting, official-document and academic standards, mixed Chinese-English fonts, and reference-style edits
- Includes
scripts/analyze.py,format_official.py,format_academic.py, andmd_to_docx.py, plus templates that also process table cell content - Requires running scripts via
uv run --with python-docx python3and sets East Asian fonts separately usingqn('w:eastAsia') - Designed for editing existing .docx files with python-docx; .doc is unsupported and Markdown conversion is handled directly
Install
$ npx -y skills add ninestep/docx-format-skill --skill docx-format -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Word 文档格式处理
使用 python-docx 库精确操作 Word 文档格式,适用于格式分析、格式规范化、批量修改。
核心规则
被调用时立即执行:
- 确认文件路径:询问用户 Word 文档的完整路径
- 明确需求:确认是分析格式还是修改格式,目标规范是什么
- 选择模板:根据需求选择合适的代码模板或脚本
- 生成脚本:创建独立的 Python 脚本文件
- 执行验证:使用
uv run执行并检查结果
强制性约束:
- ✓ 必须使用
uv run --with python-docx python3 script.py - ✓ 必须处理
doc.paragraphs和doc.tables(文档正文常在表格内) - ✓ 必须分设 中英文字体(使用
qn('w:eastAsia')) - ✓ 必须询问 用户文件路径和输出路径
- ✗ 禁止使用 直接
python命令(缺少依赖) - ✗ 禁止遗漏 表格内容处理(常见错误)
何时使用
触发场景:
- 分析 Word 文档格式(字体/字号/缩进/行距)
- 批量修改文档格式
- 统一排版规范(学术论文、报告等)
- 处理中英文混排字体
- 修改交叉引用/参考文献样式
触发关键词:修改 Word 格式、统一字体、调整缩进、分析文档格式、参考文献格式
决策树
用户需求是什么?
├─ 不清楚当前格式 → 使用 scripts/analyze.py
├─ 应用公文标准 → 使用 scripts/format_official.py
├─ 应用学术标准 → 使用 scripts/format_academic.py
├─ 统一正文格式 → 使用【快速模板:批量格式化】
├─ 修改参考文献 → 使用【快速模板:参考文献处理】
└─ 自定义需求 → 基于【基础模板】组合
快速开始
基础模板
from docx import Document
from docx.shared import Pt
from docx.oxml.ns import qn
doc = Document('input.docx')
Details
- Repository
- github.com/ninestep/docx-format-skill
- Category
- Office Files & Slides
- First seen
- Jun 3, 2026
Similar to Docx Format
More Office Files & Slides
DocxMCP servermeterlong193 starsRead, write, and manage Word .docx files: paragraphs, tables, images, and layout.
docx-manipulationSkillclaude-office-skills/skills6.4K installsProgrammatic Word document creation and editing with python-docx, covering paragraphs, tables, images, styles, headers, and footers.
word-editor-openaiPluginlawvable/awesome-legal-skills962 starsToolkit for comprehensive document reading and creation with visual quality control. Use to work with Word documents (.docx files) for: (1) Reading or extractin
docxSkillanthropics/skills220.1K installsWord-processing skill for creating, editing, and reading .docx and .dotx files, with docx-js gotchas and render verification.
chinese-style-guideSkillrightcapitalhq/chinese-style-guide293 installsA Chinese-language formatting skill that corrects spacing, punctuation, numerals, and dates while preserving the author's meaning.
wordSkilligorwarzocha/opencode-workflows778 installsProfessional Word (.docx) toolkit that enforces a render-and-review loop for visually verified, client-ready documents.