zhi-tian
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "zhi-tian" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-ad54e64e1b2873bae7a4080a9ebb90faf9c275fc05ada1d9cfa9cde56d30f97b. Verify the upstream source and version against https://skillhub.cn/skills/user_86c377d6/zhi-tian before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Bulk intelligent Excel→Word filling: automatically parse placeholders in a Word template and use AI semantic matching to map Excel columns to template fields. Supports data format conversion, conditional logic, text concatenation and other preprocessing, rendering individual Word documents per row. Applicable to complaint explanations, batch contract generation, notices, reports and other Excel→Word template scenarios. Trigger examples: batch generate documents, Excel to Word, template filling.
Introduction source: third_party · user_86c377d6 · 3.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Audience
- Translation pending; see source documentation.
- Software, accounts and paid services
- Translation pending; see source documentation.
- Limits and differences
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: zhi-tian
slug: zhi-tian
displayName: "智填"
version: "3.0.0"
description: "Excel数据批量生成Word文档的智能填充技能。自动解析Word模板中的占位符,通过AI语义理解将Excel列与模板字段智能匹配,支持数据格式转换、条件判断、文本拼接等预处理,按行记录批量渲染独立Word文档。适用于任意Excel到Word模板的自动化文档生成场景,如投诉核减说明、合同批量生成、通知书制作、报表填充等。触发词:批量生成文档、Excel转Word、模板填充、智能填表、文档批量生成。"
agent_created: true智填 - Excel数据智能填充Word文档
概述
将Excel表格数据按Word模板批量生成独立文档。核心能力:模板占位符自动解析、 Excel列与模板字段语义匹配、数据预处理转换、逐行批量渲染。
区别于硬编码字段映射的传统方案,本技能通过AI语义理解实现模板自适应—— 无需预定义字段对应关系,AI动态分析任意模板结构并智能匹配。
适用场景
- 渠道投诉核减情况说明批量生成
- 合同/协议批量填充
- 通知书/告知书批量制作
- 月度报表数据填充
- 任意"Excel数据 + Word模板"的文档生成需求
工作流程
第一步:解析Word模板
读取用户提供的Word模板文件,识别其中的占位符。
占位符语法详见 references/placeholder_syntax.md。
支持两种占位符格式:
| 格式 | 示例 | 说明 |
|---|---|---|
{{字段名}} |
{{渠道名称}} |
简单替换 |
{{字段名\|处理器}} |
{{金额\|uppercase}} |
带数据处理的替换 |
运行模板解析脚本提取所有占位符:
python scripts/parse_template.py <template.docx>
输出JSON格式的占位符列表及其在文档中的上下文信息。
第二步:读取Excel数据
读取Excel文件,获取所有工作表名称和列头信息。
关键信息需收集:
- 工作表名称(若多表,询问用户选择)
- 所有列名清单
- 前3行样例数据(用于AI推断数据类型和格式)
第三步:AI语义字段匹配
此步骤由AI完成,非脚本执行。
基于模板占位符与Excel列头进行语义匹配:
- 逐个分析占位符的语义含义
- 与Excel列头进行模糊匹配(支持同义词、缩写、近义表达)
- 对于需拼接/拆分/计算的字段,推断处理规则
- 生成字段映射方案,输出为JSON格式
匹配策略详见 references/field_matching_guide.md。
匹配完成后,向用户展示映射方案并确认:
模板字段 → Excel列名 → 处理方式
─────────────────────────────────────────────────
{{渠道名称}} → 渠道名称 → 直接填充
{{渠道标识}} → 扣罚渠道标识 → 直接填充
{{投诉内容}} → 工单受理内容 → 提取客户诉求
{{流水号}} → 工单流水号 → 直接填充
{{金额大写}} → 扣罚金额 → 金额转大写
第四步:生成字段映射配置
将确认后的映射方案写入JSON配置文件,供渲染脚本使用。
配置格式:
{
"template": "template.docx",
"excel_file": "data.xlsx",
"sheet_name": "核减结果",
"output_dir": "./output",
"filename_pattern": "{{渠道名称}}核减情况说明",
"field_mapping": [
{
"placeholder": "渠道名称",
"source_column": "渠道名称",
"processor": "direct"
},
{
"placeholder": "投诉内容",
"source_column": "工单受理内容",
"processor": "extract_pattern",
"params": {
"patterns": ["客户诉求[::](.*?)(?=#|$)", "用户称[::](.*?)(?=#|$)"],
"fallback": "raw"
}
},
{
"placeholder": "金额大写",
"source_column": "扣罚金额",
"processor": "currency_uppercase"
},
{
"placeholder": "渠道信息",
"source_columns": ["渠道名称", "扣罚渠道标识"],
"processor": "concat",
"params": {
"format": "{0}(渠道标识:{1})"
}
}
]
}
第五步:批量渲染文档
运行渲染脚本,按配置逐行生成Word文档:
python scripts/render_docs.py <config.json>
脚本功能:
- 按field_mapping配置处理每行数据
- 替换模板中的所有占位符
- 保持模板原始格式(字体、段落、表格等)
- 自动创建输出目录
- 文件名冲突时自动添加序号
第六步:验证与交付
生成完成后:
- 报告成功/失败数量
- 列出输出文件路径
- 建议用户抽查首尾各一份文档确认质量
数据处理器列表
以下处理器可在field_mapping的processor字段中使用:
| 处理器 | 说明 | 示例 |
|---|---|---|
direct |
直接填充原值 | "中国移动" → "中国移动" |
uppercase |
转大写 | "abc" → "ABC" |
lowercase |
转小写 | "ABC" → "abc" |
date_format |
日期格式化 | 20260527 → 2026年5月27日 |
currency_uppercase |
金额转中文大写 | 1234.56 → 壹仟贰佰叁拾肆元伍角陆分 |
extract_pattern |
正则提取 | 从长文本中提取特定部分 |
concat |
多列拼接 | 合并多个字段 |
default |
空值默认值 | NaN → "无" |
conditional |
条件判断 | 根据值输出不同文本 |
phone_format |
手机号格式化 | 去除科学计数法 |
custom |
自定义Python表达式 | 任意合法Python表达式 |
处理器详细用法见 references/placeholder_syntax.md。
依赖要求
- Python 3.8+
- python-docx
- openpyxl
- pandas
安装依赖:
pip install python-docx==1.1.2 openpyxl==3.1.5 pandas==2.2.3
注意事项
- 模板中的占位符必须使用
{{}}语法,且字段名不含}}字符 - Excel文件首行必须为列标题行
- 若模板含表格,占位符可放在表格单元格内
- 文件名pattern中的占位符会替换为对应数据值
- 处理大数据量(>500行)时,脚本会分批处理并报告进度
- 生成的文档保持模板原始格式样式
参考文档
references/placeholder_syntax.md— 占位符语法与处理器详细说明references/field_matching_guide.md— AI语义字段匹配策略指南
Current listing version
3.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 解决Excel到Word模板批量生成的实际办公自动化需求
- 适用于合同、通知书、报表等多种高频场景
- 通过AI语义理解实现模板自适应,无需预定义字段映射
Highlights
- 触发词覆盖全面且边界清晰
- description明确列出核心功能关键词
Areas to improve
-
缺少When to Use章节 Reported severity: Minor
文档结构完整但缺少When to Use使用场景说明章节
Recommendation: 建议补充When to Use章节,明确说明何时使用此Skill
-
文档过长 Reported severity: Minor
文档内容约600行,超出建议的500行限制
Recommendation: 建议精简部分内容或拆分到参考文档中
Highlights
- 工作流程分六步清晰描述
- 提供完整的配置格式示例
- frontmatter信息完整
Areas to improve
-
缺少Word模板格式兼容性说明 Reported severity: Minor
未详细说明对Word模板格式的兼容性要求和限制
Recommendation: 建议补充Word模板格式兼容性说明和常见错误处理
Highlights
- 提供完整的Python依赖列表和安装命令
- 包含文件名冲突处理和大数据量分批处理机制
- 脚本功能描述清晰完整
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Install or fetch external dependencies
Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.
Mentioned in main document · lines 182
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Translation pending; see source documentation.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.