Word Handler

👤 cjboy007 📦 v1.0.0 ⭐ 4.2 ⬇️ 688 下载
📄 办公效率 免费

📖 技能介绍


name: Word / DOCX description: Create, read, and edit Word documents (.docx) with support for templates, tables, and styling. metadata: {"clawdbot":{"emoji":"📘","os":["linux","darwin","win32"]}}


When to Use

User needs to create, read, or edit Word documents (.docx). Supports template filling, table generation, and professional styling.

Architecture

This skill uses python-docx for DOCX manipulation. All processing happens locally.

Quick Reference

Topic File
Generate Quotation scripts/generate_quotation_docx.py

Core Rules

1. Use Templates for Consistency

When generating documents repeatedly (quotations, proposals), use templates with placeholder text that gets replaced.

2. Handle Chinese Filenames Carefully

Use glob wildcards or pathlib for Chinese filename compatibility:

from pathlib import Path
for f in Path(".").glob("*.docx"):
    doc = Document(str(f))

3. Tables Need Explicit Styling

Word tables require explicit border and cell styling. Use Table Grid style as baseline.

4. Section Properties Control Layout

Page margins, orientation, and headers/footers are controlled at section level:

for section in doc.sections:
    section.left_margin = Cm(2.5)
    section.right_margin = Cm(2.5)

7w4.net小葱技能站,你的AI助手技能库。

5. Runs vs Paragraphs

Text formatting happens at run level. A paragraph can contain multiple runs with different styles.

Common Traps

  • Merged cells - Only top-left cell holds value in merged ranges
  • Page breaks - Insert explicitly with doc.add_page_break()
  • Images - Require absolute paths or file-like objects
  • Styles - Built-in styles vary by Word version; test compatibility

Dependencies

pip3 install python-docx

Security & Privacy

Data that stays local: - All file processing happens locally - No external services called

This skill does NOT: - Send data to external endpoints - Require network access

  • read-docx — Read-only DOCX extraction
  • excel-xlsx — Excel file handling
  • pdf-text-extractor — PDF text extraction

Feedback

  • If useful: clawhub star word-docx
  • Stay updated: clawhub sync

🤖 AI 评测

这个 Skill 专门用于生成专业的 Word 报价单,支持自动计算金额、添加表格和设置样式。文档说明清晰,容易上手,代码组织规范。主要不足是功能比较单一,只适合生成报价单类型的文档,缺少插入图片、页眉页脚等常见功能。作为命令行工具,对非技术用户有一定门槛。整体质量中规中矩,适合需要批量生成报价单的用户使用。

📊 多维度评分

适应性3.8
规范性4
有效性4.4
可靠性4.1
可信度4.9

📁 包含文件 (3 个)

📄 SKILL.md 2.2 KB
📄 _meta.json 132 B
📄 scripts/generate_quotation_docx.py 14.8 KB