universal-dev-standards 6.14.0-beta.4 → 6.14.0-beta.6
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/bin/uds.js +9 -2
- package/bundled/ai/standards/commit-message.ai.yaml +6 -2
- package/bundled/ai/standards/full-coverage-testing.ai.yaml +46 -5
- package/bundled/core/full-coverage-testing.md +57 -3
- package/bundled/locales/zh-CN/CHANGELOG.md +54 -3
- package/bundled/locales/zh-CN/README.md +1 -1
- package/bundled/locales/zh-CN/SECURITY.md +1 -1
- package/bundled/locales/zh-CN/core/full-coverage-testing.md +61 -7
- package/bundled/locales/zh-CN/docs/CHEATSHEET.md +4 -2
- package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +10 -6
- package/bundled/locales/zh-TW/CHANGELOG.md +54 -3
- package/bundled/locales/zh-TW/README.md +1 -1
- package/bundled/locales/zh-TW/SECURITY.md +1 -1
- package/bundled/locales/zh-TW/core/full-coverage-testing.md +61 -7
- package/bundled/locales/zh-TW/docs/CHEATSHEET.md +4 -2
- package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +10 -6
- package/bundled/templates/gates/check-anti-fake-tests.mjs +991 -0
- package/bundled/templates/gates/check-stubs.mjs +644 -0
- package/package.json +2 -2
- package/src/commands/audit.js +11 -0
- package/src/commands/check.js +124 -24
- package/src/commands/deps.js +31 -1
- package/src/commands/init.js +16 -0
- package/src/commands/simulate.js +20 -8
- package/src/commands/skills.js +42 -2
- package/src/commands/spec.js +14 -8
- package/src/commands/update.js +222 -21
- package/src/core/install-records.js +2 -1
- package/src/core/manifest.js +12 -10
- package/src/core/marketplace-sentinel.js +5 -0
- package/src/core/project-config.js +58 -38
- package/src/i18n/messages.js +77 -9
- package/src/reconciler/backup-locations.js +75 -0
- package/src/reconciler/backup-manager.js +435 -115
- package/src/reconciler/index.js +44 -5
- package/src/reconciler/install-roots.js +90 -0
- package/src/reconciler/plan-executor.js +23 -2
- package/src/uninstallers/hook-uninstaller.js +2 -1
- package/src/utils/command-hash-ownership.js +103 -0
- package/src/utils/commit-message-judge.js +137 -0
- package/src/utils/copier.js +21 -1
- package/src/utils/deps-applicability.js +25 -0
- package/src/utils/gate-scripts.js +141 -0
- package/src/utils/health-scorer.js +10 -7
- package/src/utils/installed-names-ownership.js +114 -0
- package/src/utils/sdd-header.js +65 -0
- package/src/utils/skill-hash-ownership.js +64 -0
- package/src/utils/skills-installer.js +12 -1
- package/src/utils/standard-validator.js +98 -27
- package/src/utils/test-change-check.js +160 -0
- package/src/utils/test-policy.js +214 -0
- package/src/utils/update-summary.js +29 -0
- package/src/vibe/micro-spec.js +15 -0
- package/standards-registry.json +7 -7
- package/bundled/extensions/languages/php/fat-free-patterns.md +0 -915
- package/bundled/extensions/languages/php/php-style.md +0 -693
|
@@ -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.6 (Pre-release) | **發布日期**: 2026-10-07 | **授權**: [雙重授權](../../LICENSE) (CC BY 4.0 + MIT)
|
|
19
19
|
|
|
20
20
|
語言無關、框架無關的軟體專案文件標準。透過 AI 原生工作流,確保不同技術堆疊之間的一致性、品質和可維護性。
|
|
21
21
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
source: ../../../core/full-coverage-testing.md
|
|
3
|
-
source_version: 1.
|
|
4
|
-
translation_version: 1.
|
|
5
|
-
last_synced: 2026-
|
|
6
|
-
source_hash:
|
|
3
|
+
source_version: 1.2.0
|
|
4
|
+
translation_version: 1.2.0
|
|
5
|
+
last_synced: 2026-10-06
|
|
6
|
+
source_hash: 1fe2966d8684
|
|
7
7
|
status: current
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -12,7 +12,7 @@ status: current
|
|
|
12
12
|
> **Language**: [English](../../../core/full-coverage-testing.md) | 繁體中文
|
|
13
13
|
|
|
14
14
|
> **AI 最佳化版本**: `ai/standards/full-coverage-testing.ai.yaml`
|
|
15
|
-
> **XSPEC**: XSPEC-178
|
|
15
|
+
> **XSPEC**: XSPEC-178、XSPEC-444(R2、R5——提交前警告與隨附閘門腳本)
|
|
16
16
|
> **取代**: 金字塔門檻模型(UT≥80%、IT≥70%、E2E 僅 happy-path)
|
|
17
17
|
|
|
18
18
|
## 概述
|
|
@@ -233,6 +233,60 @@ legacy 降級模式(外部服務失敗時的 fallback、重試、部分結果
|
|
|
233
233
|
|
|
234
234
|
---
|
|
235
235
|
|
|
236
|
+
## UDS 隨附的提交前警告與閘門腳本(XSPEC-444 R2、R5)
|
|
237
|
+
|
|
238
|
+
上面的規則過去要靠標準叫你自己寫的腳本來執行。現在 `uds init` 會直接把掃描腳本寫進你的專案,而 `uds check`——UDS 的 pre-commit hook 執行的指令——會印出這些腳本和另一項檢查找到的東西。**預設一律只警告、不擋任何東西**;要收緊是選擇性的(見「先警告,之後再收緊」)。
|
|
239
|
+
|
|
240
|
+
### 兩支掃描腳本(`uds init` 寫到 `scripts/`)
|
|
241
|
+
|
|
242
|
+
| 腳本 | 找什麼 |
|
|
243
|
+
|------|--------|
|
|
244
|
+
| `scripts/check-anti-fake-tests.mjs` | **沒有斷言**的測試;唯一的斷言是**恆真式**的測試(`expect(true).toBe(true)`、`assert 200 == 200`);**每一支測試都被跳過或標為 todo** 的測試檔 |
|
|
245
|
+
| `scripts/check-stubs.mjs` | `// WARNING: STUB` 標記;宣稱**尚未實作**的函式本體(`raise NotImplementedError`、`todo!()`、`TODO()` 等)而旁邊沒有標記;本體**為空**的具名函式而旁邊沒有標記 |
|
|
246
|
+
|
|
247
|
+
- 純 Node、零相依、不預設任何測試框架。它們是**你的檔案**:可以改、可以接進 CI。單獨執行時,找到東西就以非 0 結束——`node scripts/check-stubs.mjs` 就是本標準部署閘門所說的 pre-push/部署閘門。
|
|
248
|
+
- `uds init` 不會覆寫已存在的檔案,`uds update` 也不會;較早初始化的專案,`uds update` 會詢問是否寫入(提示的預設為否;`uds update -y` 會直接回答是)。
|
|
249
|
+
- 有暫存檔案時只讀那些檔案;沒有暫存任何東西時(CI 執行、手動 `uds check`)每支都會走訪整個專案——走訪最多 200,000 個檔案,`uds check` 給每支 120 秒(超過就回報「無法判定」,絕不算通過)——所以在很大的儲存庫裡,請在 CI 執行,不要期待立刻完成。
|
|
250
|
+
- 同一行或上面三行內出現 `STUB` 或 `COVERAGE_EXEMPT`,該暫時實作就算已**宣告**;已宣告的只以標記回報一次。
|
|
251
|
+
- **語言範圍。**測試檔規則涵蓋 JavaScript/TypeScript、Python、Java/Kotlin/Scala/C#、Go、Rust、Ruby、Elixir、PHP、Swift、Dart、Lua 與 C/C++。其他語言的測試檔會被列為「未掃描」——絕不當成乾淨。空函式規則涵蓋 JavaScript/TypeScript、Python、Go、Rust、Ruby 與 PHP;其他語言仍會找標記與「尚未實作」的本體,輸出也會寫出哪些語言沒有空函式規則。
|
|
252
|
+
- 它們讀的是文字,不執行你的測試。若某個輔助函式用掃描器認不得的名稱做斷言,會被報為「no-assertion」:把它命名為 `assert*`/`verify*`/`expect*`,或把它的樣式列在政策檔的 `assertionPatterns`。
|
|
253
|
+
- 每次執行都先拿已知的假測試與已知的好測試檢驗自己;檢驗失敗就以 `2`(「無法判定」)結束,這絕不算通過。
|
|
254
|
+
|
|
255
|
+
### 改了程式碼卻沒動測試(`uds check`,針對已暫存的變更)
|
|
256
|
+
|
|
257
|
+
有檔案暫存準備提交時,`uds check` 會比對變更內容:
|
|
258
|
+
|
|
259
|
+
- 改了程式檔,**同一次提交沒有任何測試檔變動** → 警告,並列出程式檔;
|
|
260
|
+
- 變更中有 UDS 不認得的檔案類型 → 警告,列出它並說明如何分類(絕不當成沒事,也絕不擋);
|
|
261
|
+
- 刪除不算需要測試的變更;**純重新命名**(git 的 `R100`)與符合 `exempt` 條目的路徑可免,輸出會記下理由。
|
|
262
|
+
|
|
263
|
+
沒有暫存任何東西時(CI 執行、手動 `uds check`),差異檢查不出聲;兩支掃描腳本則改為掃整個專案。
|
|
264
|
+
|
|
265
|
+
### 政策檔 `.standards/test-policy.json`(選用)
|
|
266
|
+
|
|
267
|
+
哪些路徑是測試、哪些是程式,是附有常見生態預設值的資料,不是一份框架清單。每個清單都是**加進**預設值:
|
|
268
|
+
|
|
269
|
+
```json
|
|
270
|
+
{
|
|
271
|
+
"mode": "warn",
|
|
272
|
+
"testDirs": ["integration"],
|
|
273
|
+
"testPatterns": ["*.itest.*"],
|
|
274
|
+
"sourceExtensions": ["zig"],
|
|
275
|
+
"nonCodeExtensions": ["gradle"],
|
|
276
|
+
"ignore": ["generated/**"],
|
|
277
|
+
"exempt": [{ "pattern": "src/gen/**", "reason": "generated by protoc" }],
|
|
278
|
+
"assertionPatterns": ["\\bmustMatch\\w*\\s*\\("]
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
沒有 `reason` 的 `exempt` 條目不會生效,並會被回報:豁免必須說明原因。
|
|
283
|
+
|
|
284
|
+
### 先警告,之後再收緊
|
|
285
|
+
|
|
286
|
+
`"mode": "warn"`(預設)只印出警告、放行提交。`"mode": "block"` 會讓 `uds check` 在以下情況以非 0 結束,因此擋下提交:掃描腳本找到東西、掃描腳本無法判定、或改了程式碼卻沒動測試。UDS 不認得的檔案類型永遠不會擋。**尚未實作**(規格沒有定義基線放在哪裡、以什麼計數):未配測試的變更數棘輪,以及逐次提交的豁免理由(pre-commit hook 讀不到提交訊息)。
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
236
290
|
## 從金字塔模型遷移
|
|
237
291
|
|
|
238
292
|
若你的專案先前使用金字塔門檻:
|
|
@@ -240,8 +294,8 @@ legacy 降級模式(外部服務失敗時的 fallback、重試、部分結果
|
|
|
240
294
|
1. **刪除** `jest.config.js` / `vitest.config.ts` 中任何硬編碼的覆蓋率門檻(`coverageThreshold` 選項)
|
|
241
295
|
2. **安裝** `.coverage-baseline.json`,以目前的覆蓋率作為棘輪起點
|
|
242
296
|
3. **新增** `scripts/check-coverage-ratchet.sh` 到 CI
|
|
243
|
-
4. **新增** `scripts/check-stubs.
|
|
244
|
-
5. **新增** `scripts/check-anti-fake-tests.
|
|
297
|
+
4. **新增** `scripts/check-stubs.mjs` 到 deploy.sh 與 pre-push hook(由 `uds init` 寫入;既有專案由 `uds update` 提供)
|
|
298
|
+
5. **新增** `scripts/check-anti-fake-tests.mjs` 到 pre-commit 或 CI(由 `uds init` 寫入;`uds check` 已會執行並警告)
|
|
245
299
|
|
|
246
300
|
棘輪從你目前的覆蓋率開始。從那一刻起,它只能上升。
|
|
247
301
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# UDS 速查表
|
|
2
2
|
|
|
3
|
-
> Quick reference for all UDS features | Last updated: 2026-
|
|
3
|
+
> Quick reference for all UDS features | Last updated: 2026-10-07
|
|
4
4
|
|
|
5
5
|
**Language**: [English](../../../docs/user/CHEATSHEET.md) | 繁體中文 | [简体中文](../../zh-CN/docs/CHEATSHEET.md)
|
|
6
6
|
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
| `uds configure` | Alias for "uds config" — Modify project settings |
|
|
18
18
|
| `uds check` | Check file integrity and adoption status (quick validation). For deep health diagnosis, use "uds audit" |
|
|
19
19
|
| `uds lint` | Check spec dependency validity and size against installed specs (specs/*.md) |
|
|
20
|
-
| `uds simulate` | Simulate a standard check with input (Predictive Validation) |
|
|
20
|
+
| `uds simulate` | Simulate a standard check with input (Predictive Validation). Exit 0 = passes, 1 = does not comply, 2 = no verdict (cannot simulate; not a pass). Only commit-message defines a simulator today |
|
|
21
21
|
| `uds fix` | Auto-fix standard violations (Self-Healing) |
|
|
22
22
|
| `uds update` | Update standards to latest version |
|
|
23
23
|
| `uds skills` | List installed Claude Code skills |
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
| `ci-cd-assistant` | 引導 CI/CD 管線的設計、設定與最佳化。 |
|
|
111
111
|
| `code-review-assistant` | [UDS] 系統性程式碼審查的參考資料:八大審查類別,以及 BLOCKING/IMPORTANT/SUGGESTION |
|
|
112
112
|
| `commit-standards` | [UDS] 產生符合 Conventional Commits 規範的 commit message,包含雙語格式。 |
|
|
113
|
+
| `comprehension-ladder` | [UDS] 把一段難懂的 AI 輸出換成較好懂的形式:受控文字、Mermaid 圖、單檔 HTML 解說頁。所有形式都來 |
|
|
113
114
|
| `contract-test-assistant` | [UDS] 引導 API 與微服務的合約測試策略。 |
|
|
114
115
|
| `database-assistant` | 引導資料庫設計、遷移與查詢最佳化。 |
|
|
115
116
|
| `deploy-assistant` | 引導在沒有 CI/CD 平台(GitHub Actions/GitLab CI)的情況下完成可靠部署。 |
|
|
@@ -388,6 +389,7 @@
|
|
|
388
389
|
| `generate-version-manifest.mjs` | Generate Version Manifest (SPEC-SELFDIAG-001 REQ-9 |
|
|
389
390
|
| `install-hooks.mjs` | Install Hooks |
|
|
390
391
|
| `install-hooks.sh` | Thin wrapper — scripts/install-hooks.mjs is the on |
|
|
392
|
+
| `npm-pack-files.mjs` | @param {string} stdout @returns {string[]} package |
|
|
391
393
|
| `pre-commit.mjs` | Build a platform-aware shell command for a .sh scr |
|
|
392
394
|
| `pre-release-check.ps1` | Pre Release Check |
|
|
393
395
|
| `pre-release-check.sh` | Pre-release Check Script |
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# UDS 功能參考手冊
|
|
2
2
|
|
|
3
3
|
> Universal Development Standards - 完整功能文件
|
|
4
|
-
> Auto-generated | Last updated: 2026-
|
|
4
|
+
> Auto-generated | Last updated: 2026-10-07
|
|
5
5
|
|
|
6
6
|
**Language**: [English](../../../docs/reference/FEATURE-REFERENCE.md) | 繁體中文 | [简体中文](../../zh-CN/docs/FEATURE-REFERENCE.md)
|
|
7
7
|
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
|
|
12
12
|
1. [CLI 指令](#cli-commands) (24)
|
|
13
13
|
2. [斜線命令](#slash-commands) (51)
|
|
14
|
-
3. [技能](#skills) (
|
|
14
|
+
3. [技能](#skills) (56)
|
|
15
15
|
4. [代理](#agents) (5)
|
|
16
16
|
5. [工作流程](#workflows) (5)
|
|
17
17
|
6. [核心規範](#core-standards) (153)
|
|
18
|
-
7. [腳本](#scripts) (
|
|
18
|
+
7. [腳本](#scripts) (64)
|
|
19
19
|
|
|
20
|
-
**Total Features:
|
|
20
|
+
**Total Features: 358**
|
|
21
21
|
|
|
22
22
|
---
|
|
23
23
|
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
|
|
117
117
|
### `uds simulate`
|
|
118
118
|
|
|
119
|
-
**說明**: Simulate a standard check with input (Predictive Validation)
|
|
119
|
+
**說明**: Simulate a standard check with input (Predictive Validation). Exit 0 = passes, 1 = does not comply, 2 = no verdict (cannot simulate; not a pass). Only commit-message defines a simulator today
|
|
120
120
|
|
|
121
121
|
**選項**:
|
|
122
122
|
| Option | 說明 |
|
|
@@ -181,6 +181,7 @@
|
|
|
181
181
|
| `--gh` | Force gh CLI for submission |
|
|
182
182
|
| `--format` | Output format (json) |
|
|
183
183
|
| `--quiet` | Summary only |
|
|
184
|
+
| `--offline` | No network access at all: no CLI version check, and --report does not submit |
|
|
184
185
|
| `--score` | Run multi-dimensional health score analysis |
|
|
185
186
|
| `--self` | Self mode: analyze UDS repo itself (use with --score) |
|
|
186
187
|
| `--save` | Save score snapshot for trend tracking (use with --score) |
|
|
@@ -200,6 +201,7 @@
|
|
|
200
201
|
| `--path` | Directory containing package.json (default: cwd) |
|
|
201
202
|
| `--json` | Output raw JSON |
|
|
202
203
|
| `--concurrency` | Parallel registry lookups (default: 8) |
|
|
204
|
+
| `--if-present` | Exit 0 and say that nothing was checked when there is no package.json or no runtime dependency (default: exit 1) |
|
|
203
205
|
|
|
204
206
|
### `uds uninstall`
|
|
205
207
|
|
|
@@ -365,6 +367,7 @@
|
|
|
365
367
|
| `ci-cd-assistant` | 引導 CI/CD 管線的設計、設定與最佳化。 |
|
|
366
368
|
| `code-review-assistant` | [UDS] 系統性程式碼審查的參考資料:八大審查類別,以及 BLOCKING/IMPORTANT/SUGGESTION 評論前綴。 |
|
|
367
369
|
| `commit-standards` | [UDS] 產生符合 Conventional Commits 規範的 commit message,包含雙語格式。 |
|
|
370
|
+
| `comprehension-ladder` | [UDS] 把一段難懂的 AI 輸出換成較好懂的形式:受控文字、Mermaid 圖、單檔 HTML 解說頁。所有形式都來自同一份大綱,所以形式會變,事實不會變。 |
|
|
368
371
|
| `contract-test-assistant` | [UDS] 引導 API 與微服務的合約測試策略。 |
|
|
369
372
|
| `database-assistant` | 引導資料庫設計、遷移與查詢最佳化。 |
|
|
370
373
|
| `deploy-assistant` | 引導在沒有 CI/CD 平台(GitHub Actions/GitLab CI)的情況下完成可靠部署。 |
|
|
@@ -448,7 +451,7 @@
|
|
|
448
451
|
| `ai-command-behavior` | 1.0.0 | This standard defines a structure for specifying AI Agent runtime behavior in co |
|
|
449
452
|
| `ai-friendly-architecture` | 1.0.0 | This standard defines architecture and documentation practices that maximize the |
|
|
450
453
|
| `ai-instruction-standards` | 1.1.1 | This standard defines best practices for creating and maintaining AI instruction |
|
|
451
|
-
| `ai-response-navigation` | 1.
|
|
454
|
+
| `ai-response-navigation` | 1.4.0 | This standard defines navigation behavior for AI responses: every substantive AI |
|
|
452
455
|
| `alerting-standards` | 1.0.0 | |
|
|
453
456
|
| `anti-hallucination` | 1.5.1 | This standard defines strict guidelines for AI assistants to prevent hallucinati |
|
|
454
457
|
| `anti-sycophancy-prompting` | 1.0.0 | This standard defines techniques and rules for designing prompts that elicit gen |
|
|
@@ -651,6 +654,7 @@
|
|
|
651
654
|
| `generate-version-manifest.mjs` | Generate Version Manifest (SPEC-SELFDIAG-001 REQ-9, AC-14) |
|
|
652
655
|
| `install-hooks.mjs` | Install Hooks |
|
|
653
656
|
| `install-hooks.sh` | Thin wrapper — scripts/install-hooks.mjs is the only copy of the installer |
|
|
657
|
+
| `npm-pack-files.mjs` | @param {string} stdout @returns {string[]} package-relative file paths |
|
|
654
658
|
| `pre-commit.mjs` | Build a platform-aware shell command for a .sh script. |
|
|
655
659
|
| `pre-release-check.ps1` | Pre Release Check |
|
|
656
660
|
| `pre-release-check.sh` | Pre-release Check Script |
|