Compare commits

...

2 Commits

Author SHA1 Message Date
ec049fdc2a feat(docs): add market four-tab materials (tutorial/demo/changelog) for v1.0.46
All checks were successful
技能自动化发布 / release (push) Successful in 13s
2026-07-17 11:55:29 +08:00
917df04712 Precipitate generic Agent routing and how-to gold standards
All checks were successful
技能自动化发布 / release (push) Successful in 13s
2026-07-15 15:33:23 +08:00
15 changed files with 287 additions and 35 deletions

19
CHANGELOG.md Normal file
View File

@@ -0,0 +1,19 @@
# Changelog
本文件对应技能市场 **「更新日志」** Tab。
发布 CI 会按当前 tag 版本(如 `v1.0.46``1.0.46`)提取匹配的 `##` 小节,写入该版本的 `changelog`
约定:
- 每个正式版本一节,标题形如 `## 1.0.46``## [1.0.46] - YYYY-MM-DD`
- 小节正文写用户能看懂的变化(新能力、修复、注意事项),避免堆砌内部实现细节
- 打 tag 前**必须**为即将发布的版本新增一节;找不到匹配小节时,本次发布不会更新 changelog 字段
## 1.0.46
- 模板默认增加市场材料:`TUTORIAL.md`(使用教程)、`DEMO.md`(演示)、`CHANGELOG.md`(更新日志),与根 `README.md`(技能说明)组成四 Tab 内容源
- 发布 CI 同步 `tutorial_md` / `demo_md` / `demo_video_url` / 版本 `changelog`
## 1.0.45
- 沉淀通用 Agent 路由与 how-to 文档标准(见仓库提交说明)

24
DEMO.md Normal file
View File

@@ -0,0 +1,24 @@
---
demo_video_url: ""
---
> **模板说明(复制后删除本段)**
> 本文对应技能市场 **「演示」** Tab。
> - frontmatter 的 `demo_video_url`:演示视频地址(发布时同步为 `demo_video_url`);没有视频时保持空字符串 `""`。
> - 正文(发布时同步为 `demo_md`):可选,写视频看点、时间轴或无视频时的图文演示说明。
> **不要**把演示链接写进 `SKILL.md`(市场材料 ≠ Agent 契约)。
> 复制为业务技能后:填入真实可访问的视频 URL并删掉本提示段。
# 演示说明
用一两句话说明这段演示帮助用户看懂什么(例如:从发起任务到看到结果的完整过程)。
## 建议观看顺序
1. 如何发起一次典型任务
2. 执行过程中会看到什么提示 / 进度
3. 成功后的结果长什么样
## 没有视频时
可在此用简短图文描述关键界面与结果样例;有视频后把 `demo_video_url` 填上即可,正文可保留为补充说明。

View File

@@ -6,6 +6,7 @@ description: "用用户能理解的方式说明这个技能能做什么、适合
> 本文是技能市场详情与普通用户说明,**不是** Agent 参考索引、CLI 契约或开发文档。 > 本文是技能市场详情与普通用户说明,**不是** Agent 参考索引、CLI 契约或开发文档。
> frontmatter 的 `description` 必须是用户能看懂的一句话能力描述;**不得**写成 CLI、schema、references、development、契约、数据结构、开发规范或 Agent 参考索引。 > frontmatter 的 `description` 必须是用户能看懂的一句话能力描述;**不得**写成 CLI、schema、references、development、契约、数据结构、开发规范或 Agent 参考索引。
> 正文只回答用户关心的问题,**不要**把 Playwright、DOM、Python、RPA、references、development、schema 等作为面向用户的主说明内容;若业务上必须出现技术词,须用用户能理解的方式解释,且不能喧宾夺主。 > 正文只回答用户关心的问题,**不要**把 Playwright、DOM、Python、RPA、references、development、schema 等作为面向用户的主说明内容;若业务上必须出现技术词,须用用户能理解的方式解释,且不能喧宾夺主。
> **复制后验收章节(标题可微调,建议保留):**「能帮你做什么」「适合什么场景」「使用前需要准备什么」「你可以这样告诉 Agent」「执行后你会得到什么」「注意事项」「常见问题」。
# 【技能名称】 # 【技能名称】

View File

@@ -1,7 +1,7 @@
--- ---
name: 技能开发模板(通用业务版) name: 技能开发模板(通用业务版)
description: "OpenClaw 通用业务技能开发模板,供复制后定制新业务 skill。定制步骤见 development/DEVELOPMENT.md。" description: "OpenClaw 通用业务技能开发模板,供复制后定制新业务 skill。定制步骤见 development/DEVELOPMENT.md。"
version: 1.0.44 version: 1.0.46
author: 深圳匠厂科技有限公司 author: 深圳匠厂科技有限公司
metadata: metadata:
openclaw: openclaw:
@@ -29,15 +29,28 @@ allowed-tools:
- **`bind.tables`**:只决定数据管理出现在哪些表;含 `toolbar` 时**必须**显式非空绑定。 - **`bind.tables`**:只决定数据管理出现在哪些表;含 `toolbar` 时**必须**显式非空绑定。
- **`executionProfile`**:只决定执行方式——`sync` 当场返回结果,`async` 进**任务中心**。与 placements / 入口**无关**;每个 Action **必须**显式写 `sync``async` - **`executionProfile`**:只决定执行方式——`sync` 当场返回结果,`async` 进**任务中心**。与 placements / 入口**无关**;每个 Action **必须**显式写 `sync``async`
- **同步数据**写技能本地库、不生成导出文件;**导出当前表**由宿主数据管理负责;特殊业务报告才另做 `export-*` - **同步数据**写技能本地库、不生成导出文件;**导出当前表**由宿主数据管理负责;特殊业务报告才另做 `export-*`
- **准备 vs 执行(适用则拆)**:若技能存在「先写入/准备本地数据」与「再对外产生副作用」两段Agent 必须能分开触发;禁止默认绑成不可拆的一步。一键无准备态的技能可跳过本条。
### 如何触发(决策树 ### 如何触发(能力类型
| 你要做什么 | Agent 怎么做 | 进任务中心? | | 你要做什么 | Agent 怎么做 | 进任务中心? |
|------------|--------------|--------------| |------------|--------------|--------------|
| 短查询 / 只读 / 秒级(`health` / `version` / `stats` / `list` / `get` / `logs` 等) | OpenClaw bash/exec + **共享 Python** 跑 CLI见下方「共享 Python」 | 否CLI 当场结束) | | 短查询 / 只读 / 秒级(`health` / `version` / `stats` / `list` / `get` / `logs` 等) | OpenClaw bash/exec + **共享 Python** 跑 CLI见下方「共享 Python」 | 否CLI 当场结束) |
| 已在 `actions.json` 声明且 `executionProfile: "sync"` 的能力 | 可用 `run_skill_action`,或同等效果的短 CLI同一内核 | 否 | | 已在 `actions.json` 声明且 `executionProfile: "sync"` 的能力 | 可用 `run_skill_action`,或同等效果的短 CLI同一内核 | 否 |
| 长耗时 / RPA / 浏览器 / 需要进度或取消;或 `executionProfile: "async"` | **必须** `run_skill_action`(先 `list_skill_actions` / `get_skill_action` | **是**(仅因为该 Action 是 async | | 长耗时 / RPA / 浏览器 / 需要进度或取消;或 `executionProfile: "async"` | **必须** `run_skill_action`(先 `list_skill_actions` / `get_skill_action` | **是**(仅因为该 Action 是 async |
| 用户只问用法 / 能做什么 | 读根目录 `README.md`技术细节读 `references/` | — | | 用户只问用法 / 能做什么 | 读根目录 `README.md`逐步操作再读 `TUTORIAL.md`**不要**为答用法去列目录或默认打开 `references/` | — |
### 用户意图路由表(业务技能复制后必改)
复制为业务技能后,**必须**用本技能真实意图改写下表(保留三列结构)。格子写清:短 CLI 子命令,或 `run_skill_action`**具体 action id**(及主要 `input`)。勿留模板占位语上线。
| 用户意图(本技能自填) | Agent 怎么做 | 进任务中心? |
|------------------------|--------------|--------------|
| (例)查询 / 统计 / 列表 | 短 CLI`<your-read-commands>` | 否 |
| (例)写入 / 导入 / 改本地状态 | 短 CLI`<your-prep-commands>` | 否 |
| (例)长副作用 / RPA / 需进度 | `run_skill_action``<your-async-action-id>``input.…` | 是(因该 Action 为 async |
有长任务 / RPA 时:上表至少一行指向真实的 async action id且该 id 须出现在 `assets/actions.json`;细节分流见 `references/CLI.md`
**硬规则:** **硬规则:**
@@ -46,6 +59,7 @@ allowed-tools:
3. **禁止** Agent 自行 `pip install` 3. **禁止** Agent 自行 `pip install`
4. Action **可选**:无数据管理 / 定时 / Agent 结构化调用需求时可不提供 `actions.json`;有长任务 / RPA 时**必须**提供至少一条 `executionProfile: "async"``placements``agent` 的 Action。 4. Action **可选**:无数据管理 / 定时 / Agent 结构化调用需求时可不提供 `actions.json`;有长任务 / RPA 时**必须**提供至少一条 `executionProfile: "async"``placements``agent` 的 Action。
5. **一个业务能力一个 Action**,用多个 `placements` 挂入口;底层仍是同一 `scripts/main.py` CLI。 5. **一个业务能力一个 Action**,用多个 `placements` 挂入口;底层仍是同一 `scripts/main.py` CLI。
6. 是否进任务中心**只**看该 Action 的 `executionProfile`,与数据管理 / 定时 / Agent 入口无关。
Agent 执行契约细节:`references/CLI.md``references/ACTIONS.md``references/SCHEMA.md`(不要把 `development/` 当 Agent 主读路径)。 Agent 执行契约细节:`references/CLI.md``references/ACTIONS.md``references/SCHEMA.md`(不要把 `development/` 当 Agent 主读路径)。
@@ -70,9 +84,9 @@ python {baseDir}/scripts/main.py init-db
## 面向用户问答LLM 规则) ## 面向用户问答LLM 规则)
- 本文(`SKILL.md`)是 LLM / OpenClaw 平台读取的技能入口,**不是**用户市场说明。 - 本文(`SKILL.md`)是 LLM / OpenClaw 平台读取的技能入口,**不是**用户市场说明。
- 根目录 `README.md` 是面向普通用户的说明 - 根目录市场材料面向普通用户(见下方「文档分工」),**不是** Agent 调用契约
当用户询问以下问题时,**必须优先读取**根目录 `README.md`,并用用户能理解的业务语言回答: 当用户询问以下问题时,**必须优先读取**根目录 `README.md`(能力说明)与 `TUTORIAL.md`(逐步用法),并用用户能理解的业务语言回答:
- 这个技能是做什么的 - 这个技能是做什么的
- 这个技能怎么用 - 这个技能怎么用
@@ -81,17 +95,28 @@ python {baseDir}/scripts/main.py init-db
- 执行后会得到什么 - 执行后会得到什么
- 能不能帮我完成某个业务任务 - 能不能帮我完成某个业务任务
**回答「怎么用 / 能做什么」时的要求:**
1. 「能做什么 / 场景 / FAQ」以 `README.md` 为主;「第一次怎么用完」以 `TUTORIAL.md` 为主。
2. **禁止**在回答中粘贴 `python …/scripts/main.py …` 或其它命令行(除非用户明确索要命令,或自称技术人员/开发者)。
3. **禁止**为答用法而去 `dir` / `ls` / 列技能目录,或默认打开 `references/``development/`;仅当用户明确问命令、参数、集成或排错时再读 `references/`
4. **不要**向普通用户暴露 Playwright、DOM、Python、RPA、库表名、`error_code` 等实现细节,除非用户明确询问技术实现。
**文档读取边界:**
- **不要**把 `SKILL.md``references/``development/` 中的技术细节直接作为用户回答。 - **不要**把 `SKILL.md``references/``development/` 中的技术细节直接作为用户回答。
- **只有当**用户明确询问命令、参数、输出结构、开发、调试、集成或排错时,才读取 `references/``development/` 主要给开发者 / 编码助手,对话 Agent **不必**默认打开。 - **只有当**用户明确询问命令、参数、输出结构、开发、调试、集成或排错时,才读取 `references/``development/` 主要给开发者 / 编码助手,对话 Agent **不必**默认打开。
- `README.md` `SKILL.md` / `references` 表述冲突:对用户展示与市场说明`README.md` 为准;对执行契约以 `SKILL.md` / `references` 为准。 -市场材料`SKILL.md` / `references` 表述冲突:对用户展示以 `README.md` / `TUTORIAL.md` 为准;对执行契约以 `SKILL.md` / `references` 为准。
- 回答用户时**不要**暴露 Playwright、DOM、Python、RPA 等实现细节,除非用户明确询问技术实现。
- 用户未问技术实现时,**不要**讨论 slug 命名规则;开发者问命名或 slug 时,读取 `development/NAMING.md` - 用户未问技术实现时,**不要**讨论 slug 命名规则;开发者问命名或 slug 时,读取 `development/NAMING.md`
## 文档分工 ## 文档分工
| 文档 | 读者 | 用途 | | 文档 | 读者 | 用途 |
|------|------|------| |------|------|------|
| 根目录 `README.md` | 普通用户 | 技能市场详情页说明(`metadata.readme_md` 主来源 | | 根目录 `README.md` | 普通用户 | 市场 **说明** Tab`readme_md` |
| 根目录 `TUTORIAL.md` | 普通用户 | 市场 **教程** Tab`tutorial_md` |
| 根目录 `DEMO.md` | 普通用户 | 市场 **演示** Tab`demo_video_url` + `demo_md` |
| 根目录 `CHANGELOG.md` | 普通用户 | 市场 **更新日志** Tab按版本小节 → `changelog` |
| `SKILL.md`(本文) | LLM / OpenClaw 平台 | 技能入口、触发与运行契约摘要 | | `SKILL.md`(本文) | LLM / OpenClaw 平台 | 技能入口、触发与运行契约摘要 |
| `references/` | Agent 编排 / 调用 | CLI、Action、schema 契约Agent 主读) | | `references/` | Agent 编排 / 调用 | CLI、Action、schema 契约Agent 主读) |
| `development/` | 开发者 / AI 编程代理 | 需求、开发教程、测试、深度技术规范 | | `development/` | 开发者 / AI 编程代理 | 需求、开发教程、测试、深度技术规范 |
@@ -110,7 +135,7 @@ python {baseDir}/scripts/main.py init-db
2. 业务技能仓库中**不得**存在 `.openclaw-skill-template`(仅 template 源仓库保留)。 2. 业务技能仓库中**不得**存在 `.openclaw-skill-template`(仅 template 源仓库保留)。
3. 复制目录为你的新 skill 仓库,全局替换 `your-skill-slug` 等占位词。 3. 复制目录为你的新 skill 仓库,全局替换 `your-skill-slug` 等占位词。
4.`development/DEVELOPMENT.md` 完成开发与文档定制。 4.`development/DEVELOPMENT.md` 完成开发与文档定制。
5. 用户市场说明写入根 `README.md`Agent 调用契约见 `references/CLI.md``references/SCHEMA.md``references/ACTIONS.md` 5. 用户市场四 Tab 材料写入根 `README.md` / `TUTORIAL.md` / `DEMO.md` / `CHANGELOG.md`Agent 调用契约见 `references/CLI.md``references/SCHEMA.md``references/ACTIONS.md`
6. 同步修改 `scripts/util/constants.py` 中的 `SKILL_SLUG` / `SKILL_VERSION` 6. 同步修改 `scripts/util/constants.py` 中的 `SKILL_SLUG` / `SKILL_VERSION`
7. 本地 SQLite 的中文表名/字段名、标准时间字段与字段顺序规范见 `references/SCHEMA.md` 7. 本地 SQLite 的中文表名/字段名、标准时间字段与字段顺序规范见 `references/SCHEMA.md`

63
TUTORIAL.md Normal file
View File

@@ -0,0 +1,63 @@
> **模板说明(复制后删除本段)**
> 本文对应技能市场 **「使用教程」** Tab发布时同步为 `tutorial_md`)。
> 面向普通用户写**可跟着做的步骤**,不要写 CLI、目录结构、release、开发规范。
> 与根 `README.md`技能说明分工README 讲「是什么 / 能做什么」;本文讲「第一次怎么用完」。
> **复制后验收章节(标题可微调):**「开始前」「第一步…」「第二步…」「常见卡住怎么办」。
# 【技能名称】使用教程
用最短路径带用户完成一次成功使用。步骤要具体,可用「打开匠厂 → …」这类操作语言。
---
## 开始前
确认:
1. 已安装并登录匠厂客户端
2. 已在技能市场安装本技能(或更新到最新版)
3. 【如需】相关账号已登录、权限可用;需要的文件 / 时间范围 / 单号等已准备好
---
## 第一步:打开技能并说清目标
在匠厂里新建任务或打开对话,用自然语言说明要做什么,例如:
> “帮我【完成某件业务事】,范围是【时间 / 对象 / 条件】。”
建议一次只交代一件事;范围说清楚,减少来回确认。
---
## 第二步:按提示补充信息
如果 Agent 问你缺什么(账号、文件、筛选条件),按提示补充即可。
- 有文件时:按界面提示选择或拖入
- 有账号时:确认已在对应平台登录,且具备操作权限
---
## 第三步:等待结果并核对
任务结束后,请核对:
- 是否成功完成
- 处理了多少条 / 哪些失败
- 生成的文件、表格或记录是否在预期位置
若失败,先看失败原因说明,再按下一节排查。
---
## 常见卡住怎么办
| 现象 | 你可以先试 |
|------|------------|
| 提示未登录 / 无权限 | 确认匠厂已登录;业务账号是否在线、权限是否足够 |
| 提示缺少必要信息 | 把时间范围、单号、文件等说完整后再试一次 |
| 一直没有结果 | 到任务中心查看进度或失败原因;必要时重新发起 |
| 结果不对 | 用更明确的条件再说一次,或缩小范围重试 |
仍无法解决时,把「你说了什么 + 界面提示原文」发给支持人员,便于排查。

View File

@@ -6,6 +6,6 @@
`skill-actions.schema.json` 使用 `additionalProperties: false`。正式支持 `bind.tables`toolbar Action 必填);`row`/`batch` placements 与 `concurrency`/`locks` 仍为预留。`placements``executionProfile` 正交——进任务中心只看 `async`,与入口无关。表级 Action 与 Agent 契约见 [`references/ACTIONS.md`](../references/ACTIONS.md);开发深度规范见 [`development/SKILL_ACTION_RUNTIME.md`](../development/SKILL_ACTION_RUNTIME.md)。 `skill-actions.schema.json` 使用 `additionalProperties: false`。正式支持 `bind.tables`toolbar Action 必填);`row`/`batch` placements 与 `concurrency`/`locks` 仍为预留。`placements``executionProfile` 正交——进任务中心只看 `async`,与入口无关。表级 Action 与 Agent 契约见 [`references/ACTIONS.md`](../references/ACTIONS.md);开发深度规范见 [`development/SKILL_ACTION_RUNTIME.md`](../development/SKILL_ACTION_RUNTIME.md)。
- 用户市场说明见根目录 [`README.md`](../README.md) - 用户市场四 Tab 见根目录 [`README.md`](../README.md) / [`TUTORIAL.md`](../TUTORIAL.md) / [`DEMO.md`](../DEMO.md) / [`CHANGELOG.md`](../CHANGELOG.md)
- Agent 调用/编排参考见 [`references/`](../references/)(含 [`ACTIONS.md`](../references/ACTIONS.md) - Agent 调用/编排参考见 [`references/`](../references/)(含 [`ACTIONS.md`](../references/ACTIONS.md)
- 开发规范见 [`development/`](../development/) - 开发规范见 [`development/`](../development/)

View File

@@ -106,6 +106,9 @@ your-skill/
├─ tests/ ├─ tests/
├─ .gitignore ├─ .gitignore
├─ README.md ├─ README.md
├─ TUTORIAL.md
├─ DEMO.md
├─ CHANGELOG.md
├─ requirements.txt ├─ requirements.txt
├─ release.ps1 ├─ release.ps1
└─ SKILL.md └─ SKILL.md
@@ -114,7 +117,10 @@ your-skill/
各目录职责如下: 各目录职责如下:
- `assets/`放示例输出、schema、静态说明资源 - `assets/`放示例输出、schema、静态说明资源
- `README.md`面向用户的市场详情页说明 - `README.md`市场 **说明** Tab`readme_md`
- `TUTORIAL.md`:市场 **教程** Tab`tutorial_md`
- `DEMO.md`:市场 **演示** Tab`demo_video_url` + `demo_md`
- `CHANGELOG.md`:市场 **更新日志** Tab按版本小节同步 `changelog`
- `SKILL.md`:面向 LLM / 平台的技能入口 - `SKILL.md`:面向 LLM / 平台的技能入口
- `references/`Agent 运行/编排/调用时渐进加载的补充上下文(如 CLI、SCHEMA - `references/`Agent 运行/编排/调用时渐进加载的补充上下文(如 CLI、SCHEMA
- `development/`:面向开发者与 AI 编程代理的开发资料、需求、测试与技术规范 - `development/`:面向开发者与 AI 编程代理的开发资料、需求、测试与技术规范
@@ -305,7 +311,7 @@ git remote -v
复制后优先改下面这些地方: 复制后优先改下面这些地方:
1. `SKILL.md` 1. `SKILL.md`
2. 根目录 `README.md`(用户市场说明) 2. 根目录市场四 Tab`README.md` / `TUTORIAL.md` / `DEMO.md` / `CHANGELOG.md`
3. `scripts/util/constants.py` 3. `scripts/util/constants.py`
4. `references/` 与 `development/` 下的文案 4. `references/` 与 `development/` 下的文案
5. `scripts/service/` 下的业务占位实现(优先改 `task_service.py` 5. `scripts/service/` 下的业务占位实现(优先改 `task_service.py`
@@ -339,7 +345,7 @@ git remote -v
如需浏览器自动化,不要在模板里保留空的 `platform_playwright.py`;请按业务新建 `xxx_playwright.py`(命名自定),并在 `task_service.py` 中按需引用。 如需浏览器自动化,不要在模板里保留空的 `platform_playwright.py`;请按业务新建 `xxx_playwright.py`(命名自定),并在 `task_service.py` 中按需引用。
## 6. `SKILL.md` 与根 `README.md` 应该怎么写 ## 6. `SKILL.md` 与市场四 Tab 材料应该怎么写
### `SKILL.md`LLM / 平台入口) ### `SKILL.md`LLM / 平台入口)
@@ -351,19 +357,26 @@ git remote -v
- 何时触发本技能、CLI 入口摘要、运行契约要点 - 何时触发本技能、CLI 入口摘要、运行契约要点
- 指向 `references/`Agent 调用)与 `development/`(开发规范)的分工说明 - 指向 `references/`Agent 调用)与 `development/`(开发规范)的分工说明
不要在 `SKILL.md` 里写大量用户市场文案或实现细节。 不要在 `SKILL.md` 里写大量用户市场文案或实现细节**不要**把演示视频 URL 写进 `SKILL.md`(放 `DEMO.md` frontmatter
### 根 `README.md`(用户市场说明 ### 市场四 Tab根目录面向普通用户
根 `README.md` 是技能市场详情页主来源(`metadata.readme_md`),面向普通用户。 发布 CI 会把下列文件同步到技能市场详情 Tabs有文件才更新对应字段
应包含 YAML frontmatter 的 `description`(市场列表简介),正文用用户能理解的语言说明: | 文件 | 市场 Tab | 同步字段 |
|------|----------|----------|
| `README.md` | 说明 | `readme_md`frontmatter `description` 作列表简介) |
| `TUTORIAL.md` | 教程 | `tutorial_md` |
| `DEMO.md` | 演示 | `demo_md` + frontmatter `demo_video_url` |
| `CHANGELOG.md` | 更新日志 | 匹配当前 tag 版本的 `##` 小节 → `changelog` |
- 能做什么、适合什么场景、使用前准备什么 **`README.md`**:能力与场景说明。含 frontmatter `description`;写能做什么、场景、准备、如何告诉 Agent、结果、注意事项、FAQ。不要写开发教程、目录规范、release、requirements。
- 如何自然语言告诉 Agent
- 执行结果、注意事项、常见问题
不要在根 `README.md` 里写开发教程、目录规范、release、requirements 等技术细节 **`TUTORIAL.md`**:第一次怎么用完的逐步操作。写「开始前 → 步骤 → 卡住怎么办」;不要写 CLI / 目录 / 开发规范
**`DEMO.md`**演示视频与补充说明。frontmatter 必须含 `demo_video_url`(无视频时用 `""`);正文可选。
**`CHANGELOG.md`**:每个正式版本一节(如 `## 1.0.46`)。打 tag 前为即将发布的版本新增小节;用户可读的变化,少写内部实现。
实现细节放在: 实现细节放在:
@@ -402,9 +415,12 @@ metadata:
当前规范 skill 的文档按读者拆分: 当前规范 skill 的文档按读者拆分:
**根 `README.md`** **根市场材料(四 Tab**
- 用户市场详情页说明(含 frontmatter `description` - `README.md` — 说明(含 frontmatter `description`
- `TUTORIAL.md` — 使用教程
- `DEMO.md` — 演示(`demo_video_url` + 正文)
- `CHANGELOG.md` — 按版本更新日志
**`SKILL.md`** **`SKILL.md`**
@@ -442,7 +458,7 @@ metadata:
比如 `skill-actions.schema.json`、日志记录、机读 JSON 的 schema 比如 `skill-actions.schema.json`、日志记录、机读 JSON 的 schema
不要把正式研发文档放到 `assets/`。 不要把正式研发文档放到 `assets/`。
用户说明进根 `README.md`Agent 编排资料进 `references/`;开发规范进 `development/`。 用户市场四 Tab 进根 `README.md` / `TUTORIAL.md` / `DEMO.md` / `CHANGELOG.md`Agent 编排资料进 `references/`;开发规范进 `development/`。
## 9. `cli` 层怎么写 ## 9. `cli` 层怎么写
@@ -768,7 +784,7 @@ uses: client-jiangchang/jiangchang-platform-kit/.github/workflows/reusable-relea
如果工作流失败,不要继续做平台验证,而应该先回到代码仓库排查,例如: 如果工作流失败,不要继续做平台验证,而应该先回到代码仓库排查,例如:
- 发布脚本是否正常推送 - 发布脚本是否正常推送
- `SKILL.md`、根 `README.md`、`scripts/`、`references/`、`development/` 是否齐全 - `SKILL.md`、根市场四 Tab`README.md` / `TUTORIAL.md` / `DEMO.md` / `CHANGELOG.md`、`scripts/`、`references/`、`development/` 是否齐全
- 工作流文件是否存在 - 工作流文件是否存在
- 发布包结构是否符合模板规范 - 发布包结构是否符合模板规范
@@ -903,7 +919,7 @@ uses: client-jiangchang/jiangchang-platform-kit/.github/workflows/reusable-relea
现在的新模板原则是: 现在的新模板原则是:
- 不做旧结构兼容 - 不做旧结构兼容
- 用户说明在根 `README.md`Agent 资料在 `references/`,开发规范在 `development/` - 用户市场四 Tab 在根 `README.md` / `TUTORIAL.md` / `DEMO.md` / `CHANGELOG.md`Agent 资料在 `references/`,开发规范在 `development/`
- 统一走 `scripts/main.py` 作为 CLI 入口 - 统一走 `scripts/main.py` 作为 CLI 入口
### 错误 5平台放 slug 最前 ### 错误 5平台放 slug 最前
@@ -965,7 +981,7 @@ git remote add origin <新技能仓库 URL>
如果让一个新人照着做,我建议他按这个顺序: 如果让一个新人照着做,我建议他按这个顺序:
1. 按 [`NAMING.md`](NAMING.md) 确定 slug复制模板并改目录名 1. 按 [`NAMING.md`](NAMING.md) 确定 slug复制模板并改目录名
2. 改 `SKILL.md` 与根 `README.md` 2. 改 `SKILL.md` 与根市场四 Tab`README.md` / `TUTORIAL.md` / `DEMO.md` / `CHANGELOG.md`
3. 改 `scripts/util/constants.py` 3. 改 `scripts/util/constants.py`
4. 改 `references/` 与 `development/` 4. 改 `references/` 与 `development/`
5. 改 `scripts/cli/app.py` 5. 改 `scripts/cli/app.py`
@@ -981,7 +997,7 @@ git remote add origin <新技能仓库 URL>
- 目录结构统一 - 目录结构统一
- 入口统一为 `scripts/main.py` - 入口统一为 `scripts/main.py`
- 用户说明在根 `README.md`Agent 资料在 `references/`,开发规范在 `development/` - 用户市场四 Tab 在根 `README.md` / `TUTORIAL.md` / `DEMO.md` / `CHANGELOG.md`Agent 资料在 `references/`,开发规范在 `development/`
- 业务核心逻辑统一放 `scripts/service/` - 业务核心逻辑统一放 `scripts/service/`
- 不再使用旧模板历史结构 - 不再使用旧模板历史结构

View File

@@ -8,6 +8,7 @@
| POLICY-RUNTIME-001 | 不得 vendored `scripts/jiangchang_skill_core/` | development/RUNTIME.md §共享 Python Runtime、§明确禁止 | hard | 目录不存在检查 | `tests/test_development_policy_guard.py::TestPolicyRuntime001`(另见 `tests/test_platform_import.py` | | POLICY-RUNTIME-001 | 不得 vendored `scripts/jiangchang_skill_core/` | development/RUNTIME.md §共享 Python Runtime、§明确禁止 | hard | 目录不存在检查 | `tests/test_development_policy_guard.py::TestPolicyRuntime001`(另见 `tests/test_platform_import.py` |
| POLICY-RUNTIME-002 | `requirements.txt` 非注释依赖行不得声明 `jiangchang-platform-kit` / `playwright` | development/RUNTIME.md §共享 Python Runtimedevelopment/DEVELOPMENT.md §3.1 requirements.txt 依赖规范 | hard | 解析依赖行 | `tests/test_development_policy_guard.py::TestPolicyRuntime002`(另见 `tests/test_platform_import.py` | | POLICY-RUNTIME-002 | `requirements.txt` 非注释依赖行不得声明 `jiangchang-platform-kit` / `playwright` | development/RUNTIME.md §共享 Python Runtimedevelopment/DEVELOPMENT.md §3.1 requirements.txt 依赖规范 | hard | 解析依赖行 | `tests/test_development_policy_guard.py::TestPolicyRuntime002`(另见 `tests/test_platform_import.py` |
| POLICY-RUNTIME-003 | Agent/CLI 文档须要求共享 Pythonpython-runtime / PATH 上的 `python` + `{baseDir}`);须明确**禁止**对技能脚本使用 `uv run python` | development/RUNTIME.mdreferences/CLI.mdSKILL.md | hard | 文档标记扫描 | `tests/test_docs_standards.py::test_cli_md_requires_shared_python_not_uv_run``tests/test_docs_standards.py::test_skill_md_requires_shared_python_not_uv_run` | | POLICY-RUNTIME-003 | Agent/CLI 文档须要求共享 Pythonpython-runtime / PATH 上的 `python` + `{baseDir}`);须明确**禁止**对技能脚本使用 `uv run python` | development/RUNTIME.mdreferences/CLI.mdSKILL.md | hard | 文档标记扫描 | `tests/test_docs_standards.py::test_cli_md_requires_shared_python_not_uv_run``tests/test_docs_standards.py::test_skill_md_requires_shared_python_not_uv_run` |
| POLICY-AGENT-001 | `SKILL.md` 须含「用户意图路由表」结构;`CLI.md` 须含短 CLI 白名单 / Action 强制黑名单表;用法回答须禁止无故粘贴 CLI、禁止为答用法列目录挖 references | SKILL.mdreferences/CLI.md | hard | 文档标记扫描 | `tests/test_docs_standards.py::test_skill_md_has_intent_routing_table``tests/test_docs_standards.py::test_cli_md_has_agent_routing_tables``tests/test_docs_standards.py::test_skill_md_how_to_forbids_cli_paste` |
| POLICY-INSTALL-001 | 交付执行文件不得含 `pip install` / `python -m pip install` / `uv pip install` / `playwright install` | development/RUNTIME.md §共享 Python Runtimedevelopment/RPA.md §1.4 Playwright 与安装边界development/DEVELOPMENT.md §3.1 | hard | 扫描 `scripts/**/*.py``*.ps1``*.sh``requirements.txt``.github/workflows/*`(不扫 `development/*.md` | `tests/test_development_policy_guard.py::TestPolicyInstall001` | | POLICY-INSTALL-001 | 交付执行文件不得含 `pip install` / `python -m pip install` / `uv pip install` / `playwright install` | development/RUNTIME.md §共享 Python Runtimedevelopment/RPA.md §1.4 Playwright 与安装边界development/DEVELOPMENT.md §3.1 | hard | 扫描 `scripts/**/*.py``*.ps1``*.sh``requirements.txt``.github/workflows/*`(不扫 `development/*.md` | `tests/test_development_policy_guard.py::TestPolicyInstall001` |
| POLICY-CONFIG-001 | 仓库根目录必须存在 `.env.example` | development/CONFIG.md §核心原则、§标准配置项 | hard | 文件存在性 | `tests/test_development_policy_guard.py::TestPolicyConfig001` | | POLICY-CONFIG-001 | 仓库根目录必须存在 `.env.example` | development/CONFIG.md §核心原则、§标准配置项 | hard | 文件存在性 | `tests/test_development_policy_guard.py::TestPolicyConfig001` |
| POLICY-CONFIG-002 | `.gitignore` 必须忽略 `.env``*.env.local` | development/CONFIG.md §红线:敏感信息不进 .env | hard | 解析 `.gitignore` 行 | `tests/test_development_policy_guard.py::TestPolicyConfig002` | | POLICY-CONFIG-002 | `.gitignore` 必须忽略 `.env``*.env.local` | development/CONFIG.md §红线:敏感信息不进 .env | hard | 解析 `.gitignore` 行 | `tests/test_development_policy_guard.py::TestPolicyConfig002` |

View File

@@ -17,4 +17,4 @@
脚手架与 Git 防串库:[`../tools/README.md`](../tools/README.md)`scaffold_skill.ps1`)。 脚手架与 Git 防串库:[`../tools/README.md`](../tools/README.md)`scaffold_skill.ps1`)。
Agent 调用契约见 [`../references/CLI.md`](../references/CLI.md)、[`../references/SCHEMA.md`](../references/SCHEMA.md)、[`../references/ACTIONS.md`](../references/ACTIONS.md)。 Agent 调用契约见 [`../references/CLI.md`](../references/CLI.md)、[`../references/SCHEMA.md`](../references/SCHEMA.md)、[`../references/ACTIONS.md`](../references/ACTIONS.md)。
用户市场说明见根目录 [`README.md`](../README.md),不要写进本目录。 用户市场四 Tab 见根目录 [`README.md`](../README.md) / [`TUTORIAL.md`](../TUTORIAL.md) / [`DEMO.md`](../DEMO.md) / [`CHANGELOG.md`](../CHANGELOG.md),不要写进本目录。

View File

@@ -98,7 +98,7 @@
- 目录结构必须符合当前 `skill-template` 规范 - 目录结构必须符合当前 `skill-template` 规范
- 入口必须统一为 `scripts/main.py` - 入口必须统一为 `scripts/main.py`
- 用户说明写在根 `README.md`LLM/运行契约写在 `SKILL.md`;开发规范在 `development/` - 用户市场四 Tab 写在根 `README.md` / `TUTORIAL.md` / `DEMO.md` / `CHANGELOG.md`LLM/运行契约写在 `SKILL.md`;开发规范在 `development/`
- 输出格式应尽量机读友好;错误前缀统一为 `ERROR:` - 输出格式应尽量机读友好;错误前缀统一为 `ERROR:`
- Windows 环境下需保证 UTF-8 输出兼容 - Windows 环境下需保证 UTF-8 输出兼容
- 必须具备基本日志能力;敏感字段脱敏 - 必须具备基本日志能力;敏感字段脱敏

View File

@@ -2,7 +2,7 @@
本文件说明 `assets/actions.json``scripts/main.py` CLI 的对应关系,供 **Agent 编排**与宿主 **Skill Action Runtime** 使用。这是 Agent 侧关于 Action / 任务中心的**主契约**;实现细节与开发规范见 [`../development/SKILL_ACTION_RUNTIME.md`](../development/SKILL_ACTION_RUNTIME.md)。 本文件说明 `assets/actions.json``scripts/main.py` CLI 的对应关系,供 **Agent 编排**与宿主 **Skill Action Runtime** 使用。这是 Agent 侧关于 Action / 任务中心的**主契约**;实现细节与开发规范见 [`../development/SKILL_ACTION_RUNTIME.md`](../development/SKILL_ACTION_RUNTIME.md)。
**边界:** 用户市场说明见根目录 [`README.md`](../README.md)CLI 参数见 [`CLI.md`](CLI.md)。 **边界:** 用户市场四 Tab 见根目录 [`README.md`](../README.md) / [`TUTORIAL.md`](../TUTORIAL.md) / [`DEMO.md`](../DEMO.md) / [`CHANGELOG.md`](../CHANGELOG.md)CLI 参数见 [`CLI.md`](CLI.md)。
## Agent 何时用 Action与 CLI 的分工) ## Agent 何时用 Action与 CLI 的分工)
@@ -18,6 +18,23 @@
禁止对长任务 `exec`/`bash` + `process poll` 干等 CLI。禁止 `uv run python` 跑技能脚本。 禁止对长任务 `exec`/`bash` + `process poll` 干等 CLI。禁止 `uv run python` 跑技能脚本。
## async 副作用 Action 最小组合(复制验收 checklist
对每个「会开浏览器 / 长耗时 / 需进度或取消」的 Action声明时建议同时满足
1. `executionProfile: "async"`(进入任务中心)
2. 若要让 Agent 触发:`placements` **含** `agent`
3. 有可感知副作用时:提供 `confirmation.message`
4. 需要用户/Agent 入参时:简单 `inputSchema` + entrypoint 中的 `{{fieldName}}`
5. `SKILL.md`「用户意图路由表」与 `CLI.md`「Action 强制黑名单」**出现同一 action id / 命令**
默认模板 `assets/actions.json` 仅含诊断类 sync Action**不要**为通过本 checklist 而塞假业务 Action业务技能按需添加。完整字段见下文 Phase 1。
## 可选:域前缀 CLI嵌套子命令
小技能可继续扁平:`entrypoint.command = "run"`
命令变多时,可采用**域前缀**`command` 为域(如 `<domain>`),业务动词与参数放在 `args` 数组(如 `["<verb>", "--flag", "{{field}}"]`)。与扁平入口等价,须仍指向同一 domain service。
## 模板严格规范 vs 宿主向后兼容 ## 模板严格规范 vs 宿主向后兼容
| 角色 | 定位 | | 角色 | 定位 |

View File

@@ -18,6 +18,17 @@ python {baseDir}/scripts/main.py <command> …
**禁止**对技能脚本使用 `uv run python …`(会创建临时环境,加载不到 `jiangchang-platform-kit` / `jiangchang_skill_core`)。 **禁止**对技能脚本使用 `uv run python …`(会创建临时环境,加载不到 `jiangchang-platform-kit` / `jiangchang_skill_core`)。
**禁止** Agent 自行 `pip install` / `uv pip install` 往临时环境塞依赖。 **禁止** Agent 自行 `pip install` / `uv pip install` 往临时环境塞依赖。
## Agent 分流(业务技能复制后必改)
用本表列出**本技能**哪些子命令可走短 CLI哪些必须走 Skill Action。默认短查询/只读写本地可用短 CLI长耗时 / RPA / 需进度取消进**黑名单**。有 async/RPA 的技能:**黑名单不得为空**,且黑名单命令须映射到 `actions.json` 中的 async Action。
| 类型 | 本技能命令(自填) | Agent |
|------|--------------------|-------|
| **短 CLI 白名单** | (例)`health` / `version` / `logs` / `<your-read-or-prep>` | 可用 bash/exec + 共享 `python` |
| **Action 强制黑名单** | (例)`<your-long-or-rpa-command>` | **禁止** bash + `process poll`;必须 `run_skill_action` |
细节与 Action 清单见 [`ACTIONS.md`](ACTIONS.md)。
## 最小命令 ## 最小命令
```bash ```bash

View File

@@ -5,13 +5,16 @@
**边界规则:** **边界规则:**
- 本文**不得**包含 YAML frontmatter**不得**包含 `description` 字段。 - 本文**不得**包含 YAML frontmatter**不得**包含 `description` 字段。
- 技能市场详情与普通用户说明**必须**放在根目录 [`README.md`](../README.md)。 - 技能市场四 Tab 材料**必须**放在根目录[`README.md`](../README.md)、[`TUTORIAL.md`](../TUTORIAL.md)、[`DEMO.md`](../DEMO.md)、[`CHANGELOG.md`](../CHANGELOG.md)
- **Agent 主读本目录**`CLI.md` / `ACTIONS.md` / `SCHEMA.md`)与根 [`SKILL.md`](../SKILL.md)。 - **Agent 主读本目录**`CLI.md` / `ACTIONS.md` / `SCHEMA.md`)与根 [`SKILL.md`](../SKILL.md)。
- [`../development/`](../development/) 是开发者 / 编码助手深度规范,**不是**对话 Agent 的默认读盘路径。 - [`../development/`](../development/) 是开发者 / 编码助手深度规范,**不是**对话 Agent 的默认读盘路径。
| 文档 | 用途 | | 文档 | 用途 |
|------|------| |------|------|
| 根目录 [`README.md`](../README.md) | 用户市场详情页说明 | | 根目录 [`README.md`](../README.md) | 市场说明 Tab`readme_md` |
| 根目录 [`TUTORIAL.md`](../TUTORIAL.md) | 市场教程 Tab`tutorial_md` |
| 根目录 [`DEMO.md`](../DEMO.md) | 市场演示 Tab`demo_video_url` + `demo_md` |
| 根目录 [`CHANGELOG.md`](../CHANGELOG.md) | 市场更新日志 Tab版本小节 → `changelog` |
| [`SKILL.md`](../SKILL.md) | LLM / OpenClaw 平台技能入口与触发摘要 | | [`SKILL.md`](../SKILL.md) | LLM / OpenClaw 平台技能入口与触发摘要 |
| [`CLI.md`](CLI.md) | 共享 Python、命令行入口、参数与短操作契约 | | [`CLI.md`](CLI.md) | 共享 Python、命令行入口、参数与短操作契约 |
| [`ACTIONS.md`](ACTIONS.md) | Skill Action、sync/async、任务中心、多入口可选能力 | | [`ACTIONS.md`](ACTIONS.md) | Skill Action、sync/async、任务中心、多入口可选能力 |

View File

@@ -1,6 +1,6 @@
"""技能标识、版本与平台公共库约束(复制后请修改 slug/version/logger""" """技能标识、版本与平台公共库约束(复制后请修改 slug/version/logger"""
SKILL_SLUG = "your-skill-slug" SKILL_SLUG = "your-skill-slug"
SKILL_VERSION = "1.0.44" SKILL_VERSION = "1.0.46"
LOG_LOGGER_NAME = "openclaw.skill.your_skill_slug" LOG_LOGGER_NAME = "openclaw.skill.your_skill_slug"
PLATFORM_KIT_MIN_VERSION = "1.2.0" PLATFORM_KIT_MIN_VERSION = "1.2.0"

View File

@@ -141,6 +141,47 @@ class TestDocsStandards(unittest.TestCase):
msg="SKILL.md must state README.md is user-facing documentation", msg="SKILL.md must state README.md is user-facing documentation",
) )
def test_market_tab_docs_exist(self) -> None:
root = get_skill_root()
for name in ("README.md", "TUTORIAL.md", "DEMO.md", "CHANGELOG.md"):
path = os.path.join(root, name)
self.assertTrue(os.path.isfile(path), msg=f"{name} must exist at skill root")
def test_demo_md_frontmatter_has_demo_video_url(self) -> None:
text = self._read("DEMO.md")
self.assertTrue(text.startswith("---"), "DEMO.md must start with YAML frontmatter")
frontmatter = self._parse_frontmatter(text)
self.assertIn(
"demo_video_url:",
frontmatter,
"DEMO.md frontmatter must include demo_video_url",
)
def test_changelog_has_section_for_skill_version(self) -> None:
skill_fm = self._parse_frontmatter(self._read("SKILL.md"))
match = re.search(r"(?m)^version:\s*[\"']?([0-9]+\.[0-9]+\.[0-9]+)", skill_fm)
self.assertIsNotNone(match, "SKILL.md must declare semver version")
version = match.group(1)
changelog = self._read("CHANGELOG.md")
self.assertRegex(
changelog,
rf"(?m)^##\s*\[?v?{re.escape(version)}\]?",
msg=f"CHANGELOG.md must include a ## section for version {version}",
)
def test_skill_md_documents_market_four_tabs(self) -> None:
text = self._read("SKILL.md")
for name in ("TUTORIAL.md", "DEMO.md", "CHANGELOG.md", "readme_md", "tutorial_md"):
self.assertIn(name, text, msg=f"SKILL.md must document market material {name}")
def test_development_md_documents_market_four_tabs(self) -> None:
text = self._read("development/DEVELOPMENT.md")
self.assertIn("TUTORIAL.md", text)
self.assertIn("DEMO.md", text)
self.assertIn("CHANGELOG.md", text)
self.assertIn("demo_video_url", text)
self.assertIn("tutorial_md", text)
def test_naming_md_exists_and_covers_standards(self) -> None: def test_naming_md_exists_and_covers_standards(self) -> None:
text = self._read("development/NAMING.md") text = self._read("development/NAMING.md")
self.assertIn("verb-noun-platform", text) self.assertIn("verb-noun-platform", text)
@@ -315,6 +356,12 @@ class TestDocsStandards(unittest.TestCase):
msg="CLI.md must not recommend uv run for skill scripts", msg="CLI.md must not recommend uv run for skill scripts",
) )
def test_cli_md_has_agent_routing_tables(self) -> None:
text = self._read("references/CLI.md")
self.assertIn("短 CLI 白名单", text)
self.assertIn("Action 强制黑名单", text)
self.assertIn("run_skill_action", text)
def test_skill_md_requires_shared_python_not_uv_run(self) -> None: def test_skill_md_requires_shared_python_not_uv_run(self) -> None:
text = self._read("SKILL.md") text = self._read("SKILL.md")
self.assertIn("python {baseDir}/scripts/main.py", text) self.assertIn("python {baseDir}/scripts/main.py", text)
@@ -328,6 +375,31 @@ class TestDocsStandards(unittest.TestCase):
msg="SKILL.md must state Task Center is independent of entry point", msg="SKILL.md must state Task Center is independent of entry point",
) )
def test_skill_md_has_intent_routing_table(self) -> None:
text = self._read("SKILL.md")
self.assertIn("用户意图路由表", text)
self.assertIn("用户意图", text)
self.assertIn("准备 vs 执行", text)
def test_skill_md_how_to_forbids_cli_paste(self) -> None:
text = self._read("SKILL.md")
self.assertIn("回答「怎么用", text)
self.assertIn("禁止", text)
self.assertTrue(
"粘贴" in text and "python" in text,
msg="SKILL.md must forbid pasting python CLI when answering how-to",
)
self.assertTrue(
"dir" in text or "" in text,
msg="SKILL.md must discourage directory probing for how-to answers",
)
def test_actions_md_has_async_side_effect_checklist(self) -> None:
text = self._read("references/ACTIONS.md")
self.assertIn("最小组合", text)
self.assertIn("confirmation.message", text)
self.assertIn("用户意图路由表", text)
def test_actions_md_states_profile_not_entry_for_task_center(self) -> None: def test_actions_md_states_profile_not_entry_for_task_center(self) -> None:
text = self._read("references/ACTIONS.md") text = self._read("references/ACTIONS.md")
self.assertIn("executionProfile", text) self.assertIn("executionProfile", text)