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,362 @@
1
+ ---
2
+ source: ../../../../skills/commands/sdd.md
3
+ source_version: 1.0.0
4
+ translation_version: 1.0.0
5
+ last_synced: 2026-03-19
6
+ ---
7
+
8
+ ---
9
+ description: [UDS] Create or review specification documents for Spec-Driven Development
10
+ allowed-tools: Read, Write, Grep, Glob, Bash(git:*), Bash(npm test:*)
11
+ argument-hint: "[create|review|approve|implement|verify] [spec name or file | 規格名稱或檔案]"
12
+ ---
13
+
14
+ # 規格驅動開發助手
15
+
16
+ > **Language**: [English](../../../../skills/commands/sdd.md) | 繁體中文
17
+
18
+ 建立、審查、核准、實作和驗證規格文件 — 完整 SDD 生命週期管理。
19
+
20
+ ## 前置檢查
21
+
22
+ 在執行任何 SDD 階段前,AI 助手必須執行以下適用的檢查。如果檢查失敗,停止並引導使用者到正確的階段。
23
+
24
+ ### 階段閘門矩陣
25
+
26
+ | 目標階段 | 前置檢查 | 失敗時 |
27
+ |---------|---------|--------|
28
+ | `discuss` | 無(入口點) | — |
29
+ | `create` | `ls docs/specs/` → 檢查是否有孤兒規格 | 警告,建議先關閉孤兒規格 |
30
+ | `review` | 規格檔案存在且狀態 = `Draft` | → 引導至 `/sdd create` |
31
+ | `approve` | 規格檔案存在且狀態 = `Review` | → 引導至 `/sdd review` |
32
+ | `implement` | 1. `ls docs/specs/SPEC-*.md` → 至少有一個規格 | → 引導至 `/sdd create` |
33
+ | | 2. 規格狀態 = `Approved`(檢查規格中的 `status:` 欄位) | → 引導至 `/sdd approve` |
34
+ | | 3. 檢查 `.workflow-state/` 是否有活躍的 SDD 狀態 | 如果存在則恢復 |
35
+ | `verify` | 1. 規格狀態 = `Implemented` 或有實作 commits | → 引導至 `/sdd implement` |
36
+ | | 2. 所有 AC 都有程式碼 + 測試參考 | → 列出未完成的 AC |
37
+
38
+ ### 檢查指令
39
+
40
+ ```bash
41
+ # 檢查現有規格
42
+ ls docs/specs/SPEC-*.md 2>/dev/null
43
+
44
+ # 檢查規格狀態(grep status 欄位)
45
+ grep -m1 "^status:" docs/specs/SPEC-XXX.md
46
+
47
+ # 檢查活躍的工作流程狀態
48
+ ls .workflow-state/sdd-*.yaml 2>/dev/null
49
+
50
+ # 檢查 AC 實作狀態
51
+ grep -E "^- \[(x|X)\]" docs/specs/SPEC-XXX.md
52
+ ```
53
+
54
+ ### 執行行為
55
+
56
+ - **模式:`enforce`**(預設) — 阻斷階段轉換,顯示引導
57
+ - **模式:`suggest`** — 顯示警告但允許覆蓋
58
+ - **模式:`off`** — 無檢查
59
+
60
+ 檢查專案配置:`.uds/config.yaml` → `workflow.enforcement_mode`
61
+
62
+ ---
63
+
64
+ ## SDD 工作流程
65
+
66
+ ```
67
+ /sdd discuss ──► /sdd create ──► /sdd review ──► /sdd approve ──► /sdd implement ──► /sdd verify
68
+ ```
69
+
70
+ ### 階段 0.5:Discuss — 捕捉灰色地帶
71
+
72
+ 在撰寫規格前,進行結構化討論以解決模糊之處。
73
+
74
+ **討論檢查清單:**
75
+ - [ ] 灰色地帶已識別並列出
76
+ - [ ] 範圍已鎖定(範圍內/外)
77
+ - [ ] 必讀參考已收集(read_first 清單)
78
+ - [ ] 已檢查既有決策(.project-context/)
79
+ - [ ] 問題基於實際程式碼,非猜測
80
+
81
+ **範圍鎖定規則**:討論中發現的新功能歸類為**延後**,另行追蹤。不擴大當前範圍。
82
+
83
+ **產出**:一份 `read_first` 清單和範圍定義,作為建立階段的輸入。
84
+
85
+ ### 階段 1:Create — 撰寫規格
86
+
87
+ 定義需求、技術設計、驗收標準和測試計畫。
88
+
89
+ **孤兒檢查**:建立新規格前,檢查是否有未關閉的孤兒規格。考慮先關閉或歸檔它們。
90
+
91
+ ### 階段 2:Review — 審查驗證
92
+
93
+ 與利害關係人檢查完整性、一致性和可行性。
94
+
95
+ ### 階段 3:Approve — 核准
96
+
97
+ 在開始實作前取得利害關係人核准。將規格狀態從 Draft/Review 更新為 Approved。
98
+
99
+ **核准檢查清單:**
100
+ - [ ] 所有審查意見已處理
101
+ - [ ] 需求完整且無歧義
102
+ - [ ] 驗收標準可測試
103
+ - [ ] 技術設計可行
104
+ - [ ] 測試計畫涵蓋所有 AC
105
+
106
+ **核准元資料:**
107
+ ```yaml
108
+ status: Approved
109
+ approved-date: YYYY-MM-DD
110
+ approved-by: [approver]
111
+ ```
112
+
113
+ ### 階段 4:Implement — 實作
114
+
115
+ 依照已核准規格開發,追蹤每個 AC 的實作進度。
116
+
117
+ **針對每個 AC 追蹤:**
118
+ - [ ] 程式碼已實作
119
+ - [ ] 單元測試已撰寫
120
+ - [ ] 測試通過
121
+
122
+ **每 AC 一個 Commit:**
123
+
124
+ 建議每個驗收標準一個 commit 以提升追蹤性。緊耦合的 AC 可合併。
125
+
126
+ **建議 commit 格式:**
127
+ ```
128
+ feat(<scope>): implement AC-N — <description>
129
+
130
+ Implements acceptance criteria AC-N from SPEC-XXX.
131
+ See: docs/specs/SPEC-XXX.md#AC-N
132
+
133
+ Refs: SPEC-XXX, AC-N
134
+ ```
135
+
136
+ ### 階段 5:Verify — 驗證
137
+
138
+ 確保實作符合規格、所有測試通過、AC 已滿足。產生驗證報告。
139
+
140
+ **驗證報告輸出:**
141
+ ```markdown
142
+ # Verification Report: SPEC-XXX
143
+
144
+ ## Summary
145
+ - Status: PASS / FAIL
146
+ - Date: YYYY-MM-DD
147
+
148
+ ## AC Coverage
149
+ | AC | Implementation | Test | Status |
150
+ |----|---------------|------|--------|
151
+ | AC-1 | src/auth.js:42 | tests/auth.test.js:15 | PASS |
152
+
153
+ ## Deviation Report | 偏差報告
154
+ | Type | Description | Justification |
155
+ |------|-------------|---------------|
156
+ | Added | Rate limiting on login endpoint | Security requirement discovered during implementation |
157
+ | Modified | AC-3 uses JWT instead of session tokens | Team decision (see PRJ-2026-0042) |
158
+ | Omitted | AC-5 social login | Deferred to SPEC-XXX-v2 |
159
+ ```
160
+
161
+ **偏差類別:**
162
+ - **Added**:規格中未列出的功能
163
+ - **Modified**:與規格不同的功能
164
+ - **Omitted**:未實作的規格需求
165
+
166
+ 重大偏差必須記錄為 `.project-context/` 中的 `decision` 類型條目。
167
+
168
+ **驗證迴圈上限:**
169
+
170
+ 驗證階段上限為 **3 次迭代**。3 次失敗後,停止並選擇:
171
+
172
+ 1. 審查規格是否有歧義 — AC 是否不夠清楚?
173
+ 2. 重新思考實作方案 — 嘗試不同的方法
174
+ 3. 升級處理至利害關係人
175
+
176
+ 迭代次數記錄在 `.workflow-state/` 中。
177
+
178
+ **追蹤矩陣(建議):**
179
+
180
+ 產生 REQ → AC → Test → Implementation → Commit 追蹤矩陣:
181
+
182
+ ```markdown
183
+ | REQ-ID | AC | Test | Implementation | Commit |
184
+ |--------|-----|------|----------------|--------|
185
+ | REQ-001 | AC-1 | auth.test.js:15 | auth.js:42 | abc1234 |
186
+ | REQ-002 | AC-2 | auth.test.js:30 | auth.js:67 | def5678 |
187
+ ```
188
+
189
+ 空欄位標記為 `[INCOMPLETE]`。
190
+
191
+ ## 增強工作流程
192
+
193
+ ### 階段 0:範圍評估(新增)
194
+
195
+ 在建立規格前,先評估變更範圍:
196
+
197
+ **Q1:範圍**
198
+ - [ ] 專案專用(僅 CLAUDE.md)
199
+ - [ ] 通用規則(Core Standard)
200
+
201
+ **Q2:互動**
202
+ - [ ] 需要 AI 互動 → 建立 Skill
203
+ - [ ] 靜態規則
204
+
205
+ **Q3:觸發**
206
+ - [ ] 使用者觸發 → 建立命令
207
+ - [ ] AI 自動應用
208
+
209
+ **記錄在規格元資料中:**
210
+ ```yaml
211
+ scope: universal|project|utility
212
+ sync-to:
213
+ - core-standard: pending|complete|N/A
214
+ - skill: pending|complete|N/A
215
+ - command: pending|complete|N/A
216
+ - translations: pending|complete|N/A
217
+ ```
218
+
219
+ ### 階段 6:同步驗證(新增)
220
+
221
+ 實作後,驗證所有同步目標:
222
+
223
+ - [ ] Core Standard 已建立/更新(若為 universal)
224
+ - [ ] Skill 已建立/更新(若為 interactive)
225
+ - [ ] Command 已建立/更新(若為 user-triggered)
226
+ - [ ] 翻譯已同步
227
+
228
+ ## 規格狀態
229
+
230
+ | 狀態 | 說明 |
231
+ |------|------|
232
+ | Draft | 草稿中 |
233
+ | Review | 審查中 |
234
+ | Approved | 已核准 |
235
+ | Implemented | 已實作 |
236
+ | Archived | 已歸檔 |
237
+
238
+ ## 驗收標準格式
239
+
240
+ 所有新的驗收標準**必須**使用 Given/When/Then (GWT) 格式:
241
+
242
+ ```
243
+ Given [precondition],
244
+ When [action],
245
+ Then [expected outcome].
246
+ ```
247
+
248
+ **範例:**
249
+ - `Given a logged-in user, When they click 'Export', Then a CSV file is downloaded`
250
+ - `Given an empty cart, When the user adds an item, Then the cart count shows 1`
251
+
252
+ **好處:**
253
+ - 支援透過 `/derive-bdd` 進行結構化 BDD 推導
254
+ - 減少驗收標準的模糊性
255
+ - 與測試場景一對一對應
256
+
257
+ **注意**:現有規格不需要回溯更新為 GWT 格式。
258
+
259
+ ## Session 分界建議
260
+
261
+ 對於長時間的 SDD 工作流程,建議在自然階段邊界開啟新的 AI session 以防止上下文退化:
262
+
263
+ | 分界 | 之前的階段 | 之後的階段 |
264
+ |------|-----------|-----------|
265
+ | 1 | Create + Review | Implement |
266
+ | 2 | Implement | Verify |
267
+ | 3 | Verify | Archive |
268
+
269
+ 使用 `workflow-state` 檔案和 `.project-context/` 在 session 間持久化狀態。這是建議而非強制要求。
270
+
271
+ ## 規格文件結構
272
+
273
+ ```markdown
274
+ # Feature: [Feature Name]
275
+
276
+ ## Overview
277
+ Brief description of the feature.
278
+
279
+ ## Requirements
280
+ - REQ-001: [Requirement description]
281
+ - REQ-002: [Requirement description]
282
+
283
+ ## Technical Design
284
+ ### Architecture
285
+ [Design details]
286
+
287
+ ### API Changes
288
+ [API specifications]
289
+
290
+ ### Database Changes
291
+ [Schema changes]
292
+
293
+ ## Acceptance Criteria
294
+ - AC-1: Given [precondition], When [action], Then [expected outcome]
295
+ - AC-2: Given [precondition], When [action], Then [expected outcome]
296
+
297
+ ## Test Plan
298
+ - [ ] Unit tests for [component]
299
+ - [ ] Integration tests for [flow]
300
+
301
+ ## Rollout Plan
302
+ [Deployment strategy]
303
+ ```
304
+
305
+ ## 使用方式
306
+
307
+ | 指令 | 用途 |
308
+ |------|------|
309
+ | `/sdd` | 互動式規格建立精靈 |
310
+ | `/sdd discuss` | 啟動功能討論階段 |
311
+ | `/sdd discuss auth-flow` | 討論特定功能 |
312
+ | `/sdd auth-flow` | 為特定功能建立規格 |
313
+ | `/sdd create auth-flow` | 明確指定建立階段 |
314
+ | `/sdd review` | 審查現有規格 |
315
+ | `/sdd review specs/SPEC-001.md` | 審查指定規格 |
316
+ | `/sdd approve` | 列出待核准規格 |
317
+ | `/sdd approve specs/SPEC-001.md` | 核准指定規格 |
318
+ | `/sdd implement` | 列出已核准規格 |
319
+ | `/sdd implement specs/SPEC-001.md` | 追蹤指定規格的實作 |
320
+ | `/sdd verify` | 列出已實作規格 |
321
+ | `/sdd verify specs/SPEC-001.md` | 驗證指定規格的實作 |
322
+ | `/sdd --evaluate` | 僅執行範圍評估 |
323
+ | `/sdd --sync-check` | 檢查同步狀態 |
324
+
325
+ ## 典型 SDD 工作流程
326
+
327
+ ```bash
328
+ /sdd discuss user-authentication # 階段 0.5:討論灰色地帶
329
+ /sdd user-authentication # 階段 1:建立規格
330
+ /sdd review specs/SPEC-001.md # 階段 2:審查
331
+ /sdd approve specs/SPEC-001.md # 階段 3:核准
332
+ /derive-all specs/SPEC-001.md # 產生測試結構
333
+ /sdd implement specs/SPEC-001.md # 階段 4:追蹤實作
334
+ /sdd verify specs/SPEC-001.md # 階段 5:驗證(最多 3 次迭代)
335
+ ```
336
+
337
+ ## 同步檢查清單範本
338
+
339
+ 在每個規格中包含:
340
+
341
+ ```markdown
342
+ ## Sync Checklist
343
+
344
+ ### From Core Standard
345
+ - [ ] Skill created/updated?
346
+ - [ ] Command created?
347
+ - [ ] Translations synced?
348
+
349
+ ### From Skill
350
+ - [ ] Core Standard exists? (or marked as [Scope: Utility])
351
+ - [ ] Command created?
352
+ - [ ] Translations synced?
353
+
354
+ ### From Command
355
+ - [ ] Skill documentation updated?
356
+ - [ ] Translations synced?
357
+ ```
358
+
359
+ ## 參考
360
+
361
+ - 完整標準:[spec-driven-dev](../spec-driven-dev/SKILL.md)
362
+ - 核心規範:[spec-driven-development.md](../../core/spec-driven-development.md)
@@ -0,0 +1,73 @@
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
+ # 安全助手
16
+
17
+ 引導安全審查和漏洞評估,遵循 OWASP 標準。
18
+
19
+ ## 工作流程
20
+
21
+ ```
22
+ SCOPE ──► SCAN ──► ANALYZE ──► REPORT
23
+ ```
24
+
25
+ ## 使用方式
26
+
27
+ - `/security` - 開始互動式安全審查
28
+ - `/security src/auth` - 審查指定模組
29
+ - `/security --owasp` - 聚焦 OWASP Top 10 審查
30
+
31
+ ## AI Agent Behavior | AI 代理行為
32
+
33
+ > 遵循 [AI Command Behavior Standards](../../core/ai-command-behavior.md)
34
+
35
+ ### Entry Router | 進入路由
36
+
37
+ | 輸入 | AI 動作 |
38
+ |------|---------|
39
+ | `/security` | 詢問審查範圍,進入 SCOPE |
40
+ | `/security <path>` | 直接審查指定路徑 |
41
+ | `/security --owasp` | 聚焦 OWASP Top 10 審查 |
42
+
43
+ ### Interaction Script | 互動腳本
44
+
45
+ 1. 確認審查範圍
46
+ 2. 掃描程式碼,識別潛在漏洞
47
+ 3. 依嚴重程度分類(Critical / High / Medium / Low)
48
+ 4. 生成安全審查報告
49
+
50
+ **決策:發現嚴重漏洞**
51
+ - IF Critical → 立即標記,建議優先修復
52
+ - IF High → 標記為重要,建議盡快修復
53
+ - ELSE → 列入報告,建議排程修復
54
+
55
+ 🛑 **STOP**: 報告展示後等待使用者決定
56
+
57
+ ### Stop Points | 停止點
58
+
59
+ | 停止點 | 等待內容 |
60
+ |--------|---------|
61
+ | 安全報告展示後 | 使用者決定修復優先順序 |
62
+
63
+ ### Error Handling | 錯誤處理
64
+
65
+ | 錯誤條件 | AI 動作 |
66
+ |----------|---------|
67
+ | 目標路徑不存在 | 列出可用路徑 |
68
+ | 程式碼過大無法全面掃描 | 建議聚焦高風險區域(auth、input handling、API) |
69
+
70
+ ## 參考
71
+
72
+ - 完整標準:[security-assistant](../security-assistant/SKILL.md)
73
+ - 核心指南:[security-standards](../../core/security-standards.md)
@@ -0,0 +1,115 @@
1
+ ---
2
+ source: ../../../../skills/commands/tdd.md
3
+ source_version: 1.0.0
4
+ translation_version: 1.0.0
5
+ last_synced: 2026-03-19
6
+ ---
7
+
8
+ ---
9
+ description: [UDS] Guide through Test-Driven Development workflow
10
+ allowed-tools: Read, Write, Grep, Glob, Bash(npm test:*), Bash(npx:*)
11
+ argument-hint: "[feature or function to implement | 要實作的功能]"
12
+ status: experimental
13
+ ---
14
+
15
+ # TDD 助手
16
+
17
+ > **Language**: [English](../../../../skills/commands/tdd.md) | 繁體中文
18
+
19
+ > [!WARNING]
20
+ > **實驗性功能**
21
+ >
22
+ > 此功能正在積極開發中,可能在 v4.0 中有重大變更。
23
+
24
+ 引導測試驅動開發(TDD)流程:紅-綠-重構。
25
+
26
+ ## 前置檢查
27
+
28
+ 在執行 TDD 階段前,AI 助手必須驗證前置條件。如果檢查失敗,停止並引導使用者。
29
+
30
+ ### 階段閘門矩陣
31
+
32
+ | 目標階段 | 前置檢查 | 失敗時 |
33
+ |---------|---------|--------|
34
+ | `RED` | 1. 功能/函式已清楚定義 | → 要求使用者描述行為 |
35
+ | | 2. 若為 SDD 專案:規格存在且已核准 | → 引導至 `/sdd` |
36
+ | `GREEN` | 1. 至少有一個失敗的測試存在 | → 引導回 RED 階段 |
37
+ | | 2. 執行測試 → 確認失敗(非錯誤) | → 先修復測試語法/設定 |
38
+ | `REFACTOR` | 1. 所有測試通過(確認 GREEN) | → 停留在 GREEN 階段 |
39
+ | | 2. 前一個 RED 週期沒有失敗的測試 | → 先完成 GREEN |
40
+
41
+ ### 紅燈優先強制
42
+
43
+ ```
44
+ 🔴 RED:撰寫測試 → 執行 → 必須失敗
45
+ ↓ (僅在測試以預期的斷言失敗時才繼續)
46
+ 🟢 GREEN:撰寫最少程式碼 → 執行 → 必須通過
47
+ ↓ (僅在所有測試通過時才繼續)
48
+ 🔵 REFACTOR:清理程式碼 → 執行 → 仍必須通過
49
+ ```
50
+
51
+ **關鍵規則**:AI 不得在失敗測試存在之前撰寫實作程式碼。如果使用者要求「直接寫程式碼」,提醒 TDD 契約並建議先寫測試。
52
+
53
+ ---
54
+
55
+ ## 方法論整合
56
+
57
+ 當調用 `/tdd` 時:
58
+ 1. **自動啟用 TDD 方法論**(如果尚未啟用)
59
+ 2. **將當前階段設為紅燈**(撰寫失敗的測試)
60
+ 3. **追蹤階段轉換**隨著工作進展
61
+ 4. **在回應中顯示階段指示器**(🔴 紅燈、🟢 綠燈、🔵 重構)
62
+
63
+ 參見 [methodology-system](../methodology-system/SKILL.md) 了解完整方法論追蹤。
64
+
65
+ ## TDD 循環
66
+
67
+ ```
68
+ ┌─────────────────────────────────────────┐
69
+ │ │
70
+ │ ┌─────┐ ┌─────┐ ┌─────────┐ │
71
+ │ │ RED │ ──► │GREEN│ ──► │REFACTOR │ │
72
+ │ └─────┘ └─────┘ └─────────┘ │
73
+ │ ▲ │ │
74
+ │ └──────────────────────────┘ │
75
+ │ │
76
+ └─────────────────────────────────────────┘
77
+ ```
78
+
79
+ ## 工作流程
80
+
81
+ ### 1. RED - 撰寫失敗的測試
82
+ - 為預期行為撰寫測試
83
+ - 執行測試 - 應該失敗
84
+ - 確認測試有效
85
+
86
+ ### 2. GREEN - 讓測試通過
87
+ - 撰寫最少程式碼讓測試通過
88
+ - 不加額外功能
89
+ - 執行測試 - 應該通過
90
+
91
+ ### 3. REFACTOR - 改善程式碼
92
+ - 清理程式碼
93
+ - 移除重複
94
+ - 所有測試應仍然通過
95
+
96
+ ## FIRST 原則
97
+
98
+ | 原則 | 說明 |
99
+ |------|------|
100
+ | **F**ast | 快速執行 |
101
+ | **I**ndependent | 無相依性 |
102
+ | **R**epeatable | 可重複 |
103
+ | **S**elf-validating | 自我驗證 |
104
+ | **T**imely | 及時撰寫 |
105
+
106
+ ## 使用方式
107
+
108
+ - `/tdd` - 啟動互動式 TDD session
109
+ - `/tdd calculateTotal` - 針對特定函式進行 TDD
110
+ - `/tdd "user can login"` - 針對用戶故事進行 TDD
111
+
112
+ ## 參考
113
+
114
+ - 完整標準:[tdd-assistant](../tdd-assistant/SKILL.md)
115
+ - 核心指南:[testing-standards](../../core/testing-standards.md)