Codify Skill Action sync/async and task-center gold standards (v1.0.40)
All checks were successful
技能自动化发布 / release (push) Successful in 7s

This commit is contained in:
2026-07-14 07:55:55 +08:00
parent 2e5a8d5eed
commit a7baba7210
13 changed files with 412 additions and 23 deletions

View File

@@ -525,9 +525,11 @@ metadata:
若技能需要出现在宿主**数据管理按钮**、**技能详情**、**定时任务**或 **Agent 直接调用**中,提供 `assets/actions.json`。
- 契约说明见 [`references/ACTIONS.md`](../references/ACTIONS.md)
- **运行时金标准**见 [`SKILL_ACTION_RUNTIME.md`](SKILL_ACTION_RUNTIME.md)sync/async、任务中心、Agent 禁令)
- 字段契约见 [`references/ACTIONS.md`](../references/ACTIONS.md)
- JSON Schema 见 [`assets/schemas/skill-actions.schema.json`](../assets/schemas/skill-actions.schema.json)
- 模板最小示例仅暴露 `health` / `version` / `config-path` 三个 CLI 子命令
- 模板最小示例仅暴露 `health` / `version` / `config-path`(均显式 `executionProfile: "sync"`
- 含浏览器 RPA / 长耗时的业务技能:**必须**增加至少一条 `"executionProfile": "async"` 且 `placements` 含 `agent` 的 action`POLICY-SKILL-ACTION-001`
- 没有宿主直接操作需求时,**可以删除** `actions.json`;删除后勿保留失效引用
- 复制为新技能后scaffold 会自动将 `your-skill-slug` 与 `your_skill_slug` 替换为新 slug后者用于 `LOG_LOGGER_NAME` 等下划线形式action 业务命令由技能作者自行调整
@@ -539,6 +541,25 @@ python {skillRoot}/scripts/main.py <command> <args...>
CLI 必须提供稳定退出码、结构化成功输出,以及 `ERROR:<CODE>:` / `HINT:` 错误契约(详见 `references/ACTIONS.md`)。
### 编排范式:单内核 + 多入口
长任务 / RPA 技能推荐拆分(勿把 `job_context` 塞进纯业务内核):
```text
execute_single_<biz>(...) # 鉴权 + 业务 + task_log无 job_context
cmd_run(...) # 单条job_context + execute_single + finish
cmd_run_pick(N, ...) # 批量顺序job_context + for-loop + emit(progress) + finish(partial|success|failed)
cmd_stats() # 只读 syncJSON无 job_context
```
- 批量数量用 **`pickCount` / `--pick N` 参数**(任意正整数),不写死条数。
- **顺序执行、不并发**同一浏览器 Profile / account lease。
- 详情见 [`SKILL_ACTION_RUNTIME.md`](SKILL_ACTION_RUNTIME.md) §5§6。
### 队列 + pick可选
有「待处理列表」时:队列表 `pending → processing → success/failed`;数据管理录入或 `import-*` 入库;`run --pick N` 消费;失败用 `reset` 回 `pending`不自动重试。Manifest 上配置 `*-run-pick`asynctoolbar/cron/agent
## 12. 如何接兄弟技能
如果 skill 要依赖兄弟 skill不要在业务代码里写死绝对路径。