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
@@ -10,6 +10,226 @@ Create, review, approve, implement, and verify specification documents — full
10
10
 
11
11
  建立、審查、核准、實作和驗證規格文件 — 完整 SDD 生命週期管理。
12
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) — Block phase transition, show guidance
52
+ - **Mode: `suggest`** — Show warning but allow override
53
+ - **Mode: `off`** — No checks
54
+
55
+ Check project config: `.uds/config.yaml` → `workflow.enforcement_mode`
56
+
57
+ ---
58
+
59
+ ## AI Agent Behavior | AI 代理行為
60
+
61
+ > Follows [AI Command Behavior Standards](../../core/ai-command-behavior.md)
62
+
63
+ ### Entry Router | 進入路由
64
+
65
+ | Input | AI Action | AI 行為 |
66
+ |-------|-----------|--------|
67
+ | `/sdd` | 1. 檢查 `docs/specs/` 是否有進行中的 spec 2. **有進行中的 spec** → 顯示狀態摘要,問使用者要繼續哪個還是新建 3. **無進行中的 spec** → 問使用者想做什麼功能,進入 discuss | Check for in-progress specs; show status or start discuss |
68
+ | `/sdd <feature-name>` | 進入 **discuss** 階段(以 feature-name 為主題) | Enter discuss phase for feature |
69
+ | `/sdd <phase>` | 進入指定 phase,執行 Pre-Flight Check。無指定 spec 時,列出該 phase 可操作的 spec 清單 | Enter specified phase, list eligible specs |
70
+ | `/sdd <phase> <spec-file>` | 進入指定 phase,對指定 spec 執行 Pre-Flight Check 後開始 | Enter phase for specific spec |
71
+ | `/sdd --evaluate` | 僅執行 Scope Evaluation(Phase 0),輸出範圍評估結果 | Run scope evaluation only |
72
+ | `/sdd --sync-check` | 僅執行同步檢查,輸出同步狀態 | Run sync check only |
73
+
74
+ ### Interaction Script | 互動腳本
75
+
76
+ #### Phase 0.5: Discuss
77
+
78
+ 1. 讀取相關程式碼和文件,建立對現狀的理解
79
+ 2. 列出識別到的灰色地帶(ambiguities),以編號問題呈現
80
+ 3. 逐一與使用者討論,收斂答案
81
+ 4. 鎖定範圍(In Scope / Out of Scope / Deferred)
82
+
83
+ **Decision: 灰色地帶解決程度**
84
+ - IF 所有問題都有明確答案 → 輸出 scope summary,建議進入 create
85
+ - IF 仍有未解問題 → 列出剩餘問題,問使用者是否接受風險繼續
86
+ - IF 使用者說「先這樣」 → 記錄未解問題為 `[OPEN]`,允許進入 create
87
+
88
+ **Output format | 產出格式:**
89
+ ```markdown
90
+ ### Discuss Summary
91
+ **Feature**: [name]
92
+ **In Scope**: [list]
93
+ **Out of Scope**: [list]
94
+ **Deferred**: [list]
95
+ **Open Questions**: [list or "None"]
96
+ **read_first**: [file list]
97
+ ```
98
+
99
+ 🛑 **STOP**: 顯示 Discuss Summary 後等待使用者確認進入 create
100
+
101
+ #### Phase 1: Create
102
+
103
+ 1. 基於 discuss 結論和 read_first 檔案,撰寫完整 spec
104
+ 2. 使用 Spec Document Structure 模板
105
+ 3. 所有 AC 使用 Given/When/Then 格式
106
+ 4. 為 spec 指定 ID(查看 `docs/specs/` 目錄決定下一個編號)
107
+ 5. 撰寫 Test Plan
108
+
109
+ **Decision: Spec 放置位置**
110
+ - IF 是 CLI 相關 → `docs/specs/cli/`
111
+ - IF 是 Core Standard 相關 → `docs/specs/standards/`
112
+ - IF 是 Skill 相關 → `docs/specs/skills/`
113
+ - IF 是架構相關 → `docs/specs/architecture/`
114
+ - IF 是跨元件 → `docs/specs/system/`
115
+ - ELSE → `docs/specs/`
116
+
117
+ 🛑 **STOP**: 撰寫完 spec 後展示內容,等待使用者確認再寫入檔案
118
+
119
+ #### Phase 2: Review
120
+
121
+ 1. 讀取指定 spec 檔案
122
+ 2. 逐項檢查以下維度:
123
+
124
+ | 檢查維度 | 檢查內容 |
125
+ |----------|---------|
126
+ | Requirements 完整性 | 所有 REQ 都有 Scenario |
127
+ | AC 可測試性 | 每個 AC 都是 Given/When/Then 格式 |
128
+ | AC 覆蓋率 | 每個 REQ 至少有一個 AC 對應 |
129
+ | Technical Design 可行性 | 設計不依賴不存在的 API/工具 |
130
+ | Test Plan 對應 | Test Plan 涵蓋所有 AC |
131
+ | 範圍一致性 | 沒有超出 discuss 鎖定的範圍 |
132
+ | 無歧義 | 沒有模糊用語(「等等」「適當地」) |
133
+
134
+ 3. 輸出 Review 結果表格
135
+ 4. 更新 spec status 為 `Review`
136
+
137
+ **Decision: Review 結果**
138
+ - IF 全部通過 → 建議進入 approve
139
+ - IF 有 blocking issue → 列出問題,建議修改後重新 review
140
+ - IF 只有 suggestion → 列出建議,使用者可選擇修改或直接 approve
141
+
142
+ 🛑 **STOP**: 顯示 review 結果後等待使用者決定
143
+
144
+ #### Phase 3: Approve
145
+
146
+ 1. 讀取 spec,確認 status = `Review`
147
+ 2. 逐項展示 Approval Checklist(5 項),標記通過/未通過
148
+ 3. 等待使用者確認核准
149
+
150
+ **Decision: Approval 結果**
151
+ - IF 使用者確認核准 → 更新 spec metadata(status, approved-date, approved-by)
152
+ - IF 使用者拒絕 → 記錄原因,建議回到 review 或 create
153
+
154
+ 🛑 **STOP**: 展示 checklist 結果後等待使用者明確說「核准」或「approved」
155
+
156
+ #### Phase 4: Implement
157
+
158
+ 1. 讀取 approved spec,列出所有 AC
159
+ 2. 產出實作計畫:每個 AC 要改哪些檔案、預估複雜度
160
+ 3. 等待使用者確認計畫
161
+
162
+ 🛑 **STOP**: 顯示實作計畫後等待使用者確認
163
+
164
+ 4. 逐 AC 實作:
165
+ a. 撰寫程式碼
166
+ b. 撰寫對應測試
167
+ c. 執行測試確認通過
168
+ d. 更新 spec 中的 AC checkbox
169
+
170
+ **Decision: Commit 節奏**
171
+ - IF AC 之間相互獨立 → 每完成一個 AC 就提示可以 commit
172
+ - IF AC 之間緊耦合 → 合併完成後一起提示 commit
173
+ - 不自動執行 git commit — 僅提示使用者
174
+
175
+ **Decision: 測試失敗**
176
+ - IF 測試失敗 → 修復後重新測試,最多重試 3 次
177
+ - IF 3 次仍失敗 → 🛑 STOP,報告問題,等待使用者指導
178
+
179
+ 🛑 **STOP**: 每個獨立 AC 完成後暫停,展示進度,等待使用者確認繼續
180
+
181
+ #### Phase 5: Verify
182
+
183
+ 1. 讀取 spec,列出所有 AC
184
+ 2. 對每個 AC 收集證據:
185
+ - 程式碼位置(file:line)
186
+ - 測試位置(file:line)
187
+ - 測試結果(執行測試)
188
+ 3. 檢查是否有偏差(Added / Modified / Omitted)
189
+ 4. 產生 Verification Report
190
+
191
+ **Decision: 驗證結果**
192
+ - IF 全部 PASS → 更新 spec status 為 `Implemented`,建議歸檔
193
+ - IF 有 FAIL → 列出失敗項目,建議回到 implement 修復
194
+ - IF 迭代次數 ≥ 3 → 🛑 STOP,強制升級(review spec / rethink / escalate)
195
+
196
+ 🛑 **STOP**: 顯示 Verification Report 後等待使用者決定下一步
197
+
198
+ #### Phase 6: Archive
199
+
200
+ 1. 確認 spec status = `Implemented` 且 verify 通過
201
+ 2. 連結相關 commit/PR
202
+ 3. 更新 spec status 為 `Archived`
203
+
204
+ 🛑 **STOP**: 確認歸檔前等待使用者確認
205
+
206
+ ### Stop Points Summary | 停止點總覽
207
+
208
+ | Phase | Stop Point | 等待內容 |
209
+ |-------|-----------|---------|
210
+ | discuss | Discuss Summary 輸出後 | 確認進入 create |
211
+ | create | Spec 撰寫完成後 | 確認寫入檔案 |
212
+ | review | Review 結果輸出後 | 決定修改或進入 approve |
213
+ | approve | Checklist 展示後 | 明確核准 |
214
+ | implement | 實作計畫展示後 | 確認開始實作 |
215
+ | implement | 每個獨立 AC 完成後 | 確認繼續下一個 |
216
+ | verify | Verification Report 輸出後 | 決定歸檔或修復 |
217
+ | archive | 歸檔前 | 確認歸檔 |
218
+
219
+ ### Error Handling | 錯誤處理
220
+
221
+ | Error Condition | AI Action | AI 行為 |
222
+ |-----------------|-----------|--------|
223
+ | Pre-Flight Check 失敗 | 說明哪個條件未滿足,引導到正確的 phase | State failure, guide to correct phase |
224
+ | Spec 檔案不存在 | 列出可用的 spec 檔案,或建議 `/sdd create` | List available specs or suggest create |
225
+ | Spec status 不符合目標 phase | 顯示當前 status,說明需要先完成哪個 phase | Show current status, explain required phase |
226
+ | `docs/specs/` 目錄不存在 | 自動建立目錄,繼續流程 | Create directory automatically |
227
+ | 使用者提供的 feature name 與現有 spec 重複 | 顯示現有 spec,問使用者是要繼續還是新建 | Show existing spec, ask continue or create new |
228
+ | 實作中測試反覆失敗(>3 次) | 停止自動修復,報告問題,等待使用者指導 | Stop auto-fix, report issue, wait for guidance |
229
+ | 非預期狀態(無法判斷正確行為) | 停止並詢問使用者,不猜測 | Stop and ask, never guess |
230
+
231
+ ---
232
+
13
233
  ## SDD Workflow | SDD 工作流程
14
234
 
15
235
  ```
@@ -0,0 +1,67 @@
1
+ ---
2
+ description: "[UDS] Guide security review and vulnerability assessment following OWASP standards"
3
+ allowed-tools: Read, Grep, Glob
4
+ argument-hint: "[module or file to audit | 要審計的模組或檔案]"
5
+ ---
6
+
7
+ # Security Assistant | 安全助手
8
+
9
+ Guide security review and vulnerability assessment following OWASP standards.
10
+
11
+ 引導安全審查和漏洞評估,遵循 OWASP 標準。
12
+
13
+ ## Workflow | 工作流程
14
+
15
+ ```
16
+ SCOPE ──► SCAN ──► ANALYZE ──► REPORT
17
+ ```
18
+
19
+ ## Usage | 使用方式
20
+
21
+ - `/security` - Start interactive security review
22
+ - `/security src/auth` - Review specific module
23
+ - `/security --owasp` - OWASP Top 10 focused review
24
+
25
+ ## AI Agent Behavior | AI 代理行為
26
+
27
+ > Follows [AI Command Behavior Standards](../../core/ai-command-behavior.md)
28
+
29
+ ### Entry Router | 進入路由
30
+
31
+ | Input | AI Action |
32
+ |-------|-----------|
33
+ | `/security` | 詢問審查範圍,進入 SCOPE |
34
+ | `/security <path>` | 直接審查指定路徑 |
35
+ | `/security --owasp` | 聚焦 OWASP Top 10 審查 |
36
+
37
+ ### Interaction Script | 互動腳本
38
+
39
+ 1. 確認審查範圍
40
+ 2. 掃描程式碼,識別潛在漏洞
41
+ 3. 依嚴重程度分類(Critical / High / Medium / Low)
42
+ 4. 生成安全審查報告
43
+
44
+ **Decision: 發現嚴重漏洞**
45
+ - IF Critical → 立即標記,建議優先修復
46
+ - IF High → 標記為重要,建議盡快修復
47
+ - ELSE → 列入報告,建議排程修復
48
+
49
+ 🛑 **STOP**: 報告展示後等待使用者決定
50
+
51
+ ### Stop Points | 停止點
52
+
53
+ | Stop Point | 等待內容 |
54
+ |-----------|---------|
55
+ | 安全報告展示後 | 使用者決定修復優先順序 |
56
+
57
+ ### Error Handling | 錯誤處理
58
+
59
+ | Error Condition | AI Action |
60
+ |-----------------|-----------|
61
+ | 目標路徑不存在 | 列出可用路徑 |
62
+ | 程式碼過大無法全面掃描 | 建議聚焦高風險區域(auth、input handling、API) |
63
+
64
+ ## Reference | 參考
65
+
66
+ - Full standard: [security-assistant](../security-assistant/SKILL.md)
67
+ - Core guide: [security-standards](../../core/security-standards.md)
@@ -17,6 +17,39 @@ Guide through the Test-Driven Development (TDD) workflow: Red-Green-Refactor.
17
17
 
18
18
  引導測試驅動開發(TDD)流程:紅-綠-重構。
19
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
+ **Critical Rule**: The AI MUST NOT write implementation code before a failing test exists. If the user asks to "just write the code", remind them of the TDD contract and offer to write the test first.
48
+
49
+ **關鍵規則**:AI 不得在失敗測試存在之前撰寫實作程式碼。如果使用者要求「直接寫程式碼」,提醒 TDD 契約並建議先寫測試。
50
+
51
+ ---
52
+
20
53
  ## Methodology Integration | 方法論整合
21
54
 
22
55
  When `/tdd` is invoked:
@@ -80,6 +113,74 @@ See [methodology-system](../methodology-system/SKILL.md) for full methodology tr
80
113
  - `/tdd calculateTotal` - TDD for specific function
81
114
  - `/tdd "user can login"` - TDD for user story
82
115
 
116
+ ## AI Agent Behavior | AI 代理行為
117
+
118
+ > Follows [AI Command Behavior Standards](../../core/ai-command-behavior.md)
119
+
120
+ ### Entry Router | 進入路由
121
+
122
+ | Input | AI Action |
123
+ |-------|-----------|
124
+ | `/tdd` | 詢問要實作的功能,進入 🔴 RED 階段 |
125
+ | `/tdd <function>` | 以指定函式為目標,直接進入 🔴 RED |
126
+ | `/tdd "user story"` | 以使用者故事為目標,進入 🔴 RED |
127
+
128
+ ### Interaction Script | 互動腳本
129
+
130
+ #### 🔴 RED Phase
131
+
132
+ 1. 確認目標功能/行為
133
+ 2. 撰寫一個會失敗的測試
134
+ 3. 執行測試,確認失敗(assertion failure,非 syntax error)
135
+
136
+ **Decision: 測試結果**
137
+ - IF 測試失敗(assertion) → 進入 🟢 GREEN
138
+ - IF 測試出錯(syntax/runtime error) → 修正測試本身,重新執行
139
+ - IF 測試通過 → 告知使用者測試不應該通過,檢查是否功能已存在
140
+
141
+ 🛑 **STOP**: 展示失敗測試後等待使用者確認進入 GREEN
142
+
143
+ #### 🟢 GREEN Phase
144
+
145
+ 1. 撰寫最小量程式碼使測試通過
146
+ 2. 執行測試
147
+
148
+ **Decision: 測試結果**
149
+ - IF 所有測試通過 → 建議進入 🔵 REFACTOR
150
+ - IF 仍有失敗 → 繼續修改程式碼(最多 3 次),超過則 🛑 STOP
151
+
152
+ 🛑 **STOP**: 測試通過後等待使用者確認進入 REFACTOR
153
+
154
+ #### 🔵 REFACTOR Phase
155
+
156
+ 1. 分析剛寫的程式碼是否有改善空間
157
+ 2. 提出重構建議
158
+
159
+ **Decision: 重構範圍**
160
+ - IF 有明顯重複或改善點 → 列出建議,等使用者選擇
161
+ - IF 程式碼已足夠簡潔 → 告知不需重構,建議進入下一個 RED 循環
162
+
163
+ 3. 執行重構,確認所有測試仍通過
164
+
165
+ 🛑 **STOP**: 重構完成後等待使用者決定繼續下一個 RED 循環或結束
166
+
167
+ ### Stop Points | 停止點
168
+
169
+ | Phase | Stop Point | 等待內容 |
170
+ |-------|-----------|---------|
171
+ | RED | 失敗測試撰寫後 | 確認進入 GREEN |
172
+ | GREEN | 測試通過後 | 確認進入 REFACTOR |
173
+ | REFACTOR | 重構完成後 | 決定繼續或結束 |
174
+
175
+ ### Error Handling | 錯誤處理
176
+
177
+ | Error Condition | AI Action |
178
+ |-----------------|-----------|
179
+ | 使用者要求跳過 RED 直接寫程式碼 | 提醒 TDD 契約,建議先寫測試 |
180
+ | 測試框架未偵測到 | 詢問使用者指定框架 |
181
+ | 測試語法錯誤導致無法執行 | 修正語法後重新執行,不計入嘗試次數 |
182
+ | GREEN 階段 3 次仍無法通過 | 停止,分析失敗原因,等待使用者指導 |
183
+
83
184
  ## Reference | 參考
84
185
 
85
186
  - Full standard: [tdd-assistant](../tdd-assistant/SKILL.md)
@@ -344,6 +344,67 @@ Skills are managed separately:
344
344
  **"Skills previously declined"**
345
345
  - Run `/config skills` to reinstall declined Skills
346
346
 
347
+ ## AI Agent Behavior | AI 代理行為
348
+
349
+ > Follows [AI Command Behavior Standards](../../core/ai-command-behavior.md)
350
+
351
+ ### Entry Router | 進入路由
352
+
353
+ | Input | AI Action | AI 行為 |
354
+ |-------|-----------|--------|
355
+ | `/update` | 檢查狀態 → 詢問更新偏好 → 執行 → 檢查 Skills/Commands | Check, ask, execute, post-check |
356
+ | `/update --yes` | 跳過確認直接更新(不自動安裝 Skills) | Update without confirmation |
357
+ | `/update --beta` | 檢查 beta 版本更新 | Check beta updates |
358
+ | `/update --skills` | 僅更新 Skills | Update Skills only |
359
+ | `/update --commands` | 僅更新 Commands | Update Commands only |
360
+ | `/update --offline` | 跳過 npm registry 檢查 | Skip network check |
361
+
362
+ ### Interaction Script | 互動腳本
363
+
364
+ 1. 執行 `uds check --summary` 顯示目前狀態
365
+
366
+ **Decision: 有無可用更新**
367
+ - IF 已是最新 → 顯示「Already up to date」,跳至 Step 4 檢查 Skills/Commands
368
+ - IF 有更新 → 進入 Step 2
369
+
370
+ 2. 詢問更新偏好(AskUserQuestion)
371
+
372
+ **Decision: 版本類型**
373
+ - IF stable 可用 → 選項:Update Now(建議)/ Check Beta / Skip
374
+ - IF 僅 pre-release → 顯示具體類型:Update to Alpha/Beta/RC / Skip
375
+
376
+ 🛑 **STOP**: 展示版本資訊後等待使用者選擇
377
+
378
+ 3. 執行更新 `uds update --yes` 或 `uds update --beta --yes`
379
+
380
+ 4. 檢查 Skills/Commands 狀態(Smart Grouping 策略)
381
+ - 偵測缺少的 Skills → 使用 Smart Grouping 詢問安裝
382
+ - 偵測缺少的 Commands → 使用 Smart Grouping 詢問安裝
383
+ - 已拒絕的工具不再顯示
384
+
385
+ **IMPORTANT**: AskUserQuestion 最多 4 個選項。3+ 工具時必須使用兩階段策略。
386
+
387
+ 🛑 **STOP**: 每個 Skills/Commands 安裝決策點等待使用者選擇
388
+
389
+ 5. 說明結果(更新內容、安裝結果、下一步)
390
+
391
+ ### Stop Points | 停止點
392
+
393
+ | Stop Point | 等待內容 |
394
+ |-----------|---------|
395
+ | 更新偏好選擇 | 使用者選擇更新版本或跳過 |
396
+ | Skills 安裝詢問 | 使用者選擇安裝位置或跳過 |
397
+ | Commands 安裝詢問 | 使用者選擇安裝位置或跳過 |
398
+
399
+ ### Error Handling | 錯誤處理
400
+
401
+ | Error Condition | AI Action |
402
+ |-----------------|-----------|
403
+ | 標準未初始化 | 提示執行 `/init` |
404
+ | npm registry 無法連線 | 建議加 `--offline`,或稍後重試 |
405
+ | 更新失敗(寫入錯誤) | 顯示錯誤,建議檢查檔案權限 |
406
+ | Skills 之前被拒絕 | 不再詢問,提示可透過 `/config skills` 重新安裝 |
407
+
347
408
  ## Reference | 參考
348
409
 
349
410
  - CLI documentation: `uds update --help`
@@ -114,12 +114,18 @@ When `commit_language` is `traditional-chinese`, use Chinese types and body:
114
114
  After `/commit` completes, the AI assistant should suggest:
115
115
 
116
116
  > **提交完成。建議下一步 / Commit complete. Suggested next steps:**
117
- > - 執行 `/changelog` 更新變更日誌 — Update the changelog
118
117
  > - 執行 `git push` 推送到遠端 — Push to remote
119
- > - 執行 `/release`(若準備發布)— Start release process (if ready)
118
+ > - 準備發布時 → 執行 `/changelog` + `/release` When preparing a release Run `/changelog` + `/release`
120
119
  > - 發現重複模式或規範摩擦 → 執行 `/audit --report` 回報 — Patterns or friction detected → Run `/audit --report` to submit feedback
121
120
 
122
121
  ## Reference | 參考
123
122
 
124
123
  - Detailed guide: [guide.md](./guide.md)
125
124
  - Core standard: [commit-message-guide.md](../../core/commit-message-guide.md)
125
+
126
+
127
+ ## AI Agent Behavior | AI 代理行為
128
+
129
+ > 完整的 AI 行為定義請參閱對應的命令文件:[`/commit`](../commands/commit.md#ai-agent-behavior--ai-代理行為)
130
+ >
131
+ > For complete AI agent behavior definition, see the corresponding command file: [`/commit`](../commands/commit.md#ai-agent-behavior--ai-代理行為)
@@ -0,0 +1,118 @@
1
+ ---
2
+ name: database
3
+ scope: universal
4
+ description: |
5
+ Guide database design, migration, and query optimization.
6
+ Use when: schema design, migration planning, query optimization, index strategy.
7
+ Keywords: database, schema, migration, SQL, index, query, 資料庫, 遷移, 查詢.
8
+ allowed-tools: Read, Grep, Glob
9
+ argument-hint: "[schema or migration to review | 要審查的 schema 或遷移]"
10
+ ---
11
+
12
+ # Database Assistant | 資料庫助手
13
+
14
+ Guide database design, migration planning, and query optimization.
15
+
16
+ 引導資料庫設計、遷移規劃和查詢最佳化。
17
+
18
+ ## Core Principles | 核心原則
19
+
20
+ | Principle | Description | 說明 |
21
+ |-----------|-------------|------|
22
+ | Normalization | Eliminate redundancy (3NF minimum) | 消除冗餘(至少 3NF) |
23
+ | Referential Integrity | Enforce FK constraints | 強制外鍵約束 |
24
+ | Index Strategy | Index query patterns, not all columns | 依查詢模式建立索引 |
25
+ | Migration Safety | Always reversible, zero-downtime | 可逆、零停機 |
26
+ | Data Protection | Encrypt sensitive fields, audit access | 加密敏感欄位、稽核存取 |
27
+
28
+ ## Schema Design Checklist | Schema 設計檢查清單
29
+
30
+ - [ ] Primary keys defined (prefer UUID or BIGINT) | 主鍵已定義
31
+ - [ ] Foreign keys with proper ON DELETE/UPDATE | 外鍵含適當的級聯策略
32
+ - [ ] NOT NULL constraints on required fields | 必填欄位加 NOT NULL
33
+ - [ ] Indexes on frequently queried columns | 常查詢欄位建立索引
34
+ - [ ] Created/Updated timestamps on all tables | 所有表加建立/更新時間戳
35
+ - [ ] Sensitive data encrypted at rest | 敏感資料靜態加密
36
+ - [ ] Naming conventions consistent (snake_case) | 命名慣例一致(snake_case)
37
+
38
+ ## Normalization Quick Reference | 正規化快速參考
39
+
40
+ | Normal Form | Rule | 規則 |
41
+ |-------------|------|------|
42
+ | **1NF** | Atomic values, no repeating groups | 原子值、無重複群組 |
43
+ | **2NF** | 1NF + no partial dependencies | 1NF + 無部分相依 |
44
+ | **3NF** | 2NF + no transitive dependencies | 2NF + 無遞移相依 |
45
+ | **Denormalize** | Only for proven read performance needs | 僅針對已證實的讀取效能需求 |
46
+
47
+ ## Migration Workflow | 遷移工作流程
48
+
49
+ ```
50
+ PLAN ──► WRITE ──► TEST ──► DEPLOY ──► VERIFY
51
+ ```
52
+
53
+ ### 1. Plan — Assess Impact | 評估影響
54
+ Identify affected tables, estimate data volume, plan rollback strategy.
55
+
56
+ 識別受影響的表、估算資料量、規劃回滾策略。
57
+
58
+ ### 2. Write — Create Migration | 撰寫遷移
59
+ Write forward and rollback scripts. Use incremental, numbered migrations.
60
+
61
+ 撰寫正向和回滾腳本。使用遞增編號的遷移。
62
+
63
+ ### 3. Test — Validate Migration | 驗證遷移
64
+ Run on staging with production-like data. Verify data integrity post-migration.
65
+
66
+ 在 staging 環境使用類生產資料執行。驗證遷移後資料完整性。
67
+
68
+ ### 4. Deploy — Execute Migration | 執行遷移
69
+ Apply during maintenance window or use online schema change tools.
70
+
71
+ 在維護窗口執行,或使用線上 Schema 變更工具。
72
+
73
+ ### 5. Verify — Confirm Success | 確認成功
74
+ Check row counts, constraint validity, application functionality.
75
+
76
+ 檢查列數、約束有效性、應用程式功能。
77
+
78
+ ## Index Strategy | 索引策略
79
+
80
+ | Type | Use Case | 使用場景 |
81
+ |------|----------|----------|
82
+ | B-tree | Equality, range queries (default) | 等值、範圍查詢(預設) |
83
+ | Hash | Exact match only | 僅精確匹配 |
84
+ | GIN | Full-text search, JSONB | 全文搜尋、JSONB |
85
+ | Partial | Filtered subsets | 過濾子集 |
86
+ | Composite | Multi-column queries | 多欄位查詢 |
87
+
88
+ ## Usage | 使用方式
89
+
90
+ ```
91
+ /database - Interactive database design guide | 互動式資料庫設計引導
92
+ /database schema - Review schema design | 審查 Schema 設計
93
+ /database --migration - Migration planning assistant | 遷移規劃助手
94
+ ```
95
+
96
+ ## Next Steps Guidance | 下一步引導
97
+
98
+ After `/database` completes, the AI assistant should suggest:
99
+
100
+ > **資料庫設計完成。建議下一步 / Database design complete. Suggested next steps:**
101
+ > - 執行 `/security` 檢查資料保護措施 — Check data protection measures
102
+ > - 執行 `/testing` 規劃資料庫測試策略 — Plan database testing strategy
103
+ > - 執行 `/checkin` 確認遷移符合提交規範 — Verify migrations meet check-in standards
104
+ > - 產生 API 端點 → 執行 `/api-design` — Generate API endpoints → Run `/api-design`
105
+
106
+ ## Reference | 參考
107
+
108
+ - Core standard: [database-standards.md](../../core/database-standards.md)
109
+
110
+ ## Version History | 版本歷史
111
+
112
+ | Version | Date | Changes | 變更說明 |
113
+ |---------|------|---------|----------|
114
+ | 1.0.0 | 2026-03-23 | Initial release | 初始版本 |
115
+
116
+ ## License | 授權
117
+
118
+ CC BY 4.0 — Documentation content