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,195 @@
1
+ # Change Batching Standards - AI Optimized
2
+ # Source: core/change-batching-standards.md
3
+
4
+ standard:
5
+ id: change-batching-standards
6
+ name: Change Batching Standards
7
+ description: Pending changes state machine, threshold strategies, and atomicity guarantees for batch commits
8
+
9
+ meta:
10
+ version: "1.0.0"
11
+ updated: "2026-03-18"
12
+ source: core/change-batching-standards.md
13
+ references:
14
+ - "SWEBOK v4.0 Chapter 6 (Software Configuration Management)"
15
+ - "ISO/IEC 12207 (Configuration Management Process)"
16
+ - "Continuous Delivery (Jez Humble) — Small batch sizes"
17
+ - "Lean Software Development — Batch size optimization"
18
+
19
+ state_machine:
20
+ description: Pending changes lifecycle
21
+ states:
22
+ - state: PENDING
23
+ description: Change recorded, waiting for threshold
24
+ - state: READY
25
+ description: Threshold met, batch prepared for merge
26
+ - state: MERGED
27
+ description: Batch successfully committed
28
+ - state: FAILED
29
+ description: Merge attempt failed
30
+ - state: ARCHIVED
31
+ description: Post-commit record for audit
32
+
33
+ transitions:
34
+ - from: PENDING
35
+ to: PENDING
36
+ trigger: New change added
37
+ action: Increment counters, re-evaluate thresholds
38
+ - from: PENDING
39
+ to: READY
40
+ trigger: Threshold met
41
+ action: Prepare merge batch, run pre-merge validation
42
+ - from: READY
43
+ to: MERGED
44
+ trigger: Merge succeeds
45
+ action: Create commit, clear batch, archive
46
+ - from: READY
47
+ to: FAILED
48
+ trigger: Merge fails
49
+ action: Log failure, preserve changes
50
+ - from: FAILED
51
+ to: PENDING
52
+ trigger: Reset
53
+ action: Re-queue changes, clear failure state
54
+ - from: MERGED
55
+ to: ARCHIVED
56
+ trigger: Post-commit
57
+ action: Record batch metadata for audit
58
+
59
+ threshold_strategies:
60
+ strategies:
61
+ - name: count
62
+ parameter: maxChanges
63
+ default: 5
64
+ description: Merge after N individual changes accumulated
65
+
66
+ - name: score
67
+ parameter: maxScore
68
+ default: 10
69
+ description: Merge when cumulative change score >= M
70
+
71
+ - name: time
72
+ parameter: maxAge
73
+ default: "30m"
74
+ description: Merge when oldest pending change exceeds TTL
75
+
76
+ - name: manual
77
+ parameter: null
78
+ default: null
79
+ description: Merge only on explicit user request
80
+
81
+ change_scoring:
82
+ - type: trivial
83
+ score: 1
84
+ example: Typo fix, whitespace, comment update
85
+ - type: minor
86
+ score: 2
87
+ example: Single function change, variable rename
88
+ - type: standard
89
+ score: 3
90
+ example: New function, modified logic flow
91
+ - type: complex
92
+ score: 5
93
+ example: Multi-file change, API modification
94
+ - type: critical
95
+ score: 8
96
+ example: Schema change, breaking change
97
+
98
+ composite_rule: "Multiple thresholds combine with OR logic (first met triggers merge)"
99
+
100
+ merge_rules:
101
+ priority_order:
102
+ - Same-spec affinity — changes referencing same SPEC-ID merge first
103
+ - Same-file grouping — changes to same files merge together
104
+ - Dependency order — changes with dependencies merge in order
105
+ - Chronological — within same priority, merge by creation time
106
+
107
+ conflict_resolution:
108
+ - type: Same line, same file
109
+ strategy: Latest change wins
110
+ fallback: Manual resolution
111
+ - type: Overlapping functions
112
+ strategy: Semantic merge if possible
113
+ fallback: Manual resolution
114
+ - type: Dependency conflict
115
+ strategy: Resolve dependency first
116
+ fallback: Reject batch, split
117
+
118
+ pre_merge_validation:
119
+ - check: All tests pass
120
+ required: true
121
+ - check: No lint errors
122
+ required: true
123
+ - check: No conflicts
124
+ required: true
125
+ - check: AC coverage maintained
126
+ required: false
127
+ note: Recommended
128
+
129
+ atomicity:
130
+ principle: All-or-nothing
131
+ rules:
132
+ - Single commit — each merged batch produces exactly one commit
133
+ - No partial merge — any change failure rejects entire batch
134
+ - Rollback support — failed merges restore all changes to PENDING
135
+ - Isolation — batch merge does not affect changes outside batch
136
+
137
+ rollback:
138
+ on_failure:
139
+ - Log failure with batch details
140
+ - Return all changes to PENDING state
141
+ - Diagnose failing change(s)
142
+ - Options — fix and retry, remove failing change, split batch
143
+
144
+ triggers:
145
+ - trigger: Test failure
146
+ action: Reject entire batch
147
+ automatic: true
148
+ - trigger: Lint error
149
+ action: Reject entire batch
150
+ automatic: true
151
+ - trigger: Merge conflict
152
+ action: Reject and notify
153
+ automatic: true
154
+ - trigger: Build failure
155
+ action: Reject entire batch
156
+ automatic: true
157
+ - trigger: Manual rejection
158
+ action: Return to PENDING
159
+ automatic: false
160
+
161
+ rules:
162
+ - id: set-thresholds
163
+ trigger: configuring batch pipeline
164
+ instruction: Set explicit thresholds; do not accumulate changes indefinitely
165
+ priority: required
166
+
167
+ - id: group-by-spec
168
+ trigger: batching changes
169
+ instruction: Group changes by specification or feature for cohesive commits
170
+ priority: recommended
171
+
172
+ - id: validate-before-merge
173
+ trigger: batch reaches READY state
174
+ instruction: Run full validation (tests, lint, conflicts) before merging
175
+ priority: required
176
+
177
+ - id: atomic-commits
178
+ trigger: merging a batch
179
+ instruction: Enforce all-or-nothing — either all changes commit or none do
180
+ priority: required
181
+
182
+ - id: preserve-on-failure
183
+ trigger: batch merge fails
184
+ instruction: Return all changes to PENDING state; never lose changes
185
+ priority: required
186
+
187
+ - id: log-batch-decisions
188
+ trigger: any batch state transition
189
+ instruction: Log batch decisions (threshold met, merge result) for auditability
190
+ priority: recommended
191
+
192
+ related_standards:
193
+ - checkin-standards.md
194
+ - pipeline-integration-standards.md
195
+ - commit-message-guide.md
@@ -0,0 +1,220 @@
1
+ # Database Standards - AI Optimized
2
+ # Source: core/database-standards.md
3
+
4
+ standard:
5
+ id: database
6
+ name: Database Standards
7
+ description: Schema design, indexing, migrations, query optimization, transactions, and data integrity
8
+ guidelines:
9
+ - "Data integrity enforced at database level, not only application code"
10
+ - "Schema as code: version-controlled, reproducible migrations"
11
+ - "Measure before tuning: use EXPLAIN plans before optimizing"
12
+ - "Backward-compatible schema changes during deployment windows"
13
+
14
+ meta:
15
+ version: "1.0.0"
16
+ updated: "2026-03-18"
17
+ source: core/database-standards.md
18
+ description: Schema design, indexing, migrations, query optimization, transactions, and data integrity
19
+
20
+ principles:
21
+ core:
22
+ - data_integrity_first: "Constraints and referential integrity at DB level"
23
+ - schema_as_code: "Version-controlled, reproducible migration scripts"
24
+ - least_privilege: "Minimum permissions for each database account"
25
+ - measure_before_tuning: "EXPLAIN plans and metrics before optimizing"
26
+ - defense_in_depth: "Encryption, masking, access controls at multiple layers"
27
+ - backward_compatibility: "Schema changes maintain compat during deployments"
28
+
29
+ schema_design:
30
+ naming:
31
+ tables: "snake_case, singular (user_account, order_item)"
32
+ columns: "snake_case (first_name, created_at)"
33
+ primary_keys: "id"
34
+ foreign_keys: "<referenced_table>_id"
35
+ booleans: "is_ or has_ prefix (is_active, has_verified_email)"
36
+ timestamps: "_at suffix (created_at, updated_at, deleted_at)"
37
+ indexes: "idx_<table>_<columns>"
38
+ unique_constraints: "uq_<table>_<columns>"
39
+ normalization:
40
+ target: "3NF for transactional systems"
41
+ 1NF: "Atomic values only, no repeating groups"
42
+ 2NF: "1NF + no partial dependencies on composite keys"
43
+ 3NF: "2NF + no transitive dependencies"
44
+ denormalization:
45
+ when_to_use:
46
+ - "Read-heavy workloads (>90% reads)"
47
+ - "Eventual consistency acceptable"
48
+ - "Joins cause unacceptable latency"
49
+ requirements:
50
+ - "Document source of truth and sync mechanism"
51
+ - "Implement consistency checks"
52
+ data_types:
53
+ monetary: "DECIMAL(19,4) or NUMERIC — never FLOAT/DOUBLE"
54
+ timestamps: "TIMESTAMPTZ (with timezone)"
55
+ booleans: "BOOLEAN — not INT(0/1) or CHAR('Y'/'N')"
56
+ json: "JSONB (PostgreSQL) or native JSON — not TEXT"
57
+ uuid_vs_auto_increment:
58
+ auto_increment: "Internal-only IDs, single-database systems"
59
+ uuid: "Distributed systems, publicly exposed IDs, UUIDv7 preferred"
60
+
61
+ indexing:
62
+ create_when:
63
+ - "Column in frequent WHERE clauses"
64
+ - "Column used in JOIN conditions"
65
+ - "Column used in ORDER BY or GROUP BY"
66
+ - "Unique constraint needed"
67
+ avoid_when:
68
+ - "Table < 1,000 rows"
69
+ - "Very low cardinality column"
70
+ - "Write-heavy table with rare reads"
71
+ - "Already > 8 indexes per table"
72
+ composite_order: "equality first → IN next → range last → ORDER BY last"
73
+ covering_indexes: "Include all query columns to enable index-only scans"
74
+ partial_indexes: "Index subset of rows to reduce size (WHERE clause on CREATE INDEX)"
75
+ anti_patterns:
76
+ - "Over-indexing: slows writes, audit quarterly"
77
+ - "Unused indexes: monitor pg_stat_user_indexes"
78
+ - "Duplicate indexes: (a,b) covers queries on (a)"
79
+ - "Function on indexed column: use expression index"
80
+ - "Missing FK index: always index foreign key columns"
81
+
82
+ migration:
83
+ naming: "YYYYMMDDHHMMSS_description.sql"
84
+ principles:
85
+ - "Version-controlled alongside application code"
86
+ - "Sequential, deterministic execution order"
87
+ - "Idempotent: running twice produces same result"
88
+ - "Tested against production-like data volumes"
89
+ zero_downtime:
90
+ pattern: "Expand-Contract"
91
+ phase_1: "Expand — add nullable column, no constraints"
92
+ phase_2: "Migrate — backfill data, dual-write"
93
+ phase_3: "Contract — add constraints, drop old column"
94
+ rollback:
95
+ reversible: "Use for non-destructive changes (add column, add index)"
96
+ forward_only: "Use for destructive changes (drop column, drop table)"
97
+ critical_rule: "Never drop columns in same deployment that stops writing"
98
+
99
+ query_practices:
100
+ n_plus_1: "Use JOINs or batch loading instead of per-row queries"
101
+ explain_plan: "EXPLAIN ANALYZE for queries > 100ms or > 100 calls/min"
102
+ pagination:
103
+ offset: "Simple, supports random access — avoid for large datasets"
104
+ keyset: "Consistent performance — preferred for APIs and large datasets"
105
+ anti_patterns:
106
+ - "SELECT * — list specific columns"
107
+ - "String concatenation — use parameterized queries"
108
+ - "NOT IN with NULLs — use NOT EXISTS"
109
+ - "LIKE '%prefix' — use full-text search"
110
+ - "Implicit type casting — cast explicitly"
111
+
112
+ transactions:
113
+ acid:
114
+ atomicity: "All operations succeed or all fail"
115
+ consistency: "DB moves from one valid state to another"
116
+ isolation: "Concurrent transactions don't interfere"
117
+ durability: "Committed data survives system failure"
118
+ isolation_levels:
119
+ read_uncommitted: {dirty_read: possible, use_case: "Never recommended"}
120
+ read_committed: {dirty_read: prevented, use_case: "Default; general-purpose"}
121
+ repeatable_read: {dirty_read: prevented, phantom: possible, use_case: "Financial reports"}
122
+ serializable: {dirty_read: prevented, phantom: prevented, use_case: "Money transfers, bookings"}
123
+ default_level: "Read Committed"
124
+ deadlock_prevention:
125
+ - "Consistent lock ordering across transactions"
126
+ - "Keep transactions short"
127
+ - "Set lock_timeout to fail fast"
128
+ - "Implement retry with exponential backoff"
129
+ locking:
130
+ optimistic: "Version column check — low-conflict environments"
131
+ pessimistic: "SELECT FOR UPDATE — high-conflict environments"
132
+
133
+ nosql_decision:
134
+ relational: "Structured data, complex joins, ACID — PostgreSQL, MySQL"
135
+ document: "Semi-structured, flexible schema — MongoDB, CouchDB"
136
+ key_value: "Simple lookups, caching, sessions — Redis, Memcached"
137
+ graph: "Relationship traversals — Neo4j, Amazon Neptune"
138
+ polyglot: "Use multiple database types for different workloads"
139
+
140
+ connection_management:
141
+ pooling: required
142
+ defaults:
143
+ min_pool: "2-5"
144
+ max_pool: "10-20"
145
+ connection_timeout: "5 seconds"
146
+ idle_timeout: "10 minutes"
147
+ max_lifetime: "30 minutes"
148
+ formula: "pool_size = (core_count * 2) + effective_spindle_count"
149
+ warning: "More connections is NOT better — causes contention"
150
+
151
+ sensitive_data:
152
+ classification:
153
+ public: "No special handling"
154
+ internal: "Access control"
155
+ confidential: "Encryption at rest, access logging"
156
+ restricted: "Column encryption, masking, strict audit"
157
+ pii_requirements:
158
+ - "Encrypt PII at rest and in transit"
159
+ - "Mask data in non-production environments"
160
+ - "Define retention policies"
161
+ - "Support GDPR data subject requests"
162
+ - "Log all PII access"
163
+ audit_logging: "Trigger-based audit log with old/new values, user, timestamp"
164
+
165
+ backup:
166
+ strategies:
167
+ full: "Complete copy — slowest backup, fastest restore"
168
+ incremental: "Changes since last backup — fastest backup, slowest restore"
169
+ differential: "Changes since last full — medium speed"
170
+ rpo_rto:
171
+ critical: {rpo: "<1 min", rto: "<15 min", strategy: "Sync replication + WAL"}
172
+ important: {rpo: "<1 hour", rto: "<1 hour", strategy: "Streaming replication + hourly WAL"}
173
+ standard: {rpo: "<24 hours", rto: "<4 hours", strategy: "Daily full + hourly incremental"}
174
+ testing: "Restore test monthly, verify integrity, measure actual RTO"
175
+
176
+ rules:
177
+ - id: DB-SCHEMA-001
178
+ rule: "Enforce data constraints at database level, not only in application code"
179
+ severity: error
180
+ - id: DB-INDEX-001
181
+ rule: "Always index foreign key columns"
182
+ severity: error
183
+ - id: DB-QUERY-001
184
+ rule: "Use parameterized queries; never concatenate user input into SQL"
185
+ severity: error
186
+ - id: DB-QUERY-002
187
+ rule: "Use EXPLAIN ANALYZE for queries with execution time > 100ms"
188
+ severity: warning
189
+ - id: DB-MIGRATION-001
190
+ rule: "All schema changes via version-controlled migration scripts"
191
+ severity: error
192
+ - id: DB-MIGRATION-002
193
+ rule: "Use expand-contract pattern for zero-downtime schema changes"
194
+ severity: warning
195
+ - id: DB-CONN-001
196
+ rule: "Always use connection pooling; never create per-request connections"
197
+ severity: error
198
+ - id: DB-DATA-001
199
+ rule: "Encrypt PII at rest and in transit; log all PII access"
200
+ severity: error
201
+
202
+ quick_reference:
203
+ schema:
204
+ - "snake_case for all identifiers"
205
+ - "Singular table names"
206
+ - "_id suffix for foreign keys"
207
+ - "Always have id, created_at, updated_at"
208
+ - "Normalize to 3NF, denormalize with documented reasoning"
209
+ queries:
210
+ - "Parameterized queries always"
211
+ - "List specific columns, not SELECT *"
212
+ - "EXPLAIN ANALYZE before optimizing"
213
+ - "Keyset pagination for large datasets"
214
+ - "Batch operations to prevent N+1"
215
+ operations:
216
+ - "Connection pooling required"
217
+ - "Version-control all migrations"
218
+ - "Test migrations with production-like data"
219
+ - "Monitor slow queries, connections, cache hit ratio"
220
+ - "Test backup restoration monthly"
@@ -3,8 +3,8 @@
3
3
 
4
4
  id: error-codes
5
5
  meta:
6
- version: "1.1.0"
7
- updated: "2026-01-05"
6
+ version: "1.2.0"
7
+ updated: "2026-03-18"
8
8
  source: core/error-code-standards.md
9
9
  description: Error code format, categories, and management
10
10
 
@@ -121,6 +121,41 @@ rules:
121
121
  instruction: Maintain centralized error code registry
122
122
  priority: recommended
123
123
 
124
+ - id: rfc7807-format
125
+ trigger: designing HTTP API error responses
126
+ instruction: |
127
+ Use RFC 7807 Problem Details format:
128
+ Required: type, title, status, detail, instance
129
+ Extension: code, errors[], requestId, timestamp
130
+ priority: recommended
131
+
132
+ - id: graphql-errors
133
+ trigger: handling GraphQL errors
134
+ instruction: |
135
+ Map error codes to extensions field:
136
+ - extensions.code: Application error code
137
+ - extensions.category: VALIDATION/BUSINESS_RULE/AUTHENTICATION/AUTHORIZATION/INTERNAL
138
+ priority: recommended
139
+
140
+ - id: grpc-mapping
141
+ trigger: handling gRPC errors
142
+ instruction: |
143
+ Map categories to gRPC status:
144
+ - VAL → INVALID_ARGUMENT (3)
145
+ - BIZ → FAILED_PRECONDITION (9)
146
+ - AUTH → UNAUTHENTICATED (16) / PERMISSION_DENIED (7)
147
+ - SYS → INTERNAL (13)
148
+ - NET → UNAVAILABLE (14)
149
+ priority: recommended
150
+
151
+ - id: retry-guidance
152
+ trigger: defining error retry behavior
153
+ instruction: |
154
+ Retryable: NET, AUTH token errors (200-299), SYS (maybe)
155
+ Not retryable: VAL, BIZ, AUTH credentials (001-099)
156
+ Use Idempotency-Key for non-idempotent POST operations
157
+ priority: recommended
158
+
124
159
  quick_reference:
125
160
  categories:
126
161
  columns: [Code, Category, HTTP, Use For]
@@ -0,0 +1,77 @@
1
+ # Git Worktree Isolation - AI Optimized
2
+ # Source: core/git-worktree.md
3
+ # Inspired by Superpowers using-git-worktrees (MIT)
4
+
5
+ standard:
6
+ id: git-worktree
7
+ name: Git Worktree Isolation
8
+ description: Git Worktree 隔離開發標準
9
+
10
+ meta:
11
+ version: "1.0.0"
12
+ updated: "2026-03-20"
13
+ source: core/git-worktree.md
14
+ description: Git Worktree 隔離開發與生命週期管理標準
15
+ inspired_by: superpowers/using-git-worktrees
16
+
17
+ guidelines:
18
+ - "worktree 目錄必須在 .gitignore 中"
19
+ - "建立後跑基準測試確認環境乾淨"
20
+ - "完成後先合併再清理"
21
+ - "異常退出時確保 cleanup 被執行"
22
+
23
+ lifecycle:
24
+ - phase: setup
25
+ steps:
26
+ - "選擇 worktree 目錄位置(優先順序:existing → .devap/worktrees → 詢問使用者)"
27
+ - "執行 git check-ignore 確認目錄被忽略"
28
+ - "建立 worktree + 新分支"
29
+ - "安裝依賴(若需要)"
30
+ - phase: baseline
31
+ steps:
32
+ - "在 worktree 中跑基準測試"
33
+ - "確認測試全過(環境乾淨)"
34
+ - "若測試失敗,中止並報告"
35
+ - phase: execute
36
+ steps:
37
+ - "在隔離的 worktree 中執行任務"
38
+ - "任務完成後驗證"
39
+ - phase: merge
40
+ steps:
41
+ - "確認所有測試通過"
42
+ - "合併分支回主分支(--no-ff)"
43
+ - "處理可能的合併衝突"
44
+ - phase: cleanup
45
+ steps:
46
+ - "移除 worktree(git worktree remove)"
47
+ - "刪除分支(git branch -d)"
48
+ - "prune 殘留 worktree(git worktree prune)"
49
+
50
+ rules:
51
+ - id: GW-001
52
+ trigger: "worktree 目錄不在 .gitignore 中"
53
+ action: "自動加入 .gitignore"
54
+ priority: critical
55
+ - id: GW-002
56
+ trigger: "基準測試失敗"
57
+ action: "中止任務,報告環境問題"
58
+ priority: high
59
+ - id: GW-003
60
+ trigger: "異常退出"
61
+ action: "確保 cleanup 被執行"
62
+ priority: high
63
+ - id: GW-004
64
+ trigger: "合併/刪除後殘留 worktree"
65
+ action: "prune 殘留 worktree 引用"
66
+ priority: medium
67
+
68
+ physical_spec:
69
+ type: checklist
70
+ validator:
71
+ type: ai_review
72
+ rule: "檢查 worktree 使用是否遵循完整生命週期:setup → baseline → execute → merge → cleanup"
73
+ checks:
74
+ - "worktree 目錄是否在 .gitignore 中"
75
+ - "是否執行基準測試確認環境乾淨"
76
+ - "完成後是否執行 cleanup"
77
+ - "異常退出時是否有 cleanup 機制"
@@ -3,8 +3,8 @@
3
3
 
4
4
  id: logging
5
5
  meta:
6
- version: "1.1.0"
7
- updated: "2026-01-05"
6
+ version: "1.2.0"
7
+ updated: "2026-03-18"
8
8
  source: core/logging-standards.md
9
9
  description: Logging levels, structured logging, and best practices
10
10
 
@@ -100,6 +100,25 @@ rules:
100
100
  instruction: Use async/buffered logging for performance
101
101
  priority: recommended
102
102
 
103
+ - id: distributed-tracing
104
+ trigger: logging in distributed systems
105
+ instruction: |
106
+ Include OpenTelemetry trace context:
107
+ - trace_id and span_id in every log entry
108
+ - W3C Trace Context propagation (traceparent header)
109
+ - Correlate logs with metrics and traces
110
+ priority: recommended
111
+
112
+ - id: observability-pillars
113
+ trigger: designing observability strategy
114
+ instruction: |
115
+ Three pillars: Logs, Metrics, Traces
116
+ - Logs: Discrete events with context
117
+ - Metrics: Aggregated measurements (counters, gauges, histograms)
118
+ - Traces: Request flow across services
119
+ Correlate all three via trace_id/span_id
120
+ priority: recommended
121
+
103
122
  quick_reference:
104
123
  level_selection:
105
124
  columns: [Question, Level]
@@ -0,0 +1,81 @@
1
+ # AI Model Selection Strategy - AI Optimized
2
+ # Source: core/model-selection.md
3
+ # Inspired by Superpowers subagent-driven-development model selection (MIT)
4
+
5
+ standard:
6
+ id: model-selection
7
+ name: AI Model Selection Strategy
8
+ description: AI 模型分級選擇策略
9
+
10
+ meta:
11
+ version: "1.0.0"
12
+ updated: "2026-03-20"
13
+ source: core/model-selection.md
14
+ description: 三層模型分級選擇標準
15
+ inspired_by: superpowers/subagent-driven-development
16
+
17
+ guidelines:
18
+ - "使用最便宜能勝任的模型(成本效益原則)"
19
+ - "根據任務複雜度信號選擇模型等級"
20
+ - "BLOCKED 狀態時考慮升級模型再試"
21
+
22
+ tiers:
23
+ - id: fast
24
+ description: "機械性實作 — 單一檔案、明確 spec、無需判斷"
25
+ signals:
26
+ - "修改單一檔案"
27
+ - "spec 完全明確,無歧義"
28
+ - "不需要設計判斷"
29
+ - "模式化的重複工作"
30
+ examples:
31
+ - "更新 package.json 版本號"
32
+ - "新增一個 export"
33
+ - "修正 typo"
34
+ - id: standard
35
+ description: "整合性實作 — 多檔案、需要判斷力"
36
+ signals:
37
+ - "修改 2-5 個檔案"
38
+ - "需要理解模組間關係"
39
+ - "需要一定設計判斷"
40
+ examples:
41
+ - "新增一個 API endpoint(含 route + handler + test)"
42
+ - "重構一個模組的內部結構"
43
+ - id: capable
44
+ description: "架構性工作 — 設計、審查、除錯"
45
+ signals:
46
+ - "修改 5+ 個檔案"
47
+ - "需要架構決策"
48
+ - "跨模組協調"
49
+ - "除錯複雜問題"
50
+ examples:
51
+ - "設計新的子系統架構"
52
+ - "審查大型 PR"
53
+ - "診斷跨服務的效能問題"
54
+
55
+ rules:
56
+ - id: MS-001
57
+ trigger: "BLOCKED 狀態且當前為 fast"
58
+ action: "升級至 standard 再試"
59
+ priority: high
60
+ - id: MS-002
61
+ trigger: "BLOCKED 狀態且當前為 standard"
62
+ action: "升級至 capable 再試"
63
+ priority: high
64
+ - id: MS-003
65
+ trigger: "BLOCKED 狀態且當前為 capable"
66
+ action: "標記為需要人工介入"
67
+ priority: critical
68
+ - id: MS-004
69
+ trigger: "任務需求不明確"
70
+ action: "從 standard 或更高層級開始"
71
+ priority: medium
72
+
73
+ physical_spec:
74
+ type: checklist
75
+ validator:
76
+ type: ai_review
77
+ rule: "檢查模型選擇是否基於任務複雜度信號,而非固定使用最高等級"
78
+ checks:
79
+ - "是否根據複雜度信號選擇模型等級"
80
+ - "BLOCKED 時是否嘗試升級而非直接失敗"
81
+ - "簡單任務是否避免使用過高等級模型"