universal-dev-standards 5.4.0 → 5.6.0

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.
Files changed (138) hide show
  1. package/bundled/ai/options/testing/integration-testing.ai.yaml +2 -2
  2. package/bundled/ai/options/testing/unit-testing.ai.yaml +2 -2
  3. package/bundled/ai/standards/adversarial-test.ai.yaml +277 -0
  4. package/bundled/ai/standards/audit-trail.ai.yaml +113 -0
  5. package/bundled/ai/standards/browser-compatibility-standards.ai.yaml +63 -0
  6. package/bundled/ai/standards/chaos-injection-tests.ai.yaml +91 -0
  7. package/bundled/ai/standards/container-image-standards.ai.yaml +88 -0
  8. package/bundled/ai/standards/container-security.ai.yaml +331 -0
  9. package/bundled/ai/standards/contract-testing-standards.ai.yaml +62 -0
  10. package/bundled/ai/standards/cost-budget-test.ai.yaml +96 -0
  11. package/bundled/ai/standards/cross-flow-regression.ai.yaml +61 -0
  12. package/bundled/ai/standards/data-contract.ai.yaml +110 -0
  13. package/bundled/ai/standards/data-migration-testing.ai.yaml +96 -0
  14. package/bundled/ai/standards/data-pipeline.ai.yaml +113 -0
  15. package/bundled/ai/standards/disaster-recovery-drill.ai.yaml +89 -0
  16. package/bundled/ai/standards/flaky-test-management.ai.yaml +89 -0
  17. package/bundled/ai/standards/flow-based-testing.ai.yaml +240 -0
  18. package/bundled/ai/standards/full-coverage-testing.ai.yaml +192 -0
  19. package/bundled/ai/standards/iac-design-principles.ai.yaml +83 -0
  20. package/bundled/ai/standards/incident-response.ai.yaml +107 -0
  21. package/bundled/ai/standards/license-compliance.ai.yaml +106 -0
  22. package/bundled/ai/standards/llm-output-validation.ai.yaml +269 -0
  23. package/bundled/ai/standards/mock-boundary.ai.yaml +250 -0
  24. package/bundled/ai/standards/mutation-testing.ai.yaml +192 -0
  25. package/bundled/ai/standards/pii-classification.ai.yaml +109 -0
  26. package/bundled/ai/standards/policy-as-code-testing.ai.yaml +227 -0
  27. package/bundled/ai/standards/prd-standards.ai.yaml +88 -0
  28. package/bundled/ai/standards/product-metrics-standards.ai.yaml +111 -0
  29. package/bundled/ai/standards/prompt-regression.ai.yaml +94 -0
  30. package/bundled/ai/standards/property-based-testing.ai.yaml +105 -0
  31. package/bundled/ai/standards/release-quality-manifest.ai.yaml +135 -0
  32. package/bundled/ai/standards/release-readiness-gate.ai.yaml +77 -0
  33. package/bundled/ai/standards/replay-test.ai.yaml +111 -0
  34. package/bundled/ai/standards/runbook.ai.yaml +104 -0
  35. package/bundled/ai/standards/sast-advanced.ai.yaml +135 -0
  36. package/bundled/ai/standards/schema-evolution.ai.yaml +111 -0
  37. package/bundled/ai/standards/secret-management-standards.ai.yaml +105 -0
  38. package/bundled/ai/standards/secure-op.ai.yaml +365 -0
  39. package/bundled/ai/standards/security-testing.ai.yaml +171 -0
  40. package/bundled/ai/standards/server-ops-security.ai.yaml +274 -0
  41. package/bundled/ai/standards/slo-sli.ai.yaml +97 -0
  42. package/bundled/ai/standards/smoke-test.ai.yaml +87 -0
  43. package/bundled/ai/standards/supply-chain-attestation.ai.yaml +109 -0
  44. package/bundled/ai/standards/test-completeness-dimensions.ai.yaml +52 -5
  45. package/bundled/ai/standards/testing.ai.yaml +20 -13
  46. package/bundled/ai/standards/user-story-mapping.ai.yaml +108 -0
  47. package/bundled/core/accessibility-standards.md +58 -0
  48. package/bundled/core/adversarial-test.md +212 -0
  49. package/bundled/core/branch-completion.md +4 -0
  50. package/bundled/core/browser-compatibility-standards.md +220 -0
  51. package/bundled/core/chaos-injection-tests.md +116 -0
  52. package/bundled/core/checkin-standards.md +1 -0
  53. package/bundled/core/container-security.md +521 -0
  54. package/bundled/core/contract-testing-standards.md +182 -0
  55. package/bundled/core/cost-budget-test.md +69 -0
  56. package/bundled/core/cross-flow-regression.md +190 -0
  57. package/bundled/core/data-migration-testing.md +110 -0
  58. package/bundled/core/disaster-recovery-drill.md +73 -0
  59. package/bundled/core/flaky-test-management.md +73 -0
  60. package/bundled/core/flow-based-testing.md +275 -0
  61. package/bundled/core/full-coverage-testing.md +183 -0
  62. package/bundled/core/llm-output-validation.md +178 -0
  63. package/bundled/core/mock-boundary.md +100 -0
  64. package/bundled/core/mutation-testing.md +97 -0
  65. package/bundled/core/performance-standards.md +65 -0
  66. package/bundled/core/policy-as-code-testing.md +188 -0
  67. package/bundled/core/prompt-regression.md +72 -0
  68. package/bundled/core/property-based-testing.md +73 -0
  69. package/bundled/core/release-quality-manifest.md +193 -0
  70. package/bundled/core/release-readiness-gate.md +184 -0
  71. package/bundled/core/replay-test.md +86 -0
  72. package/bundled/core/sast-advanced.md +300 -0
  73. package/bundled/core/secure-op.md +314 -0
  74. package/bundled/core/security-testing.md +87 -0
  75. package/bundled/core/server-ops-security.md +493 -0
  76. package/bundled/core/smoke-test.md +65 -0
  77. package/bundled/core/supply-chain-attestation.md +117 -0
  78. package/bundled/locales/zh-CN/CHANGELOG.md +3 -3
  79. package/bundled/locales/zh-CN/README.md +1 -1
  80. package/bundled/locales/zh-CN/skills/ai-instruction-standards/SKILL.md +5 -5
  81. package/bundled/locales/zh-TW/CHANGELOG.md +3 -3
  82. package/bundled/locales/zh-TW/README.md +1 -1
  83. package/bundled/locales/zh-TW/core/browser-compatibility-standards.md +11 -0
  84. package/bundled/locales/zh-TW/core/contract-testing-standards.md +11 -0
  85. package/bundled/locales/zh-TW/core/cross-flow-regression.md +11 -0
  86. package/bundled/locales/zh-TW/core/release-readiness-gate.md +11 -0
  87. package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +183 -79
  88. package/bundled/skills/README.md +4 -3
  89. package/bundled/skills/SKILL_NAMING.md +94 -0
  90. package/bundled/skills/ai-instruction-standards/SKILL.md +181 -88
  91. package/bundled/skills/atdd-assistant/SKILL.md +8 -0
  92. package/bundled/skills/bdd-assistant/SKILL.md +7 -0
  93. package/bundled/skills/checkin-assistant/SKILL.md +8 -0
  94. package/bundled/skills/code-review-assistant/SKILL.md +7 -0
  95. package/bundled/skills/journey-test-assistant/SKILL.md +203 -0
  96. package/bundled/skills/orchestrate/SKILL.md +167 -0
  97. package/bundled/skills/plan/SKILL.md +234 -0
  98. package/bundled/skills/pr-automation-assistant/SKILL.md +8 -0
  99. package/bundled/skills/push/SKILL.md +49 -2
  100. package/bundled/skills/{process-automation → skill-builder}/SKILL.md +1 -1
  101. package/bundled/skills/{forward-derivation → spec-derivation}/SKILL.md +1 -1
  102. package/bundled/skills/spec-driven-dev/SKILL.md +7 -0
  103. package/bundled/skills/sweep/SKILL.md +145 -0
  104. package/bundled/skills/tdd-assistant/SKILL.md +7 -0
  105. package/package.json +6 -6
  106. package/src/commands/check.js +43 -0
  107. package/src/commands/flow.js +8 -0
  108. package/src/commands/init.js +2 -1
  109. package/src/commands/start.js +14 -0
  110. package/src/commands/sweep.js +8 -0
  111. package/src/commands/update.js +10 -0
  112. package/src/commands/workflow.js +8 -0
  113. package/standards-registry.json +483 -5
  114. package/bundled/locales/zh-CN/skills/ac-coverage-assistant/SKILL.md +0 -190
  115. package/bundled/locales/zh-CN/skills/forward-derivation/SKILL.md +0 -71
  116. package/bundled/locales/zh-CN/skills/forward-derivation/guide.md +0 -130
  117. package/bundled/locales/zh-CN/skills/methodology-system/SKILL.md +0 -88
  118. package/bundled/locales/zh-CN/skills/methodology-system/create-methodology.md +0 -350
  119. package/bundled/locales/zh-CN/skills/methodology-system/guide.md +0 -131
  120. package/bundled/locales/zh-CN/skills/methodology-system/runtime.md +0 -279
  121. package/bundled/locales/zh-CN/skills/process-automation/SKILL.md +0 -143
  122. package/bundled/locales/zh-TW/skills/ac-coverage-assistant/SKILL.md +0 -195
  123. package/bundled/locales/zh-TW/skills/deploy-assistant/SKILL.md +0 -178
  124. package/bundled/locales/zh-TW/skills/forward-derivation/SKILL.md +0 -69
  125. package/bundled/locales/zh-TW/skills/forward-derivation/guide.md +0 -415
  126. package/bundled/locales/zh-TW/skills/methodology-system/SKILL.md +0 -86
  127. package/bundled/locales/zh-TW/skills/methodology-system/create-methodology.md +0 -350
  128. package/bundled/locales/zh-TW/skills/methodology-system/guide.md +0 -131
  129. package/bundled/locales/zh-TW/skills/methodology-system/runtime.md +0 -279
  130. package/bundled/locales/zh-TW/skills/process-automation/SKILL.md +0 -144
  131. /package/bundled/skills/{ac-coverage-assistant → ac-coverage}/SKILL.md +0 -0
  132. /package/bundled/skills/{methodology-system → dev-methodology}/SKILL.md +0 -0
  133. /package/bundled/skills/{methodology-system → dev-methodology}/create-methodology.md +0 -0
  134. /package/bundled/skills/{methodology-system → dev-methodology}/guide.md +0 -0
  135. /package/bundled/skills/{methodology-system → dev-methodology}/integrated-flow.md +0 -0
  136. /package/bundled/skills/{methodology-system → dev-methodology}/prerequisite-check.md +0 -0
  137. /package/bundled/skills/{methodology-system → dev-methodology}/runtime.md +0 -0
  138. /package/bundled/skills/{forward-derivation → spec-derivation}/guide.md +0 -0
@@ -1,190 +0,0 @@
1
- ---
2
- source: ../../../../skills/ac-coverage-assistant/SKILL.md
3
- source_version: 1.1.0
4
- translation_version: 1.1.0
5
- last_synced: 2026-03-26
6
- status: current
7
- description: |
8
- 分析验收条件(AC)与测试之间的追踪关系,产生覆盖率报告。
9
- 使用时机:验证 AC 覆盖率、检查测试追踪性、发布前审查。
10
- 关键字:AC, acceptance-criteria, coverage, traceability, 验收条件, 覆盖率。
11
- ---
12
-
13
- # AC 覆盖率助手
14
-
15
- > **语言**: [English](../../../../skills/ac-coverage-assistant/SKILL.md) | 简体中文
16
-
17
- 分析验收条件(AC)与测试之间的追踪关系,并产生覆盖率报告。
18
-
19
- ## 与 `/coverage` 的区别
20
-
21
- | 方面 | `/coverage` | `/ac-coverage` |
22
- |------|-------------|----------------|
23
- | **范围** | 代码级别(行/分支/函数) | 需求级别(AC 到测试) |
24
- | **输入** | 源代码 + 测试运行器 | SPEC 文件 + 测试标注 |
25
- | **问题** | "多少代码被测试了?" | "哪些 AC 有测试?" |
26
- | **输出** | 覆盖率百分比 | 追踪矩阵 + 差距报告 |
27
-
28
- ## 工作流程
29
-
30
- 1. **解析 SPEC** — 从规格文件中提取 AC 定义(AC-1、AC-2……)
31
- 2. **扫描测试** — 使用标准链接惯例搜索测试文件中的 `@AC` 和 `@SPEC` 标注
32
- 3. **构建矩阵** — 将每个 AC 映射到其测试引用(文件、测试名称、行号)
33
- 4. **分类状态** — 将每个 AC 标记为 ✅ 已覆盖、⚠️ 部分覆盖 或 ❌ 未覆盖
34
- 5. **计算覆盖率** — 套用公式:`覆盖率 % = (已覆盖 + 部分覆盖 × 0.5) / 总计 × 100`
35
- 6. **产生报告** — 输出标准化 Markdown 报告
36
-
37
- ## 标注惯例
38
-
39
- 测试必须使用标准标注引用其来源 AC:
40
-
41
- ```typescript
42
- // TypeScript/JavaScript
43
- describe('AC-1: 使用有效凭证登录', () => {
44
- // @AC AC-1
45
- // @SPEC SPEC-001
46
- it('should redirect to dashboard on successful login', () => { ... });
47
- });
48
- ```
49
-
50
- ```python
51
- # Python
52
- class TestAC1_UserLogin:
53
- """AC-1: 使用有效凭证登录
54
- @AC AC-1
55
- @SPEC SPEC-001
56
- """
57
- def test_redirect_to_dashboard(self): ...
58
- ```
59
-
60
- ```gherkin
61
- # BDD Feature
62
- @SPEC-001 @AC-1
63
- Scenario: 使用有效凭证登录
64
- ```
65
-
66
- ## 覆盖率门槛
67
-
68
- | 门槛 | 默认值 | 执行时机 |
69
- |------|--------|---------|
70
- | **提交** | 80% | 功能分支合并时必须达标 |
71
- | **发布** | 100% | 生产环境发布时必须达标 |
72
- | **警告** | 60% | 触发覆盖率警告 |
73
-
74
- 门槛可通过 `--threshold` 参数或项目配置自定义。
75
-
76
- ## 四层追溯(`--full` 模式)
77
-
78
- 使用 `--full` 标记将追溯从 2 层(AC→Test)扩展为 4 层。
79
-
80
- ### 追溯层次
81
-
82
- ```
83
- 第 0 层:需求 / 用户故事(REQ)
84
- ↓ (定义)
85
- 第 1 层:验收条件(AC)
86
- ↓ (@AC 标注)
87
- 第 2 层:测试用例
88
- ↓ (覆盖)
89
- 第 3 层:源代码(@implements)
90
- ```
91
-
92
- ### 各层标注惯例
93
-
94
- ```typescript
95
- // 第 3→1 层:代码引用 AC
96
- // @implements AC-1, AC-2
97
- function authenticate(user: string, pass: string) { ... }
98
- ```
99
-
100
- ```markdown
101
- <!-- 第 0→1 层:SPEC 中的需求 -->
102
- ## 需求
103
- ### REQ-1: 用户认证
104
- - AC-1: 给定有效凭证,当登录时,则通过认证
105
- - AC-2: 给定无效凭证,当登录时,则拒绝登录
106
- ```
107
-
108
- ### 完整追溯报告
109
-
110
- ```markdown
111
- ## 四层追溯矩阵
112
-
113
- | 需求 | AC | 测试 | 代码 | 状态 |
114
- |------|-----|------|------|------|
115
- | REQ-1 | AC-1 | auth.test.ts:15 | auth.ts:42 | ✅ 完整 |
116
- | REQ-1 | AC-2 | auth.test.ts:30 | auth.ts:58 | ✅ 完整 |
117
- | REQ-2 | AC-3 | — | dashboard.ts:10 | ⚠️ 无测试 |
118
- | REQ-3 | AC-4 | export.test.ts:5 | — | ⚠️ 无代码 |
119
-
120
- ### 差距摘要
121
- - 第 0→1 层:2 个需求缺少 AC
122
- - 第 1→2 层:1 个 AC 缺少测试
123
- - 第 2→3 层:0 个测试缺少代码映射
124
- - 第 3→1 层:3 个代码文件缺少 AC 映射
125
- ```
126
-
127
- ### 反向追溯
128
-
129
- 使用 `--trace-code <path>` 从代码反向追溯到需求。
130
-
131
- ```bash
132
- /ac-coverage --trace-code src/auth.ts
133
- # 输出:
134
- # src/auth.ts:42 → @implements AC-1 → REQ-1 (SPEC-AUTH-001)
135
- # src/auth.ts:58 → @implements AC-2 → REQ-1 (SPEC-AUTH-001)
136
- ```
137
-
138
- ## 报告格式
139
-
140
- 产生的报告遵循 `core/acceptance-criteria-traceability.md` 的标准格式:
141
-
142
- ```markdown
143
- # AC 覆盖率报告
144
-
145
- **规格**: SPEC-001 — 功能名称
146
- **产生日期**: 2026-03-26
147
- **覆盖率**: 75% (6/8 AC)
148
-
149
- ## 摘要
150
-
151
- | 状态 | 数量 | 百分比 |
152
- |------|------|--------|
153
- | ✅ 已覆盖 | 5 | 62.5% |
154
- | ⚠️ 部分覆盖 | 2 | 25.0% |
155
- | ❌ 未覆盖 | 1 | 12.5% |
156
-
157
- ## 追踪矩阵
158
-
159
- | AC-ID | 描述 | 状态 | 测试引用 |
160
- |-------|------|------|---------|
161
- | AC-1 | 使用有效凭证登录 | ✅ | auth.test.ts:15 |
162
- | AC-2 | 拒绝无效凭证 | ✅ | auth.test.ts:32 |
163
- | ... | ... | ... | ... |
164
-
165
- ## 差距
166
-
167
- - **AC-8**: 社交登录 — 被 OAuth 沙箱阻塞
168
-
169
- ## 行动项目
170
-
171
- 1. [ ] AC-8: 建立 OAuth 沙箱(预计完成时间:待定)
172
- ```
173
-
174
- ## 下一步引导
175
-
176
- `/ac-coverage` 完成后,AI 助手应建议:
177
-
178
- > **AC 覆盖率分析完成。建议下一步:**
179
- > - 覆盖率达标 → 执行 `/checkin` 品质关卡
180
- > - 有未覆盖 AC → 执行 `/derive-tdd` 补齐测试 ⭐ **推荐**
181
- > - 有部分覆盖 AC → 检查缺少的边界情况
182
- > - 需要完整追溯 → 执行 `/ac-coverage --full`
183
- > - 反向追溯 → 执行 `/ac-coverage --trace-code <path>`
184
-
185
- ## 参考
186
-
187
- - 核心规范:[acceptance-criteria-traceability.md](../../../../core/acceptance-criteria-traceability.md)
188
- - SPEC:[SPEC-AC-COVERAGE.md](../../../../docs/specs/skills/SPEC-AC-COVERAGE.md)
189
- - 相关:[test-coverage-assistant](../test-coverage-assistant/SKILL.md)(代码级别覆盖率)
190
- - 相关:[checkin-assistant](../checkin-assistant/SKILL.md)(品质关卡)
@@ -1,71 +0,0 @@
1
- ---
2
- source: ../../../../skills/forward-derivation/SKILL.md
3
- source_version: 2.0.0
4
- translation_version: 2.0.0
5
- last_synced: 2026-02-10
6
- status: current
7
- description: |
8
- 从已批准的 SDD 规格生成衍生工件(BDD 场景、TDD 骨架、ATDD 表格)。
9
- 使用时机:从规格推导测试、生成 BDD/TDD/ATDD 工件。
10
- 关键字:derive, forward, BDD, TDD, ATDD, spec, 推演, 衍生, 规格, 场景。
11
- ---
12
-
13
- # 正向推演
14
-
15
- > **语言**: [English](../../../../skills/forward-derivation/SKILL.md) | 简体中文
16
-
17
- 从已批准的 SDD 规格生成衍生工件(BDD 场景、TDD 骨架、ATDD 表格)。
18
-
19
- ## 子命令
20
-
21
- | 子命令 | 说明 | 输出 | Output |
22
- |--------|------|------|--------|
23
- | `all` | 生成 BDD + TDD(默认) | `.feature` + `.test.*` | `.feature` + `.test.*` |
24
- | `bdd` | 仅生成 BDD 场景 | `.feature` | `.feature` |
25
- | `tdd` | 仅生成 TDD 骨架 | `.test.*` | `.test.*` |
26
- | `atdd` | 生成 ATDD 测试表格 | `.md`(Markdown 表格) | `.md` (Markdown tables) |
27
-
28
- ## 工作流程
29
-
30
- 1. **读取规格** - 分析输入的 `SPEC-XXX.md` 文件
31
- 2. **提取 AC** - 解析所有验收条件
32
- 3. **生成工件** - 建立 BDD/TDD/ATDD 输出
33
- 4. **验证** - 确保 AC 与生成项目之间的 1:1 对应
34
-
35
- ## 防幻觉规则
36
-
37
- | 规则 | 说明 | Rule | Description |
38
- |------|------|------|-------------|
39
- | **1:1 对应** | 每个 AC 对应一个测试/场景 | 1:1 Mapping | Every AC has exactly one test/scenario |
40
- | **可追溯性** | 所有工件引用规格与 AC 编号 | Traceability | All artifacts reference Spec ID and AC ID |
41
- | **禁止捏造** | 不新增规格外的场景 | No Invention | Do not add scenarios not in the spec |
42
-
43
- ## 生成工件标签
44
-
45
- | 标签 | 含义 | Tag | Meaning |
46
- |------|------|-----|---------|
47
- | `[Source]` | 直接来自规格 | Source | Direct content from spec |
48
- | `[Derived]` | 从来源转换 | Derived | Transformed from source |
49
- | `[Generated]` | AI 生成的结构 | Generated | AI-generated structure |
50
- | `[TODO]` | 需人工实现 | TODO | Requires human implementation |
51
-
52
- ## 使用方式
53
-
54
- - `/derive all specs/SPEC-001.md` - 推演 BDD + TDD
55
- - `/derive bdd specs/SPEC-001.md` - 仅推演 BDD 场景
56
- - `/derive tdd specs/SPEC-001.md` - 仅推演 TDD 骨架
57
- - `/derive atdd specs/SPEC-001.md` - 推演 ATDD 表格
58
-
59
- ## 下一步引导
60
-
61
- `/derive` 完成后,AI 助手应建议:
62
-
63
- > **测试工件已生成。建议下一步:**
64
- > - 执行 `/tdd` 开始红绿重构循环
65
- > - 执行 `/bdd` 细化 Gherkin 场景
66
- > - 检查生成的 `[TODO]` 标记并补齐实现
67
-
68
- ## 参考
69
-
70
- - 详细指南:[guide.md](./guide.md)
71
- - 核心规范:[forward-derivation-standards.md](../../../../core/forward-derivation-standards.md)
@@ -1,130 +0,0 @@
1
- ---
2
- scope: partial
3
- description: |
4
- 从已批准的 SDD 规格推导 BDD 场景和 TDD 测试骨架。
5
- ATDD 验收测试表为可选输出,用于特殊需求。
6
- 使用时机:规格已批准、开始 BDD/TDD 实施、生成测试结构。
7
- 关键字:forward derivation, spec to test, BDD generation, TDD skeleton, test derivation, 正向推导, 规格转测试, 测试生成。
8
- source: ../../../../skills/forward-derivation/SKILL.md
9
- source_version: 2.0.0
10
- translation_version: 2.0.0
11
- last_synced: 2026-01-25
12
- status: current
13
- ---
14
-
15
- # 正向推导指南
16
-
17
- > **语言**: [English](../../../../skills/forward-derivation/SKILL.md) | [繁體中文](../../../zh-TW/skills/forward-derivation/SKILL.md)
18
-
19
- **版本**: 2.0.0
20
- **最后更新**: 2026-01-25
21
- **适用范围**: Claude Code Skills
22
-
23
- > **核心标准**: 此技能实现[正向推导标准](../../../../core/forward-derivation-standards.md)。任何 AI 工具皆可参考核心标准取得完整方法论文档。
24
-
25
- ---
26
-
27
- ## 目的
28
-
29
- 此技能引导您从已批准的 SDD 规格推导 BDD 场景和 TDD 测试骨架,并严格遵循反幻觉标准。
30
-
31
- > **注意**: ATDD 测试表为可选项,可通过 `/derive-atdd` 取得。BDD 场景本身已作为可执行验收测试,使 ATDD 表对大多数用例变得多余。
32
-
33
- 正向推导是[反向工程](../reverse-engineer/SKILL.md)的对称对应:
34
- - **反向工程**: 代码 → 规格
35
- - **正向推导**: 规格 → 测试
36
-
37
- ## 快速参考
38
-
39
- ### 正向推导工作流程
40
-
41
- ```
42
- ┌─────────────────────────────────────────────────────────────────┐
43
- │ 正向推导工作流程 │
44
- ├─────────────────────────────────────────────────────────────────┤
45
- │ │
46
- │ 1️⃣ SPEC 解析 (AI 自动化) │
47
- │ ├─ 读取已批准规格 │
48
- │ ├─ 提取验收标准 (GWT 或项目) │
49
- │ └─ 验证 SPEC 结构和完整性 │
50
- │ │
51
- │ 2️⃣ 推导 (AI 自动化) │
52
- │ ├─ AC → BDD Gherkin 场景 │
53
- │ ├─ AC → 带 TODO 的 TDD 测试骨架 │
54
- │ └─ (可选) AC → ATDD 验收测试表 │
55
- │ │
56
- │ 3️⃣ 人工审查 (必需) │
57
- │ ├─ 验证生成的场景匹配 AC 意图 │
58
- │ ├─ 填写 [TODO] 部分 │
59
- │ └─ 如需要,完善步骤定义 │
60
- │ │
61
- └─────────────────────────────────────────────────────────────────┘
62
- ```
63
-
64
- ### 命令概述
65
-
66
- | 命令 | 输入 | 输出 | 目的 |
67
- |------|------|------|------|
68
- | `/derive-bdd` | SPEC-XXX.md | .feature | AC → Gherkin 场景 |
69
- | `/derive-tdd` | SPEC-XXX.md | .test.ts | AC → 测试骨架 |
70
- | `/derive-all` | SPEC-XXX.md | .feature + .test.ts | 完整推导流水线 |
71
- | `/derive-atdd` | SPEC-XXX.md | acceptance.md | AC → 验收测试表 (可选) |
72
-
73
- ---
74
-
75
- ## 核心原则
76
-
77
- ### 1. 规格边界生成
78
-
79
- **关键**: 仅推导规格中存在的内容。绝不要添加超出验收标准明确定义的场景、测试或功能。
80
-
81
- ```
82
- # 反幻觉规则
83
- 输入: 带有 N 个验收标准的 SPEC
84
- 输出: 正好 N 个场景 (BDD)
85
- 正好 N 个测试组 (TDD)
86
- 正好 N 个验收测试 (ATDD,如请求)
87
-
88
- 如果输出数量 ≠ 输入数量 → 违规
89
- ```
90
-
91
- ### 2. 来源归属
92
-
93
- 每个生成项必须包含可追溯性:
94
-
95
- ```gherkin
96
- # 生成自: specs/SPEC-001.md
97
- # AC: AC-1
98
-
99
- @SPEC-001 @AC-1
100
- Scenario: 使用有效凭据的用户登录
101
- ```
102
-
103
- ### 3. 推导标签(来自统一标签系统)
104
-
105
- 此技能使用**推导标签**从规格生成新内容。有关完整标签参考,请参见[反幻觉标准](../../../../core/anti-hallucination.md#certainty-classification-tags)。
106
-
107
- | 标签 | 使用时机 | 示例 |
108
- |-----|----------|------|
109
- | `[来源]` | 直接来自 SPEC 的内容 | 功能标题,AC 文本 |
110
- | `[推导]` | 从 SPEC 内容转换 | 从项目 AC 转换的 GWT |
111
- | `[生成]` | AI 生成结构 | 测试骨架 |
112
- | `[TODO]` | 需要人工实施 | 断言,步骤定义 |
113
-
114
- ---
115
-
116
- ## 版本历史
117
-
118
- | 版本 | 日期 | 变更 |
119
- |------|------|------|
120
- | 2.0.0 | 2026-01-25 | ATDD 从必需改为可选输出;/derive-all 现在只输出 BDD + TDD |
121
- | 1.1.0 | 2026-01-25 | 新增:统一标签系统引用 |
122
- | 1.0.0 | 2026-01-19 | 初始发布 |
123
-
124
- ---
125
-
126
- ## 许可证
127
-
128
- 此技能根据 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 许可发布。
129
-
130
- **来源**: [universal-dev-standards](https://github.com/AsiaOstrich/universal-dev-standards)
@@ -1,88 +0,0 @@
1
- ---
2
- source: ../../../../skills/methodology-system/SKILL.md
3
- source_version: 1.0.0
4
- translation_version: 1.0.0
5
- last_synced: 2026-02-10
6
- status: current
7
- description: |
8
- 管理当前项目的开发方法论,支持 SDD 和双循环 TDD 两个独立系统。
9
- 使用时机:切换方法论、查看当前阶段、管理开发流程。
10
- 关键字:methodology, SDD, TDD, BDD, ATDD, 方法论, 开发流程。
11
- ---
12
-
13
- # 方法论系统
14
-
15
- > **语言**: [English](../../../../skills/methodology-system/SKILL.md) | 简体中文
16
-
17
- > [!WARNING]
18
- > **实验性功能**
19
- >
20
- > 此功能正在积极开发中,可能在 v4.0 中有重大变更。
21
-
22
- 管理当前项目的开发方法论,支持两个独立系统。
23
-
24
- **两个独立系统:**
25
- - **系统 A:SDD** - 规格驱动开发(AI 时代、规格优先)
26
- - **系统 B:双循环 TDD** - BDD(外部循环)+ TDD(内部循环)(传统)
27
-
28
- **可选输入:** ATDD - 验收测试驱动开发(可作为任一系统的输入)
29
-
30
- ## 动作
31
-
32
- | 动作 | 说明 |
33
- |------|------|
34
- | *(无)* / `status` | 显示当前阶段和检查清单 |
35
- | `switch <id>` | 切换到不同方法论 |
36
- | `phase [name]` | 显示或变更当前阶段 |
37
- | `checklist` | 显示当前阶段检查清单 |
38
- | `skip` | 跳过当前阶段(会有警告) |
39
- | `list` | 列出可用方法论 |
40
- | `create` | 建立自定方法论 |
41
-
42
- ## 可用方法论
43
-
44
- | 系统 | ID | 工作流程 |
45
- |------|-----|---------|
46
- | A:SDD | `sdd` | /sdd -> 审查 -> /derive-all -> 实现 |
47
- | B:BDD | `bdd` | 探索 -> 制定 -> 自动化 |
48
- | B:TDD | `tdd` | 红 -> 绿 -> 重构 |
49
- | 输入 | `atdd` | 工作坊 -> 示例 -> 测试 |
50
-
51
- ## 使用示例
52
-
53
- ```
54
- /methodology # 显示当前状态
55
- /methodology switch sdd # 切换到规格驱动开发
56
- /methodology phase green # 移至 GREEN 阶段(TDD)
57
- /methodology checklist # 显示当前阶段检查清单
58
- /methodology list # 列出所有可用方法论
59
- /methodology skip # 跳过当前阶段(会有警告)
60
- /methodology create # 启动自定方法论向导
61
- ```
62
-
63
- ## 配置
64
-
65
- 方法论设置存储在 `.standards/manifest.json`:
66
-
67
- ```json
68
- {
69
- "methodology": {
70
- "active": "sdd",
71
- "available": ["tdd", "bdd", "sdd", "atdd"]
72
- }
73
- }
74
- ```
75
-
76
- ## 下一步引导
77
-
78
- `/methodology` 完成后,AI 助手应根据选择的方法论建议:
79
-
80
- > **方法论已设定。建议下一步:**
81
- > - SDD 方法论 → 执行 `/sdd` 建立规格
82
- > - BDD 方法论 → 执行 `/bdd` 开始场景探索
83
- > - TDD 方法论 → 执行 `/tdd` 开始红绿重构
84
- > - ATDD 方法论 → 执行 `/atdd` 定义验收条件
85
-
86
- ## 参考
87
-
88
- - 详细指南:[guide.md](./guide.md)