universal-dev-standards 5.0.0-rc.8 → 5.0.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 (355) hide show
  1. package/bin/uds.js +5 -3
  2. package/bundled/ai/standards/acceptance-criteria-traceability.ai.yaml +178 -0
  3. package/bundled/ai/standards/agent-dispatch.ai.yaml +69 -0
  4. package/bundled/ai/standards/ai-command-behavior.ai.yaml +45 -0
  5. package/bundled/ai/standards/api-design-standards.ai.yaml +192 -0
  6. package/bundled/ai/standards/branch-completion.ai.yaml +82 -0
  7. package/bundled/ai/standards/change-batching-standards.ai.yaml +195 -0
  8. package/bundled/ai/standards/database-standards.ai.yaml +220 -0
  9. package/bundled/ai/standards/error-codes.ai.yaml +37 -2
  10. package/bundled/ai/standards/git-worktree.ai.yaml +77 -0
  11. package/bundled/ai/standards/logging.ai.yaml +21 -2
  12. package/bundled/ai/standards/model-selection.ai.yaml +81 -0
  13. package/bundled/ai/standards/pipeline-integration-standards.ai.yaml +184 -0
  14. package/bundled/ai/standards/systematic-debugging.ai.yaml +73 -0
  15. package/bundled/ai/standards/verification-evidence.ai.yaml +84 -0
  16. package/bundled/ai/standards/workflow-enforcement.ai.yaml +253 -0
  17. package/bundled/core/acceptance-criteria-traceability.md +293 -0
  18. package/bundled/core/agent-dispatch.md +149 -0
  19. package/bundled/core/ai-command-behavior.md +239 -0
  20. package/bundled/core/api-design-standards.md +938 -0
  21. package/bundled/core/branch-completion.md +158 -0
  22. package/bundled/core/change-batching-standards.md +257 -0
  23. package/bundled/core/checkin-standards.md +43 -6
  24. package/bundled/core/database-standards.md +828 -0
  25. package/bundled/core/error-code-standards.md +228 -2
  26. package/bundled/core/forward-derivation-standards.md +54 -2
  27. package/bundled/core/git-worktree.md +131 -0
  28. package/bundled/core/model-selection.md +153 -0
  29. package/bundled/core/pipeline-integration-standards.md +230 -0
  30. package/bundled/core/systematic-debugging.md +156 -0
  31. package/bundled/core/testing-standards.md +49 -39
  32. package/bundled/core/verification-evidence.md +172 -0
  33. package/bundled/core/workflow-enforcement.md +132 -0
  34. package/bundled/locales/zh-CN/CLAUDE.md +2 -2
  35. package/bundled/locales/zh-CN/README.md +4 -4
  36. package/bundled/locales/zh-CN/SECURITY.md +92 -0
  37. package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +301 -0
  38. package/bundled/locales/zh-CN/core/acceptance-test-driven-development.md +47 -0
  39. package/bundled/locales/zh-CN/core/accessibility-standards.md +124 -0
  40. package/bundled/locales/zh-CN/core/agent-dispatch.md +113 -0
  41. package/bundled/locales/zh-CN/core/ai-agreement-standards.md +103 -0
  42. package/bundled/locales/zh-CN/core/ai-command-behavior.md +247 -0
  43. package/bundled/locales/zh-CN/core/api-design-standards.md +946 -0
  44. package/bundled/locales/zh-CN/core/behavior-driven-development.md +48 -0
  45. package/bundled/locales/zh-CN/core/branch-completion.md +112 -0
  46. package/bundled/locales/zh-CN/core/change-batching-standards.md +265 -0
  47. package/bundled/locales/zh-CN/core/checkin-standards.md +43 -5
  48. package/bundled/locales/zh-CN/core/context-aware-loading.md +106 -0
  49. package/bundled/locales/zh-CN/core/database-standards.md +836 -0
  50. package/bundled/locales/zh-CN/core/deployment-standards.md +80 -0
  51. package/bundled/locales/zh-CN/core/error-code-standards.md +2 -2
  52. package/bundled/locales/zh-CN/core/forward-derivation-standards.md +493 -0
  53. package/bundled/locales/zh-CN/core/git-worktree.md +101 -0
  54. package/bundled/locales/zh-CN/core/model-selection.md +112 -0
  55. package/bundled/locales/zh-CN/core/performance-standards.md +104 -0
  56. package/bundled/locales/zh-CN/core/pipeline-integration-standards.md +238 -0
  57. package/bundled/locales/zh-CN/core/project-context-memory.md +124 -0
  58. package/bundled/locales/zh-CN/core/requirement-engineering.md +49 -0
  59. package/bundled/locales/zh-CN/core/security-standards.md +100 -0
  60. package/bundled/locales/zh-CN/core/systematic-debugging.md +106 -0
  61. package/bundled/locales/zh-CN/core/test-governance.md +116 -0
  62. package/bundled/locales/zh-CN/core/testing-standards.md +392 -156
  63. package/bundled/locales/zh-CN/core/verification-evidence.md +118 -0
  64. package/bundled/locales/zh-CN/core/virtual-organization-standards.md +104 -0
  65. package/bundled/locales/zh-CN/core/workflow-enforcement.md +132 -0
  66. package/bundled/locales/zh-CN/docs/CHEATSHEET.md +27 -1
  67. package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +9 -1
  68. package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +37 -9
  69. package/bundled/locales/zh-CN/docs/USER-MANUAL.md +652 -0
  70. package/bundled/locales/zh-CN/integrations/github-copilot/copilot-instructions.md +1 -1
  71. package/bundled/locales/zh-CN/integrations/openspec/AGENTS.md +29 -4
  72. package/bundled/locales/zh-CN/integrations/spec-kit/AGENTS.md +143 -72
  73. package/bundled/locales/zh-CN/skills/ac-coverage-assistant/SKILL.md +126 -0
  74. package/bundled/locales/zh-CN/skills/api-design-assistant/SKILL.md +100 -0
  75. package/bundled/locales/zh-CN/skills/brainstorm-assistant/SKILL.md +119 -0
  76. package/bundled/locales/zh-CN/skills/ci-cd-assistant/SKILL.md +82 -0
  77. package/bundled/locales/zh-CN/skills/commands/ac-coverage.md +97 -0
  78. package/bundled/locales/zh-CN/skills/commands/api-design.md +94 -0
  79. package/bundled/locales/zh-CN/skills/commands/atdd.md +163 -0
  80. package/bundled/locales/zh-CN/skills/commands/audit.md +77 -0
  81. package/bundled/locales/zh-CN/skills/commands/bdd.md +1 -1
  82. package/bundled/locales/zh-CN/skills/commands/brainstorm.md +87 -0
  83. package/bundled/locales/zh-CN/skills/commands/changelog.md +63 -0
  84. package/bundled/locales/zh-CN/skills/commands/check.md +219 -0
  85. package/bundled/locales/zh-CN/skills/commands/checkin.md +61 -0
  86. package/bundled/locales/zh-CN/skills/commands/ci-cd.md +77 -0
  87. package/bundled/locales/zh-CN/skills/commands/commit.md +81 -0
  88. package/bundled/locales/zh-CN/skills/commands/config.md +207 -0
  89. package/bundled/locales/zh-CN/skills/commands/coverage.md +74 -0
  90. package/bundled/locales/zh-CN/skills/commands/database.md +78 -0
  91. package/bundled/locales/zh-CN/skills/commands/derive-all.md +58 -0
  92. package/bundled/locales/zh-CN/skills/commands/derive-atdd.md +54 -0
  93. package/bundled/locales/zh-CN/skills/commands/derive-bdd.md +53 -0
  94. package/bundled/locales/zh-CN/skills/commands/derive-tdd.md +54 -0
  95. package/bundled/locales/zh-CN/skills/commands/derive.md +78 -0
  96. package/bundled/locales/zh-CN/skills/commands/dev-workflow.md +119 -0
  97. package/bundled/locales/zh-CN/skills/commands/discover.md +86 -0
  98. package/bundled/locales/zh-CN/skills/commands/docgen.md +67 -0
  99. package/bundled/locales/zh-CN/skills/commands/docs.md +65 -0
  100. package/bundled/locales/zh-CN/skills/commands/durable.md +87 -0
  101. package/bundled/locales/zh-CN/skills/commands/guide.md +52 -0
  102. package/bundled/locales/zh-CN/skills/commands/incident.md +92 -0
  103. package/bundled/locales/zh-CN/skills/commands/init.md +272 -0
  104. package/bundled/locales/zh-CN/skills/commands/methodology.md +1 -1
  105. package/bundled/locales/zh-CN/skills/commands/metrics.md +73 -0
  106. package/bundled/locales/zh-CN/skills/commands/migrate.md +92 -0
  107. package/bundled/locales/zh-CN/skills/commands/pr.md +80 -0
  108. package/bundled/locales/zh-CN/skills/commands/refactor.md +1 -1
  109. package/bundled/locales/zh-CN/skills/commands/release.md +62 -0
  110. package/bundled/locales/zh-CN/skills/commands/requirement.md +54 -0
  111. package/bundled/locales/zh-CN/skills/commands/reverse-bdd.md +47 -0
  112. package/bundled/locales/zh-CN/skills/commands/reverse-sdd.md +51 -0
  113. package/bundled/locales/zh-CN/skills/commands/reverse-tdd.md +51 -0
  114. package/bundled/locales/zh-CN/skills/commands/reverse.md +63 -0
  115. package/bundled/locales/zh-CN/skills/commands/review.md +50 -0
  116. package/bundled/locales/zh-CN/skills/commands/scan.md +76 -0
  117. package/bundled/locales/zh-CN/skills/commands/sdd-retro.md +40 -0
  118. package/bundled/locales/zh-CN/skills/commands/sdd.md +379 -0
  119. package/bundled/locales/zh-CN/skills/commands/security.md +75 -0
  120. package/bundled/locales/zh-CN/skills/commands/tdd.md +111 -0
  121. package/bundled/locales/zh-CN/skills/commands/update.md +337 -0
  122. package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +1 -2
  123. package/bundled/locales/zh-CN/skills/database-assistant/SKILL.md +97 -0
  124. package/bundled/locales/zh-CN/skills/dev-workflow-guide/SKILL.md +145 -0
  125. package/bundled/locales/zh-CN/skills/durable-execution-assistant/SKILL.md +84 -0
  126. package/bundled/locales/zh-CN/skills/incident-response-assistant/SKILL.md +107 -0
  127. package/bundled/locales/zh-CN/skills/metrics-dashboard-assistant/SKILL.md +67 -0
  128. package/bundled/locales/zh-CN/skills/migration-assistant/SKILL.md +77 -0
  129. package/bundled/locales/zh-CN/skills/pr-automation-assistant/SKILL.md +90 -0
  130. package/bundled/locales/zh-CN/skills/security-assistant/SKILL.md +79 -0
  131. package/bundled/locales/zh-CN/skills/security-scan-assistant/SKILL.md +72 -0
  132. package/bundled/locales/zh-CN/skills/spec-driven-dev/SKILL.md +73 -10
  133. package/bundled/locales/zh-CN/skills/spec-driven-dev/guide.md +267 -122
  134. package/bundled/locales/zh-TW/CLAUDE.md +2 -2
  135. package/bundled/locales/zh-TW/README.md +4 -4
  136. package/bundled/locales/zh-TW/SECURITY.md +92 -0
  137. package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +301 -0
  138. package/bundled/locales/zh-TW/core/acceptance-test-driven-development.md +47 -0
  139. package/bundled/locales/zh-TW/core/accessibility-standards.md +84 -0
  140. package/bundled/locales/zh-TW/core/agent-dispatch.md +89 -0
  141. package/bundled/locales/zh-TW/core/ai-agreement-standards.md +87 -0
  142. package/bundled/locales/zh-TW/core/ai-command-behavior.md +247 -0
  143. package/bundled/locales/zh-TW/core/api-design-standards.md +946 -0
  144. package/bundled/locales/zh-TW/core/behavior-driven-development.md +63 -0
  145. package/bundled/locales/zh-TW/core/branch-completion.md +76 -0
  146. package/bundled/locales/zh-TW/core/change-batching-standards.md +265 -0
  147. package/bundled/locales/zh-TW/core/checkin-standards.md +39 -5
  148. package/bundled/locales/zh-TW/core/context-aware-loading.md +86 -0
  149. package/bundled/locales/zh-TW/core/database-standards.md +836 -0
  150. package/bundled/locales/zh-TW/core/deployment-standards.md +66 -0
  151. package/bundled/locales/zh-TW/core/error-code-standards.md +230 -4
  152. package/bundled/locales/zh-TW/core/forward-derivation-standards.md +62 -2
  153. package/bundled/locales/zh-TW/core/git-worktree.md +104 -0
  154. package/bundled/locales/zh-TW/core/model-selection.md +83 -0
  155. package/bundled/locales/zh-TW/core/performance-standards.md +84 -0
  156. package/bundled/locales/zh-TW/core/pipeline-integration-standards.md +238 -0
  157. package/bundled/locales/zh-TW/core/project-context-memory.md +79 -0
  158. package/bundled/locales/zh-TW/core/requirement-engineering.md +79 -0
  159. package/bundled/locales/zh-TW/core/security-standards.md +74 -0
  160. package/bundled/locales/zh-TW/core/systematic-debugging.md +95 -0
  161. package/bundled/locales/zh-TW/core/test-governance.md +88 -0
  162. package/bundled/locales/zh-TW/core/testing-standards.md +309 -86
  163. package/bundled/locales/zh-TW/core/verification-evidence.md +94 -0
  164. package/bundled/locales/zh-TW/core/virtual-organization-standards.md +88 -0
  165. package/bundled/locales/zh-TW/core/workflow-enforcement.md +132 -0
  166. package/bundled/locales/zh-TW/docs/CHEATSHEET.md +27 -1
  167. package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +9 -1
  168. package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +37 -9
  169. package/bundled/locales/zh-TW/docs/USER-MANUAL.md +652 -0
  170. package/bundled/locales/zh-TW/integrations/github-copilot/copilot-instructions.md +1 -1
  171. package/bundled/locales/zh-TW/integrations/openspec/AGENTS.md +29 -4
  172. package/bundled/locales/zh-TW/integrations/spec-kit/AGENTS.md +142 -71
  173. package/bundled/locales/zh-TW/skills/ac-coverage-assistant/SKILL.md +127 -0
  174. package/bundled/locales/zh-TW/skills/ai-friendly-architecture/SKILL.md +1 -4
  175. package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +1 -4
  176. package/bundled/locales/zh-TW/skills/api-design-assistant/SKILL.md +97 -0
  177. package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +1 -4
  178. package/bundled/locales/zh-TW/skills/audit-assistant/SKILL.md +1 -4
  179. package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +1 -4
  180. package/bundled/locales/zh-TW/skills/brainstorm-assistant/SKILL.md +1 -4
  181. package/bundled/locales/zh-TW/skills/changelog-guide/SKILL.md +1 -4
  182. package/bundled/locales/zh-TW/skills/checkin-assistant/SKILL.md +1 -4
  183. package/bundled/locales/zh-TW/skills/ci-cd-assistant/SKILL.md +79 -0
  184. package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +1 -4
  185. package/bundled/locales/zh-TW/skills/commands/ac-coverage.md +95 -0
  186. package/bundled/locales/zh-TW/skills/commands/api-design.md +92 -0
  187. package/bundled/locales/zh-TW/skills/commands/atdd.md +167 -0
  188. package/bundled/locales/zh-TW/skills/commands/audit.md +75 -0
  189. package/bundled/locales/zh-TW/skills/commands/bdd.md +1 -1
  190. package/bundled/locales/zh-TW/skills/commands/brainstorm.md +91 -0
  191. package/bundled/locales/zh-TW/skills/commands/changelog.md +67 -0
  192. package/bundled/locales/zh-TW/skills/commands/check.md +223 -0
  193. package/bundled/locales/zh-TW/skills/commands/checkin.md +65 -0
  194. package/bundled/locales/zh-TW/skills/commands/ci-cd.md +75 -0
  195. package/bundled/locales/zh-TW/skills/commands/commit.md +85 -0
  196. package/bundled/locales/zh-TW/skills/commands/config.md +211 -0
  197. package/bundled/locales/zh-TW/skills/commands/coverage.md +78 -0
  198. package/bundled/locales/zh-TW/skills/commands/database.md +76 -0
  199. package/bundled/locales/zh-TW/skills/commands/derive-all.md +62 -0
  200. package/bundled/locales/zh-TW/skills/commands/derive-atdd.md +58 -0
  201. package/bundled/locales/zh-TW/skills/commands/derive-bdd.md +54 -0
  202. package/bundled/locales/zh-TW/skills/commands/derive-tdd.md +55 -0
  203. package/bundled/locales/zh-TW/skills/commands/derive.md +79 -0
  204. package/bundled/locales/zh-TW/skills/commands/dev-workflow.md +120 -0
  205. package/bundled/locales/zh-TW/skills/commands/discover.md +87 -0
  206. package/bundled/locales/zh-TW/skills/commands/docgen.md +68 -0
  207. package/bundled/locales/zh-TW/skills/commands/docs.md +66 -0
  208. package/bundled/locales/zh-TW/skills/commands/durable.md +85 -0
  209. package/bundled/locales/zh-TW/skills/commands/guide.md +51 -0
  210. package/bundled/locales/zh-TW/skills/commands/incident.md +90 -0
  211. package/bundled/locales/zh-TW/skills/commands/init.md +273 -0
  212. package/bundled/locales/zh-TW/skills/commands/methodology.md +1 -1
  213. package/bundled/locales/zh-TW/skills/commands/metrics.md +71 -0
  214. package/bundled/locales/zh-TW/skills/commands/migrate.md +90 -0
  215. package/bundled/locales/zh-TW/skills/commands/pr.md +78 -0
  216. package/bundled/locales/zh-TW/skills/commands/refactor.md +1 -1
  217. package/bundled/locales/zh-TW/skills/commands/release.md +63 -0
  218. package/bundled/locales/zh-TW/skills/commands/requirement.md +61 -0
  219. package/bundled/locales/zh-TW/skills/commands/reverse-bdd.md +54 -0
  220. package/bundled/locales/zh-TW/skills/commands/reverse-sdd.md +58 -0
  221. package/bundled/locales/zh-TW/skills/commands/reverse-tdd.md +58 -0
  222. package/bundled/locales/zh-TW/skills/commands/reverse.md +70 -0
  223. package/bundled/locales/zh-TW/skills/commands/review.md +57 -0
  224. package/bundled/locales/zh-TW/skills/commands/scan.md +74 -0
  225. package/bundled/locales/zh-TW/skills/commands/sdd-retro.md +47 -0
  226. package/bundled/locales/zh-TW/skills/commands/sdd.md +362 -0
  227. package/bundled/locales/zh-TW/skills/commands/security.md +73 -0
  228. package/bundled/locales/zh-TW/skills/commands/tdd.md +115 -0
  229. package/bundled/locales/zh-TW/skills/commands/update.md +326 -0
  230. package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +2 -6
  231. package/bundled/locales/zh-TW/skills/database-assistant/SKILL.md +94 -0
  232. package/bundled/locales/zh-TW/skills/dev-workflow-guide/SKILL.md +140 -0
  233. package/bundled/locales/zh-TW/skills/docs-generator/SKILL.md +1 -4
  234. package/bundled/locales/zh-TW/skills/documentation-guide/SKILL.md +1 -4
  235. package/bundled/locales/zh-TW/skills/durable-execution-assistant/SKILL.md +81 -0
  236. package/bundled/locales/zh-TW/skills/error-code-guide/SKILL.md +1 -4
  237. package/bundled/locales/zh-TW/skills/forward-derivation/SKILL.md +1 -4
  238. package/bundled/locales/zh-TW/skills/git-workflow-guide/SKILL.md +1 -4
  239. package/bundled/locales/zh-TW/skills/incident-response-assistant/SKILL.md +104 -0
  240. package/bundled/locales/zh-TW/skills/logging-guide/SKILL.md +1 -4
  241. package/bundled/locales/zh-TW/skills/methodology-system/SKILL.md +1 -4
  242. package/bundled/locales/zh-TW/skills/metrics-dashboard-assistant/SKILL.md +64 -0
  243. package/bundled/locales/zh-TW/skills/migration-assistant/SKILL.md +74 -0
  244. package/bundled/locales/zh-TW/skills/pr-automation-assistant/SKILL.md +87 -0
  245. package/bundled/locales/zh-TW/skills/project-discovery/SKILL.md +1 -4
  246. package/bundled/locales/zh-TW/skills/refactoring-assistant/SKILL.md +1 -4
  247. package/bundled/locales/zh-TW/skills/release-standards/SKILL.md +1 -4
  248. package/bundled/locales/zh-TW/skills/requirement-assistant/SKILL.md +1 -4
  249. package/bundled/locales/zh-TW/skills/reverse-engineer/SKILL.md +1 -4
  250. package/bundled/locales/zh-TW/skills/security-assistant/SKILL.md +76 -0
  251. package/bundled/locales/zh-TW/skills/security-scan-assistant/SKILL.md +69 -0
  252. package/bundled/locales/zh-TW/skills/spec-driven-dev/SKILL.md +74 -14
  253. package/bundled/locales/zh-TW/skills/spec-driven-dev/guide.md +243 -98
  254. package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +1 -4
  255. package/bundled/locales/zh-TW/skills/test-coverage-assistant/SKILL.md +1 -4
  256. package/bundled/locales/zh-TW/skills/testing-guide/SKILL.md +1 -5
  257. package/bundled/skills/README.md +11 -0
  258. package/bundled/skills/ac-coverage-assistant/SKILL.md +127 -0
  259. package/bundled/skills/ai-collaboration-standards/SKILL.md +10 -0
  260. package/bundled/skills/ai-friendly-architecture/SKILL.md +10 -0
  261. package/bundled/skills/ai-instruction-standards/SKILL.md +10 -0
  262. package/bundled/skills/api-design-assistant/SKILL.md +119 -0
  263. package/bundled/skills/atdd-assistant/SKILL.md +7 -0
  264. package/bundled/skills/bdd-assistant/SKILL.md +7 -0
  265. package/bundled/skills/brainstorm-assistant/SKILL.md +7 -0
  266. package/bundled/skills/checkin-assistant/SKILL.md +7 -0
  267. package/bundled/skills/ci-cd-assistant/SKILL.md +97 -0
  268. package/bundled/skills/code-review-assistant/SKILL.md +7 -0
  269. package/bundled/skills/commands/README.md +70 -0
  270. package/bundled/skills/commands/ac-coverage.md +135 -0
  271. package/bundled/skills/commands/api-design.md +86 -0
  272. package/bundled/skills/commands/atdd.md +69 -0
  273. package/bundled/skills/commands/audit.md +69 -0
  274. package/bundled/skills/commands/bdd.md +101 -0
  275. package/bundled/skills/commands/brainstorm.md +45 -0
  276. package/bundled/skills/commands/changelog.md +34 -0
  277. package/bundled/skills/commands/check.md +52 -1
  278. package/bundled/skills/commands/checkin.md +46 -0
  279. package/bundled/skills/commands/ci-cd.md +69 -0
  280. package/bundled/skills/commands/commit.md +79 -0
  281. package/bundled/skills/commands/config.md +48 -0
  282. package/bundled/skills/commands/coverage.md +53 -0
  283. package/bundled/skills/commands/database.md +70 -0
  284. package/bundled/skills/commands/derive-all.md +40 -0
  285. package/bundled/skills/commands/derive-atdd.md +33 -0
  286. package/bundled/skills/commands/derive-bdd.md +39 -0
  287. package/bundled/skills/commands/derive-tdd.md +40 -0
  288. package/bundled/skills/commands/derive.md +47 -0
  289. package/bundled/skills/commands/dev-workflow.md +104 -7
  290. package/bundled/skills/commands/discover.md +39 -0
  291. package/bundled/skills/commands/docgen.md +35 -0
  292. package/bundled/skills/commands/docs.md +40 -0
  293. package/bundled/skills/commands/durable.md +79 -0
  294. package/bundled/skills/commands/incident.md +84 -0
  295. package/bundled/skills/commands/init.md +55 -0
  296. package/bundled/skills/commands/methodology.md +72 -0
  297. package/bundled/skills/commands/metrics.md +65 -0
  298. package/bundled/skills/commands/migrate.md +84 -0
  299. package/bundled/skills/commands/pr.md +72 -0
  300. package/bundled/skills/commands/refactor.md +51 -0
  301. package/bundled/skills/commands/release.md +60 -0
  302. package/bundled/skills/commands/requirement.md +38 -0
  303. package/bundled/skills/commands/reverse-bdd.md +34 -0
  304. package/bundled/skills/commands/reverse-sdd.md +42 -0
  305. package/bundled/skills/commands/reverse-tdd.md +40 -0
  306. package/bundled/skills/commands/reverse.md +41 -0
  307. package/bundled/skills/commands/review.md +39 -0
  308. package/bundled/skills/commands/scan.md +68 -0
  309. package/bundled/skills/commands/sdd-retro.md +48 -0
  310. package/bundled/skills/commands/sdd.md +220 -0
  311. package/bundled/skills/commands/security.md +67 -0
  312. package/bundled/skills/commands/tdd.md +101 -0
  313. package/bundled/skills/commands/update.md +61 -0
  314. package/bundled/skills/commit-standards/SKILL.md +8 -2
  315. package/bundled/skills/database-assistant/SKILL.md +118 -0
  316. package/bundled/skills/dev-workflow-guide/SKILL.md +53 -7
  317. package/bundled/skills/dev-workflow-guide/workflow-phases.md +24 -0
  318. package/bundled/skills/durable-execution-assistant/SKILL.md +116 -0
  319. package/bundled/skills/forward-derivation/SKILL.md +7 -0
  320. package/bundled/skills/incident-response-assistant/SKILL.md +132 -0
  321. package/bundled/skills/methodology-system/SKILL.md +24 -2
  322. package/bundled/skills/metrics-dashboard-assistant/SKILL.md +109 -0
  323. package/bundled/skills/migration-assistant/SKILL.md +119 -0
  324. package/bundled/skills/pr-automation-assistant/SKILL.md +114 -0
  325. package/bundled/skills/project-discovery/SKILL.md +7 -0
  326. package/bundled/skills/refactoring-assistant/SKILL.md +7 -0
  327. package/bundled/skills/release-standards/SKILL.md +7 -0
  328. package/bundled/skills/requirement-assistant/SKILL.md +7 -0
  329. package/bundled/skills/reverse-engineer/SKILL.md +7 -0
  330. package/bundled/skills/security-assistant/SKILL.md +105 -0
  331. package/bundled/skills/security-scan-assistant/SKILL.md +96 -0
  332. package/bundled/skills/spec-driven-dev/SKILL.md +84 -4
  333. package/bundled/skills/spec-driven-dev/guide.md +156 -22
  334. package/bundled/skills/tdd-assistant/SKILL.md +7 -0
  335. package/bundled/skills/test-coverage-assistant/SKILL.md +11 -0
  336. package/bundled/skills/testing-guide/SKILL.md +23 -0
  337. package/package.json +1 -1
  338. package/src/commands/check.js +154 -8
  339. package/src/commands/config.js +231 -104
  340. package/src/commands/init.js +23 -3
  341. package/src/commands/update.js +250 -25
  342. package/src/config/ai-agent-paths.js +16 -0
  343. package/src/config/workflow-definitions.js +184 -0
  344. package/src/core/constants.js +6 -0
  345. package/src/flows/init-flow.js +23 -6
  346. package/src/i18n/messages.js +51 -3
  347. package/src/installers/integration-installer.js +67 -2
  348. package/src/installers/manifest-installer.js +1 -0
  349. package/src/installers/standards-installer.js +3 -2
  350. package/src/prompts/init.js +50 -3
  351. package/src/reconciler/manifest-migrator.js +2 -2
  352. package/src/reconciler/plan-executor.js +11 -0
  353. package/src/utils/integration-generator.js +327 -14
  354. package/src/utils/workflow-gate.js +292 -0
  355. package/standards-registry.json +160 -5
@@ -0,0 +1,379 @@
1
+ ---
2
+ description: [UDS] Create or review specification documents for Spec-Driven Development
3
+ allowed-tools: Read, Write, Grep, Glob, Bash(git:*), Bash(npm test:*)
4
+ argument-hint: "[create|review|approve|implement|verify] [spec name or file | 规格名称或文件]"
5
+ ---
6
+
7
+ # Spec-Driven Development Assistant | 规格驱动开发助手
8
+
9
+ Create, review, approve, implement, and verify specification documents — full SDD lifecycle management.
10
+
11
+ 创建、审查、批准、实现和验证规格文件 — 完整 SDD 生命周期管理。
12
+
13
+ ## Pre-Flight Checks | 前置检查
14
+
15
+ Before executing ANY SDD phase, the AI assistant MUST run the applicable checks below. If a check fails, STOP and guide the user to the correct phase.
16
+
17
+ 在执行任何 SDD 阶段前,AI 助手必须执行以下适用的检查。如果检查失败,停止并引导用户到正确的阶段。
18
+
19
+ ### Phase Gate Matrix | 阶段闸门矩阵
20
+
21
+ | Target Phase | Pre-Flight Check | On Failure |
22
+ |-------------|-----------------|------------|
23
+ | `discuss` | None (entry point) | — |
24
+ | `create` | `ls docs/specs/` → check for existing orphan specs | Warn, offer to close orphans first |
25
+ | `review` | Spec file exists AND status = `Draft` | → Guide to `/sdd create` |
26
+ | `approve` | Spec file exists AND status = `Review` | → Guide to `/sdd review` |
27
+ | `implement` | 1. `ls docs/specs/SPEC-*.md` → at least one spec exists | → Guide to `/sdd create` |
28
+ | | 2. Spec status = `Approved` (check `status:` field in spec) | → Guide to `/sdd approve` |
29
+ | | 3. Check `.workflow-state/` for active SDD state | Resume if exists |
30
+ | `verify` | 1. Spec status = `Implemented` or has implementation commits | → Guide to `/sdd implement` |
31
+ | | 2. All AC have code + test references | → List incomplete ACs |
32
+
33
+ ### Check Commands | 检查指令
34
+
35
+ ```bash
36
+ # Check for existing specs
37
+ ls docs/specs/SPEC-*.md 2>/dev/null
38
+
39
+ # Check spec status (grep the status field)
40
+ grep -m1 "^status:" docs/specs/SPEC-XXX.md
41
+
42
+ # Check for active workflow state
43
+ ls .workflow-state/sdd-*.yaml 2>/dev/null
44
+
45
+ # Check AC implementation status
46
+ grep -E "^- \[(x|X)\]" docs/specs/SPEC-XXX.md
47
+ ```
48
+
49
+ ### Enforcement Behavior | 执行行为
50
+
51
+ - **Mode: `enforce`** (default) — 阻止阶段转换,显示引导
52
+ - **Mode: `suggest`** — 显示警告但允许覆盖
53
+ - **Mode: `off`** — 不检查
54
+
55
+ 检查项目配置:`.uds/config.yaml` → `workflow.enforcement_mode`
56
+
57
+ ---
58
+
59
+ ## SDD Workflow | SDD 工作流程
60
+
61
+ ```
62
+ /sdd discuss ──► /sdd create ──► /sdd review ──► /sdd approve ──► /sdd implement ──► /sdd verify
63
+ ```
64
+
65
+ ### Phase 0.5: Discuss — Capture Gray Areas | 捕捉灰色地带
66
+
67
+ Before writing a spec, conduct a structured discussion to resolve ambiguities.
68
+
69
+ 在撰写规格前,进行结构化讨论以解决模糊之处。
70
+
71
+ **Discuss Checklist | 讨论检查清单:**
72
+ - [ ] 灰色地带已识别并列出
73
+ - [ ] 范围已锁定(范围内/外)
74
+ - [ ] 必读参考已收集(read_first 列表)
75
+ - [ ] 已检查既有决策(.project-context/)
76
+ - [ ] 问题基于实际代码,不是猜测
77
+
78
+ **Scope Lock Rule**: 讨论中发现的新功能归类为**延后**,另行追踪。不扩大当前范围。
79
+
80
+ **产出**:一份 `read_first` 清单和范围定义,作为创建阶段的输入。
81
+
82
+ ### Phase 1: Create — Write Spec | 撰写规格
83
+
84
+ Define requirements, technical design, acceptance criteria, and test plan.
85
+
86
+ 定义需求、技术设计、验收标准和测试计划。
87
+
88
+ **Orphan Check**: 创建新规格前,检查是否有未关闭的孤儿规格。考虑先关闭或归档它们。
89
+
90
+ ### Phase 2: Review — Validate | 审查验证
91
+
92
+ Check for completeness, consistency, and feasibility with stakeholders.
93
+
94
+ 与利益相关者检查完整性、一致性和可行性。
95
+
96
+ ### Phase 3: Approve — Sign Off | 批准
97
+
98
+ Get stakeholder sign-off before implementation begins. Update spec status from Draft/Review to Approved.
99
+
100
+ 在开始实现前取得利益相关者批准。将规格状态从 Draft/Review 更新为 Approved。
101
+
102
+ **Approval checklist | 批准检查清单:**
103
+ - [ ] 所有审查意见已处理
104
+ - [ ] 需求完整且无歧义
105
+ - [ ] 验收标准可测试
106
+ - [ ] 技术设计可行
107
+ - [ ] 测试计划涵盖所有 AC
108
+
109
+ **Approval metadata added to spec | 批准元数据:**
110
+ ```yaml
111
+ status: Approved
112
+ approved-date: YYYY-MM-DD
113
+ approved-by: [approver]
114
+ ```
115
+
116
+ ### Phase 4: Implement — Code | 实现
117
+
118
+ Develop following the approved spec, referencing requirements and AC. Track progress per AC.
119
+
120
+ 依照已批准规格开发,追踪每个 AC 的实现进度。
121
+
122
+ **针对每个 AC 追踪:**
123
+ - [ ] 代码已实现
124
+ - [ ] 单元测试已编写
125
+ - [ ] 测试通过
126
+
127
+ **Atomic Commits per AC | 每 AC 一个 Commit:**
128
+
129
+ Prefer one commit per acceptance criterion for better traceability. Tightly coupled ACs may be combined.
130
+
131
+ 建议每个验收标准一个 commit 以提升可追溯性。紧耦合的 AC 可合并。
132
+
133
+ **建议 commit 格式:**
134
+ ```
135
+ feat(<scope>): implement AC-N — <description>
136
+
137
+ Implements acceptance criteria AC-N from SPEC-XXX.
138
+ See: docs/specs/SPEC-XXX.md#AC-N
139
+
140
+ Refs: SPEC-XXX, AC-N
141
+ ```
142
+
143
+ ### Phase 5: Verify — Confirm | 验证
144
+
145
+ Ensure implementation matches spec, all tests pass, AC satisfied. Generate verification report.
146
+
147
+ 确保实现符合规格、所有测试通过、AC 已满足。生成验证报告。
148
+
149
+ **验证报告输出:**
150
+ ```markdown
151
+ # Verification Report: SPEC-XXX
152
+
153
+ ## Summary
154
+ - Status: PASS / FAIL
155
+ - Date: YYYY-MM-DD
156
+
157
+ ## AC Coverage
158
+ | AC | Implementation | Test | Status |
159
+ |----|---------------|------|--------|
160
+ | AC-1 | src/auth.js:42 | tests/auth.test.js:15 | PASS |
161
+
162
+ ## Deviation Report | 偏差报告
163
+ | Type | Description | Justification |
164
+ |------|-------------|---------------|
165
+ | Added | Rate limiting on login endpoint | Security requirement discovered during implementation |
166
+ | Modified | AC-3 uses JWT instead of session tokens | Team decision (see PRJ-2026-0042) |
167
+ | Omitted | AC-5 social login | Deferred to SPEC-XXX-v2 |
168
+ ```
169
+
170
+ **偏差类别:**
171
+ - **Added**: 规格中未列出的功能
172
+ - **Modified**: 与规格不同的功能
173
+ - **Omitted**: 未实现的规格需求
174
+
175
+ 重大偏差必须记录为 `.project-context/` 中的 `decision` 类型条目。
176
+
177
+ **验证循环上限:**
178
+
179
+ 验证阶段上限为 **3 次迭代**。3 次失败后,停止并选择:
180
+
181
+ 1. 审查规格是否有歧义 — AC 是否不清楚?
182
+ 2. 重新思考实现方案 — 尝试不同方法
183
+ 3. 升级处理至利益相关者
184
+
185
+ 迭代次数记录在 `.workflow-state/` 中。
186
+
187
+ **Traceability Matrix (Recommended) | 追溯矩阵(建议):**
188
+
189
+ 生成 REQ → AC → Test → Implementation → Commit 追溯矩阵:
190
+
191
+ ```markdown
192
+ | REQ-ID | AC | Test | Implementation | Commit |
193
+ |--------|-----|------|----------------|--------|
194
+ | REQ-001 | AC-1 | auth.test.js:15 | auth.js:42 | abc1234 |
195
+ | REQ-002 | AC-2 | auth.test.js:30 | auth.js:67 | def5678 |
196
+ ```
197
+
198
+ 空栏位标记为 `[INCOMPLETE]`。
199
+
200
+ ## Enhanced Workflow | 增强工作流程
201
+
202
+ ### Phase 0: Scope Evaluation (NEW) | 范围评估(新增)
203
+
204
+ Before creating a spec, evaluate the change scope:
205
+
206
+ 在创建规格前,先评估变更范围:
207
+
208
+ **Q1: Scope | 范围**
209
+ - [ ] Project-specific (CLAUDE.md only) | 项目专用
210
+ - [ ] Universal (Core Standard) | 通用规则
211
+
212
+ **Q2: Interaction | 交互**
213
+ - [ ] Needs AI interaction → Create Skill | 需要 AI 交互 → 创建 Skill
214
+ - [ ] Static rule only | 静态规则
215
+
216
+ **Q3: Trigger | 触发**
217
+ - [ ] User-triggered → Create Command | 用户触发 → 创建命令
218
+ - [ ] AI applies automatically | AI 自动应用
219
+
220
+ **Record in spec metadata:**
221
+ ```yaml
222
+ scope: universal|project|utility
223
+ sync-to:
224
+ - core-standard: pending|complete|N/A
225
+ - skill: pending|complete|N/A
226
+ - command: pending|complete|N/A
227
+ - translations: pending|complete|N/A
228
+ ```
229
+
230
+ ### Phase 6: Sync Verification (NEW) | 同步验证(新增)
231
+
232
+ After implementation, verify all sync targets:
233
+
234
+ 实现后,验证所有同步目标:
235
+
236
+ - [ ] Core Standard created/updated (if universal)
237
+ - [ ] Skill created/updated (if interactive)
238
+ - [ ] Command created/updated (if user-triggered)
239
+ - [ ] Translations synchronized
240
+
241
+ ## Spec States | 规格状态
242
+
243
+ | State | Description | 说明 |
244
+ |-------|-------------|------|
245
+ | Draft | Work in progress | 草稿中 |
246
+ | Review | Under review | 审查中 |
247
+ | Approved | Ready for implementation | 已批准 |
248
+ | Implemented | Code complete | 已实现 |
249
+ | Archived | Completed or deprecated | 已归档 |
250
+
251
+ ## Acceptance Criteria Format | 验收标准格式
252
+
253
+ All new acceptance criteria **MUST** use Given/When/Then (GWT) format:
254
+
255
+ 所有新的验收标准**必须**使用 Given/When/Then (GWT) 格式:
256
+
257
+ ```
258
+ Given [precondition],
259
+ When [action],
260
+ Then [expected outcome].
261
+ ```
262
+
263
+ **示例:**
264
+ - `Given a logged-in user, When they click 'Export', Then a CSV file is downloaded`
265
+ - `Given an empty cart, When the user adds an item, Then the cart count shows 1`
266
+
267
+ **好处:**
268
+ - 支持通过 `/derive-bdd` 进行结构化 BDD 推导
269
+ - 减少验收标准的模糊性
270
+ - 与测试场景一对一对应
271
+
272
+ **注意**:现有规格不需要回溯更新为 GWT 格式。
273
+
274
+ ## Session Boundaries | Session 分界建议
275
+
276
+ For long SDD workflows, consider starting a new AI session at natural phase boundaries to prevent context degradation:
277
+
278
+ 对于长时间的 SDD 工作流程,建议在自然阶段边界开启新的 AI session 以防止上下文退化:
279
+
280
+ | Boundary | Phases Before | Phases After |
281
+ |----------|--------------|--------------|
282
+ | 1 | Create + Review | Implement |
283
+ | 2 | Implement | Verify |
284
+ | 3 | Verify | Archive |
285
+
286
+ 使用 `workflow-state` 文件和 `.project-context/` 在 session 间持久化状态。这是建议而非强制要求。
287
+
288
+ ## Spec Document Structure | 规格文件结构
289
+
290
+ ```markdown
291
+ # Feature: [Feature Name]
292
+
293
+ ## Overview
294
+ Brief description of the feature.
295
+
296
+ ## Requirements
297
+ - REQ-001: [Requirement description]
298
+ - REQ-002: [Requirement description]
299
+
300
+ ## Technical Design
301
+ ### Architecture
302
+ [Design details]
303
+
304
+ ### API Changes
305
+ [API specifications]
306
+
307
+ ### Database Changes
308
+ [Schema changes]
309
+
310
+ ## Acceptance Criteria
311
+ - AC-1: Given [precondition], When [action], Then [expected outcome]
312
+ - AC-2: Given [precondition], When [action], Then [expected outcome]
313
+
314
+ ## Test Plan
315
+ - [ ] Unit tests for [component]
316
+ - [ ] Integration tests for [flow]
317
+
318
+ ## Rollout Plan
319
+ [Deployment strategy]
320
+ ```
321
+
322
+ ## Usage | 使用方式
323
+
324
+ | Command | Purpose | 用途 |
325
+ |---------|---------|------|
326
+ | `/sdd` | Interactive spec creation wizard | 交互式规格创建向导 |
327
+ | `/sdd discuss` | Start discuss phase for a feature | 启动功能讨论阶段 |
328
+ | `/sdd discuss auth-flow` | Discuss specific feature | 讨论特定功能 |
329
+ | `/sdd auth-flow` | Create spec for specific feature | 为特定功能创建规格 |
330
+ | `/sdd create auth-flow` | Explicit create phase | 明确指定创建阶段 |
331
+ | `/sdd review` | Review existing specs | 审查现有规格 |
332
+ | `/sdd review specs/SPEC-001.md` | Review specific spec | 审查指定规格 |
333
+ | `/sdd approve` | List specs pending approval | 列出待批准规格 |
334
+ | `/sdd approve specs/SPEC-001.md` | Approve specific spec | 批准指定规格 |
335
+ | `/sdd implement` | List approved specs | 列出已批准规格 |
336
+ | `/sdd implement specs/SPEC-001.md` | Track implementation for spec | 追踪指定规格的实现 |
337
+ | `/sdd verify` | List implemented specs | 列出已实现规格 |
338
+ | `/sdd verify specs/SPEC-001.md` | Verify implementation for spec | 验证指定规格的实现 |
339
+ | `/sdd --evaluate` | Run scope evaluation only | 仅执行范围评估 |
340
+ | `/sdd --sync-check` | Check sync status | 检查同步状态 |
341
+
342
+ ## Typical SDD Workflow | 典型 SDD 工作流程
343
+
344
+ ```bash
345
+ /sdd discuss user-authentication # Phase 0.5: 讨论灰色地带
346
+ /sdd user-authentication # Phase 1: 创建规格
347
+ /sdd review specs/SPEC-001.md # Phase 2: 审查
348
+ /sdd approve specs/SPEC-001.md # Phase 3: 批准
349
+ /derive-all specs/SPEC-001.md # 生成测试结构
350
+ /sdd implement specs/SPEC-001.md # Phase 4: 追踪实现
351
+ /sdd verify specs/SPEC-001.md # Phase 5: 验证(最多 3 次迭代)
352
+ ```
353
+
354
+ ## Sync Checklist Template | 同步检查清单模板
355
+
356
+ Include in every spec:
357
+
358
+ ```markdown
359
+ ## Sync Checklist
360
+
361
+ ### From Core Standard
362
+ - [ ] Skill created/updated?
363
+ - [ ] Command created?
364
+ - [ ] Translations synced?
365
+
366
+ ### From Skill
367
+ - [ ] Core Standard exists? (or marked as [Scope: Utility])
368
+ - [ ] Command created?
369
+ - [ ] Translations synced?
370
+
371
+ ### From Command
372
+ - [ ] Skill documentation updated?
373
+ - [ ] Translations synced?
374
+ ```
375
+
376
+ ## Reference | 参考
377
+
378
+ - Full standard: [spec-driven-dev](../spec-driven-dev/SKILL.md)
379
+ - Core standard: [spec-driven-development.md](../../core/spec-driven-development.md)
@@ -0,0 +1,75 @@
1
+ ---
2
+ source: ../../../../skills/commands/security.md
3
+ source_version: 1.0.0
4
+ translation_version: 1.0.0
5
+ last_synced: 2026-03-25
6
+ status: current
7
+ ---
8
+
9
+ ---
10
+ description: "[UDS] Guide security review and vulnerability assessment following OWASP standards"
11
+ allowed-tools: Read, Grep, Glob
12
+ argument-hint: "[module or file to audit | 要审计的模块或文件]"
13
+ ---
14
+
15
+ # Security Assistant | 安全助手
16
+
17
+ Guide security review and vulnerability assessment following OWASP standards.
18
+
19
+ 引导安全审查和漏洞评估,遵循 OWASP 标准。
20
+
21
+ ## Workflow | 工作流程
22
+
23
+ ```
24
+ SCOPE ──► SCAN ──► ANALYZE ──► REPORT
25
+ ```
26
+
27
+ ## Usage | 使用方式
28
+
29
+ - `/security` - 启动交互式安全审查
30
+ - `/security src/auth` - 审查特定模块
31
+ - `/security --owasp` - 聚焦 OWASP Top 10 审查
32
+
33
+ ## AI Agent Behavior | AI 代理行为
34
+
35
+ > 遵循 [AI Command Behavior Standards](../../core/ai-command-behavior.md)
36
+
37
+ ### Entry Router | 进入路由
38
+
39
+ | 输入 | AI 动作 |
40
+ |------|---------|
41
+ | `/security` | 询问审查范围,进入 SCOPE |
42
+ | `/security <path>` | 直接审查指定路径 |
43
+ | `/security --owasp` | 聚焦 OWASP Top 10 审查 |
44
+
45
+ ### Interaction Script | 交互脚本
46
+
47
+ 1. 确认审查范围
48
+ 2. 扫描代码,识别潜在漏洞
49
+ 3. 依严重程度分类(Critical / High / Medium / Low)
50
+ 4. 生成安全审查报告
51
+
52
+ **Decision: 发现严重漏洞**
53
+ - IF Critical → 立即标记,建议优先修复
54
+ - IF High → 标记为重要,建议尽快修复
55
+ - ELSE → 列入报告,建议排期修复
56
+
57
+ **STOP**: 报告展示后等待用户决定
58
+
59
+ ### Stop Points | 停止点
60
+
61
+ | 停止点 | 等待内容 |
62
+ |--------|---------|
63
+ | 安全报告展示后 | 用户决定修复优先顺序 |
64
+
65
+ ### Error Handling | 错误处理
66
+
67
+ | 错误条件 | AI 动作 |
68
+ |----------|---------|
69
+ | 目标路径不存在 | 列出可用路径 |
70
+ | 代码过大无法全面扫描 | 建议聚焦高风险区域(auth、input handling、API) |
71
+
72
+ ## Reference | 参考
73
+
74
+ - Full standard: [security-assistant](../security-assistant/SKILL.md)
75
+ - Core guide: [security-standards](../../core/security-standards.md)
@@ -0,0 +1,111 @@
1
+ ---
2
+ description: [UDS] Guide through Test-Driven Development workflow
3
+ allowed-tools: Read, Write, Grep, Glob, Bash(npm test:*), Bash(npx:*)
4
+ argument-hint: "[feature or function to implement | 要实现的功能]"
5
+ status: experimental
6
+ ---
7
+
8
+ # TDD Assistant | TDD 助手
9
+
10
+ > [!WARNING]
11
+ > **Experimental Feature / 实验性功能**
12
+ >
13
+ > This feature is under active development and may change significantly in v4.0.
14
+ > 此功能正在积极开发中,可能在 v4.0 中有重大变更。
15
+
16
+ Guide through the Test-Driven Development (TDD) workflow: Red-Green-Refactor.
17
+
18
+ 引导测试驱动开发(TDD)流程:红-绿-重构。
19
+
20
+ ## Pre-Flight Checks | 前置检查
21
+
22
+ Before executing TDD phases, the AI assistant MUST verify prerequisites. If a check fails, STOP and guide the user.
23
+
24
+ 在执行 TDD 阶段前,AI 助手必须验证前置条件。如果检查失败,停止并引导用户。
25
+
26
+ ### Phase Gate Matrix | 阶段闸门矩阵
27
+
28
+ | Target Phase | Pre-Flight Check | On Failure |
29
+ |-------------|-----------------|------------|
30
+ | `RED` | 1. Feature/function clearly defined | → Ask user to describe the behavior |
31
+ | | 2. If SDD project: spec exists and is Approved | → Guide to `/sdd` |
32
+ | `GREEN` | 1. At least one failing test exists | → Guide back to RED phase |
33
+ | | 2. Run tests → confirm failure (not error) | → Fix test syntax/setup first |
34
+ | `REFACTOR` | 1. All tests passing (GREEN confirmed) | → Stay in GREEN phase |
35
+ | | 2. No failing tests from previous RED cycle | → Complete GREEN first |
36
+
37
+ ### Red-Before-Green Enforcement | 红灯优先强制
38
+
39
+ ```
40
+ RED: Write test → run → MUST fail
41
+ ↓ (only proceed if test fails with expected assertion failure)
42
+ GREEN: Write minimal code → run → MUST pass
43
+ ↓ (only proceed if ALL tests pass)
44
+ REFACTOR: Clean up → run → MUST still pass
45
+ ```
46
+
47
+ **关键规则**:AI 不得在失败测试存在之前编写实现代码。如果用户要求「直接写代码」,提醒 TDD 契约并建议先写测试。
48
+
49
+ ---
50
+
51
+ ## Methodology Integration | 方法论整合
52
+
53
+ 当调用 `/tdd` 时:
54
+ 1. **自动启用 TDD 方法论**(如果尚未启用)
55
+ 2. **将当前阶段设为红灯**(编写失败的测试)
56
+ 3. **追踪阶段转换**随着工作进展
57
+ 4. **在响应中显示阶段指示器**
58
+
59
+ See [methodology-system](../methodology-system/SKILL.md) for full methodology tracking.
60
+
61
+ ## TDD Cycle | TDD 循环
62
+
63
+ ```
64
+ ┌─────────────────────────────────────────┐
65
+ │ │
66
+ │ ┌─────┐ ┌─────┐ ┌─────────┐ │
67
+ │ │ RED │ ──► │GREEN│ ──► │REFACTOR │ │
68
+ │ └─────┘ └─────┘ └─────────┘ │
69
+ │ ▲ │ │
70
+ │ └──────────────────────────┘ │
71
+ │ │
72
+ └─────────────────────────────────────────┘
73
+ ```
74
+
75
+ ## Workflow | 工作流程
76
+
77
+ ### 1. RED - 编写失败的测试
78
+ - 为期望的行为编写测试
79
+ - 运行测试 - 应该失败
80
+ - 确认测试有效
81
+
82
+ ### 2. GREEN - 使测试通过
83
+ - 编写最少的代码使测试通过
84
+ - 不添加额外功能
85
+ - 运行测试 - 应该通过
86
+
87
+ ### 3. REFACTOR - 改善代码
88
+ - 清理代码
89
+ - 消除重复
90
+ - 所有测试应仍然通过
91
+
92
+ ## FIRST Principles | FIRST 原则
93
+
94
+ | Principle | Description | 说明 |
95
+ |-----------|-------------|------|
96
+ | **F**ast | Tests run quickly | 快速执行 |
97
+ | **I**ndependent | No test dependencies | 无依赖性 |
98
+ | **R**epeatable | Same result every time | 可重复 |
99
+ | **S**elf-validating | Pass/fail is clear | 自我验证 |
100
+ | **T**imely | Written before code | 及时编写 |
101
+
102
+ ## Usage | 使用方式
103
+
104
+ - `/tdd` - 启动交互式 TDD 会话
105
+ - `/tdd calculateTotal` - 为特定函数进行 TDD
106
+ - `/tdd "user can login"` - 为用户故事进行 TDD
107
+
108
+ ## Reference | 参考
109
+
110
+ - Full standard: [tdd-assistant](../tdd-assistant/SKILL.md)
111
+ - Core guide: [testing-standards](../../core/testing-standards.md)