word-document

GitHub

通过生成并运行 python-docx 脚本,创建包含真实标题样式、表格和页面结构的 .docx 文件。适用于报告、合同等正式文档,确保导航窗格和目录功能正常,需代码执行环境支持。

plugins/pm-documents/skills/word-document/SKILL.md mohitagw15856/pm-claude-skills

Trigger Scenarios

用户要求生成 Word (.docx) 文件 需要制作格式化的报告、提案、合同或信函

Install

npx skills add mohitagw15856/pm-claude-skills --skill word-document -g -y
More Options

Non-standard path

npx skills add https://github.com/mohitagw15856/pm-claude-skills/tree/main/plugins/pm-documents/skills/word-document -g -y

Use without installing

npx skills use mohitagw15856/pm-claude-skills@word-document

指定 Agent (Claude Code)

npx skills add mohitagw15856/pm-claude-skills --skill word-document -a claude-code -g -y

安装 repo 全部 skill

npx skills add mohitagw15856/pm-claude-skills --all -g -y

预览 repo 内 skill

npx skills add mohitagw15856/pm-claude-skills --list

SKILL.md

Frontmatter
{
    "name": "word-document",
    "description": "Build a real, formatted Word (.docx) document — headings, styles, tables, TOC-ready. Use when asked to produce a Word doc, a .docx, a formatted report\/contract\/proposal\/letter as an actual file (not markdown). Produces an actual .docx via a generated python-docx script with proper heading styles, body text, tables, and page structure. Requires a code-execution environment (Claude Code, the API code tool, or Claude.ai)."
}

Word Document Skill

When someone needs an actual .docx — a report, proposal, contract, or formal letter they'll edit in Word — markdown won't do. This skill produces a real Word file by writing and running a python-docx script: proper heading styles (so the navigation pane and a TOC work), clean body text, tables, and page structure — a document that looks authored, not exported.

Environment: produces a binary file, so it needs code execution — Claude Code, the API code-execution tool, or Claude.ai. In the browser playground, the existing Word/PDF export turns any skill's markdown into a document; this skill is for a built-to-spec .docx.

Required Inputs

Ask for these only if they aren't already provided:

  • Document type — report, proposal, contract, SOP, letter, whitepaper — and its purpose/audience.
  • The content — the material (or a brief to expand), and the required sections/structure.
  • Formatting needs — headings/TOC, tables, numbered clauses (contracts), a cover page, letterhead/brand.
  • Length & tone.

Process

  1. Outline the structure — the section hierarchy (H1/H2/H3), and where tables or numbered clauses go. Confirm structure for formal docs (contracts, proposals).
  2. Write a python-docx script that:
    • Uses real heading styles (Heading 1/2/3) — not bold body text — so the nav pane, cross-refs, and a generated TOC work.
    • Sets clean body styling (font, size, spacing), adds tables with proper headers where needed, and page elements (title/cover, page numbers, sections) as required.
    • For contracts/formal docs: numbered headings/clauses and consistent defined-term formatting.
    • Saves to a clearly named .docx.
  3. Run it, then summarise the document and note anything the user must fill (signatures, figures, brand assets).

Output Format

  • The generated .docx file.
  • A short contents summary (the section structure) and a list of placeholders/fields the user needs to complete.

Quality Checks

  • Headings use real Word heading styles (not bold paragraphs) — TOC/nav pane work
  • Body text, spacing, and tables are consistently formatted
  • Structure matches the document type (e.g. numbered clauses for a contract)
  • The script runs and the file opens cleanly in Word/Pages/Docs
  • Placeholders the user must complete are clearly flagged

Anti-Patterns

  • Do not fake headings with bold text — use heading styles, or the document's structure breaks
  • Do not dump unstructured text — apply the section hierarchy the doc type needs
  • Do not hand-format what a style should do — consistent styles beat per-paragraph fiddling
  • Do not invent contract/legal terms silently — mark drafted clauses and recommend review for anything legal
  • Do not claim a file was produced without code execution — fall back to the markdown export instead

Based On

Document-production practice (style-based formatting, structured headings, TOC-ready) implemented with python-docx.

Programmatic Helper

This skill ships scripts/docx_tool.pyzero-dependency (stdlib zip+XML) production of real .docx files:

# Markdown-lite → Word (#/##/### headings, - bullets, 1. numbered, **bold**, *italic*)
python3 scripts/docx_tool.py create out.docx --text-file doc.md

# Fill {{placeholders}} through an existing .docx (body, headers, footers) —
# handles Word splitting a placeholder across formatting runs
python3 scripts/docx_tool.py fill template.docx out.docx --values '{"client":"Acme","date":"2026-07-03"}'

# Verify what a .docx actually says (plain-text extraction)
python3 scripts/docx_tool.py extract out.docx

Write the document first (per this skill), then create it as a real file. Honest limits: the markdown subset above with default styling; complex templates keep their formatting except in paragraphs where a placeholder spanned runs.

Version History

  • a38bc30 Current 2026-07-05 11:16

Same Skill Collection

exports/openclaw/360-feedback-template/SKILL.md
exports/openclaw/401k-plan-decoder/SKILL.md
exports/openclaw/ab-test-planner/SKILL.md
exports/openclaw/ab-test-readout/SKILL.md
exports/openclaw/accessibility-audit/SKILL.md
exports/openclaw/account-plan/SKILL.md
exports/openclaw/acquirer-red-team/SKILL.md
exports/openclaw/ad-copy/SKILL.md
exports/openclaw/aeo-optimizer/SKILL.md
exports/openclaw/agenda-or-cancel/SKILL.md
exports/openclaw/agent-design-review/SKILL.md
exports/openclaw/agent-observability-spec/SKILL.md
exports/openclaw/agent-spec/SKILL.md
exports/openclaw/ai-ethics-review/SKILL.md
exports/openclaw/ai-eval-plan/SKILL.md
exports/openclaw/ai-feature-prd/SKILL.md
exports/openclaw/ai-product-canvas/SKILL.md
exports/openclaw/air-quality/SKILL.md
exports/openclaw/altitude-shifter/SKILL.md
exports/openclaw/ambiguity-resolver/SKILL.md
exports/openclaw/analyst-relations-brief/SKILL.md
exports/openclaw/announcement-card/SKILL.md
exports/openclaw/api-docs-writer/SKILL.md
exports/openclaw/api-test-plan/SKILL.md
exports/openclaw/api-versioning-strategy/SKILL.md
exports/openclaw/apology-letter/SKILL.md
exports/openclaw/architecture-decision-record/SKILL.md
exports/openclaw/architecture-diagram/SKILL.md
exports/openclaw/archive-strategy/SKILL.md
exports/openclaw/assumption-bounty/SKILL.md
exports/openclaw/assumption-mapper/SKILL.md
exports/openclaw/async-update-format/SKILL.md
exports/openclaw/auto-repair-estimate-decoder/SKILL.md
exports/openclaw/autopilot-charter/SKILL.md
exports/openclaw/benefits-decoder/SKILL.md
exports/openclaw/bid-tender-review/SKILL.md
exports/openclaw/board-deck-narrative/SKILL.md
exports/openclaw/board-minutes/SKILL.md
exports/openclaw/board-pre-read/SKILL.md
exports/openclaw/bom-cost-review/SKILL.md
exports/openclaw/bookkeeping-categorization/SKILL.md
exports/openclaw/boolean-search-builder/SKILL.md
exports/openclaw/brag-doc/SKILL.md
exports/openclaw/brainstorming/SKILL.md
exports/openclaw/brief-builder/SKILL.md
exports/openclaw/briefing-note/SKILL.md
exports/openclaw/budget-builder/SKILL.md
exports/openclaw/budget-variance-analysis/SKILL.md
exports/openclaw/bug-diagnosis/SKILL.md
exports/openclaw/bug-report/SKILL.md

Metadata

Files
0
Version
471c606
Hash
1f35157f
Indexed
2026-07-05 11:16

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-30 11:14
浙ICP备14020137号-1 $방문자$