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:

這個技能的最新版本可以在7w4.net小蔥技能站找到。

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)

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