From a3ece117c7d3da34b4ebda219910057025f45232 Mon Sep 17 00:00:00 2001 From: HIsheR Date: Mon, 26 Oct 2026 15:55:13 +0800 Subject: [PATCH] =?UTF-8?q?iter(g155):=20llms.txt=20=E8=A1=A5=E9=85=8D?= =?UTF-8?q?=E6=96=B9=E7=9B=AE=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 速览末尾输出 9 条配方的 id / 标题 / 要点数与三种取法,Agent 不必先猜。 顺带修正 cli 清单里只写了 3 个 MCP 工具的过期描述。 --- .ua/backlog.json | 8 ++++++++ .ua/index.json | 4 ++-- llms-full.txt | 4 ++-- llms.txt | 16 +++++++++++++++- packages/tools/cli/bin/ua.js | 7 +++++++ packages/tools/cli/ua.manifest.json | 2 +- 6 files changed, 35 insertions(+), 6 deletions(-) diff --git a/.ua/backlog.json b/.ua/backlog.json index 061bd25..e9f7170 100644 --- a/.ua/backlog.json +++ b/.ua/backlog.json @@ -1596,6 +1596,14 @@ "acceptance": "返回 { packages, components } 两级结构,components 按 id/标题/props 名命中并带 package 字段;空 query 与无命中都抛明确错误;工具描述同步。", "notes": "", "status": "done" + }, + { + "id": "g155", + "title": "llms.txt 补配方目录 + 修正 MCP 工具清单描述", + "motivation": "Agent 常只读 llms.txt 速览,但速览里完全没有配方入口;同时 cli 包导出描述里只写了 3 个 MCP 工具,与实际的 6 个不符。", + "acceptance": "ua index 在 llms.txt 末尾输出配方目录(id / 标题 / 要点数)并指明三种取法;cli 清单的 mcp 导出描述与 MCP_TOOL_NAMES 一致。", + "notes": "", + "status": "open" } ] } diff --git a/.ua/index.json b/.ua/index.json index 3eebe3d..9eb0771 100644 --- a/.ua/index.json +++ b/.ua/index.json @@ -1,6 +1,6 @@ { "$schema": "ui-arch-registry-index/0.1", - "generatedAt": "2026-10-26T07:49:34.129Z", + "generatedAt": "2026-10-26T07:54:36.201Z", "repoRoot": ".", "packages": [ { @@ -3566,7 +3566,7 @@ "ua style:注释规范门禁(导出必须 /*** ***/、接口字段行尾注释、行注释中文),违规退出码 1", "ua verify:清单一致性门禁(id 唯一 / exports 对应 / props 必带 n t d / steps≥3 / demo 锚点存在)", "ua commit-lint <文件|message>:提交信息门禁(type 枚举 / scope 规则 / subject 中文祈使 ≤50 字符),规范见 COMMITTING.md,违规退出码 1", - "ua mcp:零依赖 stdio MCP server,暴露 list_components / get_component / search_components" + "ua mcp:零依赖 stdio MCP server,暴露 list_components / get_component / search_components / get_tokens / list_recipes / get_recipe" ], "keyTypes": [ "ua.manifest.json 清单结构", diff --git a/llms-full.txt b/llms-full.txt index e4f09bd..cee94bb 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -1,6 +1,6 @@ # @ui-arch 组件库 Agent 文档(无图形版) -> 自动生成于 2026-10-26T07:49:34.129Z,数据源:各包 ua.manifest.json,勿手改。人类版文档站:apps/docs/index.html。 +> 自动生成于 2026-10-26T07:54:36.201Z,数据源:各包 ua.manifest.json,勿手改。人类版文档站:apps/docs/index.html。 > 组件 = 普通函数,传 props 返回 DOM;状态用 signal 双向绑定:读 signal() 写 signal(v)。 ## 快速上手 @@ -2057,7 +2057,7 @@ API 速览: - ua style:注释规范门禁(导出必须 /*** ***/、接口字段行尾注释、行注释中文),违规退出码 1 - ua verify:清单一致性门禁(id 唯一 / exports 对应 / props 必带 n t d / steps≥3 / demo 锚点存在) - ua commit-lint <文件|message>:提交信息门禁(type 枚举 / scope 规则 / subject 中文祈使 ≤50 字符),规范见 COMMITTING.md,违规退出码 1 -- ua mcp:零依赖 stdio MCP server,暴露 list_components / get_component / search_components +- ua mcp:零依赖 stdio MCP server,暴露 list_components / get_component / search_components / get_tokens / list_recipes / get_recipe 一行用法: diff --git a/llms.txt b/llms.txt index 575c3fe..61ef067 100644 --- a/llms.txt +++ b/llms.txt @@ -134,8 +134,22 @@ - ua style:注释规范门禁(导出必须 /*** ***/、接口字段行尾注释、行注释中文),违规退出码 1 - ua verify:清单一致性门禁(id 唯一 / exports 对应 / props 必带 n t d / steps≥3 / demo 锚点存在) - ua commit-lint <文件|message>:提交信息门禁(type 枚举 / scope 规则 / subject 中文祈使 ≤50 字符),规范见 COMMITTING.md,违规退出码 1 - - ua mcp:零依赖 stdio MCP server,暴露 list_components / get_component / search_components + - ua mcp:零依赖 stdio MCP server,暴露 list_components / get_component / search_components / get_tokens / list_recipes / get_recipe - 用法: `node packages/tools/cli/bin/ua.js |docs|tokens|style|verify|commit-lint|mcp>;仓库内等价于 npm run index / docs / style / verify` - 约定: 零依赖:只用 node 标准库,Node >= 18 - 约定: 清单是单一来源:代码注释、文档站、llms-full.txt、MCP 全部从 ua.manifest.json 派生 - 约定: 门禁只增不改:新增校验必须能被人手复现,报错要指出文件与字段 + +## 组合配方(跨组件拼装) + +> 全文见 `packages/tools/cli/recipes.md` 或 llms-full.txt;MCP 用 `list_recipes` / `get_recipe` 取骨架与要点。 + +- 配方 1:表单校验 + 提交反馈(2 条要点) +- 配方 2:危险操作二次确认(2 条要点) +- 配方 3:表格筛选 + 分页 + 批量操作(3 条要点) +- 配方 4:长列表数据加载与空态(2 条要点) +- 配方 5:数据表 + 独立分页器 + 导出(4 条要点) +- 配方 6:长表单编辑页(吸底操作条 + 提交锁定)(4 条要点) +- 配方 7:筛选栏(层级归属 + 日期区间)(3 条要点) +- 配方 8:评论输入(@ 提及 + 参与人头像组)(3 条要点) +- 配方 9:详情页排版(栅格 + 排版文本 + 描述列表)(3 条要点) diff --git a/packages/tools/cli/bin/ua.js b/packages/tools/cli/bin/ua.js index b39e6dc..771a9e7 100644 --- a/packages/tools/cli/bin/ua.js +++ b/packages/tools/cli/bin/ua.js @@ -101,6 +101,13 @@ function cmdIndex() { for (const c of p.conventions ?? []) lines.push(`- 约定: ${c}`); lines.push(''); } + const recipes = parseRecipes(); // 速览也要给出配方目录:Agent 读 llms.txt 时才知道有跨组件拼装可查 + if (recipes.length) { + lines.push('## 组合配方(跨组件拼装)', ''); + lines.push('> 全文见 `packages/tools/cli/recipes.md` 或 llms-full.txt;MCP 用 `list_recipes` / `get_recipe` 取骨架与要点。', ''); + for (const r of recipes) lines.push(`- 配方 ${r.id}:${r.title}(${r.notes.length} 条要点)`); + lines.push(''); + } writeIfChanged(LLMS_FILE, lines.join('\n')); console.log(`indexed ${packages.length} package(s) -> .ua/index.json, llms.txt${changed ? '' : ' (unchanged, skip)'}`); } diff --git a/packages/tools/cli/ua.manifest.json b/packages/tools/cli/ua.manifest.json index 2d5c06a..399242d 100644 --- a/packages/tools/cli/ua.manifest.json +++ b/packages/tools/cli/ua.manifest.json @@ -19,7 +19,7 @@ "ua style:注释规范门禁(导出必须 /*** ***/、接口字段行尾注释、行注释中文),违规退出码 1", "ua verify:清单一致性门禁(id 唯一 / exports 对应 / props 必带 n t d / steps≥3 / demo 锚点存在)", "ua commit-lint <文件|message>:提交信息门禁(type 枚举 / scope 规则 / subject 中文祈使 ≤50 字符),规范见 COMMITTING.md,违规退出码 1", - "ua mcp:零依赖 stdio MCP server,暴露 list_components / get_component / search_components" + "ua mcp:零依赖 stdio MCP server,暴露 list_components / get_component / search_components / get_tokens / list_recipes / get_recipe" ], "keyTypes": [ "ua.manifest.json 清单结构",