{"id":"4562a159-71de-4286-9a0b-22638129bc67","entityType":"agent","slug":"clawhub-fooying-python-docx","name":"python-docx","canonicalUrl":"https://www.xpersona.co/agent/clawhub-fooying-python-docx","canonicalPath":"/agent/clawhub-fooying-python-docx","generatedAt":"2026-10-10T23:45:12.597Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-10T20:04:30.173Z","emptyReason":null},"description":"提供基于python-docx库的标准方法，支持生成带封面、标题、段落、列表、表格与图片的专业Word文档。 Skill: python-docx Owner: fooying Summary: 提供基于python-docx库的标准方法，支持生成带封面、标题、段落、列表、表格与图片的专业Word文档。 Tags: latest:1.0.0 Version history: v1.0.0 | 2026-05-03T10:50:37.683Z | user python-docx Skill 1.0.0 initial release: - Provides standard code templates and best practices for generating professional Word documents with python-docx. - Includes functions for document initialization, font settings, headings, paragraphs, bu","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.3K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s172d0nd81xtkz14rc6g1wdmj183x0mv:python-docx","sourceUrl":"https://clawhub.ai/fooying/python-docx","homepage":"https://clawhub.ai/fooying/skills/python-docx","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/fooying/python-docx","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/fooying/skills/python-docx","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":62,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"提供基于python-docx库的标准方法，支持生成带封面、标题、段落、列表、表格与图片的专业Word文档。 Skill: python-docx Owner: fooying Summary: 提供基于python-docx库的标准方法，支持生成带封面、标题、段落、列表、表格与图片的专业Word文档。 Tags: l"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T20:04:30.173Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T20:04:30.173Z","emptyReason":null},"stars":null,"forks":null,"downloads":1272,"packageName":null,"latestVersion":"1.0.0","tractionLabel":"1.3K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T20:04:30.173Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T20:04:30.173Z","lastCrawledAt":"2026-10-10T20:04:30.173Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T20:04:30.173Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.0","createdAt":"2026-05-03T10:50:37.683Z","changelog":"python-docx Skill 1.0.0 initial release: - Provides standard code templates and best practices for generating professional Word documents with python-docx. - Includes functions for document initialization, font settings, headings, paragraphs, bullet/numbered lists, tables, image insertion, pagination, and cover page creation. - Offers a complete example of generating a document with structured content. - Adds troubleshooting tips for common issues in using python-docx. - Lists core and auxiliary library dependencies, and links to official documentation.","fileCount":3,"zipByteSize":3944}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s172d0nd81xtkz14rc6g1wdmj183x0mv:python-docx","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-fooying-python-docx/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-fooying-python-docx/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-fooying-python-docx/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-fooying-python-docx/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-fooying-python-docx/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-fooying-python-docx/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T23:45:12.597Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-fooying-python-docx/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-fooying-python-docx/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-fooying-python-docx/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-fooying-python-docx/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-10T20:04:30.173Z","emptyReason":null},"readme":"Skill: python-docx\n\nOwner: fooying\n\nSummary: 提供基于python-docx库的标准方法，支持生成带封面、标题、段落、列表、表格与图片的专业Word文档。\n\nTags: latest:1.0.0\n\nVersion history:\n\nv1.0.0 | 2026-05-03T10:50:37.683Z | user\n\npython-docx Skill 1.0.0 initial release:\n\n- Provides standard code templates and best practices for generating professional Word documents with python-docx.\n- Includes functions for document initialization, font settings, headings, paragraphs, bullet/numbered lists, tables, image insertion, pagination, and cover page creation.\n- Offers a complete example of generating a document with structured content.\n- Adds troubleshooting tips for common issues in using python-docx.\n- Lists core and auxiliary library dependencies, and links to official documentation.\n\nArchive index:\n\nArchive v1.0.0: 3 files, 3944 bytes\n\nFiles: skill-card.md (1685b), SKILL.md (8076b), _meta.json (130b)\n\nFile v1.0.0:SKILL.md\n\n# python-docx Skill\n\n## 概述\n\n本Skill提供使用python-docx生成专业Word文档的标准方法和最佳实践。\n\n## 适用场景\n\n- 生成安全服务方案文档\n- 生成技术架构设计文档\n- 生成任何需要专业排版的Word文档\n\n## 技术栈\n\n- **核心库**: `python-docx`\n- **辅助库**: `docx.shared`, `docx.enum`, `docx.oxml.ns`\n\n## 标准代码模板\n\n### 1. 文档初始化\n\n```python\nfrom docx import Document\nfrom docx.shared import Inches, Pt, RGBColor, Cm\nfrom docx.enum.text import WD_ALIGN_PARAGRAPH\nfrom docx.enum.table import WD_TABLE_ALIGNMENT\nfrom docx.oxml.ns import qn\n\ndef create_document():\n    \"\"\"创建标准文档\"\"\"\n    doc = Document()\n\n    # 设置默认字体（关键！）\n    style = doc.styles['Normal']\n    style.font.name = 'Microsoft YaHei'\n    style._element.rPr.rFonts.set(qn('w:eastAsia'), 'Microsoft YaHei')\n\n    return doc\n```\n\n### 2. 字体设置（必须！）\n\n```python\ndef set_font(run, font_name='Microsoft YaHei'):\n    \"\"\"设置字体\"\"\"\n    run.font.name = font_name\n    run._element.rPr.rFonts.set(qn('w:eastAsia'), font_name)\n```\n\n### 3. 标题添加\n\n```python\ndef add_heading_custom(doc, text, level=1):\n    \"\"\"\n    添加标准标题\n\n    Args:\n        doc: Document对象\n        text: 标题文本\n        level: 1=一级, 2=二级, 3=三级\n\n    Returns:\n        标题段落对象\n    \"\"\"\n    heading = doc.add_heading(level=level)\n    run = heading.add_run(text)\n    set_font(run)\n\n    if level == 1:\n        run.font.size = Pt(16)\n        run.font.color.rgb = RGBColor(0, 51, 102)\n        run.font.bold = True\n    elif level == 2:\n        run.font.size = Pt(14)\n        run.font.color.rgb = RGBColor(0, 51, 102)\n        run.font.bold = True\n    else:\n        run.font.size = Pt(12)\n        run.font.color.rgb = RGBColor(0, 0, 0)\n        run.font.bold = True\n\n    return heading\n```\n\n### 4. 段落添加\n\n```python\ndef add_para_custom(doc, text, bold=False, indent=0, color=None):\n    \"\"\"\n    添加标准段落\n\n    Args:\n        doc: Document对象\n        text: 段落文本\n        bold: 是否加粗\n        indent: 首行缩进（厘米）\n        color: RGBColor颜色对象\n\n    Returns:\n        段落对象\n    \"\"\"\n    p = doc.add_paragraph()\n    p.paragraph_format.first_line_indent = Cm(indent)\n\n    run = p.add_run(text)\n    run.font.size = Pt(11)\n    set_font(run)\n\n    if bold:\n        run.font.bold = True\n    if color:\n        run.font.color.rgb = color\n\n    return p\n```\n\n### 5. 项目符号列表\n\n```python\ndef add_bullet_custom(doc, text, level=0):\n    \"\"\"\n    添加项目符号段落\n\n    Args:\n        doc: Document对象\n        text: 列表项文本\n        level: 缩进级别（0=一级, 1=二级）\n\n    Returns:\n        段落对象\n    \"\"\"\n    p = doc.add_paragraph(style='List Bullet')\n    p.paragraph_format.left_indent = Cm(0.5 + level * 0.5)\n\n    run = p.add_run(text)\n    run.font.size = Pt(11)\n    set_font(run)\n\n    return p\n```\n\n### 6. 编号列表\n\n```python\ndef add_numbered_custom(doc, text, level=0):\n    \"\"\"\n    添加编号列表段落\n\n    Args:\n        doc: Document对象\n        text: 列表项文本\n        level: 缩进级别\n\n    Returns:\n        段落对象\n    \"\"\"\n    p = doc.add_paragraph(style='List Number')\n    p.paragraph_format.left_indent = Cm(0.5 + level * 0.5)\n\n    run = p.add_run(text)\n    run.font.size = Pt(11)\n    set_font(run)\n\n    return p\n```\n\n### 7. 表格创建\n\n```python\ndef create_table(doc, headers, data):\n    \"\"\"\n    创建标准表格\n\n    Args:\n        doc: Document对象\n        headers: 表头列表\n        data: 二维列表，每行是一个列表\n\n    Returns:\n        表格对象\n    \"\"\"\n    table = doc.add_table(rows=1+len(data), cols=len(headers))\n    table.style = 'Light Grid Accent 1'\n    table.alignment = WD_TABLE_ALIGNMENT.CENTER\n\n    # 表头\n    for i, header in enumerate(headers):\n        cell = table.rows[0].cells[i]\n        cell.text = header\n        for paragraph in cell.paragraphs:\n            for run in paragraph.runs:\n                run.font.bold = True\n                run.font.size = Pt(10)\n                set_font(run)\n\n    # 数据\n    for row_idx, row_data in enumerate(data, 1):\n        for col_idx, cell_data in enumerate(row_data):\n            cell = table.rows[row_idx].cells[col_idx]\n            cell.text = str(cell_data)\n            for paragraph in cell.paragraphs:\n                for run in paragraph.runs:\n                    run.font.size = Pt(9)\n                    set_font(run)\n\n    return table\n```\n\n### 8. 图片插入\n\n```python\ndef insert_image(doc, image_path, width=Inches(6), caption=None):\n    \"\"\"\n    插入标准图片\n\n    Args:\n        doc: Document对象\n        image_path: 图片路径\n        width: 图片宽度\n        caption: 图片标题（可选）\n\n    Returns:\n        段落对象\n    \"\"\"\n    # 插入图片\n    p = doc.add_paragraph()\n    p.alignment = WD_ALIGN_PARAGRAPH.CENTER\n    run = p.add_run()\n    run.add_picture(image_path, width=width)\n\n    # 添加标题\n    if caption:\n        p = doc.add_paragraph()\n        p.alignment = WD_ALIGN_PARAGRAPH.CENTER\n        run = p.add_run(caption)\n        run.font.size = Pt(10)\n        run.font.color.rgb = RGBColor(102, 102, 102)\n        set_font(run)\n\n    return p\n```\n\n### 9. 分页\n\n```python\ndef add_page_break(doc):\n    \"\"\"添加分页符\"\"\"\n    doc.add_page_break()\n```\n\n### 10. 封面创建\n\n```python\ndef create_cover(doc, title, subtitle=None, customer=None, date=None, version=None):\n    \"\"\"\n    创建标准封面\n\n    Args:\n        doc: Document对象\n        title: 主标题\n        subtitle: 副标题（可选）\n        customer: 客户名称（可选）\n        date: 日期（可选）\n        version: 版本号（可选）\n    \"\"\"\n    # 空行占位\n    for _ in range(6):\n        doc.add_paragraph()\n\n    # 主标题\n    p = doc.add_paragraph()\n    p.alignment = WD_ALIGN_PARAGRAPH.CENTER\n    run = p.add_run(title)\n    run.font.size = Pt(28)\n    run.font.bold = True\n    run.font.color.rgb = RGBColor(0, 51, 102)\n    set_font(run)\n\n    # 副标题\n    if subtitle:\n        p = doc.add_paragraph()\n        p.alignment = WD_ALIGN_PARAGRAPH.CENTER\n        run = p.add_run(subtitle)\n        run.font.size = Pt(16)\n        run.font.color.rgb = RGBColor(102, 102, 102)\n        set_font(run)\n\n    # 空行\n    for _ in range(4):\n        doc.add_paragraph()\n\n    # 信息\n    info = doc.add_paragraph()\n    info.alignment = WD_ALIGN_PARAGRAPH.CENTER\n\n    if customer:\n        run = info.add_run(f'客户：{customer}\\n')\n        run.font.size = Pt(14)\n        set_font(run)\n\n    if date:\n        run = info.add_run(f'日期：{date}\\n')\n        run.font.size = Pt(14)\n        set_font(run)\n\n    if version:\n        run = info.add_run(f'版本：{version}')\n        run.font.size = Pt(14)\n        set_font(run)\n```\n\n## 完整示例\n\n```python\n# 创建文档\ndoc = create_document()\n\n# 添加封面\ncreate_cover(doc, \n    title='安全服务方案',\n    subtitle='Security Service Proposal',\n    customer='某某公司',\n    date='2026-03-23',\n    version='V1.0'\n)\n\n# 分页\ndoc.add_page_break()\n\n# 添加一级标题\nadd_heading_custom(doc, '一、 服务概述', level=1)\n\n# 添加二级标题\nadd_heading_custom(doc, '1.1 服务背景', level=2)\n\n# 添加正文\nadd_para_custom(doc, '这是正文内容，首行缩进两字符。', indent=0.5)\n\n# 添加项目符号\nadd_bullet_custom(doc, '项目符号内容')\n\n# 添加编号列表\nadd_numbered_custom(doc, '编号列表内容')\n\n# 添加表格\nheaders = ['列1', '列2', '列3']\ndata = [['A', 'B', 'C'], ['D', 'E', 'F']]\ncreate_table(doc, headers, data)\n\n# 保存\ndoc.save('output.docx')\n```\n\n## 常见问题\n\n**Q: 中文显示为方框？**  \nA: 确保每个run都调用set_font()设置字体\n\n**Q: 表格样式不统一？**  \nA: 设置table.style = 'Light Grid Accent 1'\n\n**Q: 图片无法显示？**  \nA: 检查图片路径是否正确，使用绝对路径\n\n**Q: 文档格式错乱？**  \nA: 确保所有文本都设置了字体和大小\n\n## 参考\n\n- python-docx官方文档: https://python-docx.readthedocs.io/\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7f8gnqy196bx27h0m3fj5nfh82432j\",\n  \"slug\": \"python-docx\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1777805437683\n}\n\nFile v1.0.0:skill-card.md\n\n## Description:\n\nProvides Chinese-oriented python-docx guidance and reusable code templates for generating professionally formatted Word documents with covers, headings, paragraphs, lists, tables, images, and pagination.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[fooying](https://clawhub.ai/user/fooying)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agents use this skill as a formatting reference when creating Word documents with python-docx, especially Chinese-language service proposals, architecture designs, and other professionally structured documents.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Copied examples may write a DOCX file with the sample output filename or use the default Microsoft YaHei font without project review.\n\nMitigation: Review and adjust the output filename, font choices, and document paths before running copied code in a real project.\n\n## Reference(s):\n\n- [python-docx official documentation](https://python-docx.readthedocs.io/)\n\n## Skill Output:\n\n**Output Type(s):** [Markdown, Code, Guidance]\n\n**Output Format:** [Markdown with Python code blocks]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Produces reusable python-docx snippets and troubleshooting guidance; example code writes a local DOCX file.]\n\n## Skill Version(s):\n\n1.0.0 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.","readmeExcerpt":"Skill: python-docx Owner: fooying Summary: 提供基于python-docx库的标准方法，支持生成带封面、标题、段落、列表、表格与图片的专业Word文档。 Tags: latest:1.0.0 Version history: v1.0.0 | 2026-05-03T10:50:37.683Z | user python-docx Skill 1.0.0 initial release: - Provides standard code templates and best practices for generating professional Word documents with python-docx. - Includes functions for document initialization, font settings, headings, paragraphs, bu","codeSnippets":[],"executableExamples":[{"language":"python","snippet":"from docx import Document\nfrom docx.shared import Inches, Pt, RGBColor, Cm\nfrom docx.enum.text import WD_ALIGN_PARAGRAPH\nfrom docx.enum.table import WD_TABLE_ALIGNMENT\nfrom docx.oxml.ns import qn\n\ndef create_document():\n    \"\"\"创建标准文档\"\"\"\n    doc = Document()\n\n    # 设置默认字体（关键！）\n    style = doc.styles['Normal']\n    style.font.name = 'Microsoft YaHei'\n    style._element.rPr.rFonts.set(qn('w:eastAsia'), 'Microsoft YaHei')\n\n    return doc"},{"language":"python","snippet":"def set_font(run, font_name='Microsoft YaHei'):\n    \"\"\"设置字体\"\"\"\n    run.font.name = font_name\n    run._element.rPr.rFonts.set(qn('w:eastAsia'), font_name)"},{"language":"python","snippet":"def add_heading_custom(doc, text, level=1):\n    \"\"\"\n    添加标准标题\n\n    Args:\n        doc: Document对象\n        text: 标题文本\n        level: 1=一级, 2=二级, 3=三级\n\n    Returns:\n        标题段落对象\n    \"\"\"\n    heading = doc.add_heading(level=level)\n    run = heading.add_run(text)\n    set_font(run)\n\n    if level == 1:\n        run.font.size = Pt(16)\n        run.font.color.rgb = RGBColor(0, 51, 102)\n        run.font.bold = True\n    elif level == 2:\n        run.font.size = Pt(14)\n        run.font.color.rgb = RGBColor(0, 51, 102)\n        run.font.bold = True\n    else:\n        run.font.size = Pt(12)\n        run.font.color.rgb = RGBColor(0, 0, 0)\n        run.font.bold = True\n\n    return heading"},{"language":"python","snippet":"def add_para_custom(doc, text, bold=False, indent=0, color=None):\n    \"\"\"\n    添加标准段落\n\n    Args:\n        doc: Document对象\n        text: 段落文本\n        bold: 是否加粗\n        indent: 首行缩进（厘米）\n        color: RGBColor颜色对象\n\n    Returns:\n        段落对象\n    \"\"\"\n    p = doc.add_paragraph()\n    p.paragraph_format.first_line_indent = Cm(indent)\n\n    run = p.add_run(text)\n    run.font.size = Pt(11)\n    set_font(run)\n\n    if bold:\n        run.font.bold = True\n    if color:\n        run.font.color.rgb = color\n\n    return p"},{"language":"python","snippet":"def add_bullet_custom(doc, text, level=0):\n    \"\"\"\n    添加项目符号段落\n\n    Args:\n        doc: Document对象\n        text: 列表项文本\n        level: 缩进级别（0=一级, 1=二级）\n\n    Returns:\n        段落对象\n    \"\"\"\n    p = doc.add_paragraph(style='List Bullet')\n    p.paragraph_format.left_indent = Cm(0.5 + level * 0.5)\n\n    run = p.add_run(text)\n    run.font.size = Pt(11)\n    set_font(run)\n\n    return p"},{"language":"python","snippet":"def add_numbered_custom(doc, text, level=0):\n    \"\"\"\n    添加编号列表段落\n\n    Args:\n        doc: Document对象\n        text: 列表项文本\n        level: 缩进级别\n\n    Returns:\n        段落对象\n    \"\"\"\n    p = doc.add_paragraph(style='List Number')\n    p.paragraph_format.left_indent = Cm(0.5 + level * 0.5)\n\n    run = p.add_run(text)\n    run.font.size = Pt(11)\n    set_font(run)\n\n    return p"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"# python-docx Skill\n\n## 概述\n\n本Skill提供使用python-docx生成专业Word文档的标准方法和最佳实践。\n\n## 适用场景\n\n- 生成安全服务方案文档\n- 生成技术架构设计文档\n- 生成任何需要专业排版的Word文档\n\n## 技术栈\n\n- **核心库**: `python-docx`\n- **辅助库**: `docx.shared`, `docx.enum`, `docx.oxml.ns`\n\n## 标准代码模板\n\n### 1. 文档初始化\n\n```python\nfrom docx import Document\nfrom docx.shared import Inches, Pt, RGBColor, Cm\nfrom docx.enum.text import WD_ALIGN_PARAGRAPH\nfrom docx.enum.table import WD_TABLE_ALIGNMENT\nfrom docx.oxml.ns import qn\n\ndef create_document():\n    \"\"\"创建标准文档\"\"\"\n    doc = Document()\n\n    # 设置默认字体（关键！）\n    style = doc.styles['Normal']\n    style.font.name = 'Microsoft YaHei'\n    style._element.rPr.rFonts.set(qn('w:eastAsia'), 'Microsoft YaHei')\n\n    return doc\n```\n\n### 2. 字体设置（必须！）\n\n```python\ndef set_font(run, font_name='Microsoft YaHei'):\n    \"\"\"设置字体\"\"\"\n    run.font.name = font_name\n    run._element.rPr.rFonts.set(qn('w:eastAsia'), font_name)\n```\n\n### 3. 标题添加\n\n```python\ndef add_heading_custom(doc, text, level=1):\n    \"\"\"\n    添加标准标题\n\n    Args:\n        doc: Document对象\n        text: 标题文本\n        level: 1=一级, 2=二级, 3=三级\n\n    Returns:\n        标题段落对象\n    \"\"\"\n    heading = doc.add_heading(level=level)\n    run = heading.add_run(text)\n    set_font(run)\n\n    if level == 1:\n        run.font.size = Pt(16)\n        run.font.color.rgb = RGBColor(0, 51, 102)\n        run.font.bold = True\n    elif level == 2:\n        run.font.size = Pt(14)\n        run.font.color.rgb = RGBColor(0, 51, 102)\n        run.font.bold = True\n    else:\n        run.font.size = Pt(12)\n        run.font.color.rgb = RGBColor(0, 0, 0)\n        run.font.bold = True\n\n    return heading\n```\n\n### 4. 段落添加\n\n```python\ndef add_para_custom(doc, text, bold=False, indent=0, color=None):\n    \"\"\"\n    添加标准段落\n\n    Args:\n        doc: Document对象\n        text: 段落文本\n        bold: 是否加粗\n        indent: 首行缩进（厘米）\n        color: RGBColor颜色对象\n\n    Returns:\n        段落对象\n    \"\"\"\n    p = doc.add_paragraph()\n    p.paragraph_format.first_line_indent = Cm(indent)\n\n    run = p.add_run(text)\n    run.font.size = Pt(11)\n    set_font(run)\n\n    if bold:\n        run.font.bold = True\n    if color:\n        run.font.color.rgb = color\n\n    return p\n```\n\n### 5. 项目符号列表\n\n```python\ndef add_bullet_custom(doc, text, level=0):\n    \"\"\"\n    添加项目符号段落\n\n    Args:\n        doc: Document对象\n        text: 列表项文本\n        level: 缩进级别（0=一级, 1=二级）\n\n    Returns:\n        段落对象\n    \"\"\"\n    p = doc.add_paragraph(style='List Bullet')\n    p.paragraph_format.left_indent = Cm(0.5 + level * 0.5)\n\n    run = p.add_run(text)\n    run.font.size = Pt(11)\n    set_font(run)\n\n    return p\n```\n\n### 6. 编号列表\n\n```python\ndef add_numbered_custom(doc, text, level=0):\n    \"\"\"\n    添加编号列表段落\n\n    Args:\n        doc: Document对象\n        text: 列表项文本\n        level: 缩进级别\n\n    Returns:\n        段落对象\n    \"\"\"\n    p = doc.add_paragraph(style='List Number')\n    p.paragraph_format.left_indent = Cm(0.5 + level * 0.5)\n\n    run = p.add_run(text)\n    run.font.size = Pt(11)\n    set_font(run)\n\n    return p\n```\n\n### 7. 表格创建\n\n```python\ndef create_table(doc, headers, data):\n    \"\"\"\n    创建标准"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7f8gnqy196bx27h0m3fj5nfh82432j\",\n  \"slug\": \"python-docx\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1777805437683\n}"},{"path":"skill-card.md","content":"## Description:\n\nProvides Chinese-oriented python-docx guidance and reusable code templates for generating professionally formatted Word documents with covers, headings, paragraphs, lists, tables, images, and pagination.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[fooying](https://clawhub.ai/user/fooying)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and agents use this skill as a formatting reference when creating Word documents with python-docx, especially Chinese-language service proposals, architecture designs, and other professionally structured documents.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Copied examples may write a DOCX file with the sample output filename or use the default Microsoft YaHei font without project review.\n\nMitigation: Review and adjust the output filename, font choices, and document paths before running copied code in a real project.\n\n## Reference(s):\n\n- [python-docx official documentation](https://python-docx.readthedocs.io/)\n\n## Skill Output:\n\n**Output Type(s):** [Markdown, Code, Guidance]\n\n**Output Format:** [Markdown with Python code blocks]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Produces reusable python-docx snippets and troubleshooting guidance; example code writes a local DOCX file.]\n\n## Skill Version(s):\n\n1.0.0 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"提供基于python-docx库的标准方法，支持生成带封面、标题、段落、列表、表格与图片的专业Word文档。 Skill: python-docx Owner: fooying Summary: 提供基于python-docx库的标准方法，支持生成带封面、标题、段落、列表、表格与图片的专业Word文档。 Tags: latest:1.0.0 Version history: v1.0.0 | 2026-05-03T10:50:37.683Z | user python-docx Skill 1.0.0 initial release: - Provides standard code templates and best practices for generating professional Word documents with python-docx. - Includes functions for document initialization, font settings, headings, paragraphs, bu","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":663,"uniquenessScore":61,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T20:04:30.173Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T20:04:30.173Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T23:45:12.597Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}