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,80 @@
1
+ ---
2
+ source: ../../../core/deployment-standards.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
+ > **语言**: [English](../../../core/deployment-standards.md) | 简体中文
10
+
11
+ # 部署标准
12
+
13
+ **版本**: 1.0.0
14
+ **最后更新**: 2026-02-09
15
+ **适用范围**: 所有具有部署流水线的软件项目
16
+ **范围**: universal
17
+ **行业标准**: Twelve-Factor App, Google SRE — Release Engineering, DORA State of DevOps
18
+ **参考**: [12factor.net](https://12factor.net/), [sre.google](https://sre.google/books/), [dora.dev](https://dora.dev/)
19
+
20
+ ---
21
+
22
+ ## 目的
23
+
24
+ 本标准定义安全部署软件到生产环境的指南,涵盖部署策略、功能标志、回滚流程、环境一致性和部署效能指标。
25
+
26
+ **参考标准**:
27
+ - [The Twelve-Factor App](https://12factor.net/) — Factor X: Dev/Prod Parity
28
+ - [Google SRE Book — Release Engineering](https://sre.google/sre-book/release-engineering/)
29
+ - [Martin Fowler — Feature Toggles](https://martinfowler.com/articles/feature-toggles.html)
30
+ - [DORA State of DevOps Report](https://dora.dev/)
31
+
32
+ ---
33
+
34
+ ## 核心原则
35
+
36
+ | 原则 | 描述 |
37
+ |------|------|
38
+ | **部署 ≠ 发布** | 将代码部署到生产环境与向用户暴露是独立动作;使用功能标志控制暴露 |
39
+ | **渐进式暴露** | 向逐渐增大的受众推出变更:内部 → 金丝雀 → 百分比 → 全面可用 |
40
+ | **快速回滚** | 每次部署必须有经过测试的回滚路径,5 分钟内执行完毕 |
41
+ | **环境一致性** | 保持开发、预发布和生产环境尽可能相似(Twelve-Factor App Factor X) |
42
+ | **全面自动化** | 手动部署步骤容易出错;自动化构建、测试、部署和回滚 |
43
+ | **全面监控** | 带可观测性部署;无法度量就无法安全部署 |
44
+
45
+ ---
46
+
47
+ ## 部署策略选择
48
+
49
+ | 策略 | 使用场景 | 回滚速度 | 资源成本 | 复杂度 |
50
+ |------|---------|---------|---------|--------|
51
+ | **滚动更新** | 无状态服务、标准更新 | 中等(分钟) | 低(无额外基础设施) | 低 |
52
+ | **蓝绿部署** | 零停机要求、数据库兼容变更 | 快速(秒,DNS/LB 切换) | 高(2× 基础设施) | 中等 |
53
+ | **金丝雀部署** | 高风险变更、大用户量 | 快速(重定向流量) | 中等(部分额外基础设施) | 高 |
54
+ | **功能标志** | 解耦部署与发布、A/B 测试 | 即时(关闭开关) | 低(代码级别) | 中等 |
55
+
56
+ ### 决策指南
57
+
58
+ ```
59
+ 是否需要零停机?
60
+ ├── 是 → 变更是否高风险或大规模?
61
+ │ ├── 是 → 金丝雀部署
62
+ │ └── 否 → 蓝绿部署
63
+ └── 否 → 变更是否在功能标志后面?
64
+ ├── 是 → 功能标志(随时部署)
65
+ └── 否 → 滚动更新
66
+ ```
67
+
68
+ ---
69
+
70
+ ## 相关标准
71
+
72
+ - [安全标准](security-standards.md)
73
+ - [性能标准](performance-standards.md)
74
+ - [测试标准](testing-standards.md)
75
+
76
+ ---
77
+
78
+ ## 许可证
79
+
80
+ 本标准采用 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 发布。
@@ -1,9 +1,9 @@
1
1
  ---
2
2
  source: ../../../core/error-code-standards.md
3
- source_version: 1.1.0
3
+ source_version: 1.2.0
4
4
  translation_version: 1.1.0
5
5
  last_synced: 2026-01-08
6
- status: current
6
+ status: outdated
7
7
  ---
8
8
 
9
9
  > **语言**: [English](../../../core/error-code-standards.md) | [简体中文](../../zh-TW/core/error-code-standards.md) | 简体中文
@@ -0,0 +1,493 @@
1
+ ---
2
+ source: ../../../core/forward-derivation-standards.md
3
+ source_version: 1.2.0
4
+ translation_version: 1.2.0
5
+ last_synced: 2026-03-23
6
+ status: current
7
+ ---
8
+
9
+ # 正向推演标准 | Forward Derivation Standards
10
+
11
+ **版本**: 1.2.0
12
+ **最后更新**: 2026-03-18
13
+ **适用范围**: 所有使用规格驱动开发的项目
14
+
15
+ > **语言**: [English](../../../core/forward-derivation-standards.md) | 简体中文
16
+
17
+ ---
18
+
19
+ ## 目的
20
+
21
+ 本规范定义正向推演的原则和工作流程——从已批准的 SDD 规格自动生成 BDD 场景、TDD 测试骨架和 ATDD 验收测试。正向推演与[反向工程标准](reverse-engineering-standards.md)互补,形成对称的推演系统。
22
+
23
+ **主要优点**:
24
+ - 一致的测试结构与规格对齐
25
+ - 从需求到测试的可追溯性(@SPEC-XXX、@AC-N 标签)
26
+ - 从已批准规格更快启动 TDD
27
+ - 减少手动转换错误
28
+
29
+ ---
30
+
31
+ ## 正向推演工作流程
32
+
33
+ ```
34
+ ┌──────────────────────────────────────────────────────────────────────────┐
35
+ │ 正向推演工作流程 │
36
+ ├──────────────────────────────────────────────────────────────────────────┤
37
+ │ │
38
+ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌───────────┐ │
39
+ │ │ 解析 SPEC │───▶│ 提取 AC │───▶│ 生成 BDD │───▶│ 生成 │ │
40
+ │ │ │ │ │ │ │ │ TDD/ATDD │ │
41
+ │ └─────────────┘ └─────────────┘ └─────────────┘ └───────────┘ │
42
+ │ │ │ │ │ │
43
+ │ │ │ │ ▼ │
44
+ │ │ │ │ ┌───────────────┐ │
45
+ │ │ │ │ │ 人类审查 │ │
46
+ │ │ │ │ └───────────────┘ │
47
+ │ │ │ │ │ │
48
+ │ ▼ ▼ ▼ ▼ │
49
+ │ [来源] [已解析] [已生成] [已审查] │
50
+ │ SPEC-XXX.md AC 列表 .feature/.test 可使用 │
51
+ │ │
52
+ └──────────────────────────────────────────────────────────────────────────┘
53
+ ```
54
+
55
+ ### 工作流程阶段
56
+
57
+ | 阶段 | 描述 | 输出 | 确定性等级 |
58
+ |------|------|------|-----------|
59
+ | **解析 SPEC** | 读取已批准的规格文档 | SPEC 元数据、区块 | [来源] |
60
+ | **提取 AC** | 解析验收条件(GWT 或条列) | 结构化 AC 列表 | [推演] |
61
+ | **生成 BDD** | 将 AC 转换为 Gherkin 场景 | .feature 文件 | [生成] |
62
+ | **生成 TDD** | 从 AC 创建测试骨架 | 带 TODO 的测试文件 | [生成] |
63
+ | **生成 ATDD** | 创建验收测试表格 | Markdown 测试表格 | [生成] |
64
+ | **人类审查** | 验证生成的输出 | 批准的测试结构 | [已审查] |
65
+
66
+ ---
67
+
68
+ ## 核心原则
69
+
70
+ ### 1. 规格限定生成
71
+
72
+ **规则**:只推演规格中存在的内容。不添加 AC 未明确定义的功能、场景或测试。
73
+
74
+ **正确示范**:
75
+ ```markdown
76
+ # SPEC AC
77
+ - [ ] 用户可以使用电子邮件和密码登录
78
+
79
+ # 生成的 BDD(正确)
80
+ Scenario: 用户以电子邮件和密码登录
81
+ ```
82
+
83
+ **错误示范**:
84
+ ```markdown
85
+ # 生成的 BDD(错误 - 超出规格范围)
86
+ Scenario: 用户以电子邮件和密码登录
87
+ Scenario: 用户以社交账号登录 # <-- 不在 AC 中
88
+ Scenario: 用户密码恢复 # <-- 不在 AC 中
89
+ ```
90
+
91
+ ### 2. 反幻觉合规
92
+
93
+ **规则**:本规范严格遵循[反幻觉标准](anti-hallucination.md):
94
+
95
+ - **1:1 对应**:每个 AC 产生恰好一个场景/测试群组
96
+ - **禁止捏造**:不发明验收条件或测试用例
97
+ - **来源标注**:所有生成项目标注来源 SPEC 和 AC 编号
98
+
99
+ **反幻觉检查**:
100
+ ```
101
+ 输入:SPEC 有 N 个验收条件
102
+ 输出:恰好 N 个场景(BDD)、N 个测试群组(TDD)、N 个验收表格(ATDD)
103
+
104
+ 若输出数量 ≠ 输入数量 → 违规
105
+ ```
106
+
107
+ ### 3. 来源标注
108
+
109
+ **规则**:每个生成项目必须包含可追溯性:
110
+
111
+ ```gherkin
112
+ # BDD 范例
113
+ # Generated from: specs/SPEC-001.md
114
+ # AC: AC-1
115
+
116
+ @SPEC-001 @AC-1
117
+ Scenario: 用户以有效凭证登录
118
+ ```
119
+
120
+ ```typescript
121
+ // TDD 范例
122
+ /**
123
+ * Generated from: specs/SPEC-001.md
124
+ * AC: AC-1
125
+ */
126
+ describe('AC-1: 用户以有效凭证登录', () => {
127
+ ```
128
+
129
+ ### 4. 确定性标签
130
+
131
+ 使用这些标签标示推演确定性:
132
+
133
+ | 标签 | 定义 | 范例 |
134
+ |------|------|------|
135
+ | `[来源]` | 直接来自 SPEC 的内容 | 功能标题、AC 文字 |
136
+ | `[推演]` | 从 SPEC 内容转换 | 从条列 AC 推演的 GWT |
137
+ | `[生成]` | AI 生成的结构 | 测试骨架、TODO 注释 |
138
+ | `[TODO]` | 需要人类实现 | 测试断言、步骤定义 |
139
+
140
+ ---
141
+
142
+ ## 输入格式要求
143
+
144
+ ### 支持的 AC 格式
145
+
146
+ #### 格式 1:Given-When-Then(推荐)
147
+
148
+ ```markdown
149
+ ### AC-1: 用户登录
150
+ **Given** 已注册的用户有有效凭证
151
+ **When** 用户提交含电子邮件和密码的登录表单
152
+ **Then** 用户被导向仪表板
153
+ **And** 创建会话令牌
154
+ ```
155
+
156
+ #### 格式 2:条列式
157
+
158
+ ```markdown
159
+ ### AC-1: 用户登录
160
+ - 用户可以使用电子邮件和密码登录
161
+ - 登录成功导向仪表板
162
+ - 无效凭证显示错误消息
163
+ ```
164
+
165
+ #### 格式 3:勾选清单
166
+
167
+ ```markdown
168
+ ## 验收条件
169
+ - [ ] 用户可以使用电子邮件和密码登录
170
+ - [ ] 登录成功时创建会话
171
+ - [ ] 无效凭证时显示错误消息
172
+ ```
173
+
174
+ ---
175
+
176
+ ## 输出格式
177
+
178
+ ### BDD 输出(.feature)
179
+
180
+ ```gherkin
181
+ # Generated from: specs/SPEC-001.md
182
+ # Generator: forward-derivation v1.0.0
183
+ # Generated at: 2026-01-19T10:00:00Z
184
+
185
+ @SPEC-001
186
+ Feature: 用户认证
187
+ 作为用户
188
+ 我想要登录系统
189
+ 以便访问我的仪表板
190
+
191
+ @AC-1 @happy-path
192
+ Scenario: 用户以有效凭证登录
193
+ # [来源] 来自 SPEC-001 AC-1
194
+ Given 已注册的用户有有效凭证
195
+ When 用户提交登录表单
196
+ Then 用户被导向仪表板
197
+
198
+ @AC-2 @error-handling
199
+ Scenario: 无效凭证登录失败
200
+ # [来源] 来自 SPEC-001 AC-2
201
+ Given 用户有无效凭证
202
+ When 用户提交登录表单
203
+ Then 显示错误消息
204
+ ```
205
+
206
+ ### TDD 输出(.test.ts)
207
+
208
+ ```typescript
209
+ /**
210
+ * Tests for SPEC-001: 用户认证
211
+ * Generated from: specs/SPEC-001.md
212
+ * Generated at: 2026-01-19T10:00:00Z
213
+ * AC Coverage: AC-1, AC-2
214
+ *
215
+ * [生成] 此文件包含测试骨架。
216
+ * [TODO] 实现测试逻辑和断言。
217
+ */
218
+
219
+ describe('SPEC-001: 用户认证', () => {
220
+ /**
221
+ * AC-1: 用户以有效凭证登录
222
+ * [来源] specs/SPEC-001.md#AC-1
223
+ */
224
+ describe('AC-1: 用户以有效凭证登录', () => {
225
+ it('should redirect to dashboard on successful login', async () => {
226
+ // Arrange
227
+ // [TODO] 设定已注册用户和有效凭证
228
+
229
+ // Act
230
+ // [TODO] 提交登录表单
231
+
232
+ // Assert
233
+ // [TODO] 验证导向仪表板
234
+ expect(true).toBe(true); // Placeholder
235
+ });
236
+ });
237
+ });
238
+ ```
239
+
240
+ ### ATDD 输出(acceptance.md)
241
+
242
+ ```markdown
243
+ # SPEC-001 验收测试
244
+
245
+ **规格**: [SPEC-001](../specs/SPEC-001.md)
246
+ **生成时间**: 2026-01-19
247
+ **状态**: 待审查
248
+
249
+ ---
250
+
251
+ ## AT-001: 用户以有效凭证登录
252
+
253
+ **来源**: SPEC-001 的 AC-1
254
+
255
+ | 步骤 | 动作 | 预期结果 | 通过/失败 |
256
+ |------|------|----------|-----------|
257
+ | 1 | 导航到登录页面 | 显示登录表单 | [ ] |
258
+ | 2 | 输入有效电子邮件 | 字段接受输入 | [ ] |
259
+ | 3 | 输入有效密码 | 字段接受输入(遮蔽) | [ ] |
260
+ | 4 | 点击「登录」按钮 | 表单已提交 | [ ] |
261
+ | 5 | 验证导向 | 用户在仪表板页面 | [ ] |
262
+
263
+ **前置条件**: 系统中存在用户账号
264
+
265
+ **测试人员**: _______________
266
+ **日期**: _______________
267
+ **结果**: [ ] 通过 / [ ] 失败
268
+ ```
269
+
270
+ ---
271
+
272
+ ## 条列式转 GWT 转换
273
+
274
+ 当 AC 以条列点撰写时,使用此模式转换:
275
+
276
+ ### 转换规则
277
+
278
+ | 条列模式 | 对应到 | 范例 |
279
+ |----------|--------|------|
280
+ | 条件/状态 | Given | 「用户已登录」→ Given 用户已登录 |
281
+ | 用户动作 | When | 「用户点击按钮」→ When 用户点击按钮 |
282
+ | 系统响应 | Then | 「显示消息」→ Then 显示消息 |
283
+ | 「可以/应该/必须」 | When + Then | 「用户可以删除项目」→ When 用户删除项目 Then 项目已移除 |
284
+
285
+ ---
286
+
287
+ ## 与开发方法论的整合
288
+
289
+ ### 正向推演管道
290
+
291
+ ```
292
+ ┌───────────────────────────────────────────────────────────────────────┐
293
+ │ 对称推演系统 │
294
+ ├───────────────────────────────────────────────────────────────────────┤
295
+ │ │
296
+ │ 反向工程 正向推演 │
297
+ │ (代码 → 规格) (规格 → 测试) │
298
+ │ │
299
+ │ ┌───────────────┐ ┌───────────────┐ │
300
+ │ │ 现有代码 │ │ 已批准 SPEC │ │
301
+ │ └───────┬───────┘ └───────┬───────┘ │
302
+ │ │ │ │
303
+ │ ▼ ▼ │
304
+ │ ┌───────────────┐ ┌───────────────┐ │
305
+ │ │ /reverse-spec │ │ /derive-bdd │ │
306
+ │ │ /reverse-bdd │◀─────SPEC-XXX───────▶│ /derive-tdd │ │
307
+ │ │ /reverse-tdd │ │ /derive-atdd │ │
308
+ │ └───────┬───────┘ └───────┬───────┘ │
309
+ │ │ │ │
310
+ │ ▼ ▼ │
311
+ │ ┌───────────────┐ ┌───────────────┐ │
312
+ │ │ 初稿 SPEC │ │ .feature │ │
313
+ │ │ [已确认] │ │ .test.ts │ │
314
+ │ │ [推断] │ │ acceptance.md │ │
315
+ │ │ [未知] │ │ [生成] │ │
316
+ │ └───────────────┘ └───────────────┘ │
317
+ │ │
318
+ └───────────────────────────────────────────────────────────────────────┘
319
+ ```
320
+
321
+ ### 与整合流程方法论
322
+
323
+ 正向推演位于 `spec-review` 和 `discovery` 阶段之间:
324
+
325
+ ```yaml
326
+ spec-review → forward-derivation → discovery
327
+ ```
328
+
329
+ 1. **规格审查 (SDD)**:规格已批准
330
+ 2. **正向推演**:自动生成 BDD 场景、TDD 骨架
331
+ 3. **探索 (BDD)**:与利害关系人审查和精炼生成的场景
332
+ 4. **TDD 红灯**:使用生成的骨架开始实现测试
333
+
334
+ ---
335
+
336
+ ## 命令
337
+
338
+ ### 命令参考
339
+
340
+ | 命令 | 输入 | 输出 | 目的 |
341
+ |------|------|------|------|
342
+ | `/derive-bdd` | SPEC-XXX.md | .feature | AC → Gherkin 场景 |
343
+ | `/derive-tdd` | SPEC-XXX.md | .test.ts | AC → 测试骨架 |
344
+ | `/derive-atdd` | SPEC-XXX.md | acceptance.md | AC → 验收测试表格 |
345
+ | `/derive-all` | SPEC-XXX.md | 以上全部 | 完整推演管道 |
346
+
347
+ ### 命令参数
348
+
349
+ | 参数 | 类型 | 默认值 | 描述 |
350
+ |------|------|--------|------|
351
+ | `--lang` | string | typescript | 目标语言: ts, js, python, java, go |
352
+ | `--framework` | string | vitest | 框架: vitest, jest, pytest, junit, go-test |
353
+ | `--output-dir` | string | ./generated | 输出目录 |
354
+ | `--dry-run` | boolean | false | 预览不创建文件 |
355
+
356
+ ### 使用范例
357
+
358
+ ```bash
359
+ # 从规格生成 BDD 场景
360
+ /derive-bdd specs/SPEC-001.md
361
+
362
+ # 使用 Python/pytest 生成 TDD 测试骨架
363
+ /derive-tdd specs/SPEC-001.md --lang python --framework pytest
364
+
365
+ # 生成所有输出
366
+ /derive-all specs/SPEC-001.md --output-dir ./generated
367
+
368
+ # 预览不创建文件
369
+ /derive-all specs/SPEC-001.md --dry-run
370
+ ```
371
+
372
+ ---
373
+
374
+ ## Pipeline 整合
375
+
376
+ ### 自动 TDD 转换
377
+
378
+ 当正向推演由自动化 Pipeline 触发时(参见 [Pipeline 整合标准](pipeline-integration-standards.md)),以下规则适用于转换至 TDD 循环:
379
+
380
+ #### Auto-TDD 进入规则
381
+
382
+ | 规则 | 说明 |
383
+ |------|------|
384
+ | **推演完整性** | 所有推演输出(BDD、TDD、ATDD)必须在进入 TDD 前完成生成 |
385
+ | **RED 状态初始化** | Pipeline 在生成测试骨架后将 TDD 状态设为 RED |
386
+ | **测试骨架验证** | 生成的测试文件必须能编译/解析无误后才能进入 RED |
387
+ | **AC 计数验证** | 进入转换前验证输出测试数量与 AC 数量匹配 |
388
+
389
+ #### Pipeline Hooks
390
+
391
+ 推演步骤可通过 Pipeline 事件自动触发:
392
+
393
+ | Hook | 触发条件 | 动作 |
394
+ |------|---------|------|
395
+ | `on-spec-approved` | Spec 状态变更为「已批准」 | 启动推演 Pipeline |
396
+ | `on-derivation-complete` | 所有推演输出已生成 | 转换至 TDD RED 阶段 |
397
+ | `on-tdd-green` | 所有推演测试通过 | 触发审查阶段 |
398
+
399
+ #### Auto-TDD 进入工作流程
400
+
401
+ ```
402
+ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
403
+ │ Spec Approved│───▶│ Derive All │───▶│ Verify Count │───▶│ TDD RED │
404
+ │ (hook) │ │ BDD+TDD+ATDD│ │ AC = Tests │ │ (auto-set) │
405
+ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
406
+ ```
407
+
408
+ 1. **Spec 批准**:Pipeline 检测到 Spec 批准(通过 hook 或轮询)
409
+ 2. **完整推演**:Pipeline 以项目配置的语言/框架执行 `/derive-all`
410
+ 3. **计数验证**:Pipeline 验证输出数量与 AC 数量匹配(反幻觉)
411
+ 4. **RED 状态**:Pipeline 将 TDD 状态设为 RED;测试骨架存在但 assertion 为 [TODO]
412
+
413
+ #### 与 Pipeline 阶段的整合
414
+
415
+ 正向推演对应 [Pipeline 整合标准](pipeline-integration-standards.md) 6 阶段模型中的 **DERIVE** 阶段:
416
+
417
+ | Pipeline 阶段 | 正向推演角色 |
418
+ |--------------|------------|
419
+ | SPEC | 输入:已批准的规格 |
420
+ | **DERIVE** | 执行:解析 AC → 生成 BDD/TDD/ATDD 输出 |
421
+ | BUILD | 输出:测试骨架进入 TDD RED→GREEN 循环 |
422
+
423
+ ---
424
+
425
+ ## 应避免的反模式
426
+
427
+ ### 生成反模式
428
+
429
+ | 反模式 | 影响 | 正确做法 |
430
+ |--------|------|----------|
431
+ | **添加额外场景** | 测试膨胀、误导覆盖率 | 严格 1:1 AC 对应 |
432
+ | **发明测试用例** | 虚假信心 | 只从明确的 AC 推演 |
433
+ | **跳过来源标注** | 失去可追溯性 | 永远包含 @SPEC-XXX、@AC-N |
434
+ | **过度指定步骤** | 脆弱的测试 | 保持步骤在业务层级 |
435
+ | **缺少 TODO 标记** | 实现不完整 | 标记所有生成代码为 [TODO] |
436
+
437
+ ### 流程反模式
438
+
439
+ | 反模式 | 影响 | 正确做法 |
440
+ |--------|------|----------|
441
+ | **从草稿 SPEC 推演** | 无效输出 | 只使用已批准的规格 |
442
+ | **跳过人类审查** | 品质问题 | 永远审查生成的输出 |
443
+ | **将骨架视为完整** | 缺少断言 | 填写 [TODO] 区块 |
444
+ | **忽略语言惯例** | 不一致的代码 | 使用适当的语言模板 |
445
+
446
+ ---
447
+
448
+ ## 最佳实践
449
+
450
+ ### 应该做的
451
+
452
+ - ✅ 只从已批准的规格推演
453
+ - ✅ 维持严格的 1:1 AC 到输出对应
454
+ - ✅ 在所有输出中包含来源标注
455
+ - ✅ 使用 [TODO] 标记需要实现的区块
456
+ - ✅ 使用前审查生成的输出
457
+ - ✅ 保持生成的步骤在业务/领域层级
458
+ - ✅ 使用适当的语言/框架模板
459
+
460
+ ### 不应该做的
461
+
462
+ - ❌ 添加 AC 未定义的场景
463
+ - ❌ 从草稿或未批准的规格推演
464
+ - ❌ 跳过对生成输出的人类审查
465
+ - ❌ 将生成的骨架视为完整测试
466
+ - ❌ 移除来源标注注释
467
+ - ❌ 在生成的代码中过度指定实现细节
468
+
469
+ ---
470
+
471
+ ## 相关规范
472
+
473
+ - [反向工程标准](reverse-engineering-standards.md) - 对称对应(代码 → 规格)
474
+ - [规格驱动开发](spec-driven-development.md) - 输入规格格式
475
+ - [行为驱动开发](../../../core/behavior-driven-development.md) - BDD 输出格式
476
+ - [测试驱动开发](test-driven-development.md) - TDD 输出用法
477
+ - [验收测试驱动开发](../../../core/acceptance-test-driven-development.md) - ATDD 输出格式
478
+ - [反幻觉指南](anti-hallucination.md) - 生成合规
479
+
480
+ ---
481
+
482
+ ## 版本历史
483
+
484
+ | 版本 | 日期 | 变更 |
485
+ |------|------|------|
486
+ | 1.2.0 | 2026-03-18 | 新增:Pipeline 整合章节 — auto-TDD 转换、pipeline hooks、auto-TDD 进入工作流程 |
487
+ | 1.0.0 | 2026-01-19 | 初始发布 |
488
+
489
+ ---
490
+
491
+ ## 授权
492
+
493
+ 本规范采用 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授权。
@@ -0,0 +1,101 @@
1
+ ---
2
+ source: ../../../core/git-worktree.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
+ > **语言**: [English](../../../core/git-worktree.md) | 简体中文
10
+
11
+ # Git Worktree 隔离
12
+
13
+ **版本**: 1.0.0
14
+ **最后更新**: 2026-03-20
15
+ **适用范围**: 所有使用 Git 进行版本控制的项目
16
+ **范围**: universal
17
+ **灵感来源**: [Superpowers](https://github.com/obra/superpowers) — using-git-worktrees (MIT)
18
+
19
+ ---
20
+
21
+ ## 目的
22
+
23
+ 定义 Git Worktree 的完整生命周期管理标准,确保环境干净、安全合并与适当清理。Worktree 允许在多个分支上并行工作,无需 stash 或切换。
24
+
25
+ ---
26
+
27
+ ## 术语表
28
+
29
+ | 术语 | 定义 |
30
+ |------|------|
31
+ | Worktree | Git 仓库在不同分支上的链接工作副本 |
32
+ | 基准测试 | 在全新 worktree 上运行的测试,验证环境是干净的 |
33
+ | Worktree 目录 | 创建 worktree 的文件系统路径 |
34
+
35
+ ---
36
+
37
+ ## 核心原则 — 隔离与问责
38
+
39
+ > **每个 worktree 必须以干净状态开始(基准测试)、在隔离环境中工作、以合并或明确清理结束。**
40
+
41
+ ---
42
+
43
+ ## 生命周期阶段
44
+
45
+ ### 阶段 1:建立
46
+
47
+ 1. **选择 worktree 位置** — 优先顺序:
48
+ - 已配置的路径
49
+ - `.devap/worktrees/` 或类似项目本地目录
50
+ - 询问用户
51
+ 2. **验证 `.gitignore`** — 运行 `git check-ignore` 确认 worktree 目录被忽略
52
+ 3. **创建 worktree** — `git worktree add <path> -b <branch-name>`
53
+ 4. **安装依赖** — 如需要,运行包管理器安装
54
+
55
+ ```bash
56
+ # 示例设置
57
+ git worktree add .worktrees/feature-auth -b feature/auth
58
+ cd .worktrees/feature-auth
59
+ pnpm install # 或 npm install、pip install 等
60
+ ```
61
+
62
+ ### 阶段 2:基准验证
63
+
64
+ 1. **运行测试套件** — 在全新 worktree 中运行
65
+ 2. **记录基准结果** — 确认所有测试通过
66
+ 3. **如果基准失败** — 不要在此 worktree 上开始工作
67
+
68
+ ### 阶段 3:开发
69
+
70
+ - 在 worktree 中正常开发
71
+ - 定期运行测试确保不破坏基准
72
+
73
+ ### 阶段 4:完成
74
+
75
+ 参照[分支完成工作流程](branch-completion.md)的四个选项完成分支。
76
+
77
+ ### 阶段 5:清理
78
+
79
+ ```bash
80
+ # 删除 worktree
81
+ git worktree remove .worktrees/feature-auth
82
+
83
+ # 列出所有 worktree
84
+ git worktree list
85
+
86
+ # 清理过期的 worktree 引用
87
+ git worktree prune
88
+ ```
89
+
90
+ ---
91
+
92
+ ## 相关标准
93
+
94
+ - [分支完成工作流程](branch-completion.md)
95
+ - [代理派遣与并行协调](agent-dispatch.md)
96
+
97
+ ---
98
+
99
+ ## 许可证
100
+
101
+ 本标准采用 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 发布。