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
@@ -2,8 +2,8 @@
2
2
 
3
3
  > **Language**: English | [繁體中文](../locales/zh-TW/core/error-code-standards.md)
4
4
 
5
- **Version**: 1.1.0
6
- **Last Updated**: 2026-01-05
5
+ **Version**: 1.2.0
6
+ **Last Updated**: 2026-03-18
7
7
  **Applicability**: All software projects
8
8
  **Scope**: universal
9
9
  **Industry Standards**: RFC 7807, RFC 9457
@@ -285,6 +285,228 @@ function validateEmail(email: string) {
285
285
  }
286
286
  ```
287
287
 
288
+ ## API Error Serialization
289
+
290
+ ### RFC 7807 / RFC 9457 Problem Details
291
+
292
+ For HTTP APIs, use the [RFC 7807](https://datatracker.ietf.org/doc/html/rfc7807) Problem Details format as the standard error envelope:
293
+
294
+ ```json
295
+ {
296
+ "type": "https://api.example.com/errors/auth-val-001",
297
+ "title": "Validation Error",
298
+ "status": 400,
299
+ "detail": "Email field is required for registration",
300
+ "instance": "/api/register",
301
+ "code": "AUTH_VAL_001",
302
+ "errors": [
303
+ {
304
+ "field": "email",
305
+ "message": "Email is required",
306
+ "code": "AUTH_VAL_001"
307
+ }
308
+ ],
309
+ "requestId": "req_abc123",
310
+ "timestamp": "2026-03-18T10:30:00Z"
311
+ }
312
+ ```
313
+
314
+ **Required Fields (RFC 7807):**
315
+
316
+ | Field | Type | Description |
317
+ |-------|------|-------------|
318
+ | `type` | URI | Reference to error documentation |
319
+ | `title` | string | Short, human-readable summary |
320
+ | `status` | integer | HTTP status code |
321
+ | `detail` | string | Human-readable explanation |
322
+ | `instance` | string | URI of the request that caused the error |
323
+
324
+ **Extension Fields (Recommended):**
325
+
326
+ | Field | Type | Description |
327
+ |-------|------|-------------|
328
+ | `code` | string | Application error code (PREFIX_CATEGORY_NUMBER) |
329
+ | `errors` | array | Detailed field-level errors |
330
+ | `requestId` | string | Correlation ID for tracing |
331
+ | `timestamp` | string | ISO 8601 timestamp |
332
+
333
+ ### REST JSON Error Response
334
+
335
+ Standard REST error response combining internal error codes with RFC 7807:
336
+
337
+ ```json
338
+ // Single error
339
+ {
340
+ "type": "https://api.example.com/errors/validation",
341
+ "title": "Validation Error",
342
+ "status": 400,
343
+ "detail": "Request validation failed",
344
+ "errors": [
345
+ {
346
+ "code": "AUTH_VAL_001",
347
+ "field": "email",
348
+ "message": "Email is required",
349
+ "pointer": "/data/attributes/email"
350
+ }
351
+ ]
352
+ }
353
+
354
+ // Multiple errors
355
+ {
356
+ "type": "https://api.example.com/errors/validation",
357
+ "title": "Validation Error",
358
+ "status": 400,
359
+ "detail": "Multiple validation errors occurred",
360
+ "errors": [
361
+ {
362
+ "code": "AUTH_VAL_001",
363
+ "field": "email",
364
+ "message": "Email is required",
365
+ "pointer": "/data/attributes/email"
366
+ },
367
+ {
368
+ "code": "AUTH_VAL_201",
369
+ "field": "password",
370
+ "message": "Password must be at least 8 characters",
371
+ "pointer": "/data/attributes/password"
372
+ }
373
+ ]
374
+ }
375
+ ```
376
+
377
+ ### GraphQL Error Handling
378
+
379
+ GraphQL uses a different error model. Map application error codes into the `extensions` field:
380
+
381
+ ```json
382
+ {
383
+ "data": null,
384
+ "errors": [
385
+ {
386
+ "message": "Email is required",
387
+ "locations": [{ "line": 2, "column": 3 }],
388
+ "path": ["createUser"],
389
+ "extensions": {
390
+ "code": "AUTH_VAL_001",
391
+ "category": "VALIDATION",
392
+ "field": "email",
393
+ "httpStatus": 400,
394
+ "timestamp": "2026-03-18T10:30:00Z"
395
+ }
396
+ }
397
+ ]
398
+ }
399
+ ```
400
+
401
+ **GraphQL Error Categories:**
402
+
403
+ | Category | Maps To | Use For |
404
+ |----------|---------|---------|
405
+ | `VALIDATION` | VAL | Input validation failures |
406
+ | `BUSINESS_RULE` | BIZ | Business logic violations |
407
+ | `AUTHENTICATION` | AUTH (001-099) | Authentication failures |
408
+ | `AUTHORIZATION` | AUTH (100-199) | Permission failures |
409
+ | `INTERNAL` | SYS | Server-side errors |
410
+ | `NETWORK` | NET | Upstream service failures |
411
+
412
+ ### gRPC Error Handling
413
+
414
+ Map application error codes to gRPC status codes and include details via metadata:
415
+
416
+ ```protobuf
417
+ // Error detail message
418
+ message ErrorDetail {
419
+ string code = 1; // "AUTH_VAL_001"
420
+ string message = 2; // Human-readable message
421
+ string field = 3; // Affected field
422
+ string documentation = 4; // Link to error docs
423
+ }
424
+ ```
425
+
426
+ **gRPC Status Code Mapping:**
427
+
428
+ | Category | gRPC Status | Code |
429
+ |----------|-------------|------|
430
+ | VAL | `INVALID_ARGUMENT` | 3 |
431
+ | BIZ | `FAILED_PRECONDITION` | 9 |
432
+ | AUTH (001-099) | `UNAUTHENTICATED` | 16 |
433
+ | AUTH (100-199) | `PERMISSION_DENIED` | 7 |
434
+ | SYS | `INTERNAL` | 13 |
435
+ | NET | `UNAVAILABLE` | 14 |
436
+
437
+ ```go
438
+ // Go example
439
+ import "google.golang.org/grpc/status"
440
+ import "google.golang.org/grpc/codes"
441
+
442
+ st := status.New(codes.InvalidArgument, "Validation failed")
443
+ st, _ = st.WithDetails(&errdetails.BadRequest{
444
+ FieldViolations: []*errdetails.BadRequest_FieldViolation{
445
+ {Field: "email", Description: "AUTH_VAL_001: Email is required"},
446
+ },
447
+ })
448
+ return st.Err()
449
+ ```
450
+
451
+ ## Retry and Idempotency
452
+
453
+ ### Retry Guidance
454
+
455
+ | Category | Retryable | Strategy |
456
+ |----------|-----------|----------|
457
+ | VAL | No | Fix input and resubmit |
458
+ | BIZ | No | Resolve business condition |
459
+ | AUTH (001-099) | No | Re-authenticate |
460
+ | AUTH (200-299) | Yes | Refresh token, then retry |
461
+ | SYS | Maybe | Retry with exponential backoff |
462
+ | NET | Yes | Retry with exponential backoff |
463
+
464
+ ### Retry Response Headers
465
+
466
+ ```http
467
+ HTTP/1.1 503 Service Unavailable
468
+ Retry-After: 30
469
+ X-RateLimit-Reset: 1679961600
470
+ ```
471
+
472
+ Include retry guidance in error responses:
473
+
474
+ ```json
475
+ {
476
+ "type": "https://api.example.com/errors/rate-limit",
477
+ "title": "Rate Limit Exceeded",
478
+ "status": 429,
479
+ "detail": "Too many requests",
480
+ "code": "API_NET_429",
481
+ "retryable": true,
482
+ "retryAfter": 30
483
+ }
484
+ ```
485
+
486
+ ### Idempotency Keys
487
+
488
+ For non-idempotent operations (POST), require `Idempotency-Key` header:
489
+
490
+ ```http
491
+ POST /api/payments HTTP/1.1
492
+ Idempotency-Key: key_abc123def456
493
+ Content-Type: application/json
494
+
495
+ {"amount": 100, "currency": "USD"}
496
+ ```
497
+
498
+ **Idempotency Rules:**
499
+
500
+ | Verb | Idempotent | Key Required |
501
+ |------|-----------|-------------|
502
+ | GET | Yes | No |
503
+ | PUT | Yes | No |
504
+ | DELETE | Yes | No |
505
+ | PATCH | No | Recommended |
506
+ | POST | No | Required for critical operations |
507
+
508
+ ---
509
+
288
510
  ## Documentation Requirements
289
511
 
290
512
  ### Error Code Documentation
@@ -366,6 +588,7 @@ AUTH_VAL_001
366
588
 
367
589
  | Version | Date | Changes |
368
590
  |---------|------|---------|
591
+ | 1.2.0 | 2026-03-18 | Added: API Error Serialization (RFC 7807 Problem Details, REST, GraphQL, gRPC), Retry and Idempotency guidance |
369
592
  | 1.1.0 | 2026-01-05 | Added: References section with RFC 7807, RFC 9457, HTTP status codes, and Microsoft REST API Guidelines |
370
593
  | 1.0.0 | 2025-12-30 | Initial error code standards |
371
594
 
@@ -377,6 +600,9 @@ AUTH_VAL_001
377
600
  - [RFC 9457 - Problem Details for HTTP APIs](https://datatracker.ietf.org/doc/html/rfc9457) - Updated RFC 7807 (2023)
378
601
  - [HTTP Status Codes (MDN)](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status) - HTTP status code reference
379
602
  - [Microsoft REST API Guidelines - Errors](https://github.com/microsoft/api-guidelines/blob/vNext/azure/Guidelines.md#handling-errors) - Industry best practices
603
+ - [GraphQL Spec - Errors](https://spec.graphql.org/October2021/#sec-Errors) - GraphQL error format specification
604
+ - [gRPC Status Codes](https://grpc.github.io/grpc/core/md_doc_statuscodes.html) - gRPC error handling reference
605
+ - [Google API Design Guide - Errors](https://cloud.google.com/apis/design/errors) - Google's API error design patterns
380
606
 
381
607
  ---
382
608
 
@@ -1,7 +1,7 @@
1
1
  # Forward Derivation Standards | 正向推演標準
2
2
 
3
- **Version**: 1.1.0
4
- **Last Updated**: 2026-01-25
3
+ **Version**: 1.2.0
4
+ **Last Updated**: 2026-03-18
5
5
  **Applicability**: All projects using Spec-Driven Development
6
6
  **Scope**: uds-specific
7
7
  **Industry Standards**: JSON Schema 2020-12
@@ -525,6 +525,57 @@ spec-review → forward-derivation → discovery
525
525
 
526
526
  ---
527
527
 
528
+ ## Pipeline Integration
529
+
530
+ ### Automated TDD Transition
531
+
532
+ When forward derivation is triggered by an automated pipeline (see [Pipeline Integration Standards](pipeline-integration-standards.md)), the following rules apply for transitioning into the TDD cycle:
533
+
534
+ #### Auto-TDD Entry Rules
535
+
536
+ | Rule | Description |
537
+ |------|-------------|
538
+ | **Derivation completeness** | All derivation outputs (BDD, TDD, ATDD) must be generated before entering TDD |
539
+ | **RED state initialization** | Pipeline sets TDD state to RED after generating test skeletons |
540
+ | **Test skeleton validation** | Generated test files must compile/parse without errors before entering RED |
541
+ | **AC count verification** | Verify output test count matches AC count before transitioning |
542
+
543
+ #### Pipeline Hooks
544
+
545
+ Derivation steps can be automatically triggered by pipeline events:
546
+
547
+ | Hook | Trigger | Action |
548
+ |------|---------|--------|
549
+ | `on-spec-approved` | Spec status changes to "approved" | Start derivation pipeline |
550
+ | `on-derivation-complete` | All derivation outputs generated | Transition to TDD RED phase |
551
+ | `on-tdd-green` | All derived tests pass | Trigger review stage |
552
+
553
+ #### Auto-TDD Entry Workflow
554
+
555
+ ```
556
+ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
557
+ │ Spec Approved│───▶│ Derive All │───▶│ Verify Count │───▶│ TDD RED │
558
+ │ (hook) │ │ BDD+TDD+ATDD│ │ AC = Tests │ │ (auto-set) │
559
+ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘
560
+ ```
561
+
562
+ 1. **Spec Approval**: Pipeline detects spec approval (via hook or polling)
563
+ 2. **Full Derivation**: Pipeline runs `/derive-all` with project-configured language/framework
564
+ 3. **Count Verification**: Pipeline verifies output count matches AC count (anti-hallucination)
565
+ 4. **RED State**: Pipeline sets TDD state to RED; test skeletons exist but assertions are [TODO]
566
+
567
+ #### Integration with Pipeline Stages
568
+
569
+ Forward derivation maps to the **DERIVE** stage in the [Pipeline Integration Standards](pipeline-integration-standards.md) 6-stage model:
570
+
571
+ | Pipeline Stage | Forward Derivation Role |
572
+ |---------------|------------------------|
573
+ | SPEC | Input: approved specification |
574
+ | **DERIVE** | Execute: parse AC → generate BDD/TDD/ATDD outputs |
575
+ | BUILD | Output: test skeletons feed into TDD RED→GREEN cycle |
576
+
577
+ ---
578
+
528
579
  ## Anti-Patterns to Avoid
529
580
 
530
581
  ### Generation Anti-Patterns
@@ -626,6 +677,7 @@ spec-review → forward-derivation → discovery
626
677
 
627
678
  | Version | Date | Changes |
628
679
  |---------|------|---------|
680
+ | 1.2.0 | 2026-03-18 | Added: Pipeline Integration section — auto-TDD transition, pipeline hooks, auto-TDD entry workflow |
629
681
  | 1.1.0 | 2026-01-25 | Added: Contract output (contract.json), Schema output (schema.json), /derive-contracts command for verification artifact generation |
630
682
  | 1.0.0 | 2026-01-19 | Initial release |
631
683
 
@@ -0,0 +1,131 @@
1
+ # Git Worktree Isolation
2
+
3
+ > **Language**: English | [繁體中文](../locales/zh-TW/core/git-worktree.md)
4
+
5
+ **Version**: 1.0.0
6
+ **Last Updated**: 2026-03-20
7
+ **Applicability**: All projects using Git for version control
8
+ **Scope**: universal
9
+ **Inspired by**: [Superpowers](https://github.com/obra/superpowers) — using-git-worktrees (MIT)
10
+
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Define a lifecycle for using Git worktrees to isolate development work, ensuring clean environments, safe merging, and proper cleanup. Worktrees allow parallel work on multiple branches without stashing or switching.
16
+
17
+ 定義 Git Worktree 的完整生命週期管理標準,確保環境乾淨、安全合併與適當清理。Worktree 允許在多個分支上並行工作,無需 stash 或切換。
18
+
19
+ ---
20
+
21
+ ## Glossary
22
+
23
+ | Term | Definition |
24
+ |------|-----------|
25
+ | Worktree | A linked working copy of a Git repository at a different branch |
26
+ | Baseline Test | A test run on a fresh worktree to verify the environment is clean |
27
+ | Worktree Directory | The filesystem path where the worktree is created |
28
+
29
+ ---
30
+
31
+ ## Core Principle — Isolation with Accountability
32
+
33
+ > **Every worktree must start clean (baseline test), work in isolation, and end with either a merge or explicit cleanup.**
34
+
35
+ 每個 worktree 必須以乾淨狀態開始(基準測試)、在隔離環境中工作、以合併或明確清理結束。
36
+
37
+ ---
38
+
39
+ ## Lifecycle Phases
40
+
41
+ ### Phase 1: Setup(建立)
42
+
43
+ 1. **Choose worktree location** — priority order:
44
+ - Existing configured path
45
+ - `.devap/worktrees/` or similar project-local directory
46
+ - Ask the user
47
+ 2. **Verify `.gitignore`** — run `git check-ignore` to confirm the worktree directory is ignored
48
+ 3. **Create the worktree** — `git worktree add <path> -b <branch-name>`
49
+ 4. **Install dependencies** — run package manager install if needed
50
+
51
+ ```bash
52
+ # Example setup
53
+ git worktree add .worktrees/feature-auth -b feature/auth
54
+ cd .worktrees/feature-auth
55
+ pnpm install # or npm install, pip install, etc.
56
+ ```
57
+
58
+ ### Phase 2: Baseline(基準驗證)
59
+
60
+ 1. **Run the test suite** in the fresh worktree
61
+ 2. **Confirm all tests pass** — this verifies the environment is clean
62
+ 3. **If tests fail** — abort and report the environment issue (do not proceed)
63
+
64
+ ```bash
65
+ # Baseline verification
66
+ pnpm test # Must pass before any work begins
67
+ ```
68
+
69
+ 基準測試失敗代表環境有問題,必須中止並報告。
70
+
71
+ ### Phase 3: Execute(執行)
72
+
73
+ 1. Work in the isolated worktree as a normal development environment
74
+ 2. Make commits as usual
75
+ 3. Run tests after changes
76
+
77
+ ### Phase 4: Merge(合併)
78
+
79
+ 1. **Verify all tests pass** in the worktree
80
+ 2. **Merge back** — use `--no-ff` to preserve branch history
81
+ 3. **Handle conflicts** if they arise
82
+
83
+ ```bash
84
+ git checkout main
85
+ git merge --no-ff feature/auth
86
+ ```
87
+
88
+ ### Phase 5: Cleanup(清理)
89
+
90
+ 1. **Remove the worktree** — `git worktree remove <path>`
91
+ 2. **Delete the branch** — `git branch -d <branch-name>`
92
+ 3. **Prune stale worktrees** — `git worktree prune`
93
+
94
+ ```bash
95
+ git worktree remove .worktrees/feature-auth
96
+ git branch -d feature/auth
97
+ git worktree prune
98
+ ```
99
+
100
+ **Important**: Cleanup must happen even on abnormal exits. Use try/finally patterns or cleanup hooks.
101
+
102
+ 清理必須在異常退出時也執行,使用 try/finally 或清理 hook。
103
+
104
+ ---
105
+
106
+ ## Rules
107
+
108
+ | ID | Trigger | Action | Priority |
109
+ |----|---------|--------|----------|
110
+ | GW-001 | Worktree directory not in `.gitignore` | Automatically add to `.gitignore` | Critical |
111
+ | GW-002 | Baseline tests fail | Abort task, report environment issue | High |
112
+ | GW-003 | Abnormal exit during worktree operation | Ensure cleanup is executed | High |
113
+ | GW-004 | Worktree exists after branch merge/delete | Prune stale worktree references | Medium |
114
+
115
+ ---
116
+
117
+ ## Best Practices
118
+
119
+ | Practice | Rationale |
120
+ |----------|-----------|
121
+ | Use a consistent worktree directory (e.g., `.worktrees/`) | Easy to `.gitignore` and locate |
122
+ | Always run baseline tests | Prevents false failures from environment issues |
123
+ | Use `--no-ff` for merges | Preserves branch topology in history |
124
+ | Clean up immediately after merge | Prevents stale worktree accumulation |
125
+
126
+ ---
127
+
128
+ ## References
129
+
130
+ - **Superpowers**: [using-git-worktrees](https://github.com/obra/superpowers) (MIT)
131
+ - **Git Documentation**: [git-worktree](https://git-scm.com/docs/git-worktree)
@@ -0,0 +1,153 @@
1
+ # AI Model Selection Strategy
2
+
3
+ > **Language**: English | [繁體中文](../locales/zh-TW/core/model-selection.md)
4
+
5
+ **Version**: 1.0.0
6
+ **Last Updated**: 2026-03-20
7
+ **Applicability**: AI-assisted development with multiple model tiers
8
+ **Scope**: universal
9
+ **Inspired by**: [Superpowers](https://github.com/obra/superpowers) — subagent-driven-development (MIT)
10
+
11
+ ---
12
+
13
+ ## Purpose
14
+
15
+ Define a cost-effective strategy for selecting AI model tiers based on task complexity signals. Use the cheapest model that can handle the job, and escalate only when necessary.
16
+
17
+ 定義基於任務複雜度的 AI 模型分級選擇策略。使用能勝任的最便宜模型,僅在必要時升級。
18
+
19
+ ---
20
+
21
+ ## Glossary
22
+
23
+ | Term | Definition |
24
+ |------|-----------|
25
+ | Model Tier | A classification level representing model capability and cost |
26
+ | Complexity Signal | Observable characteristics of a task that indicate required capability |
27
+ | Escalation | Upgrading to a higher-tier model after a lower tier fails |
28
+
29
+ ---
30
+
31
+ ## Core Principle — Cost Efficiency
32
+
33
+ > **Always start with the cheapest model tier that matches the task's complexity signals.**
34
+
35
+ 始終使用與任務複雜度匹配的最便宜模型。
36
+
37
+ ---
38
+
39
+ ## Three-Tier Model Classification
40
+
41
+ ### Tier 1: Fast(快速層)
42
+
43
+ **Purpose**: Mechanical implementation — single file, clear spec, no judgment needed.
44
+
45
+ 機械性實作 — 單一檔案、明確規格、無需判斷。
46
+
47
+ **Complexity Signals**:
48
+ - Modifies a single file
49
+ - Specification is completely unambiguous
50
+ - No design judgment required
51
+ - Repetitive, pattern-based work
52
+
53
+ **Examples**:
54
+ - Update `package.json` version number
55
+ - Add a new export statement
56
+ - Fix a typo
57
+ - Rename a variable across a file
58
+
59
+ ### Tier 2: Standard(標準層)
60
+
61
+ **Purpose**: Integration work — multiple files, requires judgment.
62
+
63
+ 整合性實作 — 多檔案、需要判斷力。
64
+
65
+ **Complexity Signals**:
66
+ - Modifies 2–5 files
67
+ - Requires understanding inter-module relationships
68
+ - Needs some design judgment
69
+ - Cross-cutting but within a bounded context
70
+
71
+ **Examples**:
72
+ - Add an API endpoint (route + handler + test)
73
+ - Refactor a module's internal structure
74
+ - Implement a feature with database migration
75
+ - Write integration tests for a subsystem
76
+
77
+ ### Tier 3: Capable(能力層)
78
+
79
+ **Purpose**: Architectural work — design, review, complex debugging.
80
+
81
+ 架構性工作 — 設計、審查、複雜除錯。
82
+
83
+ **Complexity Signals**:
84
+ - Modifies 5+ files
85
+ - Requires architectural decisions
86
+ - Cross-module coordination
87
+ - Complex debugging or performance analysis
88
+ - Ambiguous requirements needing interpretation
89
+
90
+ **Examples**:
91
+ - Design a new subsystem architecture
92
+ - Review a large pull request
93
+ - Diagnose cross-service performance issues
94
+ - Refactor a major component with many dependents
95
+
96
+ ---
97
+
98
+ ## Selection Decision Flow
99
+
100
+ ```
101
+ Analyze task complexity signals
102
+ ├── Single file, clear spec, no judgment? → Tier 1 (Fast)
103
+ ├── 2-5 files, some judgment needed? → Tier 2 (Standard)
104
+ └── 5+ files, architectural decisions? → Tier 3 (Capable)
105
+ ```
106
+
107
+ ---
108
+
109
+ ## Escalation Rules
110
+
111
+ When a model tier fails (returns `BLOCKED`), escalate to the next tier:
112
+
113
+ | Current Tier | On BLOCKED | Action |
114
+ |-------------|-----------|--------|
115
+ | Fast | → Standard | Re-dispatch with Standard tier |
116
+ | Standard | → Capable | Re-dispatch with Capable tier |
117
+ | Capable | → Human | Flag for human intervention |
118
+
119
+ ### Escalation is Not Retry
120
+
121
+ Escalation means using a more capable model, not repeating the same action. The higher-tier model receives:
122
+ - The original task
123
+ - The lower-tier model's output and failure reason
124
+ - Additional context if available
125
+
126
+ 升級不是重試。更高層級的模型會收到原始任務、低層級的輸出與失敗原因。
127
+
128
+ ---
129
+
130
+ ## Rules
131
+
132
+ | ID | Trigger | Action | Priority |
133
+ |----|---------|--------|----------|
134
+ | MS-001 | BLOCKED at Fast tier | Escalate to Standard | High |
135
+ | MS-002 | BLOCKED at Standard tier | Escalate to Capable | High |
136
+ | MS-003 | BLOCKED at Capable tier | Flag for human intervention | Critical |
137
+ | MS-004 | Task has ambiguous requirements | Start at Standard or higher | Medium |
138
+
139
+ ---
140
+
141
+ ## Cost Optimization Tips
142
+
143
+ 1. **Batch simple tasks** — send multiple Fast-tier tasks in one session
144
+ 2. **Pre-classify tasks** — use task metadata to auto-select tiers
145
+ 3. **Track escalation rates** — high escalation from Fast → Standard may indicate poor task decomposition
146
+ 4. **Review Capable usage** — ensure Capable-tier tasks genuinely need that level
147
+
148
+ ---
149
+
150
+ ## References
151
+
152
+ - **Superpowers**: [subagent-driven-development](https://github.com/obra/superpowers) (MIT)
153
+ - **Cost-Effective AI**: Principle of using the minimum capability needed