save_recipe
Captures workflow knowledge as a searchable recipe, storing usage steps and fixes in a recipes file for future reference.
Instructions
把一条用法/流程知识写入指定 root 的 recipes 文件 (add-workflow-knowledge-capture,write,bridge-local 不连接 Houdini)。
触发时机(advisory):用户完成工作流后说"沉淀这些知识"时,agent 先用
get_selection 定位,再调 capture_workflow_snapshot 取快照;用法/流程
文档("怎么用这个 HDA""这个网络怎么搭")走本工具 save_recipe(写入即被
search_lessons 检索,无 draft 门槛),错误经验走 save_lesson(draft
门槛 + 指纹累积)。本工具是 advisory,不替代 verify_hou_api /
get_houdini_help / get_best_practices,也不替代目标 Houdini 版本的
live verification。
参数说明:
- title / problem / symptom / fix / category / severity /
affected_versions: 必填;title 渲染为块上方 ``> title`` 注释行。
- severity: 必填,recipes severity 合法取值 low / medium / high
(3 值,与 lesson 的 4 值不同)。
- verified_versions: 可选;缺省 "unknown"。
- recipe_id: 可选;引用**既有** ``### BP-NNN`` 块 id(格式
``BP-\d{3}``,非自定义新 id)。提供时**原地替换**该块 9 字段、
不新增块(首块 ``> title`` 行同步更新),响应 action=updated;
未提供时维持自增追加,响应 action=created。
- root: 可选 root 名;缺省 personal(唯一默认可写 root)。
返回:{status:success, recipe_id, root, severity, source,
immediately_searchable:true, action:created|updated};recipe_id 为
BP-NNN 自动生成(扫描既有块最大序号 + 1),**不接受自定义 id**;团队
root 写入 source 自动附 ``@<用户名>``(系统标注)。错误为 status=error
+ error={code,message,details}(非法 severity → ls_write_error 并列出
合法值;recipe_id 格式非法 → ls_write_error;引用不存在的 id →
ls_recipe_not_found 且 message 附既有 id 列表;只读团队 root →
root_not_writable;未知/不可用 root → ls_unknown_root)。整体过
apply_response_cap。
方法论沉淀协议(advisory,非强制):
- 沉淀内容是工作流的**原理 / 设计意图 / 方法论**(为什么这么搭),
不是节点名与参数的复制粘贴;参数仅在用户要求或直接影响复现时收录。
- 正文索引用资产级标识(capture_workflow_snapshot 的 type_full / hda
资产全名 + 版本),实例名仅辅助。
- **禁止本机路径入正文**:不写 HDA 库路径 / hip 完整路径(团队知识库
跨机器误导源)。
- 改造 / 加深既有知识时先 search_lessons 定位既有 id,再传 recipe_id
**原地更新**,**不得新增一条重复知识**。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ctx | Yes | ||
| fix | Yes | ||
| root | No | ||
| title | Yes | ||
| problem | Yes | ||
| symptom | Yes | ||
| category | Yes | ||
| severity | Yes | ||
| recipe_id | No | ||
| affected_versions | Yes | ||
| verified_versions | No |