Make product-data skill portable

This commit is contained in:
wuyang6
2026-05-11 10:58:35 +08:00
parent d7744f026c
commit ca2f6f36fc
17 changed files with 964 additions and 2 deletions
+52
View File
@@ -0,0 +1,52 @@
# product-data
`product-data` 是产品/标签定义到标准数据记录的可迁移 skill 包。
设计原则:
- `SKILL.md` 描述流程、review 门禁和 Agent 使用方式。
- `knowledge/` 保存数据格式、生成协议和可维护知识。
- `scripts/` 保存可独立执行的脚本能力。
- `tools.yaml` 描述脚本如何被平台注册成工具;没有注册能力的 Agent 也可以直接调用脚本。
## 可迁移工具约定
脚本能力是本体,平台注册是适配层。
每个脚本都支持两种输入:
```bash
python skills/product-data/scripts/<tool>.py --input input.json
```
或:
```bash
cat input.json | python skills/product-data/scripts/<tool>.py
```
脚本统一输出 JSON
```json
{"ok":true}
```
失败时输出:
```json
{"ok":false,"error":"..."}
```
## 当前脚本
| 脚本 | 用途 |
| --- | --- |
| `scripts/normalize_dataset_draft.py` | 把 dataset draft text v1 转成 canonical records |
| `scripts/validate_dataset_records.py` | 校验 canonical records |
| `scripts/export_dataset_records.py` | 导出紧凑 JSONL/JSON |
## 平台内优先级
在 ZK Data Agent 里,仍优先使用已注册的 `data_agent_*` 工具,因为它们带有平台级 review 状态门禁和 session 输出路由。
当运行环境没有这些工具,或其他 Agent 迁移使用本 skill 时,再使用 `scripts/` 里的 portable scripts。