{"id":"7e7b46ef-20a4-494f-b05a-eaf9316a8bc0","entityType":"agent","slug":"clawhub-xixihaha123123123123-wps-docx","name":"WPS Word Document","canonicalUrl":"https://www.xpersona.co/agent/clawhub-xixihaha123123123123-wps-docx","canonicalPath":"/agent/clawhub-xixihaha123123123123-wps-docx","generatedAt":"2026-10-11T15:26:28.369Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T12:34:40.912Z","emptyReason":null},"description":"创建或编辑 Word (.docx) 文档。当用户要求生成、导出、下载 Word 文档，或对现有 .docx 编辑时使用本技能。当最终交付物是\"文档\"且用户未指定格式时（如\"生成文档\"、\"写一份文档\"、\"帮我做个文档\"），默认使用本技能生成 .docx。仅适用于最终交付物，中间生成物的格式不受此约束。 Skill: WPS Word Document Owner: xixihaha123123123123 Summary: 创建或编辑 Word (.docx) 文档。当用户要求生成、导出、下载 Word 文档，或对现有 .docx 编辑时使用本技能。当最终交付物是\"文档\"且用户未指定格式时（如\"生成文档\"、\"写一份文档\"、\"帮我做个文档\"），默认使用本技能生成 .docx。仅适用于最终交付物，中间生成物的格式不受此约束。 Tags: document:1.0.0, docx:1.0.0, latest:1.0.0, word:1.0.0 Version history: v1.0.0 | 2026-04-18T12:33:05.817Z | user Initial release Archive index: Archive v1.0.0: 11 files, 65958 bytes Files: scripts/__ini","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s172gcva854bewaha4hwd8xj4s852cyf:wps-docx","sourceUrl":"https://clawhub.ai/xixihaha123123123123/wps-docx","homepage":"https://clawhub.ai/xixihaha123123123123/skills/wps-docx","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/xixihaha123123123123/wps-docx","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/xixihaha123123123123/skills/wps-docx","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":61,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"创建或编辑 Word (.docx) 文档。当用户要求生成、导出、下载 Word 文档，或对现有 .docx 编辑时使用本技能。当最终交付物是\"文档\"且用户未指定格式时（如\"生成文档\"、\"写一份文档\"、\"帮我做个文档\"），默认使用本技能生成 .docx。仅适用于最终交付物，中间生成物的格式不受此约束。 Skill: W"},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T12:34:40.912Z","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-11T12:34:40.912Z","emptyReason":null},"stars":null,"forks":null,"downloads":1064,"packageName":null,"latestVersion":"1.0.0","tractionLabel":"1.1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T12:34:40.812Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T12:34:40.912Z","lastCrawledAt":"2026-10-11T12:34:40.812Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T12:34:40.812Z","lastVerifiedAt":null,"highlights":[{"version":"1.0.0","createdAt":"2026-04-18T12:33:05.817Z","changelog":"Initial release","fileCount":11,"zipByteSize":65958}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s172gcva854bewaha4hwd8xj4s852cyf:wps-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-xixihaha123123123123-wps-docx/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xixihaha123123123123-wps-docx/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xixihaha123123123123-wps-docx/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-xixihaha123123123123-wps-docx/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-xixihaha123123123123-wps-docx/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-xixihaha123123123123-wps-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-11T15:26:28.367Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xixihaha123123123123-wps-docx/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xixihaha123123123123-wps-docx/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xixihaha123123123123-wps-docx/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-xixihaha123123123123-wps-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-11T12:34:40.912Z","emptyReason":null},"readme":"Skill: WPS Word Document\n\nOwner: xixihaha123123123123\n\nSummary: 创建或编辑 Word (.docx) 文档。当用户要求生成、导出、下载 Word 文档，或对现有 .docx 编辑时使用本技能。当最终交付物是\"文档\"且用户未指定格式时（如\"生成文档\"、\"写一份文档\"、\"帮我做个文档\"），默认使用本技能生成 .docx。仅适用于最终交付物，中间生成物的格式不受此约束。\n\nTags: document:1.0.0, docx:1.0.0, latest:1.0.0, word:1.0.0\n\nVersion history:\n\nv1.0.0 | 2026-04-18T12:33:05.817Z | user\n\nInitial release\n\nArchive index:\n\nArchive v1.0.0: 11 files, 65958 bytes\n\nFiles: scripts/__init__.py (834b), scripts/edit_docx.py (6676b), scripts/html2docx.py (230051b), scripts/office/__init__.py (215b), scripts/office/_shared.py (4652b), scripts/office/pack.py (3354b), scripts/office/unpack.py (3278b), scripts/office/validate.py (2310b), skill-card.md (2425b), SKILL.md (13530b), _meta.json (127b)\n\nFile v1.0.0:SKILL.md\n\n---\nname: docx\ndescription: 创建或编辑 Word (.docx) 文档。当用户要求生成、导出、下载 Word 文档，或对现有 .docx 编辑时使用本技能。当最终交付物是\"文档\"且用户未指定格式时（如\"生成文档\"、\"写一份文档\"、\"帮我做个文档\"），默认使用本技能生成 .docx。仅适用于最终交付物，中间生成物的格式不受此约束。\n---\n\n# DOCX 文档创建与编辑\n\n## 何时使用\n\n- **最终交付物**为文档且用户未指定格式时，默认生成 `.docx`\n- 用户明确要求生成、导出、下载 Word 文档\n- 对现有 `.docx` 做文本替换（正文、页眉、页脚）\n- 解包查看 Word XML 结构并重新打包\n\n注意：任务过程中的中间生成物（如临时数据文件、处理脚本等）不需要使用本技能，格式自由选择。\n\n## 何时不要使用\n\n- 批注、回复批注\n- 接受修订或保留修订\n- 大规模样式重构、复杂目录修复、复杂域代码处理\n\n---\n\n## 快速参考\n\n| 任务             | 推荐方式                             |\n| ---------------- | ------------------------------------ |\n| 创建新 `.docx`   | 写 HTML → `html2docx()` → 见工作流 A |\n| 编辑现有 `.docx` | `edit_docx()` → 见工作流 B           |\n| 检查 XML 结构    | `unpack_docx()`                      |\n| 重新打包         | `pack_docx()`（默认含校验）          |\n\n---\n\n## 工作流 A：创建新文档\n\n流程分三步：根据内容基调设计视觉风格 → 用 `start_write_file` / `end_write_file` 编写语义化 HTML → 通过 `jupyter_cell_exec`工具 执行转换脚本输出 .docx。\n\n### 第 1 步：分析内容基调，推演视觉风格\n\n在编写 HTML 前，先完成意图识别与风格推演，并将结果直接落实到后续 CSS 中：\n\n- **色板**：根据内容基调设定主标题颜色、正文颜色和弱化文本颜色。轻量级高亮可使用浅色背景。公文、法律声明、严肃通知、学术论文等严肃场景禁止使用彩色，仅使用 `#000000` 和 `#333333`\n- **字体**：正式报告优先使用衬线体（宋体、仿宋）；现代文档或技术文档优先使用无衬线体（微软雅黑、黑体）；代码部分使用等宽字体（Consolas）；公文场景禁止使用非衬线字体，默认全用宋体或黑体\n- **节奏**：设定符合打印和离线阅读的行高（如 `1.5` 到 `1.8`）、统一段落间距（如 `12pt`）及章节留白\n\n### 第 2 步：用 start_write_file / end_write_file 编写 HTML 文件\n\n> **强制规则：必须使用 `start_write_file` + `end_write_file` 写入 HTML 文件。禁止通过 Python 代码生成 HTML 内容。** HTML 内容应由你直接以文本形式输出，以充分发挥 LLM 的长文本生成能力和排版能力。\n\n1. 调用 `start_write_file(path=\"<OUTPUT_ROOT>/<文档名>.html\")` 开启写作模式\n2. 直接以 `<!DOCTYPE html>` 开头输出完整 HTML（禁止使用 ` ```html ` 等 markdown 代码围栏包裹，直接输出原始 HTML 内容）\n3. 输出完毕后调用 `end_write_file()` 保存文件\n\n生成 HTML 时，提示词正文按以下约束执行：\n\n- **适用范围**：本规范仅适用于经 `html2docx()` 转为 Word 文档的 HTML 源文件，不适用于其他场景的 HTML 写作\n- **角色目标**：根据用户输入指令，生成专门用于转换为 `.docx` 文件的单文件 HTML 源文件，要求结构严谨、内容生动、具备专业美感，并适配 Word 离线阅读场景\n- **核心目标**：深入理解用户输入内容的意图、受众和情感基调，量身定制符合 Word 渲染逻辑的视觉呈现方案；排版兼顾信息层级秩序与文档正式感，确保转换为 `.docx` 后仍具备良好阅读体验\n\n_Technical Constraints（Word 渲染限制，必须绝对遵守）：_\n\n- 禁用现代布局：绝对不可使用 Flexbox（`display: flex`）、CSS Grid（`display: grid`）、`float`、`position: absolute`、`position: fixed`；若需左右分栏或复杂对齐，必须且只能使用无边框表格：`<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">`\n- 禁用现代 CSS 特性：绝对不可使用 CSS 变量（`var(--xxx)`）、`calc()`、`clamp()`、伪类（如 `:hover`）、`transition`、媒体查询（`@media`）\n- 安全单位与颜色：字体大小和行高必须使用 `pt` 或 `px`，缩进和间距可使用 `em`；颜色值必须使用确定的 Hex 值，如 `#000000`，不可使用 `rgba()` 或 `hsla()`\n- 字体声明机制：必须使用标准 CSS 的字体回退机制，并严格遵守“先英文字体，后中文字体”的声明顺序，例如 `font-family: Arial, \"Microsoft YaHei\", SimSun, sans-serif;`\n\n_语义化重组与内容强化：_\n\n- HTML 必须包含完整 `<!DOCTYPE html><html><head><body>` 结构，且头部必须声明 `<meta charset=\"UTF-8\">`\n- 严格按信息层级分配 `h1` 到 `h6`，为 Word 自动目录做好结构化准备\n- 在不改变核心原意的前提下优化可读性：长段落中的关键结论可独立抽取并使用 `<blockquote>` 包裹，配合左侧粗边框（`border-left`）和极浅背景色强调；公文等严肃文档不宜使用此样式\n- 将松散短句归纳为 `<ol>` 或 `<ul>` 列表，并保持列表项间距适中\n- 识别专业术语、代码片段、按键，使用 `<code>` 标签包裹，并设置浅灰背景、圆角及等宽字体\n\n_Word 兼容 CSS 构建：_\n\n- CSS 仅允许写在 `<head>` 的 `<style>` 标签内，尽量使用标签选择器或单层类选择器，避免复杂嵌套\n- 如内容基调需要传统中文排版，可使用 `text-indent: 2em;` 处理首行缩进\n- 如需使用表格，必须通过 CSS 设置 `border-collapse: collapse;`，并为 `th`、`td` 设置明确边框与内边距，例如 `border: 1px solid #dddddd; padding: 8px;`\n\n_Output Constraints：_\n\n- 必须输出单文件 HTML，包含完整 `<!DOCTYPE html>`、`<head>`（含内联 `<style>`）和 `<body>`\n- 严肃文档必须基于事实创作，禁止编造数据、KPI、日期、公司名、电话、邮箱、论文引用等\n- 文档内容需根据用户需求和上下文灵活调整文体，禁止生搬硬套和假大空\n- 用户如明确限制字数、字体、排版、演讲时长等要求，必须严格遵循\n\n### 第 3 步：执行转换脚本（仅用于 HTML → DOCX 转换）\n\n> **`jupyter_cell_exec`工具 仅用于调用 html2docx 转换脚本**，不要用它来生成或写入 HTML 内容。\n\n通过 **`jupyter_cell_exec`工具** 执行以下代码：\n\n```python\nimport sys, os\nsys.path.insert(0, os.path.join(os.getenv('skill_path'), 'docx', 'scripts'))\nfrom html2docx import html2docx\n\nresult = html2docx(input_html=\"<OUTPUT_ROOT>/report.html\", output_docx=\"<OUTPUT_ROOT>/report.docx\")  # 此处填写 OUTPUT_ROOT 完整路径\nprint(result)\n```\n\n> **路径规则：**\n>\n> - `html2docx()` 的两个参数需要填写 OUTPUT_ROOT 前缀的**完整绝对路径**。\n\n**函数签名：**\n\n| 参数          | 类型  | 说明               |\n| ------------- | ----- | ------------------ |\n| `input_html`  | `str` | 输入 HTML 文件路径 |\n| `output_docx` | `str` | 输出 DOCX 文件路径 |\n\n**返回值：** `dict`，必须检查 `result[\"ok\"]` 判断转换是否成功。\n\n```python\n# 成功\n{\"ok\": True, \"output_path\": \"...\", \"message\": \"转换成功，文件大小 123.4 KB\"}\n# 失败\n{\"ok\": False, \"output_path\": \"...\", \"message\": \"转换失败: ...\"}\n```\n\n## 纯 Python 实现（BeautifulSoup + python-docx），无需 Selenium 或 Chrome。\n\n## 工作流 B：编辑现有文档\n\n### 1. 基础文本替换\n\n通过 `edit_docx()` 完成，内部流程：解包 → 合并相邻同样式 run → 文本替换 → 重打包 → 校验。通过 **`jupyter_cell_exec`工具** 执行：\n\n```python\nimport sys, os\nsys.path.insert(0, os.path.join(os.getenv('skill_path'), 'docx', 'scripts'))\nfrom edit_docx import edit_docx\n\nresult = edit_docx(\n    input_docx=\"<OUTPUT_ROOT>/input.docx\",\n    output_docx=\"<OUTPUT_ROOT>/output.docx\",\n    replacements=[\n        {\"from\": \"旧公司名称\", \"to\": \"新公司名称\"},\n        {\"from\": \"2024年\", \"to\": \"2025年\"},\n    ],\n)\nprint(result)\n```\n\n**参数：**\n\n| 参数           | 类型                | 默认值      | 说明                                                                                |\n| -------------- | ------------------- | ----------- | ----------------------------------------------------------------------------------- |\n| `input_docx`   | `str`               | —           | 输入文件完整路径                                                                    |\n| `output_docx`  | `str`               | —           | 输出文件完整路径                                                                    |\n| `replacements` | `list[dict]`        | —           | 替换规则列表，每项含 `\"from\"` 和 `\"to\"`                                             |\n| `parts`        | `list[str] \\| None` | `None`      | 要处理的 XML 部件（支持 glob），默认 `document.xml` + `header*.xml` + `footer*.xml` |\n| `match_mode`   | `str`               | `\"literal\"` | `\"literal\"` 精确匹配 或 `\"regex\"` 正则匹配                                          |\n| `ignore_case`  | `bool`              | `False`     | 是否忽略大小写                                                                      |\n\n**返回值结构：**\n\n```python\n{\n    \"ok\": True,                         # 校验是否通过\n    \"input_path\": \"...\",\n    \"output_path\": \"...\",\n    \"match_mode\": \"literal\",\n    \"ignore_case\": False,\n    \"files_modified\": [\"word/document.xml\"],\n    \"replacements_applied\": [           # 每条规则的命中次数\n        {\"from\": \"旧公司名称\", \"to\": \"新公司名称\", \"count\": 3},\n    ],\n    \"validation\": {\"ok\": True, \"errors\": [], \"warnings\": []},\n}\n```\n\n**正则替换示例：**\n\n```python\nimport sys, os\nsys.path.insert(0, os.path.join(os.getenv('skill_path'), 'docx', 'scripts'))\nfrom edit_docx import edit_docx\n\nresult = edit_docx(\n    input_docx=\"<OUTPUT_ROOT>/input.docx\",\n    output_docx=\"<OUTPUT_ROOT>/output.docx\",\n    replacements=[{\"from\": r\"Q([1-4]) 2024\", \"to\": r\"Q\\1 2025\"}],\n    match_mode=\"regex\",\n    ignore_case=True,\n)\nprint(result)\n```\n\n### 2. 低层 XML 编辑\n\n如果 `edit_docx()` 替换命中数为 0，通常是目标文本被 Word 拆成了多个 XML run。可退回低层工具链手动处理：\n\n```python\nimport sys, os\nfrom pathlib import Path\n\nsys.path.insert(0, os.path.join(os.getenv('skill_path'), 'docx', 'scripts'))\nfrom office.unpack import unpack_docx\nfrom office.pack import pack_docx\n\nsource = Path(\"<OUTPUT_ROOT>/input.docx\")\nunpacked = Path(\"<OUTPUT_ROOT>/input_unpacked\")\noutput = Path(\"<OUTPUT_ROOT>/output.docx\")\n\nunpack_docx(source, unpacked)   # 解包并合并相邻同样式 run\n# 用 jupyter_cell_exec工具 读取并修改 unpacked/word/*.xml\npack_docx(unpacked, output)     # 重打包（默认含校验，失败会抛 ValueError）\n```\n\n重点文件：\n\n- `word/document.xml`：正文\n- `word/header*.xml`：页眉\n- `word/footer*.xml`：页脚\n- `word/styles.xml`：样式\n\n---\n\n## 编辑规则\n\n- `edit_docx()` 是基础文本替换工具，不负责批注、修订和复杂域代码\n- 解包时会合并相邻的同样式 run，提高文本替换命中率\n- 对于被 Word 拆成复杂片段的文本，退回 `unpack_docx()` 手动处理\n- `pack_docx()` 会自动修复常见的 XML 空白属性和 `durableId` 溢出问题\n\n---\n\n## Troubleshooting\n\n| 问题                                       | 处理方式                                                                      |\n| ------------------------------------------ | ----------------------------------------------------------------------------- |\n| `FileNotFoundError`                        | 检查路径是否使用了 OUTPUT_ROOT 完整前缀                                       |\n| `缺少依赖 beautifulsoup4`                  | `pip install beautifulsoup4`                                                  |\n| `replacements_applied` 中某项 `count` 为 0 | 先 `unpack_docx()` 检查目标文本是否被拆成多个 XML run                         |\n| `DOCX 验证失败`                            | 检查修改过的 XML 文件是否有语法错误                                           |\n| flex/grid 布局错位                         | 转换器将 flex/grid 降级为表格，简化布局结构或改用扁平 HTML                    |\n| 输出样式丢失                               | 确认 CSS 选择器命中正确；复杂嵌套选择器可能不被支持，改用类选择器或标签选择器 |\n| 中文乱码                                   | 确认 HTML 头部有 `<meta charset=\"UTF-8\">`                                     |\n\n---\n\n## 资源\n\n| 文件                                     | 用途                                    |\n| ---------------------------------------- | --------------------------------------- |\n| `skills/docx/scripts/html2docx.py`       | HTML → DOCX 转换主入口（`html2docx()`） |\n| `skills/docx/scripts/edit_docx.py`       | DOCX 文本替换编辑                       |\n| `skills/docx/scripts/office/unpack.py`   | 解包 DOCX 为 XML 目录                   |\n| `skills/docx/scripts/office/pack.py`     | 重打包 XML 目录为 DOCX                  |\n| `skills/docx/scripts/office/validate.py` | DOCX 结构校验                           |\n| `skills/docx/scripts/office/_shared.py`  | 底层 XML 读写与命名空间工具             |\n\nFile v1.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn75sj7ng3atr0ybce5905vm85853fbc\",\n  \"slug\": \"wps-docx\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1776515585817\n}\n\nFile v1.0.0:skill-card.md\n\n## Description:\n\nWPS Word Document helps agents create or edit Word .docx documents, including HTML-to-DOCX generation, targeted text replacement, DOCX unpacking, validation, and repacking.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[xixihaha123123123123](https://clawhub.ai/user/xixihaha123123123123)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users and developers use this skill when an agent needs to deliver a Word document or make targeted edits to an existing DOCX file. It is most useful for generating DOCX files from Word-compatible HTML, replacing text in document bodies, headers, and footers, and inspecting or repacking DOCX XML structures.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The security evidence reports under-disclosed network fetching during HTML-to-DOCX conversion.\n\nMitigation: Run the skill in a sandbox with limited network access and avoid converting HTML that contains remote images or other attacker-controlled remote resources.\n\nRisk: The security evidence reports unsafe file and archive handling around DOCX unpacking and output paths.\n\nMitigation: Process only trusted DOCX files, write unpacked content to disposable directories, and avoid pointing outputs at existing important directories.\n\nRisk: The security verdict is suspicious for this release.\n\nMitigation: Review the skill before deployment and install it only in environments with limited filesystem and network access.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/xixihaha123123123123/skills/wps-docx)\n- [Publisher profile](https://clawhub.ai/user/xixihaha123123123123)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown instructions with Python snippets and generated DOCX files as the intended artifact]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [The skill directs agents to create HTML, convert it to DOCX, edit DOCX XML content, and report structured success or validation results.]\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: WPS Word Document Owner: xixihaha123123123123 Summary: 创建或编辑 Word (.docx) 文档。当用户要求生成、导出、下载 Word 文档，或对现有 .docx 编辑时使用本技能。当最终交付物是\"文档\"且用户未指定格式时（如\"生成文档\"、\"写一份文档\"、\"帮我做个文档\"），默认使用本技能生成 .docx。仅适用于最终交付物，中间生成物的格式不受此约束。 Tags: document:1.0.0, docx:1.0.0, latest:1.0.0, word:1.0.0 Version history: v1.0.0 | 2026-04-18T12:33:05.817Z | user Initial release Archive index: Archive v1.0.0: 11 files, 65958 bytes Files: scripts/__ini","codeSnippets":[],"executableExamples":[{"language":"python","snippet":"import sys, os\nsys.path.insert(0, os.path.join(os.getenv('skill_path'), 'docx', 'scripts'))\nfrom html2docx import html2docx\n\nresult = html2docx(input_html=\"<OUTPUT_ROOT>/report.html\", output_docx=\"<OUTPUT_ROOT>/report.docx\")  # 此处填写 OUTPUT_ROOT 完整路径\nprint(result)"},{"language":"python","snippet":"# 成功\n{\"ok\": True, \"output_path\": \"...\", \"message\": \"转换成功，文件大小 123.4 KB\"}\n# 失败\n{\"ok\": False, \"output_path\": \"...\", \"message\": \"转换失败: ...\"}"},{"language":"python","snippet":"import sys, os\nsys.path.insert(0, os.path.join(os.getenv('skill_path'), 'docx', 'scripts'))\nfrom edit_docx import edit_docx\n\nresult = edit_docx(\n    input_docx=\"<OUTPUT_ROOT>/input.docx\",\n    output_docx=\"<OUTPUT_ROOT>/output.docx\",\n    replacements=[\n        {\"from\": \"旧公司名称\", \"to\": \"新公司名称\"},\n        {\"from\": \"2024年\", \"to\": \"2025年\"},\n    ],\n)\nprint(result)"},{"language":"python","snippet":"{\n    \"ok\": True,                         # 校验是否通过\n    \"input_path\": \"...\",\n    \"output_path\": \"...\",\n    \"match_mode\": \"literal\",\n    \"ignore_case\": False,\n    \"files_modified\": [\"word/document.xml\"],\n    \"replacements_applied\": [           # 每条规则的命中次数\n        {\"from\": \"旧公司名称\", \"to\": \"新公司名称\", \"count\": 3},\n    ],\n    \"validation\": {\"ok\": True, \"errors\": [], \"warnings\": []},\n}"},{"language":"python","snippet":"import sys, os\nsys.path.insert(0, os.path.join(os.getenv('skill_path'), 'docx', 'scripts'))\nfrom edit_docx import edit_docx\n\nresult = edit_docx(\n    input_docx=\"<OUTPUT_ROOT>/input.docx\",\n    output_docx=\"<OUTPUT_ROOT>/output.docx\",\n    replacements=[{\"from\": r\"Q([1-4]) 2024\", \"to\": r\"Q\\1 2025\"}],\n    match_mode=\"regex\",\n    ignore_case=True,\n)\nprint(result)"},{"language":"python","snippet":"import sys, os\nfrom pathlib import Path\n\nsys.path.insert(0, os.path.join(os.getenv('skill_path'), 'docx', 'scripts'))\nfrom office.unpack import unpack_docx\nfrom office.pack import pack_docx\n\nsource = Path(\"<OUTPUT_ROOT>/input.docx\")\nunpacked = Path(\"<OUTPUT_ROOT>/input_unpacked\")\noutput = Path(\"<OUTPUT_ROOT>/output.docx\")\n\nunpack_docx(source, unpacked)   # 解包并合并相邻同样式 run\n# 用 jupyter_cell_exec工具 读取并修改 unpacked/word/*.xml\npack_docx(unpacked, output)     # 重打包（默认含校验，失败会抛 ValueError）"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: docx\ndescription: 创建或编辑 Word (.docx) 文档。当用户要求生成、导出、下载 Word 文档，或对现有 .docx 编辑时使用本技能。当最终交付物是\"文档\"且用户未指定格式时（如\"生成文档\"、\"写一份文档\"、\"帮我做个文档\"），默认使用本技能生成 .docx。仅适用于最终交付物，中间生成物的格式不受此约束。\n---\n\n# DOCX 文档创建与编辑\n\n## 何时使用\n\n- **最终交付物**为文档且用户未指定格式时，默认生成 `.docx`\n- 用户明确要求生成、导出、下载 Word 文档\n- 对现有 `.docx` 做文本替换（正文、页眉、页脚）\n- 解包查看 Word XML 结构并重新打包\n\n注意：任务过程中的中间生成物（如临时数据文件、处理脚本等）不需要使用本技能，格式自由选择。\n\n## 何时不要使用\n\n- 批注、回复批注\n- 接受修订或保留修订\n- 大规模样式重构、复杂目录修复、复杂域代码处理\n\n---\n\n## 快速参考\n\n| 任务             | 推荐方式                             |\n| ---------------- | ------------------------------------ |\n| 创建新 `.docx`   | 写 HTML → `html2docx()` → 见工作流 A |\n| 编辑现有 `.docx` | `edit_docx()` → 见工作流 B           |\n| 检查 XML 结构    | `unpack_docx()`                      |\n| 重新打包         | `pack_docx()`（默认含校验）          |\n\n---\n\n## 工作流 A：创建新文档\n\n流程分三步：根据内容基调设计视觉风格 → 用 `start_write_file` / `end_write_file` 编写语义化 HTML → 通过 `jupyter_cell_exec`工具 执行转换脚本输出 .docx。\n\n### 第 1 步：分析内容基调，推演视觉风格\n\n在编写 HTML 前，先完成意图识别与风格推演，并将结果直接落实到后续 CSS 中：\n\n- **色板**：根据内容基调设定主标题颜色、正文颜色和弱化文本颜色。轻量级高亮可使用浅色背景。公文、法律声明、严肃通知、学术论文等严肃场景禁止使用彩色，仅使用 `#000000` 和 `#333333`\n- **字体**：正式报告优先使用衬线体（宋体、仿宋）；现代文档或技术文档优先使用无衬线体（微软雅黑、黑体）；代码部分使用等宽字体（Consolas）；公文场景禁止使用非衬线字体，默认全用宋体或黑体\n- **节奏**：设定符合打印和离线阅读的行高（如 `1.5` 到 `1.8`）、统一段落间距（如 `12pt`）及章节留白\n\n### 第 2 步：用 start_write_file / end_write_file 编写 HTML 文件\n\n> **强制规则：必须使用 `start_write_file` + `end_write_file` 写入 HTML 文件。禁止通过 Python 代码生成 HTML 内容。** HTML 内容应由你直接以文本形式输出，以充分发挥 LLM 的长文本生成能力和排版能力。\n\n1. 调用 `start_write_file(path=\"<OUTPUT_ROOT>/<文档名>.html\")` 开启写作模式\n2. 直接以 `<!DOCTYPE html>` 开头输出完整 HTML（禁止使用 ` ```html ` 等 markdown 代码围栏包裹，直接输出原始 HTML 内容）\n3. 输出完毕后调用 `end_write_file()` 保存文件\n\n生成 HTML 时，提示词正文按以下约束执行：\n\n- **适用范围**：本规范仅适用于经 `html2docx()` 转为 Word 文档的 HTML 源文件，不适用于其他场景的 HTML 写作\n- **角色目标**：根据用户输入指令，生成专门用于转换为 `.docx` 文件的单文件 HTML 源文件，要求结构严谨、内容生动、具备专业美感，并适配 Word 离线阅读场景\n- **核心目标**：深入理解用户输入内容的意图、受众和情感基调，量身定制符合 Word 渲染逻辑的视觉呈现方案；排版兼顾信息层级秩序与文档正式感，确保转换为 `.docx` 后仍具备良好阅读体验\n\n_Technical Constraints（Word 渲染限制，必须绝对遵守）：_\n\n- 禁用现代布局：绝对不可使用 Flexbox（`display: flex`）、CSS Grid（`display: grid`）、`float`、`position: absolute`、`position: fixed`；若需左右分栏或复杂对齐，必须且只能使用无边框表格：`<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">`\n- 禁用现代 CSS 特性：绝对不可使用 CSS 变量（`var(--xxx)`）、`calc()`、`clamp()`、伪类（如 `:hover`）、`transition`、媒体查询（`@media`）\n- 安全单位与颜色：字体大小和行高必须使用 `pt` 或 `px`，缩进和间距可使用 `em`；颜色值必须使用确定的 Hex 值，如 `#000000`，不可使用 `rgba()` 或 `hsla()`\n- 字体声明机制：必须使用标准 CSS 的字体回退机制，并严格遵守“先英文字体，后中文字体”的声明顺序，例如 `font-family: Arial, \"Microsoft YaHei\", SimSun, sans-serif;`\n\n_语义化重组与内容强化：_\n\n- HTML 必须包含完整 `<!DOCTYPE html><html><head><body>` 结构，且头部必须声明 `<meta charset=\"UTF-8\">`\n- 严格按信息层级分配 `h1` 到 `h6`，为 Word 自动目录做好结构化准备\n- 在不改变核心原意的前提下优化可读性：长段落中的关键结论可独立抽取并使用 `<blockquote>` 包裹，配合左侧粗边框（`border-left`）和极浅背景色强调；公文等严肃文档不宜使用此样式\n- 将松散短句归纳为 `<ol>` 或 `<ul>` 列表，并保持列表项间距适中\n- 识别专业术语、代码片段、按键，使用 `<code>` 标签包裹，并设置浅灰背景、圆角及等宽字体\n\n_Word 兼容 CSS 构建：_\n\n- CSS 仅允许写在 `<head>` 的 `<style>` 标签内，尽量使用标签选择器或单层类选择器，避免复杂嵌套\n- 如内容基调需要传统中文排版，可使用 `text-indent: 2em;` 处理首行缩进\n- 如需使用表格，必须通过 CSS 设置 `border-collapse: collapse;`，并为 `th`、`td"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn75sj7ng3atr0ybce5905vm85853fbc\",\n  \"slug\": \"wps-docx\",\n  \"version\": \"1.0.0\",\n  \"publishedAt\": 1776515585817\n}"},{"path":"skill-card.md","content":"## Description:\n\nWPS Word Document helps agents create or edit Word .docx documents, including HTML-to-DOCX generation, targeted text replacement, DOCX unpacking, validation, and repacking.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[xixihaha123123123123](https://clawhub.ai/user/xixihaha123123123123)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users and developers use this skill when an agent needs to deliver a Word document or make targeted edits to an existing DOCX file. It is most useful for generating DOCX files from Word-compatible HTML, replacing text in document bodies, headers, and footers, and inspecting or repacking DOCX XML structures.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The security evidence reports under-disclosed network fetching during HTML-to-DOCX conversion.\n\nMitigation: Run the skill in a sandbox with limited network access and avoid converting HTML that contains remote images or other attacker-controlled remote resources.\n\nRisk: The security evidence reports unsafe file and archive handling around DOCX unpacking and output paths.\n\nMitigation: Process only trusted DOCX files, write unpacked content to disposable directories, and avoid pointing outputs at existing important directories.\n\nRisk: The security verdict is suspicious for this release.\n\nMitigation: Review the skill before deployment and install it only in environments with limited filesystem and network access.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/xixihaha123123123123/skills/wps-docx)\n- [Publisher profile](https://clawhub.ai/user/xixihaha123123123123)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, code, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown instructions with Python snippets and generated DOCX files as the intended artifact]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [The skill directs agents to create HTML, convert it to DOCX, edit DOCX XML content, and report structured success or validation results.]\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":"创建或编辑 Word (.docx) 文档。当用户要求生成、导出、下载 Word 文档，或对现有 .docx 编辑时使用本技能。当最终交付物是\"文档\"且用户未指定格式时（如\"生成文档\"、\"写一份文档\"、\"帮我做个文档\"），默认使用本技能生成 .docx。仅适用于最终交付物，中间生成物的格式不受此约束。 Skill: WPS Word Document Owner: xixihaha123123123123 Summary: 创建或编辑 Word (.docx) 文档。当用户要求生成、导出、下载 Word 文档，或对现有 .docx 编辑时使用本技能。当最终交付物是\"文档\"且用户未指定格式时（如\"生成文档\"、\"写一份文档\"、\"帮我做个文档\"），默认使用本技能生成 .docx。仅适用于最终交付物，中间生成物的格式不受此约束。 Tags: document:1.0.0, docx:1.0.0, latest:1.0.0, word:1.0.0 Version history: v1.0.0 | 2026-04-18T12:33:05.817Z | user Initial release Archive index: Archive v1.0.0: 11 files, 65958 bytes Files: scripts/__ini","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":838,"uniquenessScore":59,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T12:34:40.912Z","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-11T12:34:40.912Z","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-11T15:26:28.369Z","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"}]}}}