universal-dev-standards 6.14.0-beta.7 → 6.14.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/locales/zh-CN/CHANGELOG.md +30 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/SECURITY.md +1 -1
- package/bundled/locales/zh-TW/CHANGELOG.md +30 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/SECURITY.md +1 -1
- package/package.json +1 -1
- package/src/commands/hitl.js +3 -0
- package/src/commands/list.js +12 -3
- package/src/commands/mcp.js +2 -3
- package/src/commands/quickstart.js +29 -13
- package/src/commands/release.js +41 -17
- package/src/commands/spec-split.js +28 -16
- package/src/commands/spec.js +34 -13
- package/src/commands/uninstall.js +2 -2
- package/src/hitl/manager.js +4 -2
- package/src/i18n/messages.js +3 -3
- package/src/mcp/__tests__/server.test.js +0 -1
- package/src/mcp/server.js +16 -4
- package/src/uninstallers/skills-uninstaller.js +83 -16
- package/src/uninstallers/standards-uninstaller.js +56 -7
- package/src/utils/agents-installer.js +10 -17
- package/src/utils/prompt-closed.js +18 -0
- package/standards-registry.json +32 -7
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../CHANGELOG.md
|
|
3
|
-
source_version: 6.14.0-beta.
|
|
4
|
-
translation_version: 6.14.0-beta.
|
|
5
|
-
last_synced: 2026-10-
|
|
3
|
+
source_version: 6.14.0-beta.8
|
|
4
|
+
translation_version: 6.14.0-beta.8
|
|
5
|
+
last_synced: 2026-10-09
|
|
6
6
|
status: current
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -17,6 +17,33 @@ status: current
|
|
|
17
17
|
|
|
18
18
|
## [Unreleased]
|
|
19
19
|
|
|
20
|
+
## [6.14.0-beta.8] - 2026-10-10
|
|
21
|
+
|
|
22
|
+
> **测试版**——以 `npm install -g universal-dev-standards@beta` 安装。要测什么、如何退回正式版:[docs/PRE-RELEASE.md](../../docs/PRE-RELEASE.md)。
|
|
23
|
+
>
|
|
24
|
+
> **行为改变:**`uds hitl check` 无人可答时拒绝(结束码 1);`uds release verify` 失败以 1、无法验证以 2 结束;`uds release promote` 不再为没做的事印「✓」;移除 `uds mcp serve --root`;没有终端机时 `uds spec delete/split` 以 2、`uds spec create` 以 0 结束;`uds uninstall` 只移除 UDS 写的、你没改过的文件。
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- **CI:uds CLI 的每个命令、子命令与选项都要有验收步骤,而且步骤必须读回效果,不能只看退出码(XSPEC-471 R2、R3)。** `node scripts/beta-acceptance/check-cli-coverage.mjs`(CI 工作「Beta Acceptance Coverage」)加载真正的 `cli/bin/uds.js`,记录它建出的 commander 程序(含隐藏命令、隐藏选项与别名;不读帮助文本),当 `scripts/beta-acceptance/steps.json` 的任何步骤都没用到某个命令、子命令或选项时,逐一列名并使 CI 变红,并打印已用、豁免与缺少各几个。要豁免只能在 `exemptions` 加 `{"command": ...}` 或 `{"option": ...}`,并附至少 20 字符的理由;空白或单字理由等于没有豁免。加入这项检查时已存在的缺口(31 个命令与子命令、115 个选项)列在 `scripts/beta-acceptance/coverage-baseline.json`,这份文件只能减少:不在其中的缺口会红,已被步骤用到的条目若没移除也会红(`--shrink-baseline`),所以文件不会腐烂;`--baseline-not-larger-than <ref>` 会让新增条目的变更变红。`check-steps.mjs` 现在也会指名 `expect` 只有退出码的步骤(含人工步骤;`{"step": ..., "reason": ...}` 可豁免一个步骤)。**未验证**:CI 接线只由 YAML 解析器与测试读过,尚未由 GitHub 实际执行。
|
|
29
|
+
- **CI:`scripts/bump-version.mjs` 遇到不带预览标记的版本号,除非它最近一个预览版已在三个平台验收通过,否则拒绝(XSPEC-471 R5)。** 在改动任何文件之前,它先确认:`scripts/beta-acceptance/reports/<预览版>/` 有 Windows、macOS、Linux 三个平台、来自已发布包的报告(用 `--local-bin`、`--source` 或注入的安装器做出的报告不算;同一平台从多种 shell 跑过时,每一种都要看,取最差的),其中没有任何自动步骤失败,`check-cli-coverage.mjs` 与 `check-steps.mjs` 为绿、`coverage-baseline.json` 为空,当前 `steps.json` 的每一步都在这些报告里(预览版发布之后新增的步骤需要更新的预览版),而且 `steps.json` 没有任何豁免写明功能“已知坏掉”(R4 的写法 "known broken",`已知壞掉` 也会读)。缺的东西会在一次拒绝中全部列出,退出码为 1。没人确认的人工步骤会列出,但不挡。预览版本号不检查。这道关卡没有跳过的开关,连 `SKIP_BUNDLE_PARITY` 也管不到:补丁版先以预览版发出,发版后的验收会自动跑。规则在 `scripts/beta-acceptance/lib/stable-gate.mjs`。
|
|
30
|
+
|
|
31
|
+
### 变更
|
|
32
|
+
|
|
33
|
+
- **行为变更——`uds release verify` 验证失败时改以退出码 1 结束,无法验证时以 2 结束(XSPEC-471 R4)。** 它打印“Manifest 驗證失敗”后仍以 0 结束,把验证当作发布关卡的脚本或 CI 步骤会把每一次失败都读成通过。退出码 0 表示 manifest 验证通过;1 表示 commit 或 artifact 的 checksum 与 manifest 的记录不符;2 表示根本无法验证:没有 `build-manifest.json`、文件不是合法 JSON、`--artifact` 指的文件不存在,或发布模式(`ci-cd`)没有 `verify`。分法与 `uds hitl check` 相同(1=答案是否,2=没有答案)。缺少 staging 结果仍只是警告,不改变退出码。若有脚本一直假设 `uds release verify` 必回 0,请处理 1 与 2。
|
|
34
|
+
- **`uds release promote <版本>` 不再为它没做的事打印“✓ 晉升紀錄建立”与“✓ Git tag”(XSPEC-471 R4)。** 这个命令不写晋升记录、也不建 tag,只打印文字;相信那些勾号的人可能把一个从未打过 tag 的版本拿去部署。现在它明说“這個指令不會建立晉升紀錄,也不會建立 Git tag”,并列出要你自己执行的下一步,包含 `git tag v<版本>`。没有新增任何行为:它仍然什么都不写、什么 tag 都不建。
|
|
35
|
+
- **行为变更——移除 `uds mcp serve` 的 `--root <path>` 选项(XSPEC-471 R4)。** 它被接受并存起来,但没有任何程序读它,所以 `--root /elsewhere` 不改变任何回答,却看起来像在指定标准从哪里来。服务器照旧从已安装的包读 UDS 随附的文件。`uds mcp serve --root <path>` 现在会以 `error: unknown option '--root'` 与退出码 1 停下;请从任何传入它的 MCP 客户端配置中移除这个选项。
|
|
36
|
+
|
|
37
|
+
### 修复
|
|
38
|
+
|
|
39
|
+
- **`uds mcp serve`:`get_design_standards` 与 `get_design_token` 的 DESIGN.md 模板后备,在每一种安装方式下都返回 ENOENT(XSPEC-471 R4)。** 服务器去“`cli/src/mcp/` 往上四层”找 UDS 随附的文件,那个位置在仓库之外,已安装的包也一样在包之外。现在改找包的 `bundled/` 文件夹,在源码检出时则找 `cli/` 的上一层。服务器的单元测试把文件系统换掉了,所以从没发现;新增的端到端测试会启动真正的 `uds mcp serve` 并读回响应。
|
|
40
|
+
- **`uds release deploy <env>` 在“`release-config.yaml` 是 UDS 自己生成”的项目里,拒绝每一个环境(XSPEC-471 R4)。** `uds init` 与 `uds config` 把 `release.environments` 写成对象(`- name: staging`),检查却拿用户输入的名称去比这些对象,于是说“未知的环境”并列出 `[object Object]`。现在对象形式与纯名称都能读懂。
|
|
41
|
+
- **`uds agent list` 与 `uds agent info` 显示空白的说明,也没有专长、工具、技能(XSPEC-471 R4)。** 代理文件是 YAML(`description: |`、列表),读取程序一次只看一行 `key: value`,把说明看成 `|`。现在 front matter 以 YAML 解析。
|
|
42
|
+
- **行为变更——`uds hitl check` 在无法询问时不再以退出码 0 结束(XSPEC-471 R4)。** 没有终端可回答、也没有 `CI` 变量时,高风险的 `--op` 会打开一个永远等不到回答的提示,打印堆栈跟踪后以 0 结束,脚本会把它当成“已批准”。现在打印“Blocked (Safety First)”与“Denied”并以 1 结束,与 CI 下相同。`uds hitl check` 没给 `--op` 时以 2 结束(原本是 0)。
|
|
43
|
+
- **`uds list` 只显示它所计算的 163 个标准中的 81 个,而且拒绝 `--category core`(编写 XSPEC-471 R4 验收步骤时发现)。** “Total”行计入注册表中的每一个标准,但列表只走固定的五个分类,所以 `core`、`testing`、`security`、`deployment`、`operations` 这五个分类里的 82 个标准被计入却从未显示,`uds list --category core` 还回答“Unknown category”。现在列表会显示注册表里有标准的每一个分类,每个分类各有标题与数量,标题上的数字加起来等于 Total;这五个分类已声明在 `cli/standards-registry.json`(并注明它们不由 `uds init` 安装,要用 `uds update --apply --add-standard` 按编号加入),日后注册表新增的分类会以它自己的名称列出,不会再被丢掉。“有效分类”提示现在列出全部十个。标题与 Total 不一致时 `npm test` 会失败。
|
|
44
|
+
- **`uds quickstart`、`uds spec create`、`uds spec delete`、`uds spec split` 在没有任何东西能回答它们的问题时,以 Node 堆栈跟踪结束,且退出码为 0(编写 XSPEC-471 R4 验收步骤时发现)。** 在没有终端的环境(AI 助手、CI、管道)运行时,它们画出问题后就死在 `ExitPromptError`,整次运行看起来像成功。`uds update` 与 `uds uninstall` 早先已用同样方式修复。现在:`uds quickstart` 打印四个流程与各自的命令(这份指南本来的工作就是列出命令);没给 `--yes` 的 `uds spec create` 把已写好的规格留作草稿并说明如何确认(退出码 0);没给 `--yes` 的 `uds spec delete` 什么都不删、说明要加 `--yes` 重跑,并以 2 结束(原为 0);`uds spec split` 什么都不改、说明要在终端运行,并以 2 结束(原为 0)。有终端时行为不变。
|
|
45
|
+
- **验收步骤 `init-locale-pack-missing-is-said` 在任何跑过 `prepack` 的 checkout 上,用 `run.mjs --local-bin cli/bin/uds.js` 会失败(XSPEC-471 R5)。** 它以 `cli/bundled/` 是否存在来区分已发布包与源码 checkout,但源码 checkout 在 `prepack` 之后也有那个文件夹,于是“缺少 zh-TW 技能文本”的副本被建在仓库根目录,`skills-installer.js` 照样在那里找到 `locales/zh-TW`,装了中文技能。现在步骤改问 `locales/zh-TW` 是否在 `cli/` 旁边。已发布的包从未受影响,`uds init` 也没有。
|
|
46
|
+
|
|
20
47
|
## [6.14.0-beta.7] - 2026-10-08
|
|
21
48
|
|
|
22
49
|
> **测试版**——以 `npm install -g universal-dev-standards@beta` 安装。要测什么、如何退回正式版:[docs/PRE-RELEASE.md](../../docs/PRE-RELEASE.md)。
|
|
@@ -15,7 +15,7 @@ status: current
|
|
|
15
15
|
|
|
16
16
|
> **语言**: [English](../../README.md) | [繁體中文](../zh-TW/README.md) | 简体中文
|
|
17
17
|
|
|
18
|
-
**版本**: 6.14.0-beta.
|
|
18
|
+
**版本**: 6.14.0-beta.8 (Pre-release) | **发布日期**: 2026-10-07 | **授权**: [双重授权](../../LICENSE) (CC BY 4.0 + MIT)
|
|
19
19
|
|
|
20
20
|
语言无关、框架无关的软件项目文档标准。通过 AI 原生工作流,确保不同技术栈之间的一致性、质量和可维护性。
|
|
21
21
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../CHANGELOG.md
|
|
3
|
-
source_version: 6.14.0-beta.
|
|
4
|
-
translation_version: 6.14.0-beta.
|
|
5
|
-
last_synced: 2026-10-
|
|
3
|
+
source_version: 6.14.0-beta.8
|
|
4
|
+
translation_version: 6.14.0-beta.8
|
|
5
|
+
last_synced: 2026-10-09
|
|
6
6
|
status: current
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -17,6 +17,33 @@ status: current
|
|
|
17
17
|
|
|
18
18
|
## [Unreleased]
|
|
19
19
|
|
|
20
|
+
## [6.14.0-beta.8] - 2026-10-10
|
|
21
|
+
|
|
22
|
+
> **測試版**——以 `npm install -g universal-dev-standards@beta` 安裝。要測什麼、如何退回正式版:[docs/PRE-RELEASE.md](../../docs/PRE-RELEASE.md)。
|
|
23
|
+
>
|
|
24
|
+
> **行為改變:**`uds hitl check` 無人可答時拒絕(結束碼 1);`uds release verify` 失敗以 1、無法驗證以 2 結束;`uds release promote` 不再為沒做的事印「✓」;移除 `uds mcp serve --root`;沒有終端機時 `uds spec delete/split` 以 2、`uds spec create` 以 0 結束;`uds uninstall` 只移除 UDS 寫的、你沒改過的檔。
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- **CI:uds CLI 的每個指令、子指令與選項都要有驗收步驟,而且步驟必須讀回效果,不能只看結束碼(XSPEC-471 R2、R3)。** `node scripts/beta-acceptance/check-cli-coverage.mjs`(CI 工作「Beta Acceptance Coverage」)載入真正的 `cli/bin/uds.js`,記錄它建出的 commander 程式(含隱藏指令、隱藏選項與別名;不讀說明文字),當 `scripts/beta-acceptance/steps.json` 的任何步驟都沒用到某個指令、子指令或選項時,逐一列名並使 CI 變紅,並印出已用、豁免與缺少各幾個。要豁免只能在 `exemptions` 加 `{"command": ...}` 或 `{"option": ...}`,並附至少 20 字元的理由;空白或單字理由等於沒有豁免。加入這項檢查時已存在的缺口(31 個指令與子指令、115 個選項)列在 `scripts/beta-acceptance/coverage-baseline.json`,這份檔案只能減少:不在其中的缺口會紅,已被步驟用到的項目若沒移除也會紅(`--shrink-baseline`),所以檔案不會腐爛;`--baseline-not-larger-than <ref>` 會讓新增項目的變更變紅。`check-steps.mjs` 現在也會指名 `expect` 只有結束碼的步驟(含人工步驟;`{"step": ..., "reason": ...}` 可豁免一個步驟)。**未驗證**:CI 接線只由 YAML 解析器與測試讀過,尚未由 GitHub 實際執行。
|
|
29
|
+
- **CI:`scripts/bump-version.mjs` 遇到不帶預覽標記的版號,除非它最近一個預覽版已在三個平台驗收通過,否則拒絕(XSPEC-471 R5)。** 在改動任何檔案之前,它先確認:`scripts/beta-acceptance/reports/<預覽版>/` 有 Windows、macOS、Linux 三個平台、來自已發布套件的報告(用 `--local-bin`、`--source` 或注入的安裝器做出的報告不算;同一平台從多種殼層跑過時,每一種都要看,取最差的),其中沒有任何自動步驟失敗,`check-cli-coverage.mjs` 與 `check-steps.mjs` 為綠、`coverage-baseline.json` 為空,目前 `steps.json` 的每一步都在這些報告裡(預覽版發布之後新增的步驟需要更新的預覽版),而且 `steps.json` 沒有任何豁免寫明功能「已知壞掉」(R4 的寫法 "known broken",`已知壞掉` 也會讀)。缺的東西會在一次拒絕中全部列出,結束碼為 1。沒人確認的人工步驟會列出,但不擋。預覽版號不檢查。這道關卡沒有跳過的開關,連 `SKIP_BUNDLE_PARITY` 也管不到:修補版先以預覽版發出,發版後的驗收會自動跑。規則在 `scripts/beta-acceptance/lib/stable-gate.mjs`。
|
|
30
|
+
|
|
31
|
+
### 變更
|
|
32
|
+
|
|
33
|
+
- **行為變更——`uds release verify` 驗證失敗時改以結束碼 1 結束,無法驗證時以 2 結束(XSPEC-471 R4)。** 它印出「Manifest 驗證失敗」後仍以 0 結束,把驗證當作發布關卡的腳本或 CI 步驟會把每一次失敗都讀成通過。結束碼 0 表示 manifest 驗證通過;1 表示 commit 或 artifact 的 checksum 與 manifest 的紀錄不符;2 表示根本無法驗證:沒有 `build-manifest.json`、檔案不是合法 JSON、`--artifact` 指的檔案不存在,或發布模式(`ci-cd`)沒有 `verify`。分法與 `uds hitl check` 相同(1=答案是否,2=沒有答案)。缺少 staging 結果仍只是警告,不改變結束碼。若有腳本一直假設 `uds release verify` 必回 0,請處理 1 與 2。
|
|
34
|
+
- **`uds release promote <版本>` 不再為它沒做的事印出「✓ 晉升紀錄建立」與「✓ Git tag」(XSPEC-471 R4)。** 這個指令不寫晉升紀錄、也不建 tag,只印出文字;相信那些勾號的人可能把一個從未打過 tag 的版本拿去部署。現在它明說「這個指令不會建立晉升紀錄,也不會建立 Git tag」,並列出要你自己執行的下一步,包含 `git tag v<版本>`。沒有新增任何行為:它仍然什麼都不寫、什麼 tag 都不建。
|
|
35
|
+
- **行為變更——移除 `uds mcp serve` 的 `--root <path>` 選項(XSPEC-471 R4)。** 它被接受並存起來,但沒有任何程式讀它,所以 `--root /elsewhere` 不改變任何回答,卻看起來像在指定標準從哪裡來。伺服器照舊從已安裝的套件讀 UDS 隨附的檔案。`uds mcp serve --root <path>` 現在會以 `error: unknown option '--root'` 與結束碼 1 停下;請從任何傳入它的 MCP 用戶端設定中移除這個選項。
|
|
36
|
+
|
|
37
|
+
### 修正
|
|
38
|
+
|
|
39
|
+
- **`uds mcp serve`:`get_design_standards` 與 `get_design_token` 的 DESIGN.md 範本後備,在每一種安裝方式下都回 ENOENT(XSPEC-471 R4)。** 伺服器去「`cli/src/mcp/` 往上四層」找 UDS 隨附的檔案,那個位置在 repository 之外,已安裝的套件也一樣在套件之外。現在改找套件的 `bundled/` 資料夾,在原始碼檢出時則找 `cli/` 的上一層。伺服器的單元測試把檔案系統換掉了,所以從沒看到;新增的端對端測試會啟動真正的 `uds mcp serve` 並讀回回應。
|
|
40
|
+
- **`uds release deploy <env>` 在「`release-config.yaml` 是 UDS 自己產生」的專案裡,拒絕每一個環境(XSPEC-471 R4)。** `uds init` 與 `uds config` 把 `release.environments` 寫成物件(`- name: staging`),檢查卻拿使用者輸入的名稱去比那些物件,於是說「未知的環境」並列出 `[object Object]`。現在物件形式與純名稱都讀得懂。
|
|
41
|
+
- **`uds agent list` 與 `uds agent info` 顯示空白的說明,也沒有專長、工具、技能(XSPEC-471 R4)。** 代理檔是 YAML(`description: |`、清單),讀取程式一次只看一行 `key: value`,把說明看成 `|`。現在 front matter 以 YAML 解析。
|
|
42
|
+
- **行為變更——`uds hitl check` 在無法詢問時不再以結束碼 0 結束(XSPEC-471 R4)。** 沒有終端機可回答、也沒有 `CI` 變數時,高風險的 `--op` 會開一個永遠等不到回答的提示,印出堆疊追蹤後以 0 結束,腳本會把它當成「已核准」。現在印出「Blocked (Safety First)」與「Denied」並以 1 結束,與 CI 下相同。`uds hitl check` 沒給 `--op` 時以 2 結束(原本是 0)。
|
|
43
|
+
- **`uds list` 只顯示它所計算的 163 個標準中的 81 個,而且拒絕 `--category core`(撰寫 XSPEC-471 R4 驗收步驟時發現)。** 「Total」行計入登錄檔中的每一個標準,但列表只走固定的五個分類,所以 `core`、`testing`、`security`、`deployment`、`operations` 這五個分類裡的 82 個標準被計入卻從未顯示,`uds list --category core` 還回答「Unknown category」。現在列表會顯示登錄檔裡有標準的每一個分類,每個分類各有標題與數量,標題上的數字加起來等於 Total;這五個分類已宣告在 `cli/standards-registry.json`(並註明它們不由 `uds init` 安裝,要用 `uds update --apply --add-standard` 依編號加入),日後登錄檔新增的分類會以它自己的名稱列出,不會再被丟掉。「有效分類」提示現在列出全部十個。標題與 Total 不一致時 `npm test` 會失敗。
|
|
44
|
+
- **`uds quickstart`、`uds spec create`、`uds spec delete`、`uds spec split` 在沒有任何東西能回答它們的問題時,以 Node 堆疊追蹤結束,且結束碼為 0(撰寫 XSPEC-471 R4 驗收步驟時發現)。** 在沒有終端機的環境(AI 助理、CI、管線)執行時,它們畫出問題後就死在 `ExitPromptError`,整次執行看起來像成功。`uds update` 與 `uds uninstall` 早先已用同樣方式修正。現在:`uds quickstart` 印出四個流程與各自的指令(這份指南本來的工作就是列出指令);沒給 `--yes` 的 `uds spec create` 把已寫好的規格留作草稿並說明如何確認(結束碼 0);沒給 `--yes` 的 `uds spec delete` 什麼都不刪、說明要加 `--yes` 重跑,並以 2 結束(原為 0);`uds spec split` 什麼都不改、說明要在終端機執行,並以 2 結束(原為 0)。有終端機時行為不變。
|
|
45
|
+
- **驗收步驟 `init-locale-pack-missing-is-said` 在任何跑過 `prepack` 的 checkout 上,用 `run.mjs --local-bin cli/bin/uds.js` 會失敗(XSPEC-471 R5)。** 它以 `cli/bundled/` 是否存在來分辨已發布套件與原始碼 checkout,但原始碼 checkout 在 `prepack` 之後也有那個資料夾,於是「缺少 zh-TW 技能文字」的複本被建在 repository 根目錄,`skills-installer.js` 照樣在那裡找到 `locales/zh-TW`,裝了中文技能。現在步驟改問 `locales/zh-TW` 是否在 `cli/` 旁邊。已發布的套件從未受影響,`uds init` 也沒有。
|
|
46
|
+
|
|
20
47
|
## [6.14.0-beta.7] - 2026-10-08
|
|
21
48
|
|
|
22
49
|
> **測試版**——以 `npm install -g universal-dev-standards@beta` 安裝。要測什麼、如何退回正式版:[docs/PRE-RELEASE.md](../../docs/PRE-RELEASE.md)。
|
|
@@ -15,7 +15,7 @@ status: current
|
|
|
15
15
|
|
|
16
16
|
> **語言**: [English](../../README.md) | 繁體中文 | [简体中文](../zh-CN/README.md)
|
|
17
17
|
|
|
18
|
-
**版本**: 6.14.0-beta.
|
|
18
|
+
**版本**: 6.14.0-beta.8 (Pre-release) | **發布日期**: 2026-10-07 | **授權**: [雙重授權](../../LICENSE) (CC BY 4.0 + MIT)
|
|
19
19
|
|
|
20
20
|
語言無關、框架無關的軟體專案文件標準。透過 AI 原生工作流,確保不同技術堆疊之間的一致性、品質和可維護性。
|
|
21
21
|
|
package/package.json
CHANGED
package/src/commands/hitl.js
CHANGED
|
@@ -7,16 +7,19 @@ const MAX_OP_LENGTH = 500;
|
|
|
7
7
|
export async function hitlCommand(options) {
|
|
8
8
|
if (!options.op) {
|
|
9
9
|
console.error(chalk.red('Error: --op <operation> is required'));
|
|
10
|
+
process.exit(2); // not 0: a caller that reads the exit code must not take a missing question for "allowed"
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
const op = String(options.op).trim();
|
|
14
15
|
if (op.length === 0) {
|
|
15
16
|
console.error(chalk.red('Error: --op must not be empty'));
|
|
17
|
+
process.exit(2);
|
|
16
18
|
return;
|
|
17
19
|
}
|
|
18
20
|
if (op.length > MAX_OP_LENGTH) {
|
|
19
21
|
console.error(chalk.red(`Error: --op must be ≤ ${MAX_OP_LENGTH} characters (got ${op.length})`));
|
|
22
|
+
process.exit(2);
|
|
20
23
|
return;
|
|
21
24
|
}
|
|
22
25
|
|
package/src/commands/list.js
CHANGED
|
@@ -8,6 +8,14 @@ import {
|
|
|
8
8
|
import { readManifest, isInitialized } from '../utils/copier.js';
|
|
9
9
|
import { t, getLanguage, setLanguage, isLanguageExplicitlySet } from '../i18n/messages.js';
|
|
10
10
|
|
|
11
|
+
/**
|
|
12
|
+
* The order the listing shows its categories in. A category the registry holds standards for but that is not named
|
|
13
|
+
* here is still listed (after these, under its own key): the "Total" line counts every standard in the registry, so a
|
|
14
|
+
* category that was left out of the display used to make the total larger than the list (82 of 163 standards were
|
|
15
|
+
* counted and never shown, and `--category core` was refused as unknown).
|
|
16
|
+
*/
|
|
17
|
+
const CATEGORY_ORDER = ['skill', 'reference', 'core', 'testing', 'security', 'deployment', 'operations', 'extension', 'integration', 'template'];
|
|
18
|
+
|
|
11
19
|
/**
|
|
12
20
|
* List command - displays available standards
|
|
13
21
|
* @param {Object} options - Command options
|
|
@@ -44,7 +52,8 @@ export function listCommand(options) {
|
|
|
44
52
|
const categoryInfo = getCategoryInfo(category);
|
|
45
53
|
if (!categoryInfo) {
|
|
46
54
|
console.log(chalk.red(`${msg.errorUnknownCategory} '${category}'`));
|
|
47
|
-
|
|
55
|
+
const valid = CATEGORY_ORDER.filter((c) => getCategoryInfo(c));
|
|
56
|
+
console.log(chalk.gray(`${msg.validCategories} ${valid.join(', ')}`));
|
|
48
57
|
process.exit(1);
|
|
49
58
|
}
|
|
50
59
|
standards = getStandardsByCategory(category);
|
|
@@ -65,13 +74,13 @@ export function listCommand(options) {
|
|
|
65
74
|
}
|
|
66
75
|
|
|
67
76
|
// Display each category
|
|
68
|
-
const categoryOrder = [
|
|
77
|
+
const categoryOrder = [...CATEGORY_ORDER, ...Object.keys(grouped).filter((c) => !CATEGORY_ORDER.includes(c))];
|
|
69
78
|
|
|
70
79
|
for (const cat of categoryOrder) {
|
|
71
80
|
if (!grouped[cat] || grouped[cat].length === 0) continue;
|
|
72
81
|
|
|
73
82
|
const catInfo = getCategoryInfo(cat);
|
|
74
|
-
console.log(chalk.yellow.bold(`${catInfo
|
|
83
|
+
console.log(chalk.yellow.bold(`${catInfo?.name ?? cat} (${grouped[cat].length})`));
|
|
75
84
|
|
|
76
85
|
for (const std of grouped[cat]) {
|
|
77
86
|
const name = std.skillName
|
package/src/commands/mcp.js
CHANGED
|
@@ -16,9 +16,8 @@ export function mcpCommand(program) {
|
|
|
16
16
|
mcp
|
|
17
17
|
.command('serve')
|
|
18
18
|
.description('Start MCP Design Standards Server (stdio transport)')
|
|
19
|
-
.
|
|
20
|
-
|
|
21
|
-
const server = new McpServer({ udsRoot: options.root });
|
|
19
|
+
.action(() => {
|
|
20
|
+
const server = new McpServer();
|
|
22
21
|
server.start();
|
|
23
22
|
// Log to stderr only — stdout is reserved for MCP JSON-RPC messages
|
|
24
23
|
process.stderr.write('UDS MCP Design Standards Server started (stdio)\n');
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
import chalk from 'chalk';
|
|
23
23
|
import { select } from '@inquirer/prompts';
|
|
24
|
+
import { isPromptClosed } from '../utils/prompt-closed.js';
|
|
24
25
|
|
|
25
26
|
export const WORKFLOWS = [
|
|
26
27
|
{
|
|
@@ -64,6 +65,18 @@ export const WORKFLOWS = [
|
|
|
64
65
|
},
|
|
65
66
|
];
|
|
66
67
|
|
|
68
|
+
/** Print one workflow: its name, what it is for, and its numbered commands. */
|
|
69
|
+
function printWorkflow(workflow) {
|
|
70
|
+
console.log(chalk.bold(`\n${workflow.name}\n`));
|
|
71
|
+
console.log(chalk.gray(`${workflow.description}\n`));
|
|
72
|
+
|
|
73
|
+
for (let i = 0; i < workflow.steps.length; i++) {
|
|
74
|
+
const step = workflow.steps[i];
|
|
75
|
+
console.log(` ${chalk.cyan(`${i + 1}.`)} ${chalk.yellow(step.cmd)}`);
|
|
76
|
+
console.log(` ${chalk.gray(step.desc)}\n`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
67
80
|
/**
|
|
68
81
|
* Execute the quickstart command
|
|
69
82
|
*/
|
|
@@ -77,20 +90,23 @@ export async function quickstartCommand() {
|
|
|
77
90
|
description: w.description,
|
|
78
91
|
}));
|
|
79
92
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
console.log(
|
|
93
|
+
let selected;
|
|
94
|
+
try {
|
|
95
|
+
selected = await select({
|
|
96
|
+
message: 'Which workflow do you want to follow?',
|
|
97
|
+
choices,
|
|
98
|
+
});
|
|
99
|
+
} catch (promptError) {
|
|
100
|
+
if (!isPromptClosed(promptError)) throw promptError;
|
|
101
|
+
// Nothing can answer (not a terminal: an AI assistant, CI, a pipe). The guide's whole job is to show the commands, so show all of them
|
|
102
|
+
// rather than a stack trace and an exit code of 0.
|
|
103
|
+
console.log(chalk.gray('Nothing here can answer the question (not a terminal), so every workflow is shown.'));
|
|
104
|
+
for (const workflow of WORKFLOWS) printWorkflow(workflow);
|
|
105
|
+
console.log(chalk.gray('Tip: Run "uds quickstart" in a terminal to pick one workflow.\n'));
|
|
106
|
+
return;
|
|
93
107
|
}
|
|
94
108
|
|
|
109
|
+
printWorkflow(WORKFLOWS[selected]);
|
|
110
|
+
|
|
95
111
|
console.log(chalk.gray('Tip: Run each command in order. Use "uds quickstart" anytime to see this guide again.\n'));
|
|
96
112
|
}
|
package/src/commands/release.js
CHANGED
|
@@ -7,8 +7,17 @@
|
|
|
7
7
|
* deploy — Record deployment to environment (manual/hybrid mode)
|
|
8
8
|
* manifest — Generate build-manifest.json (manual/hybrid mode)
|
|
9
9
|
* verify — Verify manifest against git state (manual/hybrid mode)
|
|
10
|
+
*
|
|
11
|
+
* Exit codes of `verify` (a script that gates a release on it must never read a failure as a pass):
|
|
12
|
+
* 0 the manifest verified
|
|
13
|
+
* 1 verification FAILED (commit or checksum does not match what the manifest records)
|
|
14
|
+
* 2 could not verify (no manifest, unreadable manifest, artifact not found, or the mode has no verify)
|
|
15
|
+
* 1 = "the answer is no", 2 = "no answer", the same split as `uds hitl check`.
|
|
10
16
|
*/
|
|
11
17
|
|
|
18
|
+
const EXIT_VERIFY_FAILED = 1;
|
|
19
|
+
const EXIT_CANNOT_VERIFY = 2;
|
|
20
|
+
|
|
12
21
|
import chalk from 'chalk';
|
|
13
22
|
import * as yaml from 'js-yaml';
|
|
14
23
|
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
|
@@ -16,7 +25,7 @@ import { join } from 'path';
|
|
|
16
25
|
import { execSync } from 'child_process';
|
|
17
26
|
import { createHash } from 'crypto';
|
|
18
27
|
import { resolveReleaseWorkflow } from '../utils/release-config.js';
|
|
19
|
-
import { formatGitTag,
|
|
28
|
+
import { formatGitTag, parseRCVersion, isStableVersion } from '../utils/version-promote.js';
|
|
20
29
|
|
|
21
30
|
// Default deployment environments (overridable via release-config.yaml release.environments)
|
|
22
31
|
const DEFAULT_ENVIRONMENTS = ['development', 'staging', 'canary', 'preview', 'production'];
|
|
@@ -39,6 +48,20 @@ function loadReleaseConfig(projectPath) {
|
|
|
39
48
|
}
|
|
40
49
|
}
|
|
41
50
|
|
|
51
|
+
/**
|
|
52
|
+
* The deployment environment names a release-config.yaml declares, or null when it declares none.
|
|
53
|
+
* An entry is a name (`- staging`) or the object `uds config` writes (`- name: staging`, with `type` and so on).
|
|
54
|
+
* The object form used to be compared as if it were a name, so a project set up by UDS itself could not deploy anywhere.
|
|
55
|
+
*/
|
|
56
|
+
function configuredEnvironmentNames(releaseConfig) {
|
|
57
|
+
const declared = releaseConfig?.release?.environments;
|
|
58
|
+
if (!Array.isArray(declared)) return null;
|
|
59
|
+
const names = declared
|
|
60
|
+
.map((entry) => (entry && typeof entry === 'object' ? entry.name : entry))
|
|
61
|
+
.filter((name) => typeof name === 'string' && name.trim() !== '');
|
|
62
|
+
return names.length > 0 ? names : null;
|
|
63
|
+
}
|
|
64
|
+
|
|
42
65
|
/**
|
|
43
66
|
* Load deployments.yaml
|
|
44
67
|
*/
|
|
@@ -151,9 +174,13 @@ export async function releaseCommand(subcommand, args, options) {
|
|
|
151
174
|
case 'verify':
|
|
152
175
|
if (!workflow.hasManifest) {
|
|
153
176
|
console.log(chalk.red('verify 子命令僅在 manual 或 hybrid 模式下可用。'));
|
|
177
|
+
process.exitCode = EXIT_CANNOT_VERIFY; // nothing was verified; 0 would read as "verified"
|
|
154
178
|
return;
|
|
155
179
|
}
|
|
156
|
-
|
|
180
|
+
{
|
|
181
|
+
const verifyExit = await handleVerify(projectPath, options);
|
|
182
|
+
if (verifyExit !== 0) process.exitCode = verifyExit; // wire:release-verify-exit
|
|
183
|
+
}
|
|
157
184
|
break;
|
|
158
185
|
|
|
159
186
|
default:
|
|
@@ -203,16 +230,12 @@ async function handlePromote(targetVersion, projectPath) {
|
|
|
203
230
|
console.log(chalk.gray(` 晉升目標: ${targetVersion}`));
|
|
204
231
|
}
|
|
205
232
|
|
|
206
|
-
//
|
|
207
|
-
const record = createPromotionRecord(currentVersion || 'unknown', targetVersion);
|
|
208
|
-
console.log();
|
|
209
|
-
console.log(chalk.green(` ✓ 晉升紀錄建立: ${record.promoted_from} → ${record.version}`));
|
|
210
|
-
|
|
211
|
-
// Create git tag
|
|
233
|
+
// This command only prints. It writes no promotion record and creates no git tag, so it must not say it did.
|
|
212
234
|
const tag = formatGitTag(targetVersion);
|
|
213
|
-
console.log(chalk.green(` ✓ Git tag: ${tag}`));
|
|
214
235
|
console.log();
|
|
215
|
-
console.log(chalk.
|
|
236
|
+
console.log(chalk.yellow('這個指令不會建立晉升紀錄,也不會建立 Git tag;它只列出下一步要執行的事。'));
|
|
237
|
+
console.log();
|
|
238
|
+
console.log(chalk.cyan('下一步(由你執行):'));
|
|
216
239
|
console.log(chalk.gray(` 1. 更新版本檔案為 ${targetVersion}`));
|
|
217
240
|
console.log(chalk.gray(` 2. git tag ${tag}`));
|
|
218
241
|
console.log(chalk.gray(' 3. 從此 commit 重新打包'));
|
|
@@ -234,10 +257,7 @@ async function handleDeploy(environment, options, projectPath) {
|
|
|
234
257
|
|
|
235
258
|
// Validate environment against allow-list (overridable via release-config.yaml)
|
|
236
259
|
const deployConfig = loadReleaseConfig(projectPath);
|
|
237
|
-
const allowedEnvironments =
|
|
238
|
-
Array.isArray(deployConfig?.release?.environments) && deployConfig.release.environments.length > 0
|
|
239
|
-
? deployConfig.release.environments
|
|
240
|
-
: DEFAULT_ENVIRONMENTS;
|
|
260
|
+
const allowedEnvironments = configuredEnvironmentNames(deployConfig) || DEFAULT_ENVIRONMENTS;
|
|
241
261
|
if (!allowedEnvironments.includes(environment)) {
|
|
242
262
|
console.log(chalk.red(`未知的部署環境: ${environment}`));
|
|
243
263
|
console.log(chalk.gray(` 允許的環境: ${allowedEnvironments.join(', ')}`));
|
|
@@ -335,6 +355,8 @@ async function handleManifest(versionArg, options, projectPath) {
|
|
|
335
355
|
*
|
|
336
356
|
* T13 (XSPEC-292): when --artifact is given, compute its SHA256 so verify
|
|
337
357
|
* actually CONSUMES the checksum recorded in the manifest, not just stores it.
|
|
358
|
+
*
|
|
359
|
+
* @returns {Promise<number>} the exit code: 0 verified, EXIT_VERIFY_FAILED, or EXIT_CANNOT_VERIFY
|
|
338
360
|
*/
|
|
339
361
|
async function handleVerify(projectPath, options = {}) {
|
|
340
362
|
const manifestPath = join(projectPath, 'build-manifest.json');
|
|
@@ -342,7 +364,7 @@ async function handleVerify(projectPath, options = {}) {
|
|
|
342
364
|
if (!existsSync(manifestPath)) {
|
|
343
365
|
console.log(chalk.red('找不到 build-manifest.json'));
|
|
344
366
|
console.log(chalk.gray(' 請先執行 uds release manifest'));
|
|
345
|
-
return;
|
|
367
|
+
return EXIT_CANNOT_VERIFY;
|
|
346
368
|
}
|
|
347
369
|
|
|
348
370
|
let manifest;
|
|
@@ -350,7 +372,7 @@ async function handleVerify(projectPath, options = {}) {
|
|
|
350
372
|
manifest = JSON.parse(readFileSync(manifestPath, 'utf-8'));
|
|
351
373
|
} catch {
|
|
352
374
|
console.log(chalk.red('build-manifest.json 格式不正確'));
|
|
353
|
-
return;
|
|
375
|
+
return EXIT_CANNOT_VERIFY;
|
|
354
376
|
}
|
|
355
377
|
const currentCommit = getGitCommit();
|
|
356
378
|
|
|
@@ -360,7 +382,7 @@ async function handleVerify(projectPath, options = {}) {
|
|
|
360
382
|
if (artifactPath) {
|
|
361
383
|
if (!existsSync(artifactPath)) {
|
|
362
384
|
console.log(chalk.red(`找不到 artifact:${artifactPath}`));
|
|
363
|
-
return;
|
|
385
|
+
return EXIT_CANNOT_VERIFY;
|
|
364
386
|
}
|
|
365
387
|
actualChecksum = createHash('sha256').update(readFileSync(artifactPath)).digest('hex');
|
|
366
388
|
}
|
|
@@ -396,6 +418,8 @@ async function handleVerify(projectPath, options = {}) {
|
|
|
396
418
|
} else {
|
|
397
419
|
console.log(chalk.yellow(' Staging: 未通過或無紀錄'));
|
|
398
420
|
}
|
|
421
|
+
|
|
422
|
+
return result.valid ? 0 : EXIT_VERIFY_FAILED;
|
|
399
423
|
}
|
|
400
424
|
|
|
401
425
|
/**
|
|
@@ -13,6 +13,7 @@ import { MicroSpec } from '../vibe/micro-spec.js';
|
|
|
13
13
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, copyFileSync } from 'node:fs';
|
|
14
14
|
import { join } from 'node:path';
|
|
15
15
|
import { withFileTransaction } from '../utils/transaction.js';
|
|
16
|
+
import { isPromptClosed } from '../utils/prompt-closed.js';
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* Extract acceptance criteria from spec markdown
|
|
@@ -86,25 +87,36 @@ export async function specSplitCommand(id, options = {}) {
|
|
|
86
87
|
}
|
|
87
88
|
console.log();
|
|
88
89
|
|
|
89
|
-
// Interactive selection: which ACs to move to new spec
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
90
|
+
// Interactive selection: which ACs to move to new spec. Nothing can be written before both answers are in,
|
|
91
|
+
// so a prompt that cannot be answered (not a terminal) changes nothing and says so.
|
|
92
|
+
let toMove;
|
|
93
|
+
let proceed;
|
|
94
|
+
try {
|
|
95
|
+
toMove = await checkbox({
|
|
96
|
+
message: 'Select ACs to move to a NEW spec (remaining stay in original):',
|
|
97
|
+
choices: acs.map(ac => ({
|
|
98
|
+
name: `${ac.id}: ${ac.text.substring(ac.id.length + 1).trim().substring(0, 60)}`,
|
|
99
|
+
value: ac.id,
|
|
100
|
+
})),
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
if (toMove.length === 0 || toMove.length === acs.length) {
|
|
104
|
+
console.log(chalk.yellow('Must select some (but not all) ACs to move. Aborting.'));
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
proceed = await inquirerConfirm({
|
|
109
|
+
message: `Split ${id}: keep ${acs.length - toMove.length} ACs, move ${toMove.length} ACs to new spec?`,
|
|
110
|
+
default: true,
|
|
111
|
+
});
|
|
112
|
+
} catch (promptError) {
|
|
113
|
+
if (!isPromptClosed(promptError)) throw promptError;
|
|
114
|
+
console.log(chalk.red('\nCannot ask which ACs to move: there is nothing attached to answer the prompt (non-interactive shell, CI, or a pipe).'));
|
|
115
|
+
console.log(chalk.gray(` Run \`uds spec split ${id}\` in a terminal. Nothing has been changed.`));
|
|
116
|
+
process.exitCode = 2;
|
|
100
117
|
return;
|
|
101
118
|
}
|
|
102
119
|
|
|
103
|
-
const proceed = await inquirerConfirm({
|
|
104
|
-
message: `Split ${id}: keep ${acs.length - toMove.length} ACs, move ${toMove.length} ACs to new spec?`,
|
|
105
|
-
default: true,
|
|
106
|
-
});
|
|
107
|
-
|
|
108
120
|
if (!proceed) {
|
|
109
121
|
console.log(chalk.gray('Split cancelled.'));
|
|
110
122
|
return;
|
package/src/commands/spec.js
CHANGED
|
@@ -15,6 +15,7 @@ import { existsSync, readFileSync } from 'node:fs';
|
|
|
15
15
|
import { join } from 'node:path';
|
|
16
16
|
import { MicroSpec, SpecStatus } from '../vibe/micro-spec.js';
|
|
17
17
|
import { msg } from '../i18n/messages.js';
|
|
18
|
+
import { isPromptClosed } from '../utils/prompt-closed.js';
|
|
18
19
|
|
|
19
20
|
/**
|
|
20
21
|
* Get localized message with fallback
|
|
@@ -69,15 +70,25 @@ export async function specCreateCommand(intent, options = {}) {
|
|
|
69
70
|
|
|
70
71
|
// Ask for confirmation unless --yes flag
|
|
71
72
|
if (!options.yes) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
let action;
|
|
74
|
+
try {
|
|
75
|
+
action = await select({
|
|
76
|
+
message: t('spec.confirmQuestion', 'How would you like to proceed?'),
|
|
77
|
+
choices: [
|
|
78
|
+
{ name: t('spec.confirm', 'Confirm and proceed'), value: 'confirm' },
|
|
79
|
+
{ name: t('spec.edit', 'Edit the spec'), value: 'edit' },
|
|
80
|
+
{ name: t('spec.skip', 'Skip (keep as draft)'), value: 'skip' },
|
|
81
|
+
{ name: t('spec.discard', 'Discard'), value: 'discard' }
|
|
82
|
+
]
|
|
83
|
+
});
|
|
84
|
+
} catch (promptError) {
|
|
85
|
+
if (!isPromptClosed(promptError)) throw promptError;
|
|
86
|
+
// Nothing can answer (not a terminal): the spec is already written, so it stays a draft and the person is told how to confirm it.
|
|
87
|
+
console.log('');
|
|
88
|
+
console.log(chalk.yellow(t('spec.cannotAsk', 'Nothing here can answer the question, so the spec stays a draft.')));
|
|
89
|
+
console.log(chalk.gray(t('spec.cannotAskHint', 'Run `uds spec confirm <id>` to confirm it, or create it with --yes.')));
|
|
90
|
+
action = 'skip';
|
|
91
|
+
}
|
|
81
92
|
|
|
82
93
|
if (action === 'confirm') {
|
|
83
94
|
microSpec.confirm(spec.id);
|
|
@@ -265,10 +276,20 @@ export async function specDeleteCommand(id, options = {}) {
|
|
|
265
276
|
});
|
|
266
277
|
|
|
267
278
|
if (!options.yes) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
279
|
+
let confirmed;
|
|
280
|
+
try {
|
|
281
|
+
confirmed = await inquirerConfirm({
|
|
282
|
+
message: t('spec.deleteConfirm', `Are you sure you want to delete spec '${id}'?`),
|
|
283
|
+
default: false
|
|
284
|
+
});
|
|
285
|
+
} catch (promptError) {
|
|
286
|
+
if (!isPromptClosed(promptError)) throw promptError;
|
|
287
|
+
// Not auto-confirming: an unattended run must not be allowed to delete what a person was asked about.
|
|
288
|
+
console.log(chalk.red(t('spec.cannotConfirmDelete', 'Cannot ask for confirmation: there is nothing attached to answer the prompt (non-interactive shell, CI, or a pipe).')));
|
|
289
|
+
console.log(chalk.gray(t('spec.cannotConfirmDeleteHint', 'Re-run with --yes to delete. Nothing has been deleted.')));
|
|
290
|
+
process.exitCode = 2;
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
272
293
|
|
|
273
294
|
if (!confirmed) {
|
|
274
295
|
console.log(chalk.gray(t('spec.deleteCancelled', 'Delete cancelled.')));
|
|
@@ -227,7 +227,7 @@ async function gatherPreview(projectPath, manifest, categories, includeUserLevel
|
|
|
227
227
|
preview.integrations = await uninstallIntegrations(projectPath, manifest, { dryRun: true });
|
|
228
228
|
}
|
|
229
229
|
if (categories.includes('standards')) {
|
|
230
|
-
preview.standards = uninstallStandards(projectPath, { dryRun: true });
|
|
230
|
+
preview.standards = uninstallStandards(projectPath, { dryRun: true, manifest });
|
|
231
231
|
}
|
|
232
232
|
if (categories.includes('hooks')) {
|
|
233
233
|
// Nothing is deleted yet in a preview, so folders are judged against what the
|
|
@@ -267,7 +267,7 @@ async function executeUninstall(projectPath, manifest, categories, options) {
|
|
|
267
267
|
});
|
|
268
268
|
}
|
|
269
269
|
if (categories.includes('standards')) {
|
|
270
|
-
results.standards = uninstallStandards(projectPath);
|
|
270
|
+
results.standards = uninstallStandards(projectPath, { manifest });
|
|
271
271
|
}
|
|
272
272
|
if (categories.includes('hooks')) {
|
|
273
273
|
// After everything else, so a folder that only held UDS files is empty by now.
|
package/src/hitl/manager.js
CHANGED
|
@@ -40,8 +40,10 @@ export class HitlManager {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
async _promptUser(operation, riskLevel, context) {
|
|
43
|
-
// Check if we are in non-interactive mode
|
|
44
|
-
|
|
43
|
+
// Check if we are in non-interactive mode: CI, a declared non-interactive run, or no terminal to answer on.
|
|
44
|
+
// A prompt with no terminal never gets an answer; @inquirer/prompts then lets the process end with exit code 0 and a
|
|
45
|
+
// stack trace, which `uds hitl check` callers read as "approved". No one to ask means blocked, as in CI.
|
|
46
|
+
if (process.env.CI || process.env.UDS_NON_INTERACTIVE || !process.stdin.isTTY) {
|
|
45
47
|
console.log(chalk.yellow(''));
|
|
46
48
|
console.log(chalk.yellow('HITL Checkpoint triggered in non-interactive mode.'));
|
|
47
49
|
console.log(chalk.gray(` Operation: ${operation}`));
|
package/src/i18n/messages.js
CHANGED
|
@@ -728,7 +728,7 @@ export const messages = {
|
|
|
728
728
|
errorLevelRange: 'Error: Level must be 1, 2, or 3',
|
|
729
729
|
showingLevel: 'Showing Level',
|
|
730
730
|
errorUnknownCategory: 'Error: Unknown category',
|
|
731
|
-
validCategories: 'Valid categories:
|
|
731
|
+
validCategories: 'Valid categories:',
|
|
732
732
|
category: 'Category',
|
|
733
733
|
appliesTo: 'Applies to',
|
|
734
734
|
totalSummary: 'standards',
|
|
@@ -2083,7 +2083,7 @@ export const messages = {
|
|
|
2083
2083
|
errorLevelRange: '錯誤:等級必須是 1、2 或 3',
|
|
2084
2084
|
showingLevel: '顯示等級',
|
|
2085
2085
|
errorUnknownCategory: '錯誤:未知類別',
|
|
2086
|
-
validCategories: '有效類別:
|
|
2086
|
+
validCategories: '有效類別:',
|
|
2087
2087
|
category: '類別',
|
|
2088
2088
|
appliesTo: '適用於',
|
|
2089
2089
|
totalSummary: '項標準',
|
|
@@ -3360,7 +3360,7 @@ export const messages = {
|
|
|
3360
3360
|
errorLevelRange: '错误:等级必须是 1、2 或 3',
|
|
3361
3361
|
showingLevel: '显示等级',
|
|
3362
3362
|
errorUnknownCategory: '错误:未知类别',
|
|
3363
|
-
validCategories: '有效类别:
|
|
3363
|
+
validCategories: '有效类别:',
|
|
3364
3364
|
category: '类别',
|
|
3365
3365
|
appliesTo: '适用于',
|
|
3366
3366
|
totalSummary: '项标准',
|
package/src/mcp/server.js
CHANGED
|
@@ -10,8 +10,21 @@ import { fileURLToPath } from 'url';
|
|
|
10
10
|
|
|
11
11
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Where the files UDS ships (ai/standards/, templates/) are.
|
|
15
|
+
*
|
|
16
|
+
* This file is `<cli>/src/mcp/server.js`, so `<cli>` is two levels up. A published package carries the shipped
|
|
17
|
+
* files in `<cli>/bundled/`; a repository checkout carries them one level above `<cli>`. (It used to climb four
|
|
18
|
+
* levels, which lands outside the repository and, in an installed package, outside the package: every tool that
|
|
19
|
+
* reads a shipped file failed with ENOENT, and the unit tests never saw it because they replace the file system.)
|
|
20
|
+
*
|
|
21
|
+
* @returns {string}
|
|
22
|
+
*/
|
|
23
|
+
export function resolveUdsRepoRoot() {
|
|
24
|
+
const cliRoot = resolve(__dirname, '../..');
|
|
25
|
+
const bundled = join(cliRoot, 'bundled');
|
|
26
|
+
return existsSync(join(bundled, 'ai')) ? bundled : resolve(cliRoot, '..');
|
|
27
|
+
}
|
|
15
28
|
|
|
16
29
|
/**
|
|
17
30
|
* Required DESIGN.md sections per frontend-design-standards.
|
|
@@ -29,9 +42,8 @@ const REQUIRED_DESIGN_SECTIONS = [
|
|
|
29
42
|
|
|
30
43
|
export class McpServer {
|
|
31
44
|
constructor(options = {}) {
|
|
32
|
-
this.udsRoot = options.udsRoot || process.cwd();
|
|
33
45
|
// For reading UDS bundled files, always use UDS_REPO_ROOT
|
|
34
|
-
this.udsRepoRoot = options.udsRepoRoot ||
|
|
46
|
+
this.udsRepoRoot = options.udsRepoRoot || resolveUdsRepoRoot();
|
|
35
47
|
}
|
|
36
48
|
|
|
37
49
|
/**
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import { existsSync, rmSync } from 'fs';
|
|
1
|
+
import { existsSync, rmSync, rmdirSync, readdirSync, unlinkSync } from 'fs';
|
|
2
|
+
import { dirname, join } from 'path';
|
|
2
3
|
import {
|
|
3
4
|
getSkillsDirForAgent,
|
|
4
|
-
getCommandsDirForAgent
|
|
5
|
-
getAgentsDirForAgent,
|
|
6
|
-
getWorkflowsDirForAgent
|
|
5
|
+
getCommandsDirForAgent
|
|
7
6
|
} from '../config/ai-agent-paths.js';
|
|
7
|
+
import { computeFileHash } from '../utils/hasher.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Uninstall skills
|
|
10
|
+
* Uninstall skills and commands
|
|
11
|
+
*
|
|
12
|
+
* Skills and commands go into folders the adopter shares with other things
|
|
13
|
+
* (`.claude/skills/` holds their own skills too; `init` says so where it writes
|
|
14
|
+
* them). So this removes only what UDS can PROVE it wrote and nobody has changed
|
|
15
|
+
* since: a record in the manifest (`skillHashes` / `commandHashes`) plus a
|
|
16
|
+
* matching content hash. The same rule `uds uninstall` already applies to hook
|
|
17
|
+
* scripts and integration files. A file with no record, or edited since, is
|
|
18
|
+
* kept and said so. A folder UDS emptied is removed; a folder that still holds
|
|
19
|
+
* something else is left alone.
|
|
20
|
+
*
|
|
21
|
+
* This used to `rmSync` the whole skills folder, which took the adopter's own
|
|
22
|
+
* skills with it.
|
|
23
|
+
*
|
|
11
24
|
* @param {string} projectPath - Project root path
|
|
12
25
|
* @param {Object} manifest - Parsed manifest object
|
|
13
26
|
* @param {Object} options - { dryRun, includeUserLevel }
|
|
@@ -26,30 +39,52 @@ export function uninstallSkills(projectPath, manifest, options = {}) {
|
|
|
26
39
|
// Process skill installations
|
|
27
40
|
const skillInstalls = manifest?.skills?.installations || [];
|
|
28
41
|
for (const install of skillInstalls) {
|
|
29
|
-
processInstallation(install, 'skills', projectPath, options, result);
|
|
42
|
+
processInstallation(install, 'skills', projectPath, manifest, options, result);
|
|
30
43
|
}
|
|
31
44
|
|
|
32
45
|
// Process command installations
|
|
33
46
|
const cmdInstalls = manifest?.commands?.installations || [];
|
|
34
47
|
for (const install of cmdInstalls) {
|
|
35
|
-
processInstallation(install, 'commands', projectPath, options, result);
|
|
48
|
+
processInstallation(install, 'commands', projectPath, manifest, options, result);
|
|
36
49
|
}
|
|
37
50
|
|
|
38
51
|
return result;
|
|
39
52
|
}
|
|
40
53
|
|
|
41
54
|
/**
|
|
42
|
-
*
|
|
55
|
+
* The files the manifest says UDS wrote into one installation's folder.
|
|
56
|
+
* Skill records are keyed `<agent>/<level>/<skill>/<file>`; command records
|
|
57
|
+
* `<agent>/<file>` (they carry no level).
|
|
58
|
+
* @returns {Array<{ rel: string, hash: string }>} path inside the folder (forward slashes) and recorded hash
|
|
43
59
|
*/
|
|
44
|
-
function
|
|
60
|
+
function recordedFiles(manifest, type, agent, level) {
|
|
61
|
+
const table = (type === 'skills' ? manifest?.skillHashes : manifest?.commandHashes) || {};
|
|
62
|
+
const prefix = type === 'skills' ? `${agent}/${level}/` : `${agent}/`;
|
|
63
|
+
return Object.entries(table)
|
|
64
|
+
.filter(([key]) => key.startsWith(prefix))
|
|
65
|
+
.map(([key, info]) => ({ rel: key.slice(prefix.length), hash: info && info.hash }));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Remove `dir` if nothing is left in it. Returns whether it is gone. */
|
|
69
|
+
function removeIfEmpty(dir) {
|
|
70
|
+
try {
|
|
71
|
+
if (readdirSync(dir).length > 0) return false;
|
|
72
|
+
rmdirSync(dir);
|
|
73
|
+
return true;
|
|
74
|
+
} catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Process a single skill/command installation for removal
|
|
81
|
+
*/
|
|
82
|
+
function processInstallation(install, type, projectPath, manifest, options, result) {
|
|
45
83
|
const { dryRun = false, includeUserLevel = false } = options;
|
|
46
84
|
const { agent, level } = install;
|
|
47
85
|
|
|
48
86
|
// Determine directory getter
|
|
49
|
-
const getDirFn = type === 'skills' ? getSkillsDirForAgent :
|
|
50
|
-
type === 'commands' ? getCommandsDirForAgent :
|
|
51
|
-
type === 'agents' ? getAgentsDirForAgent :
|
|
52
|
-
getWorkflowsDirForAgent;
|
|
87
|
+
const getDirFn = type === 'skills' ? getSkillsDirForAgent : getCommandsDirForAgent;
|
|
53
88
|
|
|
54
89
|
const dir = getDirFn(agent, level || 'project', projectPath);
|
|
55
90
|
if (!dir) {
|
|
@@ -71,14 +106,46 @@ function processInstallation(install, type, projectPath, options, result) {
|
|
|
71
106
|
return;
|
|
72
107
|
}
|
|
73
108
|
|
|
109
|
+
const records = recordedFiles(manifest, type, agent, level || 'project');
|
|
110
|
+
if (records.length === 0) {
|
|
111
|
+
result.skipped.push(`${label} — kept ${dir}: the manifest records no file UDS wrote there, so UDS cannot prove which are its own`);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const toRemove = [];
|
|
116
|
+
const changed = [];
|
|
117
|
+
for (const { rel, hash } of records) {
|
|
118
|
+
const file = join(dir, ...rel.split('/'));
|
|
119
|
+
if (!existsSync(file)) continue;
|
|
120
|
+
const now = computeFileHash(file);
|
|
121
|
+
if (now && hash && now.hash === hash) toRemove.push(file);
|
|
122
|
+
else changed.push(rel);
|
|
123
|
+
}
|
|
124
|
+
|
|
74
125
|
if (dryRun) {
|
|
75
|
-
result.removed.push(`${label} → ${dir}`);
|
|
126
|
+
result.removed.push(`${label} → ${dir} (${toRemove.length} file(s) UDS wrote)`);
|
|
127
|
+
if (changed.length > 0) result.skipped.push(`${label} — would keep ${changed.length} file(s) changed since UDS wrote them`);
|
|
76
128
|
return;
|
|
77
129
|
}
|
|
78
130
|
|
|
79
131
|
try {
|
|
80
|
-
|
|
81
|
-
|
|
132
|
+
const touched = new Set();
|
|
133
|
+
for (const file of toRemove) {
|
|
134
|
+
unlinkSync(file);
|
|
135
|
+
touched.add(dirname(file));
|
|
136
|
+
}
|
|
137
|
+
// UDS's own bookkeeping for the folder (written by the skills installer, never hashed): go with the last of its files.
|
|
138
|
+
if (changed.length === 0) {
|
|
139
|
+
const marker = join(dir, '.manifest.json');
|
|
140
|
+
if (existsSync(marker)) rmSync(marker, { force: true });
|
|
141
|
+
}
|
|
142
|
+
// Folders UDS emptied, deepest first, then the installation folder itself.
|
|
143
|
+
for (const d of [...touched].sort((a, b) => b.length - a.length)) {
|
|
144
|
+
if (d !== dir) removeIfEmpty(d);
|
|
145
|
+
}
|
|
146
|
+
const gone = removeIfEmpty(dir);
|
|
147
|
+
result.removed.push(`${label} → ${dir} (${toRemove.length} file(s) UDS wrote${gone ? '' : '; folder kept: it still holds files that are not UDS\'s'})`);
|
|
148
|
+
if (changed.length > 0) result.skipped.push(`${label} — kept ${changed.length} file(s) changed since UDS wrote them`);
|
|
82
149
|
} catch (error) {
|
|
83
150
|
result.errors.push(`${label} — ${error.message}`);
|
|
84
151
|
}
|
|
@@ -1,14 +1,27 @@
|
|
|
1
|
-
import { existsSync,
|
|
1
|
+
import { existsSync, readdirSync, rmdirSync, unlinkSync } from 'fs';
|
|
2
2
|
import { join } from 'path';
|
|
3
|
+
import { classifyStandardsFiles, computeFileHash } from '../utils/hasher.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
|
-
* Uninstall .standards/
|
|
6
|
+
* Uninstall the files UDS wrote into .standards/
|
|
7
|
+
*
|
|
8
|
+
* `.standards/` is a folder the adopter may add files to (UDS's own docs invite
|
|
9
|
+
* teams to), so this removes only what UDS can PROVE it wrote and nobody has
|
|
10
|
+
* changed since: a file the manifest records (`fileHashes`, or `provenance`)
|
|
11
|
+
* whose content still matches its recorded hash. A file with no record, or edited
|
|
12
|
+
* since, is kept and said so. The manifest goes last, and the folder only when
|
|
13
|
+
* nothing else is in it. The same rule `uds uninstall` applies to skills, hook
|
|
14
|
+
* scripts and integration files.
|
|
15
|
+
*
|
|
16
|
+
* This used to `rmSync` the whole folder, which took the adopter's own files
|
|
17
|
+
* with it.
|
|
18
|
+
*
|
|
6
19
|
* @param {string} projectPath - Project root path
|
|
7
|
-
* @param {Object} options - { dryRun: boolean }
|
|
20
|
+
* @param {Object} options - { dryRun: boolean, manifest: Object } (the manifest says which files UDS wrote)
|
|
8
21
|
* @returns {Object} { removed: string[], skipped: string[], errors: string[] }
|
|
9
22
|
*/
|
|
10
23
|
export function uninstallStandards(projectPath, options = {}) {
|
|
11
|
-
const { dryRun = false } = options;
|
|
24
|
+
const { dryRun = false, manifest = null } = options;
|
|
12
25
|
const result = { removed: [], skipped: [], errors: [] };
|
|
13
26
|
const standardsDir = join(projectPath, '.standards');
|
|
14
27
|
|
|
@@ -16,18 +29,54 @@ export function uninstallStandards(projectPath, options = {}) {
|
|
|
16
29
|
result.skipped.push('.standards/ (not found)');
|
|
17
30
|
return result;
|
|
18
31
|
}
|
|
32
|
+
if (!manifest) {
|
|
33
|
+
result.skipped.push('.standards/ — kept: there is no manifest to say which files UDS wrote');
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const census = classifyStandardsFiles(projectPath, manifest);
|
|
38
|
+
const toRemove = [];
|
|
39
|
+
const changed = [];
|
|
40
|
+
for (const rel of census.udsOwned) {
|
|
41
|
+
const record = manifest.fileHashes && manifest.fileHashes[rel];
|
|
42
|
+
const file = join(projectPath, ...rel.split('/'));
|
|
43
|
+
if (record && record.hash) {
|
|
44
|
+
const now = computeFileHash(file);
|
|
45
|
+
if (!now || now.hash !== record.hash) { changed.push(rel); continue; }
|
|
46
|
+
}
|
|
47
|
+
toRemove.push(file);
|
|
48
|
+
}
|
|
49
|
+
const notUds = [...census.foreign, ...census.unknown];
|
|
50
|
+
const kept = [...changed, ...notUds];
|
|
51
|
+
const manifestFile = join(standardsDir, 'manifest.json');
|
|
52
|
+
const count = toRemove.length + (existsSync(manifestFile) ? 1 : 0);
|
|
53
|
+
|
|
54
|
+
const describe = (wholeFolderGone) => `.standards/ (${count} file(s) UDS wrote${wholeFolderGone ? '' : '; folder kept: it still holds files that are not UDS\'s'})`;
|
|
55
|
+
const keptNote = `.standards/ — kept ${kept.length} file(s) UDS did not write or that changed since: ${kept.slice(0, 5).join(', ')}${kept.length > 5 ? ', ...' : ''}`;
|
|
19
56
|
|
|
20
57
|
if (dryRun) {
|
|
21
|
-
result.removed.push(
|
|
58
|
+
result.removed.push(describe(kept.length === 0));
|
|
59
|
+
if (kept.length > 0) result.skipped.push(keptNote);
|
|
22
60
|
return result;
|
|
23
61
|
}
|
|
24
62
|
|
|
25
63
|
try {
|
|
26
|
-
|
|
27
|
-
|
|
64
|
+
for (const file of toRemove) unlinkSync(file);
|
|
65
|
+
if (existsSync(manifestFile)) unlinkSync(manifestFile);
|
|
66
|
+
removeEmptyFolders(standardsDir);
|
|
67
|
+
result.removed.push(describe(!existsSync(standardsDir)));
|
|
68
|
+
if (kept.length > 0) result.skipped.push(keptNote);
|
|
28
69
|
} catch (error) {
|
|
29
70
|
result.errors.push(`.standards/ — ${error.message}`);
|
|
30
71
|
}
|
|
31
72
|
|
|
32
73
|
return result;
|
|
33
74
|
}
|
|
75
|
+
|
|
76
|
+
/** Remove every folder under `dir` that is empty, deepest first, then `dir` itself if it ends up empty. */
|
|
77
|
+
function removeEmptyFolders(dir) {
|
|
78
|
+
for (const entry of readdirSync(dir, { withFileTypes: true })) {
|
|
79
|
+
if (entry.isDirectory()) removeEmptyFolders(join(dir, entry.name));
|
|
80
|
+
}
|
|
81
|
+
if (readdirSync(dir).length === 0) rmdirSync(dir);
|
|
82
|
+
}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
import { mkdirSync, writeFileSync, existsSync, readFileSync, readdirSync, statSync } from 'fs';
|
|
11
11
|
import { dirname, join, basename } from 'path';
|
|
12
12
|
import { fileURLToPath } from 'url';
|
|
13
|
+
import * as yaml from 'js-yaml';
|
|
13
14
|
import {
|
|
14
15
|
getAgentConfig,
|
|
15
16
|
getAgentsDirForAgent,
|
|
@@ -83,28 +84,20 @@ export function getAgentContent(agentName) {
|
|
|
83
84
|
* @returns {Object} Parsed frontmatter fields
|
|
84
85
|
*/
|
|
85
86
|
export function parseAgentFrontmatter(content) {
|
|
86
|
-
const frontmatterMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
87
|
+
const frontmatterMatch = content.match(/^---\r?\n([\s\S]*?)\r?\n---/);
|
|
87
88
|
if (!frontmatterMatch) {
|
|
88
89
|
return {};
|
|
89
90
|
}
|
|
90
91
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
if (value.startsWith('[') && value.endsWith(']')) {
|
|
100
|
-
frontmatter[key] = value.slice(1, -1).split(',').map(s => s.trim().replace(/"/g, ''));
|
|
101
|
-
} else {
|
|
102
|
-
frontmatter[key] = value.trim();
|
|
103
|
-
}
|
|
104
|
-
}
|
|
92
|
+
// The agent files are YAML: `description: |` is a block, `expertise:` is a list. A line-by-line `key: value`
|
|
93
|
+
// reader saw the description as the single character `|` and dropped every list, so `uds agent list` and
|
|
94
|
+
// `uds agent info` showed an empty description and no expertise, tools or skills.
|
|
95
|
+
try {
|
|
96
|
+
const parsed = yaml.load(frontmatterMatch[1]);
|
|
97
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed) ? parsed : {};
|
|
98
|
+
} catch {
|
|
99
|
+
return {};
|
|
105
100
|
}
|
|
106
|
-
|
|
107
|
-
return frontmatter;
|
|
108
101
|
}
|
|
109
102
|
|
|
110
103
|
/**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Did a prompt end because nothing could answer it?
|
|
3
|
+
* // implements XSPEC-471 R4 (the interactive commands found without an acceptance step)
|
|
4
|
+
*
|
|
5
|
+
* `@inquirer/prompts` rejects with `ExitPromptError` when stdin is not a terminal and ends (CI, a pipe, a process
|
|
6
|
+
* started by another program) and when the person presses Ctrl+C. A command that does not catch it prints a Node
|
|
7
|
+
* stack trace, and the process still ends with exit code 0: a run that did nothing looks like a success.
|
|
8
|
+
* `uds update` and `uds uninstall` catch it for themselves; this is the same test for the other commands.
|
|
9
|
+
*
|
|
10
|
+
* Detect by what the prompt did, not by probing `process.stdin.isTTY`: isTTY is a proxy for "somebody can answer",
|
|
11
|
+
* and a wrapped or mocked stdin answers fine with isTTY unset.
|
|
12
|
+
*
|
|
13
|
+
* @param {unknown} err
|
|
14
|
+
* @returns {boolean}
|
|
15
|
+
*/
|
|
16
|
+
export function isPromptClosed(err) {
|
|
17
|
+
return err?.name === 'ExitPromptError' || /force closed the prompt/i.test(err?.message || '');
|
|
18
|
+
}
|
package/standards-registry.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
-
"version": "6.14.0-beta.
|
|
3
|
+
"version": "6.14.0-beta.8",
|
|
4
4
|
"lastUpdated": "2026-05-13",
|
|
5
5
|
"description": "Standards registry for universal-dev-standards with integrated skills and AI-optimized formats",
|
|
6
6
|
"formats": {
|
|
@@ -58,14 +58,14 @@
|
|
|
58
58
|
"standards": {
|
|
59
59
|
"name": "universal-dev-standards",
|
|
60
60
|
"url": "https://github.com/AsiaOstrich/universal-dev-standards",
|
|
61
|
-
"version": "6.14.0-beta.
|
|
61
|
+
"version": "6.14.0-beta.8"
|
|
62
62
|
},
|
|
63
63
|
"skills": {
|
|
64
64
|
"name": "universal-dev-standards",
|
|
65
65
|
"url": "https://github.com/AsiaOstrich/universal-dev-standards",
|
|
66
66
|
"localPath": "skills",
|
|
67
67
|
"rawUrl": "https://raw.githubusercontent.com/AsiaOstrich/universal-dev-standards/main/skills",
|
|
68
|
-
"version": "6.14.0-beta.
|
|
68
|
+
"version": "6.14.0-beta.8",
|
|
69
69
|
"note": "Skills are now included in the main repository under skills/"
|
|
70
70
|
}
|
|
71
71
|
},
|
|
@@ -691,6 +691,31 @@
|
|
|
691
691
|
"name": "Template",
|
|
692
692
|
"description": "Document templates for specific purposes. Use as starting point for project documents.",
|
|
693
693
|
"adoptionMethod": "Copy and customize"
|
|
694
|
+
},
|
|
695
|
+
"core": {
|
|
696
|
+
"name": "Core Standard",
|
|
697
|
+
"description": "Core development standards that apply across projects: governance, agent behavior, observability, workflow discipline. Not installed by uds init.",
|
|
698
|
+
"adoptionMethod": "Install by id with uds update --apply --add-standard"
|
|
699
|
+
},
|
|
700
|
+
"testing": {
|
|
701
|
+
"name": "Testing Standard",
|
|
702
|
+
"description": "Standards for specific kinds of tests and test hygiene: contract, property-based, smoke, replay, flaky-test management and others. Not installed by uds init.",
|
|
703
|
+
"adoptionMethod": "Install by id with uds update --apply --add-standard"
|
|
704
|
+
},
|
|
705
|
+
"security": {
|
|
706
|
+
"name": "Security Standard",
|
|
707
|
+
"description": "Security standards for operations, containers, static analysis and supply-chain attestation. Not installed by uds init.",
|
|
708
|
+
"adoptionMethod": "Install by id with uds update --apply --add-standard"
|
|
709
|
+
},
|
|
710
|
+
"deployment": {
|
|
711
|
+
"name": "Deployment Standard",
|
|
712
|
+
"description": "Standards for what must be known and checked before a release goes out: quality manifest and release readiness gate. Not installed by uds init.",
|
|
713
|
+
"adoptionMethod": "Install by id with uds update --apply --add-standard"
|
|
714
|
+
},
|
|
715
|
+
"operations": {
|
|
716
|
+
"name": "Operations Standard",
|
|
717
|
+
"description": "Standards for running a system after it is released, such as disaster recovery drills. Not installed by uds init.",
|
|
718
|
+
"adoptionMethod": "Install by id with uds update --apply --add-standard"
|
|
694
719
|
}
|
|
695
720
|
},
|
|
696
721
|
"standards": [
|
|
@@ -2309,7 +2334,7 @@
|
|
|
2309
2334
|
"id": "license-compliance",
|
|
2310
2335
|
"name": "License Compliance Standards",
|
|
2311
2336
|
"nameZh": "授權合規標準",
|
|
2312
|
-
"version": "6.14.0-beta.
|
|
2337
|
+
"version": "6.14.0-beta.8",
|
|
2313
2338
|
"source": {
|
|
2314
2339
|
"human": "core/license-compliance.md",
|
|
2315
2340
|
"ai": "ai/standards/license-compliance.ai.yaml"
|
|
@@ -2321,7 +2346,7 @@
|
|
|
2321
2346
|
"id": "verification-oracle",
|
|
2322
2347
|
"name": "Verification Oracle Standards",
|
|
2323
2348
|
"nameZh": "驗證 Oracle 標準",
|
|
2324
|
-
"version": "6.14.0-beta.
|
|
2349
|
+
"version": "6.14.0-beta.8",
|
|
2325
2350
|
"source": {
|
|
2326
2351
|
"human": "core/verification-oracle.md",
|
|
2327
2352
|
"ai": "ai/standards/verification-oracle.ai.yaml"
|
|
@@ -2333,7 +2358,7 @@
|
|
|
2333
2358
|
"id": "model-provenance",
|
|
2334
2359
|
"name": "Model Provenance Policy Standards",
|
|
2335
2360
|
"nameZh": "模型來源政策標準",
|
|
2336
|
-
"version": "6.14.0-beta.
|
|
2361
|
+
"version": "6.14.0-beta.8",
|
|
2337
2362
|
"source": {
|
|
2338
2363
|
"human": "core/model-provenance.md",
|
|
2339
2364
|
"ai": "ai/standards/model-provenance.ai.yaml"
|
|
@@ -2345,7 +2370,7 @@
|
|
|
2345
2370
|
"id": "resource-cost-boundary",
|
|
2346
2371
|
"name": "Resource / Cost Boundary Declaration Standards",
|
|
2347
2372
|
"nameZh": "資源/成本邊界宣告標準",
|
|
2348
|
-
"version": "6.14.0-beta.
|
|
2373
|
+
"version": "6.14.0-beta.8",
|
|
2349
2374
|
"source": {
|
|
2350
2375
|
"human": "core/resource-cost-boundary.md",
|
|
2351
2376
|
"ai": "ai/standards/resource-cost-boundary.ai.yaml"
|