12312

用于将 Word DOCX 模板中以双花括号表示的占位符替换为来自 task_context JSON、docxReview 注释/映射及 ontologyInstance 属性值的内容;支持用户提供模板与本体字段绑定或包含 task_context/docxReview/mapping/ontologyInstance 的查询,并在 word-actions 块内通过 TUSD 上传生成的 DOCX。

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "12312":https://skillpi.com/zh/skills/deepskill-6a41cff27e5e98363a986e0ca114d33c8bad455224a705f65140f0ce1fc322d8。安装前核对上游来源和版本:https://skillhub.cn/skills/user_078cba33/ad。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

skillhub.cn

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

用于将 Word DOCX 模板中以双花括号表示的占位符替换为来自 task_context JSON、docxReview 注释/映射及 ontologyInstance 属性值的内容;支持用户提供模板与本体字段绑定或包含 task_context/docxReview/mapping/ontologyInstance 的查询,并在 word-actions 块内通过 TUSD 上传生成的 DOCX。

0 下载

介绍来源: third_party · user_078cba33 · 1.0.0 参考来源

SkillPi 解读

能完成的任务
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: docx-template-binding-fill
description: "Fill Word DOCX templates whose placeholders are written as double-brace variables from task_context JSON, docxReview annotations/mapping, and ontologyInstance property values. Use when a user provides a Word template plus ontology field bindings, asks to replace double-brace variables in a DOCX, or supplies a query containing task_context/docxReview/mapping/ontologyInstance and expects a generated DOCX uploaded through TUSD inside a word-actions block."

DOCX Template Binding Fill

Use this skill to fill an existing Word template from ontology-bound field values. The required input is a user query containing task_context, whose value is the download URL for the full task JSON.

Mandatory Workflow

Run the workflow without asking the user to confirm JSON contents.

  1. Parse task_context from the user query and download it:
python scripts/download_url.py --query-text "<raw user query>" --output-dir .tmp --output-name source_context.json
  1. Split the downloaded context into the four required fragments:
python scripts/split_context.py .tmp/source_context.json --output-dir .tmp

The script writes .tmp/currentDocx.json, .tmp/annotations.json, .tmp/mapping.json, and .tmp/ontologyInstance.json.

  1. Download the source Word template from currentDocx.sourceFetchUrl:
python scripts/download_docx.py .tmp/currentDocx.json --output-dir .tmp
  1. Build placeholder bindings from annotations, mapping, and ontologyInstance:
python scripts/build_bindings.py --annotations .tmp/annotations.json --mapping .tmp/mapping.json --ontology-instance .tmp/ontologyInstance.json --output .tmp/binding-values.json

Each annotation id maps to mapping[id]; the first binding property id is read from mapping[id]["bindings"][0]["propertyId"]. All ontology values matching that propertyId are collected in the exact order and count they appear in ontologyInstance.json, including duplicate values. Do not deduplicate repeated values, because repeated values can represent distinct table rows. If the same placeholder is referenced by multiple annotations for the same property, collect that property's value sequence only once for that placeholder. If the same placeholder text is bound to different property ids in different document locations, keep separate value variants and fill each template-row occurrence in document order.

  1. Fill the DOCX with OOXML editing:
python scripts/fill_docx_template.py .tmp/source.docx --bindings .tmp/binding-values.json --output outputs/filled.docx

The filler replaces placeholders across Word runs. If placeholders are inside a table row and any bound value has multiple values, it duplicates that template row and fills each row by index. If a value is missing, leave the original placeholder unchanged.

Strict replacement guard: only replace exact placeholders that match the double-brace text extracted from annotations.json and appear in binding-values.json. Never edit, polish, normalize, rewrite, merge, or otherwise change nearby text that is not inside the matched double-brace placeholder. In OOXML, perform replacement only at paragraph scope, not document/body/table/cell/root scope, so non-placeholder content keeps its original location and structure.

  1. Upload the generated DOCX to TUSD and return exactly one block:
python scripts/upload_docx_to_tusd.py outputs/filled.docx
<word-actions>https://...uploaded.docx</word-actions>

Do not return local file paths, raw JSON, or intermediate artifacts in the final answer when upload succeeds.

End-To-End Command

Prefer the orchestrator for normal use:

python scripts/run_workflow.py --query-text "<raw user query>" --work-dir .tmp --output-dir outputs

It performs every mandatory step, prints progress JSON to stderr, and prints the final <word-actions>...</word-actions> block to stdout.

Script Notes

  • download_url.py is generic and always writes the exact output filename requested; for task context use source_context.json.
  • split_context.py accepts either a root JSON object or a { "context": ... } wrapper.
  • download_docx.py always prefers sourceFetchUrl and falls back only to common URL fields.
  • build_bindings.py handles ontologyInstance.properties as either an object or list and recursively searches nested child values. It preserves the source order and repeated occurrence count for matching property values.
  • fill_docx_template.py edits OOXML directly and preserves unrelated DOCX parts, styles, relationships, headers, footers, images, and metadata.
  • upload_docx_to_tusd.py defaults to the built-in TUSD base URL http://192.168.0.192:1080/plm/files/; TUSD_BASE_URL or --base-url can override it. It reads optional TUSD_AUTHORIZATION or --authorization.

Failure Handling

  • If task_context is missing or invalid, ask for the raw query containing task_context: "https://...".
  • If currentDocx.sourceFetchUrl cannot be downloaded, report the URL and error.
  • If no binding value exists for a placeholder, leave that placeholder unchanged and include the unresolved placeholder in the script report.
  • If TUSD upload fails, report the upload error and do not emit a fake word-actions URL.

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 解决企业文档自动化生成中的高频刚需场景
  • 功能闭环完整,支持 ontology 绑定、模板填充、TUSD 上传全流程
触发精准95/100

亮点

  • 触发条件描述清晰,覆盖多种用户输入变体
  • 关键词边界明确,不易与其他 Skill 混淆
结构规范94/100

待提升项

  • description 重复 原报告严重程度:轻微

    顶层 frontmatter 和 skill_body 内部均包含 description,内容重复

    改进建议:建议移除 skill_body 内部的 description 重复内容,保持单一来源

  • 缺少显式 When to Use 章节 原报告严重程度:轻微

    文档未使用 "When to Use" 作为独立章节标题

    改进建议:建议在文档开头添加 "When to Use" 章节以增强可读性

亮点

  • 工作流程步骤清晰,共 6 个明确阶段
  • 包含端到-end 命令和详细的失败处理机制
执行可靠93/100

亮点

  • 所有脚本来源明确,参数使用规范
  • 覆盖主要异常场景并提供明确处理建议
  • DOCX 编辑有严格替换保护机制,防止误修改
证据可验 (前四项均值)94/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

未从主文档识别到上述常见操作,不能据此判断无需权限或没有风险。

文档引用的域名或地址

这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。

  • ...
  • ...uploaded.docx
  • 192.168.0.192

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。