iter(g148): MCP 暴露组合配方检索

新增 list_recipes / get_recipe 两个工具,配方解析统一走 recipes.md。
顺带把误嵌在 renderAgentDocs 内部的 loadRecipes 提到顶层,
并给 verify 加配方结构校验:编号连续、代码骨架、要点、通用约定段。
This commit is contained in:
HIsheR
2026-10-26 15:48:21 +08:00
parent 38284ac425
commit 4a655d2dea
7 changed files with 90 additions and 18 deletions
+8
View File
@@ -1540,6 +1540,14 @@
"acceptance": "recipes.md 补配方 7-9(筛选栏、评论输入、详情页排版),只消费对外 API,随 npm run docs 进入 llms-full.txt;npm run check 全绿",
"notes": "自补:Agent 文档完善",
"status": "done"
},
{
"id": "g148",
"title": "MCP 暴露组合配方检索(list_recipes / get_recipe)",
"motivation": "recipes.md 已有 9 条跨组件配方,但只写在文档里:Agent 通过 MCP 只能查单组件参数,拿不到「怎么拼」,容易各自造轮子或漏掉约定。",
"acceptance": "ua mcp 新增 list_recipes(id/title/components)与 get_recipe(骨架代码 + 要点 + 用到的组件)两个工具;配方解析复用 recipes.md 单一来源;verify 增加配方结构校验(编号连续、每条有代码块与要点、有通用约定段);AGENTS/README/CLI 清单文档同步。",
"notes": "",
"status": "open"
}
]
}
+2 -3
View File
@@ -1,6 +1,6 @@
{
"$schema": "ui-arch-registry-index/0.1",
"generatedAt": "2026-10-26T07:43:07.847Z",
"generatedAt": "2026-10-26T07:47:10.174Z",
"repoRoot": ".",
"packages": [
{
@@ -3586,8 +3586,7 @@
"查组件:ua list 看全量,ua info <组件id> 看 props/步骤/示例(ua info <包名> 看单包 api 与约定,加 --json 出原始清单)",
"查令牌:ua tokens 打印全部 --ua-* 变量(颜色带暗色值),--json 输出结构化数组;写样式前先查,禁止硬编码",
"改完清单跑 npm run docs:同时刷新人类文档站与 llms-full.txt(Agent 首选喂料)",
"在 ~/.workbuddy/mcp.json 注册 ua mcp 后,Agent 可直接调 list_components / get_component / search_components / get_tokens",
"在 ~/.workbuddy/mcp.json 注册 ua mcp 后,Agent 可直接调 list_components / get_component / search_components"
"在 ~/.workbuddy/mcp.json 注册 ua mcp 后,Agent 可直接调 list_components / get_component / search_components / get_tokens / list_recipes / get_recipe"
],
"components": []
},