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
@@ -1,17 +1,19 @@
1
1
  # 測試標準
2
2
 
3
- > **語言**: [English](../../../core/testing-standards.md) | 繁體中文
3
+ > **Language**: [English](../../../core/testing-standards.md) | 繁體中文
4
4
 
5
- **版本**: 3.0.0
6
- **最後更新**: 2026-02-10
7
- **適用性**: 所有軟體專案
8
- **範圍**: 通用 (Universal)
5
+ **版本**: 3.1.0
6
+ **最後更新**: 2026-03-25
7
+ **適用範圍**: 所有軟體專案
8
+ **Scope**: universal
9
+ **產業標準**: ISTQB CTFL v4.0, ISO/IEC/IEEE 29119
10
+ **參考資料**: [istqb.org](https://istqb.org/)
9
11
 
10
12
  ---
11
13
 
12
14
  ## 目的
13
15
 
14
- 本標準為 AI 代理和開發人員定義可執行的測試規則和慣例。關於理論基礎、教育內容和詳細範例,請參閱 **[測試理論知識庫](guides/testing-guide.md)**。
16
+ 本標準定義可操作的測試規則與慣例,供 AI 代理與開發人員使用。如需理論基礎、教育內容與詳細範例,請參閱 [測試理論知識庫](../../../skills/testing-guide/testing-theory.md)
15
17
 
16
18
  **參考標準**:
17
19
  - [ISTQB CTFL v4.0](https://istqb.org/certifications/certified-tester-foundation-level-ctfl-v4-0/)
@@ -22,47 +24,84 @@
22
24
 
23
25
  ## 術語表
24
26
 
25
- | 縮寫 | 全稱 | 說明 |
27
+ | 縮寫 | 全名 | 說明 |
26
28
  |------|------|------|
27
- | **UT** | 單元測試 (Unit Testing) | 隔離測試個別函式/方法 |
28
- | **IT** | 整合測試 (Integration Testing) | 測試元件之間的互動 |
29
- | **ST** | 系統測試 (System Testing) | 測試完整整合的系統 |
30
- | **AT** | 驗收測試 (Acceptance Testing) | 針對業務驗收標準進行測試 |
31
- | **E2E** | 端對端測試 (End-to-End Testing) | 測試完整的使用者工作流程 |
32
- | **UAT** | 使用者驗收測試 (User Acceptance Testing) | 由最終使用者執行的驗收測試 |
33
- | **SIT** | 系統整合測試 (System Integration Testing) | 測試多個系統的整合 |
29
+ | **UT** | Unit Testing | 獨立測試個別函式/方法 |
30
+ | **IT** | Integration Testing | 測試元件之間的互動 |
31
+ | **ST** | System Testing | 測試完整的整合系統 |
32
+ | **AT** | Acceptance Testing | 依據業務驗收標準進行測試 |
33
+ | **E2E** | End-to-End Testing | 測試完整的使用者工作流程 |
34
+ | **UAT** | User Acceptance Testing | 由終端使用者執行的驗收測試 |
35
+ | **SIT** | System Integration Testing | 測試多個系統的整合 |
34
36
 
35
- > **注意**:本文件中的「IT」一律指「整合測試 (Integration Testing)」,而非「資訊科技 (Information Technology)」。
37
+ > **注意**: 本文件中的 "IT" 一律指 "Integration Testing"(整合測試),而非 "Information Technology"(資訊科技)。
36
38
 
37
39
  ---
38
40
 
39
- ## 測試金字塔 (預設比例)
41
+ ## 覆蓋率目標(主要指標)
40
42
 
41
- ```
42
- ┌─────────┐
43
- │ E2E │ ← 10% (較少,較慢,成本較高)
44
- ─┴─────────┴─
45
- ┌─────────────┐
46
- │ IT/SIT │ ← 20% (整合測試)
47
- ─┴─────────────┴─
48
- ┌─────────────────┐
49
- │ UT │ ← 70% (單元測試 - 基礎)
50
- └─────────────────┘
51
- ```
43
+ > **Coverage is the primary metric for test quality.** Higher coverage means more code is protected by tests.
44
+ > **覆蓋率是測試品質的主要指標。** 更高的覆蓋率代表更多程式碼受到測試保護。
45
+
46
+ | 指標 | 最低要求 | 標準 | 理想 |
47
+ |------|---------|------|------|
48
+ | **行覆蓋率 (Line Coverage)** | 80% | 90% | 95%+ |
49
+ | **分支覆蓋率 (Branch Coverage)** | 70% | 85% | 90%+ |
50
+ | **函式覆蓋率 (Function Coverage)** | 85% | 95% | 100% |
51
+ | **突變分數 (Mutation Score)** | — | 80% | 90%+(關鍵程式碼) |
52
+
53
+ **層級定義:**
54
+ - **最低要求**: 所有專案的基準線 — 低於此值即為品質風險
55
+ - **標準**: 大多數專案的目標 — 透過紀律化的測試即可達成
56
+ - **理想**: 關鍵系統與核心業務邏輯的目標 — 在可行的情況下追求 100%
57
+
58
+ > **實務指引**: 100% 覆蓋率是理想目標。實務上,行覆蓋率達到 95% 以上時會出現邊際效益遞減。最後的 5% 應集中在關鍵路徑(認證、支付、資料完整性),而非自動產生的程式碼或簡單的 getter/setter。
59
+
60
+ ---
61
+
62
+ ## 覆蓋率與佔比 — 關鍵區別
63
+
64
+ > **AI 代理與開發人員:請勿混淆這兩個概念。**
65
+
66
+ | 概念 | 意義 | 重要性 |
67
+ |------|------|--------|
68
+ | **覆蓋率(Coverage)** | 測試所執行的程式碼百分比 | **主要指標** — 衡量保護程度 |
69
+ | **佔比(Ratio)** | 各層級測試數量的分布 | 僅供參考 — 影響執行時間 |
70
+
71
+ **覆蓋率**回答的問題是:「我的程式碼有多少被測試了?」
72
+ **佔比**回答的問題是:「我的測試中,單元測試、整合測試、E2E 測試各佔多少比例?」
52
73
 
53
- | 層級 | 比例 | 執行時間目標 |
54
- |------|------|--------------|
55
- | 單元測試 (UT) | 70% | 總計 < 10 分鐘 |
56
- | 整合測試 (IT) | 20% | 總計 < 30 分鐘 |
57
- | E2E 測試 | 10% | 總計 < 2 小時 |
74
+ ---
75
+
76
+ ## 測試框架選擇
77
+
78
+ | 框架 | 層級 | 最適用於 |
79
+ |------|------|---------|
80
+ | **ISTQB** | UT → IT/SIT → ST → AT/UAT | 企業級、法規遵循、正式 QA |
81
+ | **業界金字塔** | UT → IT → ST → E2E | 敏捷、DevOps、CI/CD |
58
82
 
59
83
  ---
60
84
 
61
- ## 測試層級需求
85
+ ## 測試金字塔(測試數量佔比 — 僅供參考)
86
+
87
+ > **注意**: 以下為測試**數量**佔比(各層級有多少測試),而非覆蓋率目標。覆蓋率要求請參閱上方的[覆蓋率目標](#覆蓋率目標主要指標)。
88
+
89
+ | 層級 | 測試數量佔比 | 執行時間目標 |
90
+ |------|-------------|-------------|
91
+ | 單元測試 (UT) | 約 70% 的測試 | < 10 分鐘 |
92
+ | 整合測試 (IT) | 約 20% 的測試 | < 30 分鐘 |
93
+ | 系統測試 (ST) | 約 7% 的測試 | < 1 小時 |
94
+ | E2E 測試 | 約 3% 的測試 | < 2 小時 |
95
+
96
+ > 70/20/7/3 的比例為經驗法則建議(Mike Cohn)。其目的在於最佳化回饋速度 — 大部分測試快速執行(UT),較少測試緩慢執行(E2E)。
97
+
98
+ ---
99
+
100
+ ## 測試層級要求
62
101
 
63
102
  ### 單元測試 (UT)
64
103
 
65
- **特性**: 隔離、快速 (< 100ms/個)、確定性
104
+ **特性**: 隔離、快速(每個 < 100ms)、確定性
66
105
 
67
106
  #### 範圍
68
107
 
@@ -83,39 +122,35 @@
83
122
  [class_name]_test.[ext] # Python, Go
84
123
  ```
85
124
 
86
- **方法命名** (每個專案擇一):
125
+ **方法命名**(每個專案選擇一種):
87
126
 
88
- | 風格 | 最適合 | 範例 |
89
- |------|--------|------|
127
+ | 風格 | 最適用於 | 範例 |
128
+ |------|---------|------|
90
129
  | `[Method]_[Scenario]_[Result]` | C#, Java | `CalculateTotal_NegativePrice_ThrowsException()` |
91
130
  | `should_[behavior]_when_[condition]` | JavaScript/TypeScript | `should_reject_login_when_account_locked()` |
92
131
  | `test_[method]_[scenario]_[expected]` | Python (pytest) | `test_validate_email_invalid_format_returns_false()` |
93
132
 
94
- #### 覆蓋率閾值
133
+ #### 覆蓋率門檻
95
134
 
96
- | 指標 | 最低 | 推薦 |
97
- |------|------|------|
98
- | 行覆蓋率 (Line) | 70% | 85% |
99
- | 分支覆蓋率 (Branch) | 60% | 80% |
100
- | 函式覆蓋率 (Function) | 80% | 90% |
135
+ > 請參閱本文件頂部的[覆蓋率目標](#覆蓋率目標主要指標)以取得權威的覆蓋率要求。
101
136
 
102
137
  ---
103
138
 
104
139
  ### 整合測試 (IT)
105
140
 
106
- **特性**: 元件整合、真實相依性 (通常容器化)、1-10 秒/個
141
+ **特性**: 元件整合、真實相依性(通常容器化)、每個 1-10
107
142
 
108
- #### 何時必須有整合測試
143
+ #### 何時需要
109
144
 
110
- **決策規則**: 如果你的單元測試對查詢/過濾參數使用萬用匹配器 (`any()`, `It.IsAny<>`, `Arg.Any<>`),該功能必須有整合測試。
145
+ **決策規則**: 若您的單元測試使用萬用匹配器(`any()`、`It.IsAny<>`、`Arg.Any<>`)來處理查詢/過濾參數,該功能**必須**有整合測試。
111
146
 
112
147
  | 情境 | 原因 |
113
148
  |------|------|
114
149
  | 查詢述詞 | Mock 無法驗證過濾表達式 |
115
- | 實體關聯 | 驗證外鍵正確性 |
116
- | 複合主鍵 | 記憶體資料庫可能與真實 DB 不同 |
150
+ | 實體關係 | 驗證外鍵正確性 |
151
+ | 複合鍵 | 記憶體資料庫可能與真實資料庫不同 |
117
152
  | 欄位對應 | DTO ↔ Entity 轉換 |
118
- | 分頁 | 資料排序和計數 |
153
+ | 分頁 | 列排序與計數 |
119
154
  | 交易 | 回滾行為 |
120
155
 
121
156
  #### 範圍
@@ -123,9 +158,11 @@
123
158
  | 包含 | 排除 |
124
159
  |------|------|
125
160
  | 資料庫 CRUD 操作 | 完整使用者工作流程 |
126
- | Repository + Database | 跨服務通訊 |
161
+ | Repository + 資料庫 | 跨服務通訊 |
127
162
  | Service + Repository | UI 互動 |
128
163
  | API 端點 + Service 層 | |
164
+ | 訊息佇列生產者/消費者 | |
165
+ | 快取讀寫操作 | |
129
166
 
130
167
  #### 命名慣例
131
168
 
@@ -137,17 +174,54 @@
137
174
 
138
175
  ---
139
176
 
177
+ ### 系統測試 (ST)
178
+
179
+ **特性**: 完整系統、類生產環境、基於需求
180
+
181
+ #### 範圍
182
+
183
+ | 包含 | 排除 |
184
+ |------|------|
185
+ | 完整 API 工作流程 | UI 視覺測試 |
186
+ | 跨服務交易 | 使用者旅程模擬 |
187
+ | 資料流經整個系統 | A/B 測試情境 |
188
+ | 安全需求 | |
189
+ | 負載下的效能 | |
190
+ | 錯誤處理與復原 | |
191
+
192
+ #### 類型
193
+
194
+ | 類型 | 說明 |
195
+ |------|------|
196
+ | 功能性 | 驗證功能按規格運作 |
197
+ | 效能 | 負載、壓力、可擴展性測試 |
198
+ | 安全性 | 滲透測試、弱點掃描 |
199
+ | 可靠性 | 故障轉移、復原、穩定性 |
200
+ | 相容性 | 跨平台、瀏覽器相容性 |
201
+
202
+ #### 命名慣例
203
+
204
+ ```
205
+ [Feature]SystemTests.[ext]
206
+ [Feature].system.test.[ext]
207
+ [Feature]_st.[ext]
208
+ ```
209
+
210
+ ---
211
+
140
212
  ### 端對端測試 (E2E)
141
213
 
142
- **特性**: 使用者視角、全端 (UI → API → Database)、最慢 (30s+/個)
214
+ **特性**: 使用者視角、全端(UI → API → 資料庫)、最慢(每個 30 秒以上)
143
215
 
144
216
  #### 範圍
145
217
 
146
218
  | 包含 | 排除 |
147
219
  |------|------|
148
- | 關鍵使用者旅程 | 每個可能的使用者路徑 |
149
- | 登入/驗證流程 | 邊緣案例 (使用 UT/IT) |
220
+ | 關鍵使用者旅程 | 所有可能的使用者路徑 |
221
+ | 登入/認證流程 | 邊界案例(使用 UT/IT |
150
222
  | 核心業務交易 | 效能基準測試 |
223
+ | 跨瀏覽器功能 | |
224
+ | 部署的冒煙測試 | |
151
225
 
152
226
  #### 命名慣例
153
227
 
@@ -159,67 +233,108 @@ e2e/[feature]/[scenario].[ext]
159
233
 
160
234
  ---
161
235
 
162
- ## 測試替身 (Test Doubles)
236
+ ## 測試替身
163
237
 
164
- | 類型 | 目的 | 何時使用 |
165
- |------|------|----------|
166
- | **Stub** | 回傳預定義值 | 固定的 API 回應 |
167
- | **Mock** | 驗證互動 | 驗證方法被呼叫 |
168
- | **Fake** | 簡化的實作 | 記憶體資料庫 |
169
- | **Spy** | 記錄呼叫 | 部分 Mock |
170
- | **Dummy** | 佔位符 | 填補必要參數 |
238
+ | 類型 | 用途 | 使用時機 |
239
+ |------|------|---------|
240
+ | **Stub** | 回傳預定義的值 | 固定的 API 回應 |
241
+ | **Mock** | 驗證互動行為 | 驗證方法是否被呼叫 |
242
+ | **Fake** | 簡化實作 | 記憶體資料庫 |
243
+ | **Spy** | 記錄呼叫,委派給真實物件 | 部分模擬 |
244
+ | **Dummy** | 佔位符,不會被使用 | 填充必要參數 |
171
245
 
172
- ### 依測試層級使用
246
+ ### 各測試層級的使用指引
173
247
 
174
248
  | 層級 | 指引 |
175
249
  |------|------|
176
- | **UT** | 對所有外部依賴使用 Mocks/Stubs |
177
- | **IT** | 資料庫使用 Fakes,外部 API 使用 Stubs |
178
- | **E2E** | 全部使用真實元件;僅外部支付/郵件使用 Stub |
250
+ | **UT** | 對所有外部相依性使用 Mock/Stub |
251
+ | **IT** | 資料庫使用 Fake,外部 API 使用 Stub |
252
+ | **ST** | 使用真實元件,僅對外部第三方使用 Fake |
253
+ | **E2E** | 使用全部真實元件;僅對外部支付/郵件使用 Stub |
179
254
 
180
255
  ---
181
256
 
182
- ## Mock 限制
257
+ ## Mock 的限制
183
258
 
184
- **問題**: 萬用匹配器 (`any()`, `It.IsAny<>`) 會忽略實際查詢邏輯,允許錯誤的查詢通過。
259
+ **問題**: 萬用匹配器(`any()`、`It.IsAny<>`)會忽略實際查詢邏輯,使不正確的查詢通過測試。
185
260
 
186
- **規則**: 如果 Mock 一個接受查詢/過濾/述詞參數的方法,你**必須**有對應的整合測試來驗證查詢邏輯。
261
+ **規則**: 若模擬一個接受查詢/過濾/述詞參數的方法,你**必須**有對應的整合測試來驗證查詢邏輯。
187
262
 
188
263
  ```python
189
264
  # 範例 - Python
190
265
  # ❌ 此測試無法驗證查詢正確性
191
266
  mock_repo.find.return_value = users
192
267
 
193
- # ✓ 新增整合測試來驗證實際查詢
268
+ # ✓ 新增整合測試以驗證實際查詢
194
269
  ```
195
270
 
196
271
  ---
197
272
 
198
- ## 測試資料需求
273
+ ## 測試資料要求
199
274
 
200
- ### 區分識別碼規則
275
+ ### 原則
201
276
 
202
- 當實體同時具有代理鍵 (自動產生 ID) 和業務識別碼時,測試資料**必須**為兩者使用不同的值。
277
+ 1. **隔離**: 每個測試管理自己的資料
278
+ 2. **清理**: 測試結束後自行清理
279
+ 3. **確定性**: 測試不依賴共享狀態
280
+ 4. **可讀性**: 測試資料清楚表達意圖
281
+
282
+ ### 區別識別碼規則
283
+
284
+ 當實體同時擁有代理鍵(自動產生的 ID)和業務識別碼時,測試資料**必須**使用不同的值。
203
285
 
204
286
  ```python
205
- # ❌ 錯誤: id 等於 business_code - 對應錯誤無法偵測
287
+ # ❌ 錯誤: id 等於 business_code - 映射錯誤無法被偵測
206
288
  dept = Department(id=1, business_code=1)
207
289
 
208
- # ✓ 正確: 區分值可捕捉對應錯誤
290
+ # ✓ 正確: 不同的值可捕捉映射錯誤
209
291
  dept = Department(id=1, business_code=1001)
210
292
  ```
211
293
 
294
+ ### 複合鍵規則
295
+
296
+ 對於擁有複合主鍵的實體,確保每筆記錄有唯一的鍵組合。
297
+
298
+ ```python
299
+ # ❌ 鍵衝突
300
+ batch1 = BatchRecord(id=0, send_time=now)
301
+ batch2 = BatchRecord(id=0, send_time=now) # 衝突!
302
+
303
+ # ✓ 唯一組合
304
+ batch1 = BatchRecord(id=0, send_time=now + timedelta(seconds=1))
305
+ batch2 = BatchRecord(id=0, send_time=now + timedelta(seconds=2))
306
+ ```
307
+
212
308
  ---
213
309
 
214
310
  ## 測試環境
215
311
 
216
- ### 依測試層級的容器使用
312
+ ### 各語言工具
313
+
314
+ | 語言 | 版本管理工具 | 鎖定檔案 |
315
+ |------|-------------|---------|
316
+ | Python | venv, virtualenv, poetry | requirements.txt, poetry.lock |
317
+ | Node.js | nvm, fnm | package-lock.json, yarn.lock |
318
+ | Ruby | rbenv, rvm | Gemfile.lock |
319
+ | Java | SDKMAN, jenv | pom.xml, build.gradle.lock |
320
+ | .NET | dotnet SDK | packages.lock.json |
321
+ | Go | go mod | go.sum |
322
+ | Rust | rustup, cargo | Cargo.lock |
323
+
324
+ ### 最佳實踐
325
+
326
+ 1. **始終使用虛擬環境**進行開發與測試
327
+ 2. **提交鎖定檔案**至版本控制
328
+ 3. **在 CI/CD 管線中固定版本**
329
+ 4. **在 README 或 .tool-versions 中記錄所需的執行環境版本**
330
+
331
+ ### 各測試層級的容器使用
217
332
 
218
333
  | 層級 | 容器使用 |
219
- |------|----------|
220
- | UT | 不需要 - 使用 mocks |
221
- | IT | Testcontainers 用於資料庫、快取 |
222
- | ST | Docker Compose 用於完整環境 |
334
+ |------|---------|
335
+ | UT | 不需要 - 使用 mock |
336
+ | IT | 使用 Testcontainers 處理資料庫、快取 |
337
+ | ST | 使用 Docker Compose 建立完整環境 |
223
338
  | E2E | 完整容器化堆疊 |
224
339
 
225
340
  ---
@@ -233,18 +348,116 @@ dept = Department(id=1, business_code=1001)
233
348
  | 單元測試 | 每次提交 | 10 分鐘 |
234
349
  | 整合測試 | 每次提交 | 30 分鐘 |
235
350
  | 系統測試 | PR 合併至 main | 2 小時 |
236
- | E2E 測試 | 發布候選版 | 4 小時 |
351
+ | E2E 測試 | 發布候選版本 | 4 小時 |
352
+
353
+ ### 必要指標
354
+
355
+ | 指標 | UT | IT | ST | E2E |
356
+ |------|----|----|----|----|
357
+ | 通過/失敗數 | 必要 | 必要 | 必要 | 必要 |
358
+ | 執行時間 | 必要 | 必要 | 必要 | 必要 |
359
+ | 覆蓋率 % | 必要 | 必要 | 選用 | 不需要 |
360
+ | 不穩定測試率 | 必要 | 必要 | 必要 | 必要 |
361
+ | 截圖/影片 | 不需要 | 不需要 | 選用 | 必要 |
362
+
363
+ ---
364
+
365
+ ## 最佳實踐
366
+
367
+ ### AAA 模式
368
+
369
+ ```
370
+ // Arrange - 設置測試資料與環境
371
+ // Act - 執行待測行為
372
+ // Assert - 驗證結果
373
+ ```
374
+
375
+ ### FIRST 原則
376
+
377
+ | 原則 | 說明 |
378
+ |------|------|
379
+ | **F**ast(快速) | 測試快速執行 |
380
+ | **I**ndependent(獨立) | 測試之間互不影響 |
381
+ | **R**epeatable(可重複) | 每次結果相同 |
382
+ | **S**elf-validating(自我驗證) | 明確的通過/失敗 |
383
+ | **T**imely(及時) | 與生產程式碼同時撰寫 |
384
+
385
+ ### 應避免的反模式
386
+
387
+ - 測試相依性(測試必須按特定順序執行)
388
+ - 不穩定測試(時而通過、時而失敗)
389
+ - 測試實作細節(重構時測試就壞了)
390
+ - 過度 Mock(沒有真正測試到任何東西)
391
+ - 缺少斷言(測試沒有驗證有意義的內容)
392
+ - 魔術數字/字串(無法解釋的值)
393
+ - 相同的測試 ID(代理鍵與業務鍵使用相同值)
394
+
395
+ ---
396
+
397
+ ## 測試文件結構
398
+
399
+ ### tests/README.md 必要章節
400
+
401
+ 每個 `tests/` 目錄**應該**包含一個 README.md,內含:
402
+
403
+ #### 1. 測試概覽表
404
+
405
+ | 測試類型 | 數量 | 框架 | 環境 |
406
+ |---------|------|------|------|
407
+ | 單元測試 | 150 | Jest | Node.js |
408
+ | 整合測試 | 45 | Jest | Node.js + TestContainers |
409
+ | E2E 測試 | 12 | Playwright | Browser |
410
+
411
+ #### 2. 目前狀態章節
412
+
413
+ | 指標 | 值 | 目標 | 狀態 |
414
+ |------|-----|------|------|
415
+ | 通過率 | 98.5% | >= 95% | 通過 |
416
+ | 行覆蓋率 | 82% | >= 80% | 通過 |
417
+ | 分支覆蓋率 | 75% | >= 70% | 通過 |
418
+
419
+ #### 3. 報告連結章節
420
+
421
+ | 報告類型 | 位置 | 說明 |
422
+ |---------|------|------|
423
+ | 測試結果 | `results/` | 時間戳記的執行報告 |
424
+ | 覆蓋率 | `coverage/` | 程式碼覆蓋率報告 |
425
+ | 差距分析 | `docs/gap-analysis.md` | 缺失覆蓋率分析 |
426
+
427
+ ### 測試報告命名慣例
428
+
429
+ | 項目 | 慣例 | 範例 |
430
+ |------|------|------|
431
+ | 報告檔名 | `test-report-YYYYMMDD-HHMMSS.md` | `test-report-20260129-143000.md` |
432
+ | 報告目錄 | `tests/results/` | |
433
+ | 覆蓋率目錄 | `tests/coverage/` | |
434
+
435
+ ### 目錄結構
436
+
437
+ ```
438
+ tests/
439
+ ├── README.md # 測試概覽與狀態
440
+ ├── results/ # 測試執行報告
441
+ ├── coverage/ # 覆蓋率報告
442
+ ├── docs/ # 測試文件
443
+ ├── unit/ # 單元測試
444
+ ├── integration/ # 整合測試
445
+ └── e2e/ # 端對端測試
446
+ ```
447
+
448
+ ---
237
449
 
238
450
  ---
239
451
 
240
452
  ## 相關標準
241
453
 
242
- - [測試理論知識庫](guides/testing-guide.md) - 教育內容、範例、技巧
454
+ - [測試理論知識庫](../../../skills/testing-guide/testing-theory.md) - 教育內容、範例、技術
243
455
  - [測試驅動開發](test-driven-development.md) - TDD/BDD/ATDD 方法論
244
456
  - [測試完整性維度](test-completeness-dimensions.md) - 8 維度測試覆蓋
245
457
  - [規格驅動開發](spec-driven-development.md) - SDD 工作流程整合
246
458
  - [程式碼簽入標準](checkin-standards.md)
247
- - [程式碼審查清單](code-review-checklist.md)
459
+ - [程式碼審查檢查清單](code-review-checklist.md)
460
+ - [部署標準](deployment-standards.md) - 部署準備的測試要求
248
461
 
249
462
  ---
250
463
 
@@ -252,13 +465,23 @@ dept = Department(id=1, business_code=1001)
252
465
 
253
466
  | 版本 | 日期 | 變更 |
254
467
  |------|------|------|
255
- | 3.0.0 | 2026-01-29 | **重大重構**:拆分為規則(本文件)和理論(testing-guide.md)。優化 AI 閱讀效率。 |
468
+ | 3.1.0 | 2026-03-24 | **覆蓋率優先重構**: 將覆蓋率目標提升至首要位置,提高門檻(行 80/90/95+、分支 70/85/90+、函式 85/95/100),新增覆蓋率與佔比的區別,將測試金字塔降為僅供參考 |
469
+ | 3.0.0 | 2026-01-29 | **重大重構**: 拆分為規則(本檔案)與理論(testing-theory.md)。從 141KB/3185 行縮減至約 12KB/350 行。所有教育內容移至 skills/testing-guide/testing-theory.md。純規則格式,針對 AI 代理消費最佳化。 |
256
470
  | 2.2.0 | 2026-01-20 | 新增測試文件結構章節 |
257
- | 2.1.0 | 2026-01-05 | 新增 SWEBOK v4.0 參考 |
258
- | 2.0.0 | 2026-01-05 | 根據 ISTQB CTFL v4.0 ISO/IEC/IEEE 29119 進行重大更新 |
471
+ | 2.1.0 | 2026-01-05 | 新增 SWEBOK v4.0 參考、測試基礎知識、測試相關量測 |
472
+ | 2.0.0 | 2026-01-05 | 重大更新,對齊 ISTQB CTFL v4.0 ISO/IEC/IEEE 29119 |
473
+ | 1.3.0 | 2025-12-29 | 新增測試框架選擇、IT/SIT 縮寫說明 |
474
+ | 1.2.0 | 2025-12-19 | 新增 Mock 限制、整合測試要求、測試資料模式 |
475
+ | 1.1.1 | 2025-12-11 | 改善系統測試範例,使用通用領域概念 |
476
+ | 1.1.0 | 2025-12-05 | 新增測試環境隔離章節 |
477
+ | 1.0.0 | 2025-12-05 | 初始測試標準,包含 UT/IT/ST/E2E 覆蓋 |
259
478
 
260
479
  ---
261
480
 
262
481
  ## 授權
263
482
 
264
- 本標準以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權發布。
483
+ 本標準以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 釋出。
484
+
485
+ ---
486
+
487
+ **維護者**: 開發團隊
@@ -0,0 +1,94 @@
1
+ ---
2
+ source: ../../../core/verification-evidence.md
3
+ source_version: 1.0.0
4
+ translation_version: 1.0.0
5
+ last_synced: 2026-03-24
6
+ status: current
7
+ ---
8
+
9
+ # 驗證證據標準
10
+
11
+ > **語言**: [English](../../../core/verification-evidence.md) | 繁體中文
12
+
13
+ **版本**: 1.0.0
14
+ **最後更新**: 2026-03-20
15
+ **適用性**: 所有 AI 輔助開發工作流
16
+ **範圍**: 通用 (Universal)
17
+ **靈感來源**: [Superpowers](https://github.com/obra/superpowers) — verification-before-completion (MIT)
18
+
19
+ ---
20
+
21
+ ## 目的
22
+
23
+ 建立「鐵律」:無驗證證據不可聲稱完成。防止 AI 代理虛構成功結果,確保每個完成聲明都有可執行的證據支持。
24
+
25
+ ---
26
+
27
+ ## 術語表
28
+
29
+ | 術語 | 定義 |
30
+ |------|------|
31
+ | 驗證證據 (Verification Evidence) | 驗證指令執行及其結果的結構化記錄 |
32
+ | 鐵律 (Iron Law) | 絕對規則:無證據 = 不可聲稱完成 |
33
+ | RED-GREEN 循環 | 透過展示修復前測試失敗、修復後測試通過來證明 bug 修復 |
34
+ | Exit Code | 指令的數值回傳值(0 = 成功、非零 = 失敗) |
35
+
36
+ ---
37
+
38
+ ## 鐵律
39
+
40
+ > **無驗證證據 = 不可聲稱完成。**
41
+
42
+ 代理聲稱「已完成」不是證據。驗證必須是可獨立執行且產生可觀察輸出的。
43
+
44
+ ---
45
+
46
+ ## 證據格式
47
+
48
+ 每個完成聲明必須包含以下結構化證據:
49
+
50
+ ```markdown
51
+ ## 驗證證據
52
+
53
+ **指令**: `npm test`
54
+ **Exit Code**: 0
55
+ **摘要**: 全部 42 個測試通過
56
+ **時間戳**: 2026-03-24T10:30:00Z
57
+ ```
58
+
59
+ ## 證據類型
60
+
61
+ | 類型 | 適用場景 | 範例 |
62
+ |------|----------|------|
63
+ | **測試結果** | 功能開發、bug 修復 | `npm test` 輸出 |
64
+ | **建置成功** | 編譯、打包 | `npm run build` 的 exit code 0 |
65
+ | **Lint 通過** | 程式碼品質 | `npm run lint` 無錯誤 |
66
+ | **RED-GREEN** | bug 修復 | 修復前失敗 → 修復後通過 |
67
+ | **手動驗證** | UI 變更、視覺效果 | 截圖或螢幕錄影 |
68
+
69
+ ## RED-GREEN 循環
70
+
71
+ 修復 bug 時的驗證流程:
72
+
73
+ 1. **RED** — 展示修復前測試失敗
74
+ 2. **修復** — 套用修復
75
+ 3. **GREEN** — 展示修復後測試通過
76
+ 4. **全套** — 執行完整測試套件確認無回歸
77
+
78
+ ## 禁止的完成聲明
79
+
80
+ 以下聲明**不構成**驗證證據:
81
+
82
+ | 聲明 | 原因 |
83
+ |------|------|
84
+ | 「已完成」 | 無可觀察的輸出 |
85
+ | 「應該可以了」 | 未執行驗證 |
86
+ | 「我改了程式碼」 | 修改 ≠ 驗證 |
87
+ | 「測試應該會通過」 | 預測 ≠ 事實 |
88
+
89
+ ## 相關標準
90
+
91
+ - [系統化除錯](systematic-debugging.md)
92
+ - [反幻覺標準](anti-hallucination.md)
93
+ - [提交規範](checkin-standards.md)
94
+ - [代理派遣與並行協調](agent-dispatch.md)