universal-dev-standards 6.14.0-beta.9 → 6.14.1-beta.1

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 (721) hide show
  1. package/bin/uds.js +12 -1
  2. package/bundled/ai/options/commit-message/traditional-chinese.ai.yaml +69 -67
  3. package/bundled/ai/standards/commit-message.ai.yaml +12 -2
  4. package/bundled/ai/standards/mock-boundary.ai.yaml +138 -2
  5. package/bundled/ai/standards/secret-management-standards.ai.yaml +12 -1
  6. package/bundled/ai/standards/turn-completion-integrity.ai.yaml +6 -2
  7. package/bundled/core/commit-message-guide.md +22 -19
  8. package/bundled/core/mock-boundary.md +70 -2
  9. package/bundled/core/secret-management-standards.md +13 -1
  10. package/bundled/core/turn-completion-integrity.md +8 -2
  11. package/bundled/extensions/locales/zh-tw.md +19 -19
  12. package/bundled/hooks/check-dangerous-cmd.mjs +161 -26
  13. package/bundled/hooks/check-logging-standard.mjs +35 -6
  14. package/bundled/hooks/validate-commit-msg.mjs +317 -28
  15. package/bundled/locales/zh-CN/CHANGELOG.md +2323 -1099
  16. package/bundled/locales/zh-CN/CLAUDE.md +987 -101
  17. package/bundled/locales/zh-CN/README.md +3 -3
  18. package/bundled/locales/zh-CN/SECURITY.md +4 -3
  19. package/bundled/locales/zh-CN/STANDARDS-MAPPING.md +103 -6
  20. package/bundled/locales/zh-CN/adoption/ADOPTION-GUIDE.md +68 -97
  21. package/bundled/locales/zh-CN/adoption/DAILY-WORKFLOW-GUIDE.md +2 -1
  22. package/bundled/locales/zh-CN/adoption/STATIC-DYNAMIC-GUIDE.md +8 -9
  23. package/bundled/locales/zh-CN/adoption/checklists/enterprise.md +81 -80
  24. package/bundled/locales/zh-CN/adoption/checklists/minimal.md +18 -14
  25. package/bundled/locales/zh-CN/adoption/checklists/recommended.md +49 -46
  26. package/bundled/locales/zh-CN/ai/MAINTENANCE.md +44 -9
  27. package/bundled/locales/zh-CN/ai/options/commit-message/traditional-chinese.ai.yaml +63 -55
  28. package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +61 -14
  29. package/bundled/locales/zh-CN/core/acceptance-test-driven-development.md +2 -1
  30. package/bundled/locales/zh-CN/core/accessibility-standards.md +871 -62
  31. package/bundled/locales/zh-CN/core/adr-standards.md +155 -32
  32. package/bundled/locales/zh-CN/core/agent-communication-protocol.md +2 -1
  33. package/bundled/locales/zh-CN/core/agent-dispatch.md +68 -33
  34. package/bundled/locales/zh-CN/core/ai-agreement-standards.md +23 -22
  35. package/bundled/locales/zh-CN/core/ai-command-behavior.md +2 -1
  36. package/bundled/locales/zh-CN/core/ai-friendly-architecture.md +311 -72
  37. package/bundled/locales/zh-CN/core/ai-instruction-standards.md +71 -49
  38. package/bundled/locales/zh-CN/core/ai-response-navigation.md +2 -1
  39. package/bundled/locales/zh-CN/core/alerting-standards.md +231 -36
  40. package/bundled/locales/zh-CN/core/anti-hallucination.md +116 -697
  41. package/bundled/locales/zh-CN/core/anti-sycophancy-prompting.md +34 -33
  42. package/bundled/locales/zh-CN/core/api-design-standards.md +144 -58
  43. package/bundled/locales/zh-CN/core/behavior-driven-development.md +2 -1
  44. package/bundled/locales/zh-CN/core/branch-completion.md +75 -20
  45. package/bundled/locales/zh-CN/core/capability-declaration.md +44 -94
  46. package/bundled/locales/zh-CN/core/change-batching-standards.md +2 -1
  47. package/bundled/locales/zh-CN/core/changelog-standards.md +485 -63
  48. package/bundled/locales/zh-CN/core/chaos-engineering-standards.md +141 -39
  49. package/bundled/locales/zh-CN/core/checkin-standards.md +176 -116
  50. package/bundled/locales/zh-CN/core/circuit-breaker.md +43 -77
  51. package/bundled/locales/zh-CN/core/code-review-checklist.md +37 -23
  52. package/bundled/locales/zh-CN/core/commit-message-guide.md +892 -69
  53. package/bundled/locales/zh-CN/core/containerization-standards.md +259 -57
  54. package/bundled/locales/zh-CN/core/context-aware-loading.md +103 -29
  55. package/bundled/locales/zh-CN/core/database-standards.md +115 -114
  56. package/bundled/locales/zh-CN/core/deprecation-standards.md +155 -40
  57. package/bundled/locales/zh-CN/core/design-document-standards.md +265 -55
  58. package/bundled/locales/zh-CN/core/developer-memory.md +150 -60
  59. package/bundled/locales/zh-CN/core/documentation-lifecycle.md +20 -16
  60. package/bundled/locales/zh-CN/core/documentation-structure.md +1284 -127
  61. package/bundled/locales/zh-CN/core/documentation-writing-standards.md +649 -259
  62. package/bundled/locales/zh-CN/core/dual-phase-output.md +37 -70
  63. package/bundled/locales/zh-CN/core/environment-standards.md +251 -73
  64. package/bundled/locales/zh-CN/core/error-code-standards.md +501 -60
  65. package/bundled/locales/zh-CN/core/estimation-standards.md +174 -41
  66. package/bundled/locales/zh-CN/core/execution-history.md +2 -1
  67. package/bundled/locales/zh-CN/core/failure-source-taxonomy.md +71 -84
  68. package/bundled/locales/zh-CN/core/feature-flag-standards.md +202 -57
  69. package/bundled/locales/zh-CN/core/forward-derivation-standards.md +613 -154
  70. package/bundled/locales/zh-CN/core/frontend-design-standards.md +361 -78
  71. package/bundled/locales/zh-CN/core/git-workflow.md +148 -262
  72. package/bundled/locales/zh-CN/core/git-worktree.md +59 -26
  73. package/bundled/locales/zh-CN/core/guides/file-placement-guide.md +132 -48
  74. package/bundled/locales/zh-CN/core/guides/performance-guide.md +61 -59
  75. package/bundled/locales/zh-CN/core/guides/security-guide.md +2 -0
  76. package/bundled/locales/zh-CN/core/health-check-standards.md +46 -104
  77. package/bundled/locales/zh-CN/core/immutability-first.md +83 -60
  78. package/bundled/locales/zh-CN/core/knowledge-transfer-standards.md +94 -31
  79. package/bundled/locales/zh-CN/core/mock-boundary.md +74 -6
  80. package/bundled/locales/zh-CN/core/mutation-testing.md +45 -6
  81. package/bundled/locales/zh-CN/core/observability-standards.md +281 -37
  82. package/bundled/locales/zh-CN/core/performance-standards.md +402 -42
  83. package/bundled/locales/zh-CN/core/pipeline-integration-standards.md +2 -1
  84. package/bundled/locales/zh-CN/core/postmortem-standards.md +358 -53
  85. package/bundled/locales/zh-CN/core/privacy-standards.md +148 -40
  86. package/bundled/locales/zh-CN/core/project-context-memory.md +182 -48
  87. package/bundled/locales/zh-CN/core/project-structure.md +550 -170
  88. package/bundled/locales/zh-CN/core/recovery-recipe-registry.md +54 -114
  89. package/bundled/locales/zh-CN/core/refactoring-standards.md +141 -556
  90. package/bundled/locales/zh-CN/core/requirement-engineering.md +7 -6
  91. package/bundled/locales/zh-CN/core/retrospective-standards.md +215 -22
  92. package/bundled/locales/zh-CN/core/retry-standards.md +46 -101
  93. package/bundled/locales/zh-CN/core/reverse-engineering-standards.md +370 -120
  94. package/bundled/locales/zh-CN/core/runbook-standards.md +294 -48
  95. package/bundled/locales/zh-CN/core/security-decision.md +45 -70
  96. package/bundled/locales/zh-CN/core/security-standards.md +169 -16
  97. package/bundled/locales/zh-CN/core/skill-standard-alignment-check.md +105 -71
  98. package/bundled/locales/zh-CN/core/slo-standards.md +296 -44
  99. package/bundled/locales/zh-CN/core/spec-driven-development.md +37 -6
  100. package/bundled/locales/zh-CN/core/standard-admission-criteria.md +25 -31
  101. package/bundled/locales/zh-CN/core/standard-lifecycle-management.md +49 -57
  102. package/bundled/locales/zh-CN/core/structured-task-definition.md +2 -1
  103. package/bundled/locales/zh-CN/core/supply-chain-security-standards.md +159 -32
  104. package/bundled/locales/zh-CN/core/systematic-debugging.md +87 -42
  105. package/bundled/locales/zh-CN/core/tech-debt-standards.md +202 -86
  106. package/bundled/locales/zh-CN/core/test-completeness-dimensions.md +262 -190
  107. package/bundled/locales/zh-CN/core/test-data-standards.md +252 -30
  108. package/bundled/locales/zh-CN/core/test-driven-development.md +21 -1022
  109. package/bundled/locales/zh-CN/core/test-governance.md +94 -43
  110. package/bundled/locales/zh-CN/core/testing-standards.md +83 -37
  111. package/bundled/locales/zh-CN/core/timeout-standards.md +45 -85
  112. package/bundled/locales/zh-CN/core/token-budget.md +44 -80
  113. package/bundled/locales/zh-CN/core/translation-lifecycle-standards.md +48 -36
  114. package/bundled/locales/zh-CN/core/turn-completion-integrity.md +8 -6
  115. package/bundled/locales/zh-CN/core/verification-evidence.md +44 -22
  116. package/bundled/locales/zh-CN/core/versioning.md +737 -73
  117. package/bundled/locales/zh-CN/core/virtual-organization-standards.md +30 -29
  118. package/bundled/locales/zh-CN/core/workflow-enforcement.md +9 -8
  119. package/bundled/locales/zh-CN/core/workflow-state-protocol.md +9 -8
  120. package/bundled/locales/zh-CN/docs/CHEATSHEET.md +2 -1
  121. package/bundled/locales/zh-CN/docs/CLI-FLOW.md +2 -1
  122. package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +19 -10
  123. package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +8 -6
  124. package/bundled/locales/zh-CN/docs/STANDARDS-REFERENCE.md +2 -1
  125. package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +133 -132
  126. package/bundled/locales/zh-CN/docs/USER-MANUAL.md +11 -3
  127. package/bundled/locales/zh-CN/docs/WINDOWS-GUIDE.md +5 -2
  128. package/bundled/locales/zh-CN/docs/specs/system/memory-adoption-strategy.md +2 -0
  129. package/bundled/locales/zh-CN/docs/user/FAQ.md +2 -0
  130. package/bundled/locales/zh-CN/docs/user/GETTING-STARTED.md +2 -0
  131. package/bundled/locales/zh-CN/docs/user/GLOSSARY.md +2 -0
  132. package/bundled/locales/zh-CN/docs/user/README.md +4 -2
  133. package/bundled/locales/zh-CN/docs/user/TROUBLESHOOTING.md +2 -0
  134. package/bundled/locales/zh-CN/integrations/codex/AGENTS.md +136 -2
  135. package/bundled/locales/zh-CN/integrations/codex/README.md +62 -10
  136. package/bundled/locales/zh-CN/integrations/gemini-cli/GEMINI.md +59 -1
  137. package/bundled/locales/zh-CN/integrations/gemini-cli/README.md +9 -2
  138. package/bundled/locales/zh-CN/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +7 -1
  139. package/bundled/locales/zh-CN/integrations/github-copilot/README.md +8 -2
  140. package/bundled/locales/zh-CN/integrations/github-copilot/copilot-instructions.md +146 -12
  141. package/bundled/locales/zh-CN/integrations/github-copilot/skills-mapping.md +7 -1
  142. package/bundled/locales/zh-CN/integrations/google-antigravity/AGENTS.md +110 -3
  143. package/bundled/locales/zh-CN/integrations/google-antigravity/README.md +7 -1
  144. package/bundled/locales/zh-CN/integrations/opencode/AGENTS.md +140 -2
  145. package/bundled/locales/zh-CN/integrations/opencode/README.md +7 -1
  146. package/bundled/locales/zh-CN/integrations/opencode/skills-mapping.md +8 -2
  147. package/bundled/locales/zh-CN/integrations/openspec/AGENTS.md +46 -1
  148. package/bundled/locales/zh-CN/integrations/openspec/README.md +7 -1
  149. package/bundled/locales/zh-CN/integrations/spec-kit/AGENTS.md +20 -2
  150. package/bundled/locales/zh-CN/integrations/spec-kit/README.md +7 -1
  151. package/bundled/locales/zh-CN/options/changelog/auto-generated.md +2 -0
  152. package/bundled/locales/zh-CN/options/changelog/keep-a-changelog.md +2 -0
  153. package/bundled/locales/zh-CN/options/code-review/automated-review.md +2 -0
  154. package/bundled/locales/zh-CN/options/code-review/pair-programming.md +2 -0
  155. package/bundled/locales/zh-CN/options/commit-message/bilingual.md +139 -50
  156. package/bundled/locales/zh-CN/options/commit-message/english.md +159 -42
  157. package/bundled/locales/zh-CN/options/commit-message/traditional-chinese.md +156 -75
  158. package/bundled/locales/zh-CN/options/documentation/api-docs.md +3 -1
  159. package/bundled/locales/zh-CN/options/documentation/markdown-docs.md +2 -0
  160. package/bundled/locales/zh-CN/options/documentation/wiki-style.md +2 -0
  161. package/bundled/locales/zh-CN/options/git-workflow/gitflow.md +105 -77
  162. package/bundled/locales/zh-CN/options/git-workflow/github-flow.md +75 -57
  163. package/bundled/locales/zh-CN/options/git-workflow/merge-commit.md +155 -44
  164. package/bundled/locales/zh-CN/options/git-workflow/rebase-ff.md +168 -53
  165. package/bundled/locales/zh-CN/options/git-workflow/squash-merge.md +122 -37
  166. package/bundled/locales/zh-CN/options/git-workflow/trunk-based.md +108 -61
  167. package/bundled/locales/zh-CN/options/project-structure/dotnet.md +266 -47
  168. package/bundled/locales/zh-CN/options/project-structure/go.md +301 -43
  169. package/bundled/locales/zh-CN/options/project-structure/java.md +268 -48
  170. package/bundled/locales/zh-CN/options/project-structure/kotlin.md +2 -0
  171. package/bundled/locales/zh-CN/options/project-structure/nodejs.md +168 -51
  172. package/bundled/locales/zh-CN/options/project-structure/php.md +2 -0
  173. package/bundled/locales/zh-CN/options/project-structure/python.md +210 -52
  174. package/bundled/locales/zh-CN/options/project-structure/ruby.md +2 -0
  175. package/bundled/locales/zh-CN/options/project-structure/rust.md +2 -0
  176. package/bundled/locales/zh-CN/options/project-structure/swift.md +2 -0
  177. package/bundled/locales/zh-CN/options/testing/contract-testing.md +2 -0
  178. package/bundled/locales/zh-CN/options/testing/e2e-testing.md +227 -66
  179. package/bundled/locales/zh-CN/options/testing/industry-pyramid.md +2 -0
  180. package/bundled/locales/zh-CN/options/testing/integration-testing.md +185 -73
  181. package/bundled/locales/zh-CN/options/testing/istqb-framework.md +2 -0
  182. package/bundled/locales/zh-CN/options/testing/performance-testing.md +2 -0
  183. package/bundled/locales/zh-CN/options/testing/security-testing.md +2 -0
  184. package/bundled/locales/zh-CN/options/testing/system-testing.md +270 -96
  185. package/bundled/locales/zh-CN/options/testing/unit-testing.md +185 -71
  186. package/bundled/locales/zh-CN/skills/CONTRIBUTING.template.md +43 -42
  187. package/bundled/locales/zh-CN/skills/INTEGRATION-GUIDE.md +2 -1
  188. package/bundled/locales/zh-CN/skills/README.md +2 -1
  189. package/bundled/locales/zh-CN/skills/_shared/README.md +2 -1
  190. package/bundled/locales/zh-CN/skills/adr-assistant/guide.md +240 -4
  191. package/bundled/locales/zh-CN/skills/agents/README.md +180 -82
  192. package/bundled/locales/zh-CN/skills/agents/code-architect.md +3 -1
  193. package/bundled/locales/zh-CN/skills/agents/doc-writer.md +3 -1
  194. package/bundled/locales/zh-CN/skills/agents/reviewer.md +4 -2
  195. package/bundled/locales/zh-CN/skills/agents/spec-analyst.md +3 -1
  196. package/bundled/locales/zh-CN/skills/agents/test-specialist.md +3 -1
  197. package/bundled/locales/zh-CN/skills/ai-collaboration-standards/SKILL.md +91 -81
  198. package/bundled/locales/zh-CN/skills/ai-collaboration-standards/anti-hallucination.md +79 -59
  199. package/bundled/locales/zh-CN/skills/ai-collaboration-standards/certainty-labels.md +66 -40
  200. package/bundled/locales/zh-CN/skills/ai-friendly-architecture/SKILL.md +23 -36
  201. package/bundled/locales/zh-CN/skills/ai-instruction-standards/SKILL.md +217 -137
  202. package/bundled/locales/zh-CN/skills/api-design-assistant/SKILL.md +13 -2
  203. package/bundled/locales/zh-CN/skills/atdd-assistant/SKILL.md +16 -2
  204. package/bundled/locales/zh-CN/skills/atdd-assistant/acceptance-criteria-guide.md +2 -1
  205. package/bundled/locales/zh-CN/skills/atdd-assistant/atdd-workflow.md +98 -1
  206. package/bundled/locales/zh-CN/skills/atdd-assistant/guide.md +148 -132
  207. package/bundled/locales/zh-CN/skills/audit-assistant/SKILL.md +5 -2
  208. package/bundled/locales/zh-CN/skills/bdd-assistant/SKILL.md +16 -2
  209. package/bundled/locales/zh-CN/skills/bdd-assistant/bdd-workflow.md +2 -1
  210. package/bundled/locales/zh-CN/skills/bdd-assistant/gherkin-guide.md +2 -1
  211. package/bundled/locales/zh-CN/skills/bdd-assistant/guide.md +122 -121
  212. package/bundled/locales/zh-CN/skills/changelog-guide/SKILL.md +9 -2
  213. package/bundled/locales/zh-CN/skills/changelog-guide/guide.md +91 -88
  214. package/bundled/locales/zh-CN/skills/checkin-assistant/SKILL.md +12 -2
  215. package/bundled/locales/zh-CN/skills/checkin-assistant/guide.md +211 -210
  216. package/bundled/locales/zh-CN/skills/ci-cd-assistant/SKILL.md +14 -2
  217. package/bundled/locales/zh-CN/skills/code-review-assistant/SKILL.md +12 -2
  218. package/bundled/locales/zh-CN/skills/code-review-assistant/checkin-checklist.md +79 -78
  219. package/bundled/locales/zh-CN/skills/code-review-assistant/guide.md +119 -45
  220. package/bundled/locales/zh-CN/skills/code-review-assistant/review-checklist.md +89 -88
  221. package/bundled/locales/zh-CN/skills/commands/ac-coverage.md +43 -1
  222. package/bundled/locales/zh-CN/skills/commands/api-design.md +2 -1
  223. package/bundled/locales/zh-CN/skills/commands/atdd.md +71 -1
  224. package/bundled/locales/zh-CN/skills/commands/audit.md +2 -1
  225. package/bundled/locales/zh-CN/skills/commands/bdd.md +160 -62
  226. package/bundled/locales/zh-CN/skills/commands/changelog.md +36 -1
  227. package/bundled/locales/zh-CN/skills/commands/check.md +53 -1
  228. package/bundled/locales/zh-CN/skills/commands/checkin.md +45 -1
  229. package/bundled/locales/zh-CN/skills/commands/ci-cd.md +3 -2
  230. package/bundled/locales/zh-CN/skills/commands/code-review.md +41 -1
  231. package/bundled/locales/zh-CN/skills/commands/commit.md +56 -1
  232. package/bundled/locales/zh-CN/skills/commands/config.md +50 -1
  233. package/bundled/locales/zh-CN/skills/commands/coverage.md +43 -1
  234. package/bundled/locales/zh-CN/skills/commands/database.md +4 -3
  235. package/bundled/locales/zh-CN/skills/commands/derive-all.md +42 -1
  236. package/bundled/locales/zh-CN/skills/commands/derive-atdd.md +35 -1
  237. package/bundled/locales/zh-CN/skills/commands/derive-bdd.md +41 -1
  238. package/bundled/locales/zh-CN/skills/commands/derive-tdd.md +42 -1
  239. package/bundled/locales/zh-CN/skills/commands/derive.md +60 -4
  240. package/bundled/locales/zh-CN/skills/commands/dev-workflow.md +58 -8
  241. package/bundled/locales/zh-CN/skills/commands/discover.md +41 -1
  242. package/bundled/locales/zh-CN/skills/commands/docgen.md +37 -1
  243. package/bundled/locales/zh-CN/skills/commands/docs.md +136 -5
  244. package/bundled/locales/zh-CN/skills/commands/durable.md +4 -3
  245. package/bundled/locales/zh-CN/skills/commands/e2e.md +85 -1
  246. package/bundled/locales/zh-CN/skills/commands/guide.md +2 -1
  247. package/bundled/locales/zh-CN/skills/commands/incident.md +5 -4
  248. package/bundled/locales/zh-CN/skills/commands/init.md +57 -1
  249. package/bundled/locales/zh-CN/skills/commands/methodology.md +166 -77
  250. package/bundled/locales/zh-CN/skills/commands/metrics.md +3 -2
  251. package/bundled/locales/zh-CN/skills/commands/migrate.md +5 -4
  252. package/bundled/locales/zh-CN/skills/commands/observability.md +48 -3
  253. package/bundled/locales/zh-CN/skills/commands/pr.md +4 -3
  254. package/bundled/locales/zh-CN/skills/commands/refactor.md +76 -38
  255. package/bundled/locales/zh-CN/skills/commands/release.md +82 -1
  256. package/bundled/locales/zh-CN/skills/commands/requirement.md +40 -1
  257. package/bundled/locales/zh-CN/skills/commands/reverse-bdd.md +36 -1
  258. package/bundled/locales/zh-CN/skills/commands/reverse-sdd.md +44 -1
  259. package/bundled/locales/zh-CN/skills/commands/reverse-tdd.md +42 -1
  260. package/bundled/locales/zh-CN/skills/commands/reverse.md +43 -1
  261. package/bundled/locales/zh-CN/skills/commands/runbook.md +50 -3
  262. package/bundled/locales/zh-CN/skills/commands/scan.md +3 -2
  263. package/bundled/locales/zh-CN/skills/commands/sdd-retro.md +50 -1
  264. package/bundled/locales/zh-CN/skills/commands/sdd.md +182 -1
  265. package/bundled/locales/zh-CN/skills/commands/security.md +3 -2
  266. package/bundled/locales/zh-CN/skills/commands/slo.md +51 -3
  267. package/bundled/locales/zh-CN/skills/commands/tdd.md +74 -5
  268. package/bundled/locales/zh-CN/skills/commands/update.md +70 -8
  269. package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +4 -4
  270. package/bundled/locales/zh-CN/skills/commit-standards/conventional-commits.md +45 -44
  271. package/bundled/locales/zh-CN/skills/commit-standards/guide.md +172 -52
  272. package/bundled/locales/zh-CN/skills/commit-standards/language-options.md +50 -47
  273. package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +2 -2
  274. package/bundled/locales/zh-CN/skills/contract-test-assistant/guide.md +76 -1
  275. package/bundled/locales/zh-CN/skills/database-assistant/SKILL.md +18 -5
  276. package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +4 -2
  277. package/bundled/locales/zh-CN/skills/dev-methodology/create-methodology.md +2 -0
  278. package/bundled/locales/zh-CN/skills/dev-methodology/runtime.md +2 -0
  279. package/bundled/locales/zh-CN/skills/docs-generator/SKILL.md +16 -2
  280. package/bundled/locales/zh-CN/skills/docs-generator/guide.md +8 -7
  281. package/bundled/locales/zh-CN/skills/documentation-guide/SKILL.md +209 -184
  282. package/bundled/locales/zh-CN/skills/documentation-guide/documentation-structure.md +73 -72
  283. package/bundled/locales/zh-CN/skills/documentation-guide/readme-template.md +37 -36
  284. package/bundled/locales/zh-CN/skills/durable-execution-assistant/SKILL.md +28 -2
  285. package/bundled/locales/zh-CN/skills/e2e-assistant/SKILL.md +21 -6
  286. package/bundled/locales/zh-CN/skills/error-code-guide/SKILL.md +76 -95
  287. package/bundled/locales/zh-CN/skills/git-workflow-guide/SKILL.md +80 -87
  288. package/bundled/locales/zh-CN/skills/git-workflow-guide/branch-naming.md +44 -43
  289. package/bundled/locales/zh-CN/skills/git-workflow-guide/git-workflow.md +66 -65
  290. package/bundled/locales/zh-CN/skills/incident-response-assistant/SKILL.md +31 -13
  291. package/bundled/locales/zh-CN/skills/metrics-dashboard-assistant/SKILL.md +38 -2
  292. package/bundled/locales/zh-CN/skills/observability-assistant/SKILL.md +75 -1
  293. package/bundled/locales/zh-CN/skills/pr-automation-assistant/SKILL.md +32 -6
  294. package/bundled/locales/zh-CN/skills/project-discovery/SKILL.md +8 -2
  295. package/bundled/locales/zh-CN/skills/project-discovery/guide.md +158 -157
  296. package/bundled/locales/zh-CN/skills/project-structure-guide/SKILL.md +49 -46
  297. package/bundled/locales/zh-CN/skills/project-structure-guide/language-patterns.md +8 -7
  298. package/bundled/locales/zh-CN/skills/refactoring-assistant/SKILL.md +22 -2
  299. package/bundled/locales/zh-CN/skills/refactoring-assistant/guide.md +172 -171
  300. package/bundled/locales/zh-CN/skills/release-standards/SKILL.md +66 -23
  301. package/bundled/locales/zh-CN/skills/release-standards/changelog-format.md +42 -41
  302. package/bundled/locales/zh-CN/skills/release-standards/guide.md +51 -43
  303. package/bundled/locales/zh-CN/skills/release-standards/release-workflow.md +131 -95
  304. package/bundled/locales/zh-CN/skills/release-standards/semantic-versioning.md +62 -61
  305. package/bundled/locales/zh-CN/skills/requirement-assistant/SKILL.md +24 -15
  306. package/bundled/locales/zh-CN/skills/requirement-assistant/guide.md +88 -79
  307. package/bundled/locales/zh-CN/skills/requirement-assistant/requirement-checklist.md +128 -127
  308. package/bundled/locales/zh-CN/skills/requirement-assistant/requirement-writing.md +121 -120
  309. package/bundled/locales/zh-CN/skills/retrospective-assistant/guide.md +206 -2
  310. package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +2 -2
  311. package/bundled/locales/zh-CN/skills/reverse-engineer/bdd-extraction.md +2 -1
  312. package/bundled/locales/zh-CN/skills/reverse-engineer/guide.md +297 -173
  313. package/bundled/locales/zh-CN/skills/reverse-engineer/tdd-analysis.md +2 -1
  314. package/bundled/locales/zh-CN/skills/reverse-engineer/workflow.md +2 -1
  315. package/bundled/locales/zh-CN/skills/runbook-assistant/SKILL.md +9 -2
  316. package/bundled/locales/zh-CN/skills/security-assistant/SKILL.md +24 -6
  317. package/bundled/locales/zh-CN/skills/security-scan-assistant/SKILL.md +34 -10
  318. package/bundled/locales/zh-CN/skills/slo-assistant/SKILL.md +2 -1
  319. package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +2 -2
  320. package/bundled/locales/zh-CN/skills/spec-driven-dev/guide.md +38 -6
  321. package/bundled/locales/zh-CN/skills/tdd-assistant/SKILL.md +16 -3
  322. package/bundled/locales/zh-CN/skills/tdd-assistant/guide.md +217 -156
  323. package/bundled/locales/zh-CN/skills/tdd-assistant/language-examples.md +727 -82
  324. package/bundled/locales/zh-CN/skills/tdd-assistant/tdd-workflow.md +396 -214
  325. package/bundled/locales/zh-CN/skills/test-coverage-assistant/SKILL.md +14 -5
  326. package/bundled/locales/zh-CN/skills/test-coverage-assistant/guide.md +25 -12
  327. package/bundled/locales/zh-CN/skills/testing-guide/testing-pyramid.md +99 -98
  328. package/bundled/locales/zh-CN/skills/testing-guide/testing-theory.md +3 -1
  329. package/bundled/locales/zh-CN/skills/tools/cline/README.md +2 -1
  330. package/bundled/locales/zh-CN/skills/tools/copilot/README.md +65 -18
  331. package/bundled/locales/zh-CN/skills/tools/copilot/copilot-instructions.md +2 -1
  332. package/bundled/locales/zh-CN/skills/tools/cursor/README.md +2 -1
  333. package/bundled/locales/zh-CN/skills/tools/windsurf/README.md +2 -1
  334. package/bundled/locales/zh-CN/skills/workflows/README.md +4 -2
  335. package/bundled/locales/zh-CN/templates/reverse-spec-template.md +50 -1
  336. package/bundled/locales/zh-TW/CHANGELOG.md +2323 -1128
  337. package/bundled/locales/zh-TW/CLAUDE.md +962 -76
  338. package/bundled/locales/zh-TW/README.md +3 -3
  339. package/bundled/locales/zh-TW/SECURITY.md +4 -3
  340. package/bundled/locales/zh-TW/STANDARDS-MAPPING.md +103 -6
  341. package/bundled/locales/zh-TW/adoption/ADOPTION-GUIDE.md +46 -93
  342. package/bundled/locales/zh-TW/adoption/DAILY-WORKFLOW-GUIDE.md +2 -1
  343. package/bundled/locales/zh-TW/adoption/STATIC-DYNAMIC-GUIDE.md +3 -1
  344. package/bundled/locales/zh-TW/adoption/checklists/enterprise.md +10 -9
  345. package/bundled/locales/zh-TW/adoption/checklists/minimal.md +6 -2
  346. package/bundled/locales/zh-TW/adoption/checklists/recommended.md +7 -4
  347. package/bundled/locales/zh-TW/ai/MAINTENANCE.md +34 -14
  348. package/bundled/locales/zh-TW/ai/options/commit-message/traditional-chinese.ai.yaml +48 -40
  349. package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +56 -10
  350. package/bundled/locales/zh-TW/core/acceptance-test-driven-development.md +2 -1
  351. package/bundled/locales/zh-TW/core/accessibility-standards.md +895 -46
  352. package/bundled/locales/zh-TW/core/adr-standards.md +2 -1
  353. package/bundled/locales/zh-TW/core/agent-communication-protocol.md +2 -1
  354. package/bundled/locales/zh-TW/core/agent-dispatch.md +102 -33
  355. package/bundled/locales/zh-TW/core/ai-agreement-standards.md +58 -41
  356. package/bundled/locales/zh-TW/core/ai-command-behavior.md +2 -1
  357. package/bundled/locales/zh-TW/core/ai-friendly-architecture.md +306 -67
  358. package/bundled/locales/zh-TW/core/ai-instruction-standards.md +16 -13
  359. package/bundled/locales/zh-TW/core/ai-response-navigation.md +3 -3
  360. package/bundled/locales/zh-TW/core/alerting-standards.md +257 -35
  361. package/bundled/locales/zh-TW/core/anti-hallucination.md +169 -40
  362. package/bundled/locales/zh-TW/core/anti-sycophancy-prompting.md +2 -1
  363. package/bundled/locales/zh-TW/core/api-design-standards.md +2 -1
  364. package/bundled/locales/zh-TW/core/behavior-driven-development.md +3 -17
  365. package/bundled/locales/zh-TW/core/branch-completion.md +130 -34
  366. package/bundled/locales/zh-TW/core/capability-declaration.md +41 -79
  367. package/bundled/locales/zh-TW/core/change-batching-standards.md +2 -1
  368. package/bundled/locales/zh-TW/core/changelog-standards.md +14 -9
  369. package/bundled/locales/zh-TW/core/chaos-engineering-standards.md +138 -36
  370. package/bundled/locales/zh-TW/core/checkin-standards.md +84 -26
  371. package/bundled/locales/zh-TW/core/circuit-breaker.md +48 -87
  372. package/bundled/locales/zh-TW/core/code-review-checklist.md +19 -7
  373. package/bundled/locales/zh-TW/core/commit-message-guide.md +218 -87
  374. package/bundled/locales/zh-TW/core/containerization-standards.md +259 -57
  375. package/bundled/locales/zh-TW/core/context-aware-loading.md +121 -27
  376. package/bundled/locales/zh-TW/core/database-standards.md +2 -1
  377. package/bundled/locales/zh-TW/core/deprecation-standards.md +139 -37
  378. package/bundled/locales/zh-TW/core/design-document-standards.md +265 -55
  379. package/bundled/locales/zh-TW/core/developer-memory.md +102 -12
  380. package/bundled/locales/zh-TW/core/documentation-lifecycle.md +2 -1
  381. package/bundled/locales/zh-TW/core/documentation-structure.md +17 -8
  382. package/bundled/locales/zh-TW/core/dual-phase-output.md +28 -90
  383. package/bundled/locales/zh-TW/core/environment-standards.md +250 -72
  384. package/bundled/locales/zh-TW/core/error-code-standards.md +17 -6
  385. package/bundled/locales/zh-TW/core/estimation-standards.md +177 -44
  386. package/bundled/locales/zh-TW/core/execution-history.md +2 -1
  387. package/bundled/locales/zh-TW/core/failure-source-taxonomy.md +59 -117
  388. package/bundled/locales/zh-TW/core/feature-flag-standards.md +202 -57
  389. package/bundled/locales/zh-TW/core/forward-derivation-standards.md +592 -133
  390. package/bundled/locales/zh-TW/core/frontend-design-standards.md +120 -8
  391. package/bundled/locales/zh-TW/core/git-workflow.md +197 -37
  392. package/bundled/locales/zh-TW/core/git-worktree.md +79 -49
  393. package/bundled/locales/zh-TW/core/guides/anti-hallucination-guide.md +234 -487
  394. package/bundled/locales/zh-TW/core/guides/file-placement-guide.md +86 -2
  395. package/bundled/locales/zh-TW/core/guides/git-workflow-guide.md +411 -464
  396. package/bundled/locales/zh-TW/core/guides/performance-guide.md +2 -0
  397. package/bundled/locales/zh-TW/core/guides/refactoring-guide.md +237 -484
  398. package/bundled/locales/zh-TW/core/guides/security-guide.md +2 -0
  399. package/bundled/locales/zh-TW/core/health-check-standards.md +46 -104
  400. package/bundled/locales/zh-TW/core/immutability-first.md +45 -85
  401. package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +2 -1
  402. package/bundled/locales/zh-TW/core/knowledge-transfer-standards.md +103 -40
  403. package/bundled/locales/zh-TW/core/mock-boundary.md +74 -6
  404. package/bundled/locales/zh-TW/core/observability-standards.md +284 -40
  405. package/bundled/locales/zh-TW/core/performance-standards.md +387 -86
  406. package/bundled/locales/zh-TW/core/pipeline-integration-standards.md +2 -1
  407. package/bundled/locales/zh-TW/core/postmortem-standards.md +367 -36
  408. package/bundled/locales/zh-TW/core/privacy-standards.md +153 -46
  409. package/bundled/locales/zh-TW/core/project-context-memory.md +210 -31
  410. package/bundled/locales/zh-TW/core/project-structure.md +240 -19
  411. package/bundled/locales/zh-TW/core/recovery-recipe-registry.md +54 -114
  412. package/bundled/locales/zh-TW/core/refactoring-standards.md +153 -48
  413. package/bundled/locales/zh-TW/core/requirement-engineering.md +8 -37
  414. package/bundled/locales/zh-TW/core/retrospective-standards.md +127 -7
  415. package/bundled/locales/zh-TW/core/retry-standards.md +41 -105
  416. package/bundled/locales/zh-TW/core/reverse-engineering-standards.md +5 -1
  417. package/bundled/locales/zh-TW/core/runbook-standards.md +296 -23
  418. package/bundled/locales/zh-TW/core/secret-management-standards.md +12 -4
  419. package/bundled/locales/zh-TW/core/security-decision.md +43 -84
  420. package/bundled/locales/zh-TW/core/security-standards.md +204 -25
  421. package/bundled/locales/zh-TW/core/self-review-protocol.md +2 -1
  422. package/bundled/locales/zh-TW/core/skill-standard-alignment-check.md +103 -69
  423. package/bundled/locales/zh-TW/core/slo-standards.md +301 -49
  424. package/bundled/locales/zh-TW/core/spec-driven-development.md +36 -7
  425. package/bundled/locales/zh-TW/core/standard-admission-criteria.md +22 -28
  426. package/bundled/locales/zh-TW/core/standard-lifecycle-management.md +40 -48
  427. package/bundled/locales/zh-TW/core/structured-task-definition.md +2 -1
  428. package/bundled/locales/zh-TW/core/supply-chain-security-standards.md +137 -10
  429. package/bundled/locales/zh-TW/core/systematic-debugging.md +94 -38
  430. package/bundled/locales/zh-TW/core/tech-debt-standards.md +170 -54
  431. package/bundled/locales/zh-TW/core/test-completeness-dimensions.md +101 -12
  432. package/bundled/locales/zh-TW/core/test-data-standards.md +245 -23
  433. package/bundled/locales/zh-TW/core/test-driven-development.md +4 -1
  434. package/bundled/locales/zh-TW/core/test-governance.md +92 -32
  435. package/bundled/locales/zh-TW/core/testing-standards.md +61 -14
  436. package/bundled/locales/zh-TW/core/timeout-standards.md +45 -85
  437. package/bundled/locales/zh-TW/core/token-budget.md +41 -112
  438. package/bundled/locales/zh-TW/core/translation-lifecycle-standards.md +28 -16
  439. package/bundled/locales/zh-TW/core/turn-completion-integrity.md +8 -6
  440. package/bundled/locales/zh-TW/core/verification-evidence.md +2 -1
  441. package/bundled/locales/zh-TW/core/versioning.md +6 -2
  442. package/bundled/locales/zh-TW/core/virtual-organization-standards.md +42 -36
  443. package/bundled/locales/zh-TW/core/workflow-enforcement.md +2 -1
  444. package/bundled/locales/zh-TW/core/workflow-state-protocol.md +2 -1
  445. package/bundled/locales/zh-TW/docs/CHEATSHEET.md +2 -1
  446. package/bundled/locales/zh-TW/docs/CLI-FLOW.md +2 -1
  447. package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +12 -3
  448. package/bundled/locales/zh-TW/docs/DEV-WORKFLOW-MAPPING.md +2 -1
  449. package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +8 -6
  450. package/bundled/locales/zh-TW/docs/STANDARDS-REFERENCE.md +2 -1
  451. package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +2 -1
  452. package/bundled/locales/zh-TW/docs/USER-MANUAL.md +9 -1
  453. package/bundled/locales/zh-TW/docs/WINDOWS-GUIDE.md +4 -1
  454. package/bundled/locales/zh-TW/docs/specs/system/memory-adoption-strategy.md +2 -0
  455. package/bundled/locales/zh-TW/docs/user/FAQ.md +2 -0
  456. package/bundled/locales/zh-TW/docs/user/GETTING-STARTED.md +2 -0
  457. package/bundled/locales/zh-TW/docs/user/GLOSSARY.md +2 -0
  458. package/bundled/locales/zh-TW/docs/user/README.md +2 -0
  459. package/bundled/locales/zh-TW/docs/user/TROUBLESHOOTING.md +2 -0
  460. package/bundled/locales/zh-TW/integrations/claude-code/README.md +2 -1
  461. package/bundled/locales/zh-TW/integrations/codex/AGENTS.md +136 -2
  462. package/bundled/locales/zh-TW/integrations/codex/README.md +7 -1
  463. package/bundled/locales/zh-TW/integrations/gemini-cli/GEMINI.md +59 -1
  464. package/bundled/locales/zh-TW/integrations/gemini-cli/README.md +8 -1
  465. package/bundled/locales/zh-TW/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +7 -1
  466. package/bundled/locales/zh-TW/integrations/github-copilot/README.md +9 -3
  467. package/bundled/locales/zh-TW/integrations/github-copilot/copilot-instructions.md +146 -12
  468. package/bundled/locales/zh-TW/integrations/github-copilot/skills-mapping.md +7 -1
  469. package/bundled/locales/zh-TW/integrations/google-antigravity/AGENTS.md +110 -3
  470. package/bundled/locales/zh-TW/integrations/google-antigravity/README.md +7 -1
  471. package/bundled/locales/zh-TW/integrations/opencode/AGENTS.md +140 -2
  472. package/bundled/locales/zh-TW/integrations/opencode/README.md +7 -1
  473. package/bundled/locales/zh-TW/integrations/opencode/skills-mapping.md +8 -2
  474. package/bundled/locales/zh-TW/integrations/openspec/AGENTS.md +46 -1
  475. package/bundled/locales/zh-TW/integrations/openspec/README.md +7 -1
  476. package/bundled/locales/zh-TW/integrations/spec-kit/AGENTS.md +20 -2
  477. package/bundled/locales/zh-TW/integrations/spec-kit/README.md +7 -1
  478. package/bundled/locales/zh-TW/methodologies/guides/tdd-guide.md +584 -475
  479. package/bundled/locales/zh-TW/options/changelog/auto-generated.md +2 -0
  480. package/bundled/locales/zh-TW/options/changelog/keep-a-changelog.md +2 -0
  481. package/bundled/locales/zh-TW/options/code-review/automated-review.md +2 -0
  482. package/bundled/locales/zh-TW/options/code-review/pair-programming.md +2 -0
  483. package/bundled/locales/zh-TW/options/commit-message/bilingual.md +93 -5
  484. package/bundled/locales/zh-TW/options/commit-message/english.md +118 -1
  485. package/bundled/locales/zh-TW/options/commit-message/traditional-chinese.md +82 -1
  486. package/bundled/locales/zh-TW/options/documentation/api-docs.md +2 -0
  487. package/bundled/locales/zh-TW/options/documentation/markdown-docs.md +2 -0
  488. package/bundled/locales/zh-TW/options/documentation/wiki-style.md +2 -0
  489. package/bundled/locales/zh-TW/options/git-workflow/gitflow.md +99 -71
  490. package/bundled/locales/zh-TW/options/git-workflow/github-flow.md +68 -50
  491. package/bundled/locales/zh-TW/options/git-workflow/merge-commit.md +131 -20
  492. package/bundled/locales/zh-TW/options/git-workflow/rebase-ff.md +142 -27
  493. package/bundled/locales/zh-TW/options/git-workflow/squash-merge.md +100 -15
  494. package/bundled/locales/zh-TW/options/git-workflow/trunk-based.md +103 -56
  495. package/bundled/locales/zh-TW/options/project-structure/dotnet.md +233 -14
  496. package/bundled/locales/zh-TW/options/project-structure/go.md +270 -12
  497. package/bundled/locales/zh-TW/options/project-structure/java.md +235 -15
  498. package/bundled/locales/zh-TW/options/project-structure/kotlin.md +2 -0
  499. package/bundled/locales/zh-TW/options/project-structure/nodejs.md +136 -19
  500. package/bundled/locales/zh-TW/options/project-structure/php.md +2 -0
  501. package/bundled/locales/zh-TW/options/project-structure/python.md +177 -19
  502. package/bundled/locales/zh-TW/options/project-structure/ruby.md +2 -0
  503. package/bundled/locales/zh-TW/options/project-structure/rust.md +2 -0
  504. package/bundled/locales/zh-TW/options/project-structure/swift.md +2 -0
  505. package/bundled/locales/zh-TW/options/testing/contract-testing.md +2 -0
  506. package/bundled/locales/zh-TW/options/testing/e2e-testing.md +182 -21
  507. package/bundled/locales/zh-TW/options/testing/industry-pyramid.md +2 -0
  508. package/bundled/locales/zh-TW/options/testing/integration-testing.md +134 -22
  509. package/bundled/locales/zh-TW/options/testing/istqb-framework.md +2 -0
  510. package/bundled/locales/zh-TW/options/testing/performance-testing.md +2 -0
  511. package/bundled/locales/zh-TW/options/testing/security-testing.md +2 -0
  512. package/bundled/locales/zh-TW/options/testing/system-testing.md +175 -1
  513. package/bundled/locales/zh-TW/options/testing/unit-testing.md +123 -9
  514. package/bundled/locales/zh-TW/skills/CONTRIBUTING.template.md +3 -2
  515. package/bundled/locales/zh-TW/skills/INTEGRATION-GUIDE.md +2 -1
  516. package/bundled/locales/zh-TW/skills/README.md +2 -1
  517. package/bundled/locales/zh-TW/skills/_shared/README.md +2 -1
  518. package/bundled/locales/zh-TW/skills/ac-coverage/SKILL.md +15 -4
  519. package/bundled/locales/zh-TW/skills/adr-assistant/guide.md +123 -3
  520. package/bundled/locales/zh-TW/skills/agents/README.md +99 -1
  521. package/bundled/locales/zh-TW/skills/agents/code-architect.md +2 -0
  522. package/bundled/locales/zh-TW/skills/agents/doc-writer.md +2 -0
  523. package/bundled/locales/zh-TW/skills/agents/reviewer.md +3 -1
  524. package/bundled/locales/zh-TW/skills/agents/spec-analyst.md +2 -0
  525. package/bundled/locales/zh-TW/skills/agents/test-specialist.md +2 -0
  526. package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +48 -37
  527. package/bundled/locales/zh-TW/skills/ai-collaboration-standards/anti-hallucination.md +22 -2
  528. package/bundled/locales/zh-TW/skills/ai-collaboration-standards/certainty-labels.md +29 -3
  529. package/bundled/locales/zh-TW/skills/ai-friendly-architecture/SKILL.md +23 -36
  530. package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +12 -36
  531. package/bundled/locales/zh-TW/skills/api-design-assistant/SKILL.md +21 -5
  532. package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +40 -15
  533. package/bundled/locales/zh-TW/skills/atdd-assistant/acceptance-criteria-guide.md +2 -1
  534. package/bundled/locales/zh-TW/skills/atdd-assistant/atdd-workflow.md +98 -1
  535. package/bundled/locales/zh-TW/skills/atdd-assistant/guide.md +24 -8
  536. package/bundled/locales/zh-TW/skills/audit-assistant/SKILL.md +8 -2
  537. package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +29 -6
  538. package/bundled/locales/zh-TW/skills/bdd-assistant/bdd-workflow.md +2 -1
  539. package/bundled/locales/zh-TW/skills/bdd-assistant/gherkin-guide.md +2 -1
  540. package/bundled/locales/zh-TW/skills/bdd-assistant/guide.md +9 -8
  541. package/bundled/locales/zh-TW/skills/changelog-guide/SKILL.md +12 -3
  542. package/bundled/locales/zh-TW/skills/changelog-guide/guide.md +11 -7
  543. package/bundled/locales/zh-TW/skills/checkin-assistant/SKILL.md +19 -3
  544. package/bundled/locales/zh-TW/skills/checkin-assistant/guide.md +5 -3
  545. package/bundled/locales/zh-TW/skills/ci-cd-assistant/SKILL.md +35 -16
  546. package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +19 -2
  547. package/bundled/locales/zh-TW/skills/code-review-assistant/checkin-checklist.md +2 -1
  548. package/bundled/locales/zh-TW/skills/code-review-assistant/guide.md +81 -6
  549. package/bundled/locales/zh-TW/skills/code-review-assistant/review-checklist.md +2 -1
  550. package/bundled/locales/zh-TW/skills/commands/ac-coverage.md +47 -2
  551. package/bundled/locales/zh-TW/skills/commands/api-design.md +3 -2
  552. package/bundled/locales/zh-TW/skills/commands/atdd.md +80 -10
  553. package/bundled/locales/zh-TW/skills/commands/audit.md +3 -2
  554. package/bundled/locales/zh-TW/skills/commands/bdd.md +114 -16
  555. package/bundled/locales/zh-TW/skills/commands/changelog.md +45 -9
  556. package/bundled/locales/zh-TW/skills/commands/check.md +74 -21
  557. package/bundled/locales/zh-TW/skills/commands/checkin.md +56 -11
  558. package/bundled/locales/zh-TW/skills/commands/ci-cd.md +2 -1
  559. package/bundled/locales/zh-TW/skills/commands/code-review.md +43 -2
  560. package/bundled/locales/zh-TW/skills/commands/commit.md +58 -4
  561. package/bundled/locales/zh-TW/skills/commands/config.md +52 -4
  562. package/bundled/locales/zh-TW/skills/commands/coverage.md +45 -4
  563. package/bundled/locales/zh-TW/skills/commands/database.md +3 -2
  564. package/bundled/locales/zh-TW/skills/commands/derive-all.md +44 -2
  565. package/bundled/locales/zh-TW/skills/commands/derive-atdd.md +37 -2
  566. package/bundled/locales/zh-TW/skills/commands/derive-bdd.md +44 -3
  567. package/bundled/locales/zh-TW/skills/commands/derive-tdd.md +45 -3
  568. package/bundled/locales/zh-TW/skills/commands/derive.md +62 -5
  569. package/bundled/locales/zh-TW/skills/commands/dev-workflow.md +60 -9
  570. package/bundled/locales/zh-TW/skills/commands/discover.md +43 -2
  571. package/bundled/locales/zh-TW/skills/commands/docgen.md +39 -2
  572. package/bundled/locales/zh-TW/skills/commands/docs.md +139 -7
  573. package/bundled/locales/zh-TW/skills/commands/durable.md +3 -2
  574. package/bundled/locales/zh-TW/skills/commands/e2e.md +86 -3
  575. package/bundled/locales/zh-TW/skills/commands/guide.md +4 -2
  576. package/bundled/locales/zh-TW/skills/commands/incident.md +3 -2
  577. package/bundled/locales/zh-TW/skills/commands/init.md +72 -15
  578. package/bundled/locales/zh-TW/skills/commands/methodology.md +117 -28
  579. package/bundled/locales/zh-TW/skills/commands/metrics.md +2 -1
  580. package/bundled/locales/zh-TW/skills/commands/migrate.md +2 -1
  581. package/bundled/locales/zh-TW/skills/commands/observability.md +45 -2
  582. package/bundled/locales/zh-TW/skills/commands/pr.md +2 -1
  583. package/bundled/locales/zh-TW/skills/commands/refactor.md +54 -13
  584. package/bundled/locales/zh-TW/skills/commands/release.md +83 -2
  585. package/bundled/locales/zh-TW/skills/commands/requirement.md +41 -2
  586. package/bundled/locales/zh-TW/skills/commands/reverse-bdd.md +37 -2
  587. package/bundled/locales/zh-TW/skills/commands/reverse-sdd.md +45 -2
  588. package/bundled/locales/zh-TW/skills/commands/reverse-tdd.md +43 -2
  589. package/bundled/locales/zh-TW/skills/commands/reverse.md +44 -2
  590. package/bundled/locales/zh-TW/skills/commands/runbook.md +47 -2
  591. package/bundled/locales/zh-TW/skills/commands/scan.md +3 -2
  592. package/bundled/locales/zh-TW/skills/commands/sdd-retro.md +52 -3
  593. package/bundled/locales/zh-TW/skills/commands/sdd.md +209 -28
  594. package/bundled/locales/zh-TW/skills/commands/security.md +3 -2
  595. package/bundled/locales/zh-TW/skills/commands/slo.md +48 -2
  596. package/bundled/locales/zh-TW/skills/commands/tdd.md +71 -2
  597. package/bundled/locales/zh-TW/skills/commands/update.md +64 -2
  598. package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +2 -2
  599. package/bundled/locales/zh-TW/skills/commit-standards/conventional-commits.md +2 -1
  600. package/bundled/locales/zh-TW/skills/commit-standards/guide.md +137 -17
  601. package/bundled/locales/zh-TW/skills/commit-standards/language-options.md +21 -18
  602. package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +2 -2
  603. package/bundled/locales/zh-TW/skills/contract-test-assistant/guide.md +81 -1
  604. package/bundled/locales/zh-TW/skills/database-assistant/SKILL.md +21 -5
  605. package/bundled/locales/zh-TW/skills/deploy-assistant/SKILL.md +2 -1
  606. package/bundled/locales/zh-TW/skills/dev-methodology/SKILL.md +4 -1
  607. package/bundled/locales/zh-TW/skills/dev-methodology/create-methodology.md +2 -0
  608. package/bundled/locales/zh-TW/skills/dev-methodology/runtime.md +2 -0
  609. package/bundled/locales/zh-TW/skills/docs-generator/SKILL.md +19 -2
  610. package/bundled/locales/zh-TW/skills/docs-generator/guide.md +4 -3
  611. package/bundled/locales/zh-TW/skills/documentation-guide/SKILL.md +67 -42
  612. package/bundled/locales/zh-TW/skills/documentation-guide/documentation-structure.md +2 -1
  613. package/bundled/locales/zh-TW/skills/documentation-guide/readme-template.md +2 -1
  614. package/bundled/locales/zh-TW/skills/durable-execution-assistant/SKILL.md +32 -3
  615. package/bundled/locales/zh-TW/skills/e2e-assistant/SKILL.md +25 -7
  616. package/bundled/locales/zh-TW/skills/error-code-guide/SKILL.md +17 -34
  617. package/bundled/locales/zh-TW/skills/git-workflow-guide/SKILL.md +33 -38
  618. package/bundled/locales/zh-TW/skills/git-workflow-guide/branch-naming.md +2 -1
  619. package/bundled/locales/zh-TW/skills/git-workflow-guide/git-workflow.md +2 -1
  620. package/bundled/locales/zh-TW/skills/incident-response-assistant/SKILL.md +35 -14
  621. package/bundled/locales/zh-TW/skills/journey-test-assistant/SKILL.md +2 -14
  622. package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +6 -2
  623. package/bundled/locales/zh-TW/skills/metrics-dashboard-assistant/SKILL.md +42 -3
  624. package/bundled/locales/zh-TW/skills/observability-assistant/SKILL.md +85 -18
  625. package/bundled/locales/zh-TW/skills/pr-automation-assistant/SKILL.md +27 -3
  626. package/bundled/locales/zh-TW/skills/project-discovery/SKILL.md +11 -3
  627. package/bundled/locales/zh-TW/skills/project-discovery/guide.md +5 -3
  628. package/bundled/locales/zh-TW/skills/project-discovery/workflow.md +2 -1
  629. package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +19 -16
  630. package/bundled/locales/zh-TW/skills/project-structure-guide/language-patterns.md +2 -1
  631. package/bundled/locales/zh-TW/skills/refactoring-assistant/SKILL.md +26 -3
  632. package/bundled/locales/zh-TW/skills/refactoring-assistant/guide.md +4 -2
  633. package/bundled/locales/zh-TW/skills/release-standards/SKILL.md +91 -45
  634. package/bundled/locales/zh-TW/skills/release-standards/changelog-format.md +4 -3
  635. package/bundled/locales/zh-TW/skills/release-standards/guide.md +14 -5
  636. package/bundled/locales/zh-TW/skills/release-standards/release-workflow.md +5 -1
  637. package/bundled/locales/zh-TW/skills/release-standards/semantic-versioning.md +2 -1
  638. package/bundled/locales/zh-TW/skills/requirement-assistant/SKILL.md +15 -6
  639. package/bundled/locales/zh-TW/skills/requirement-assistant/guide.md +18 -8
  640. package/bundled/locales/zh-TW/skills/requirement-assistant/requirement-checklist.md +2 -1
  641. package/bundled/locales/zh-TW/skills/requirement-assistant/requirement-writing.md +2 -1
  642. package/bundled/locales/zh-TW/skills/retrospective-assistant/guide.md +200 -6
  643. package/bundled/locales/zh-TW/skills/reverse-engineer/bdd-extraction.md +2 -1
  644. package/bundled/locales/zh-TW/skills/reverse-engineer/guide.md +161 -36
  645. package/bundled/locales/zh-TW/skills/reverse-engineer/tdd-analysis.md +2 -1
  646. package/bundled/locales/zh-TW/skills/reverse-engineer/workflow.md +2 -1
  647. package/bundled/locales/zh-TW/skills/runbook-assistant/SKILL.md +9 -1
  648. package/bundled/locales/zh-TW/skills/security-assistant/SKILL.md +25 -5
  649. package/bundled/locales/zh-TW/skills/security-scan-assistant/SKILL.md +34 -8
  650. package/bundled/locales/zh-TW/skills/skill-builder/SKILL.md +3 -21
  651. package/bundled/locales/zh-TW/skills/slo-assistant/SKILL.md +3 -1
  652. package/bundled/locales/zh-TW/skills/spec-derivation/SKILL.md +2 -1
  653. package/bundled/locales/zh-TW/skills/spec-driven-dev/guide.md +35 -2
  654. package/bundled/locales/zh-TW/skills/sweep/SKILL.md +2 -1
  655. package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +10 -2
  656. package/bundled/locales/zh-TW/skills/tdd-assistant/guide.md +68 -9
  657. package/bundled/locales/zh-TW/skills/tdd-assistant/language-examples.md +693 -47
  658. package/bundled/locales/zh-TW/skills/tdd-assistant/tdd-workflow.md +183 -1
  659. package/bundled/locales/zh-TW/skills/test-coverage-assistant/SKILL.md +15 -5
  660. package/bundled/locales/zh-TW/skills/test-coverage-assistant/guide.md +26 -13
  661. package/bundled/locales/zh-TW/skills/testing-guide/testing-pyramid.md +2 -1
  662. package/bundled/locales/zh-TW/skills/testing-guide/testing-theory.md +3 -1
  663. package/bundled/locales/zh-TW/skills/tools/cline/README.md +2 -1
  664. package/bundled/locales/zh-TW/skills/tools/copilot/README.md +65 -18
  665. package/bundled/locales/zh-TW/skills/tools/copilot/copilot-instructions.md +2 -1
  666. package/bundled/locales/zh-TW/skills/tools/cursor/README.md +2 -1
  667. package/bundled/locales/zh-TW/skills/tools/windsurf/README.md +2 -1
  668. package/bundled/locales/zh-TW/skills/workflows/README.md +11 -9
  669. package/bundled/locales/zh-TW/templates/reverse-spec-template.md +50 -1
  670. package/bundled/skills/.claude-plugin/plugin.json +71 -0
  671. package/bundled/skills/commit-standards/SKILL.md +2 -2
  672. package/bundled/skills/commit-standards/guide.md +3 -2
  673. package/bundled/skills/commit-standards/language-options.md +19 -17
  674. package/package.json +2 -2
  675. package/src/commands/audit.js +28 -1
  676. package/src/commands/check.js +72 -3
  677. package/src/commands/compile.js +37 -4
  678. package/src/commands/config.js +49 -24
  679. package/src/commands/init.js +78 -30
  680. package/src/commands/open-work.js +6 -2
  681. package/src/commands/release-messages.js +228 -0
  682. package/src/commands/release.js +127 -68
  683. package/src/commands/run-intent.js +11 -0
  684. package/src/commands/spec.js +4 -2
  685. package/src/commands/update.js +227 -47
  686. package/src/compilers/claude-code-compiler.js +9 -1
  687. package/src/config/ai-agent-paths.js +14 -1
  688. package/src/core/installed-formats.js +15 -0
  689. package/src/core/open-work-config.js +20 -1
  690. package/src/core/project-config.js +55 -0
  691. package/src/i18n/messages.js +106 -2
  692. package/src/installers/hooks-installer.js +1 -1
  693. package/src/installers/manifest-installer.js +1 -1
  694. package/src/installers/skills-installer.js +1 -1
  695. package/src/installers/standards-installer.js +3 -1
  696. package/src/mcp/server.js +9 -3
  697. package/src/prompts/init.js +26 -22
  698. package/src/reconciler/actual-state-scanner.js +2 -8
  699. package/src/reconciler/backup-locations.js +5 -0
  700. package/src/reconciler/backup-manager.js +19 -11
  701. package/src/reconciler/desired-state-calculator.js +89 -57
  702. package/src/reconciler/plan-executor.js +101 -8
  703. package/src/reconciler/recorded-versions.js +49 -0
  704. package/src/reconciler/relative-path.js +23 -0
  705. package/src/uninstallers/hook-uninstaller.js +9 -1
  706. package/src/uninstallers/skills-uninstaller.js +22 -3
  707. package/src/utils/available-standards-report.js +25 -4
  708. package/src/utils/available-standards.js +13 -3
  709. package/src/utils/build-manifest.js +1 -1
  710. package/src/utils/commit-message-judge.js +60 -13
  711. package/src/utils/friction-detector.js +23 -11
  712. package/src/utils/git-hooks.js +106 -4
  713. package/src/utils/integration-generator.js +95 -67
  714. package/src/utils/legacy-hook-migration.js +121 -2
  715. package/src/utils/open-work-tracking.mjs +105 -16
  716. package/src/utils/sdd-header.js +16 -4
  717. package/src/utils/skills-installer.js +2 -1
  718. package/src/utils/spinner.js +14 -4
  719. package/src/utils/standard-validator.js +3 -2
  720. package/standards-registry.json +10 -8
  721. package/bundled/locales/zh-TW/core/guides/testing-guide.md +0 -2280
@@ -1,152 +1,77 @@
1
1
  ---
2
- source: ../../core/refactoring-standards.md
3
- source_version: 2.0.0
4
- translation_version: 2.0.0
5
- last_synced: 2026-01-21
2
+ source: ../../../../core/guides/refactoring-guide.md
3
+ source_version: 1.0.0
4
+ translation_version: 1.0.0
5
+ last_synced: 2026-10-16
6
+ source_hash: a34c3eab7aca
6
7
  status: current
7
8
  ---
8
9
 
9
- # 重構標準
10
+ # 重構指南
10
11
 
11
- > **語言**: [English](../../../../core/refactoring-standards.md) | 繁體中文
12
+ > **語言**: [English](../../../../core/guides/refactoring-guide.md) | 繁體中文
12
13
 
13
- **版本**: 2.0.0
14
- **最後更新**: 2026-01-21
15
- **適用範圍**: 所有進行程式碼改善的軟體專案
14
+ **版本**: 1.0.0
15
+ **最後更新**: 2026-01-29
16
+ **相關標準**: [重構標準](../refactoring-standards.md)
16
17
 
17
18
  ---
18
19
 
19
20
  ## 目的
20
21
 
21
- 本標準定義程式碼重構的完整指引,涵蓋從日常 TDD 重構循環到大型遺留系統現代化的所有場景。確保重構工作安全、可衡量,並與業務目標一致。
22
-
23
- **主要優點**:
24
- - 系統化的程式碼品質改善方法
25
- - 降低重構過程中引入錯誤的風險
26
- - 清晰的重構 vs 重寫決策框架
27
- - 可衡量的成果與投資報酬率追蹤
22
+ 本指南提供程式碼重構的詳細說明、模式與教學。有關可執行的規則、檢查清單與門檻值,請參見[重構標準](../refactoring-standards.md)。
28
23
 
29
24
  ---
30
25
 
31
26
  ## 目錄
32
27
 
33
- 1. [重構 vs 重寫決策矩陣](#重構-vs-重寫決策矩陣)
34
- 2. [戰術性重構策略](#戰術性重構策略)
35
- - [預備性重構](#預備性重構)
36
- - [童子軍規則](#童子軍規則)
37
- - [紅-綠-重構](#紅-綠-重構)
38
- 3. [戰略性重構策略](#戰略性重構策略)
39
- - [絞殺榕模式](#絞殺榕模式)
40
- - [防腐層](#防腐層)
41
- - [抽象分支](#抽象分支)
42
- - [平行變更](#平行變更expand-migrate-contract)
43
- 4. [遺留程式碼安全策略](#遺留程式碼安全策略)
44
- - [特徵測試](#特徵測試)
45
- - [探針式重構](#探針式重構)
46
- - [尋找接縫](#尋找接縫)
47
- - [Sprout 與 Wrap 技術](#sprout-與-wrap-技術)
48
- 5. [資料庫重構](#資料庫重構)
49
- 6. [安全重構工作流程](#安全重構工作流程)
50
- 7. [重構度量指標](#重構度量指標)
51
- 8. [團隊協作](#團隊協作)
52
- 9. [技術債管理](#技術債管理)
53
- 10. [決策矩陣摘要](#決策矩陣摘要)
54
- 11. [相關標準](#相關標準)
55
- 12. [參考資料](#參考資料)
56
- 13. [版本歷程](#版本歷程)
57
-
58
- ---
59
-
60
- ## 重構 vs 重寫決策矩陣
61
-
62
- 在開始任何大型重構工作之前,評估重構或重寫哪個更合適。
63
-
64
- ### 決策流程圖
65
-
66
- ```
67
- ┌─────────────────────────────────────────────────────────────────┐
68
- │ 重構 vs 重寫決策樹 │
69
- ├─────────────────────────────────────────────────────────────────┤
70
- │ │
71
- │ 程式碼目前在生產環境運行嗎? │
72
- │ ├─ 否 → 考慮重寫(風險較低) │
73
- │ └─ 是 ↓ │
74
- │ │
75
- │ 你了解程式碼在做什麼嗎? │
76
- │ ├─ 否 → 先寫特徵測試,再決定 │
77
- │ └─ 是 ↓ │
78
- │ │
79
- │ 測試覆蓋率足夠嗎(>60%)? │
80
- │ ├─ 否 → 先補測試,再決定 │
81
- │ └─ 是 ↓ │
82
- │ │
83
- │ 核心架構可以保留嗎? │
84
- │ ├─ 否 → Strangler Fig(漸進替換) │
85
- │ └─ 是 → 漸進式重構 ✓ │
86
- │ │
87
- └─────────────────────────────────────────────────────────────────┘
88
- ```
89
-
90
- ### 比較矩陣
91
-
92
- | 因素 | 傾向重構 | 傾向重寫 |
93
- |------|---------|---------|
94
- | **程式碼規模** | 大型、複雜 | 小型、獨立 |
95
- | **測試覆蓋率** | 良好(>60%)| 差或沒有 |
96
- | **業務連續性** | 關鍵 | 可容忍停機 |
97
- | **團隊知識** | 團隊理解程式碼 | 無組織知識 |
98
- | **核心架構** | 健全,只是混亂 | 根本性缺陷 |
99
- | **時間壓力** | 緊迫期限 | 彈性時間 |
100
- | **風險容忍度** | 低 | 較高 |
101
-
102
- ### 警告:第二系統效應
103
-
104
- > 「第二個系統是一個人設計過最危險的系統。」— Fred Brooks
105
-
106
- 重寫時,團隊常常過度工程化。避免:
107
- - 新增原本沒有的功能
108
- - 「為了未來彈性」過度抽象
109
- - 忽視現有系統的教訓
28
+ 1. [戰術性重構策略](#tactical-refactoring-strategies)
29
+ 2. [戰略性重構策略](#strategic-refactoring-strategies)
30
+ 3. [遺留程式碼安全策略](#safety-strategies-for-legacy-code)
31
+ 4. [資料庫重構模式](#database-refactoring-patterns)
32
+ 5. [團隊協作實踐](#team-collaboration-practices)
33
+ 6. [技術債管理](#technical-debt-management)
34
+ 7. [參考資料](#references)
110
35
 
111
36
  ---
112
37
 
113
38
  ## 戰術性重構策略
114
39
 
115
- 戰術性策略用於日常開發工作。運作時間為分鐘到小時級別,需要最小的協調。
40
+ 戰術性策略應用於日常開發工作。它們在分鐘至小時級別的時間尺度上運作,且僅需最少的協調。
116
41
 
117
42
  ### 預備性重構
118
43
 
119
- **定義**:在新增功能之前,先調整既有結構,使其易於接納新功能。
44
+ **定義**:重構現有程式碼,使即將進行的變更更容易實作。
120
45
 
121
46
  > 「先把改變變容易(這可能很難),然後再做那個容易的改變。」— Kent Beck
122
47
 
123
48
  **適用情境**:
124
- - 現有架構難以直接插入新功能
125
- - 程式碼結構需要調整以支援新需求
126
- - 降低即將到來的變更的阻力
49
+ - 現有架構難以容納你要新增的功能
50
+ - 程式碼結構需要調整以適應新需求
51
+ - 你希望減少後續變更的阻力
127
52
 
128
53
  **工作流程**:
129
54
 
130
55
  ```
131
- 1. 識別你想要做的改變
132
- 2. 識別是什麼讓這個改變變困難
133
- 3. 重構以讓改變變容易
134
- 4. 做那個(現在已經變容易的)改變
56
+ 1. Identify the change you want to make
57
+ 2. Identify what makes this change difficult
58
+ 3. Refactor to make the change easy
59
+ 4. Make the (now easy) change
135
60
  ```
136
61
 
137
62
  **範例**:
138
- - 改變前:為一個緊耦合的服務加入快取很複雜
139
- - 預備性重構:抽取介面、注入依賴
140
- - 改變後:加入快取變得簡單直接
63
+ - 變更前:為緊密耦合的服務新增快取非常複雜
64
+ - 預備性重構:提取介面、注入依賴
65
+ - 變更後:新增快取變得簡單直接
141
66
 
142
67
  **關鍵原則**:
143
- - 預備性重構是與功能分開的提交
68
+ - 預備性重構是與功能分開的獨立提交
144
69
  - 每一步都維持測試通過
145
70
  - 不要在同一個提交中混合重構與功能開發
146
71
 
147
72
  ### 童子軍規則
148
73
 
149
- **定義**:離開時讓程式碼比你來的時候更乾淨。這是一種「機會主義重構」— 不刻意安排重構衝刺,而是在修復 Bug 或新增功能時,順手清理所接觸到的程式碼。
74
+ **定義**:離開時讓程式碼比你發現它時更乾淨。這是一種「機會主義重構」— 不刻意安排重構衝刺,而是在修復 Bug 或新增功能時,順手清理所接觸到的程式碼。
150
75
 
151
76
  > 「離開營地時,讓它比你來的時候更乾淨。」— Robert C. Martin
152
77
 
@@ -154,20 +79,20 @@ status: current
154
79
  - 任何維護作業
155
80
  - Bug 修復
156
81
  - 功能新增
157
- - 對抗軟體熵(Software Entropy)
82
+ - 對抗軟體熵(software entropy)
158
83
 
159
84
  **指導原則**:
160
- - 只做小改進(分鐘,不是小時)
85
+ - 只做小改進(數分鐘,而非數小時)
161
86
  - 不可改變行為
162
87
  - 不可破壞現有測試
163
- - 改動範圍保持在你的任務內
88
+ - 改動範圍保持在當前任務之內
164
89
 
165
90
  **童子軍改進的範例**:
166
- - 重新命名一個令人困惑的變數
91
+ - 重新命名令人困惑的變數
167
92
  - 將幾行程式碼提取為命名良好的方法
168
93
  - 移除你注意到的死程式碼
169
94
  - 加入澄清註解
170
- - 修復一個小的程式碼風格問題
95
+ - 修復微小的程式碼風格問題
171
96
 
172
97
  **應避免的反模式**:
173
98
  - 把 Bug 修復變成大規模重構專案
@@ -177,12 +102,12 @@ status: current
177
102
 
178
103
  ### 紅-綠-重構
179
104
 
180
- 測試驅動開發(TDD)循環的一部分。完整細節請見[測試驅動開發](../test-driven-development.md)。
105
+ 測試驅動開發(TDD)循環的一部分。完整細節請參見[測試驅動開發](../test-driven-development.md)。
181
106
 
182
107
  **特點**:
183
108
  - 時長:每循環 5-15 分鐘
184
109
  - 範圍:單一方法或類別
185
- - 測試:重構後必須保持綠色
110
+ - 測試:重構後必須保持綠燈
186
111
 
187
112
  **循環**:
188
113
 
@@ -190,7 +115,7 @@ status: current
190
115
  ┌─────────────────────────────────────────┐
191
116
  │ │
192
117
  │ ┌─────┐ ┌─────┐ ┌─────────┐ │
193
- │ │ 紅燈│ ──► │綠燈 │ ──► │ 重構 │ │
118
+ │ │ RED │ ──► │GREEN│ ──► │REFACTOR │ │
194
119
  │ └─────┘ └─────┘ └─────────┘ │
195
120
  │ ▲ │ │
196
121
  │ └──────────────────────────┘ │
@@ -198,7 +123,7 @@ status: current
198
123
  └─────────────────────────────────────────┘
199
124
  ```
200
125
 
201
- **常用重構技術**:
126
+ **常見重構技術**:
202
127
  - 提取方法(Extract Method)
203
128
  - 重新命名(Rename)
204
129
  - 內聯變數(Inline Variable)
@@ -213,9 +138,9 @@ status: current
213
138
 
214
139
  ### 絞殺榕模式
215
140
 
216
- **定義**:透過逐步將功能路由到新系統,漸進替換遺留系統。
141
+ **定義**:透過逐步將功能路由至新系統,漸進替換遺留系統。
217
142
 
218
- **來源**:命名自絞殺榕樹,它們環繞宿主樹生長,最終取代它。
143
+ **來源**:得名於絞殺榕樹,它們環繞宿主樹生長,最終取代它。
219
144
 
220
145
  **適用情境**:
221
146
  - 漸進替換遺留系統
@@ -226,58 +151,58 @@ status: current
226
151
 
227
152
  ```
228
153
  ┌─────────────────────────────────────────────────────────────────┐
229
- │ 絞殺榕模式 (Strangler Fig) │
154
+ │ Strangler Fig Pattern │
230
155
  ├─────────────────────────────────────────────────────────────────┤
231
156
  │ │
232
- │ 階段 1: 攔截(INTERCEPT) │
157
+ │ Phase 1: INTERCEPT │
233
158
  │ ┌─────────┐ ┌─────────┐ ┌─────────────┐ │
234
- │ │ 請求 │────▶│ 門面 │────▶│ 舊系統(100%)│ │
159
+ │ │ Request │────▶│ Facade │────▶│ Legacy (100%)│ │
235
160
  │ └─────────┘ └─────────┘ └─────────────┘ │
236
161
  │ │
237
- │ 階段 2: 遷移(MIGRATE) │
162
+ │ Phase 2: MIGRATE │
238
163
  │ ┌─────────┐ ┌─────────┐ ┌─────────────┐ │
239
- │ │ 請求 │────▶│ 門面 │──┬─▶│ 新系統(功能A)│ │
164
+ │ │ Request │────▶│ Facade │──┬─▶│ New (Feature A)│ │
240
165
  │ └─────────┘ └─────────┘ │ └─────────────┘ │
241
- │ └─▶│ 舊系統(其餘) │ │
166
+ │ └─▶│ Legacy (Rest) │ │
242
167
  │ └─────────────┘ │
243
168
  │ │
244
- │ 階段 3: 完成(COMPLETE) │
169
+ │ Phase 3: COMPLETE │
245
170
  │ ┌─────────┐ ┌─────────────┐ │
246
- │ │ 請求 │────▶│ 新系統(100%)│ [舊系統已下線] │
171
+ │ │ Request │────▶│ New (100%) │ [Legacy decommissioned] │
247
172
  │ └─────────┘ └─────────────┘ │
248
173
  │ │
249
174
  └─────────────────────────────────────────────────────────────────┘
250
175
  ```
251
176
 
252
- **檢查清單**:
177
+ **實作檢查清單**:
253
178
  - [ ] 識別攔截點(API 閘道、門面、代理)
254
179
  - [ ] 建立事件捕獲層
255
180
  - [ ] 在新系統中實作第一個功能
256
181
  - [ ] 漸進式路由流量
257
182
  - [ ] 監控並比較結果
258
- - [ ] 下線舊元件
183
+ - [ ] 下線遺留元件
259
184
 
260
185
  ### 防腐層
261
186
 
262
- **定義**:在遺留系統與新系統之間建立的翻譯層,防止遺留系統混亂的領域模型「污染」新系統的整潔架構。
187
+ **定義**:在遺留系統與新系統之間的翻譯層,防止遺留系統混亂的領域模型「污染」新系統的整潔架構。
263
188
 
264
- **來源**:Eric Evans,《領域驅動設計》(2003)
189
+ **來源**:Eric Evans, Domain-Driven Design (2003)
265
190
 
266
191
  **適用情境**:
267
192
  - 新舊系統必須並存且頻繁互動
268
- - 遺留系統有複雜/混亂的領域模型
193
+ - 遺留系統有複雜/混亂的領域模型
269
194
  - 保護新系統的限界上下文(Bounded Context)
270
195
 
271
196
  **架構**:
272
197
 
273
198
  ```
274
199
  ┌────────────────────────────────────────────────────────────┐
275
- │ 防腐層 (ACL) │
200
+ │ Anti-Corruption Layer (ACL) │
276
201
  ├────────────────────────────────────────────────────────────┤
277
202
  │ │
278
203
  │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │
279
- │ │ 新系統 │────▶│ ACL │────▶│ 遺留系統 │ │
280
- │ │ (整潔 API) │ │ │ │(混亂模型) │ │
204
+ │ │ New System │────▶│ ACL │────▶│Legacy System│ │
205
+ │ │ (Clean API) │ │ │ │(Messy Model)│ │
281
206
  │ └─────────────┘ │ ┌─────────┐ │ └─────────────┘ │
282
207
  │ │ │ Adapter │ │ │
283
208
  │ │ │ Facade │ │ │
@@ -291,14 +216,14 @@ status: current
291
216
  **組件**:
292
217
 
293
218
  | 組件 | 用途 |
294
- |------|------|
295
- | **Facade(門面)** | 簡化複雜的遺留介面 |
296
- | **Adapter(轉接器)** | 將遺留資料格式轉換為新領域模型 |
297
- | **Translator(翻譯器)** | 將遺留術語映射到通用語言 |
219
+ |-----------|---------|
220
+ | **Facade** | 簡化複雜的遺留介面 |
221
+ | **Adapter** | 將遺留資料格式轉換為新領域模型 |
222
+ | **Translator** | 將遺留術語映射到通用語言 |
298
223
 
299
224
  **實作檢查清單**:
300
225
  - [ ] 定義 ACL 的清晰介面
301
- - [ ] 映射遺留實體到新領域模型
226
+ - [ ] 將遺留實體映射至新領域模型
302
227
  - [ ] 處理資料格式轉換
303
228
  - [ ] 實作錯誤翻譯
304
229
  - [ ] 加入日誌以便除錯
@@ -307,43 +232,43 @@ status: current
307
232
  **與絞殺榕的比較**:
308
233
 
309
234
  | 面向 | 絞殺榕 | 防腐層 |
310
- |------|--------|--------|
235
+ |--------|---------------|----------------------|
311
236
  | **目標** | 取代遺留系統 | 與遺留系統共存 |
312
- | **方向** | 遷移離開遺留 | 整合遺留 |
237
+ | **方向** | 遷移離開遺留系統 | 與遺留系統整合 |
313
238
  | **最終狀態** | 遺留系統下線 | 兩個系統繼續運作 |
314
239
 
315
240
  ### 抽象分支
316
241
 
317
- **定義**:透過引入抽象層,在不使用長期分支的情況下重構共享程式碼。
242
+ **定義**:透過引入抽象層,在不使用長期分支的情況下重構共用程式碼。
318
243
 
319
244
  **適用情境**:
320
- - 在不用長期分支的情況下重構共享程式碼
321
- - 需要主幹開發
322
- - 變更風險太高,無法單一提交
245
+ - 在不使用長期分支的情況下重構共用程式碼
246
+ - 需要基於主幹的開發(trunk-based development)
247
+ - 變更風險過高,無法以單一 commit 完成
323
248
 
324
249
  **步驟**:
325
250
 
326
251
  ```
327
- 步驟 1:引入抽象
328
- 客戶端 → 抽象(介面)→ 舊實作
252
+ Step 1: Introduce Abstraction
253
+ Client → Abstraction (interface) → Old Implementation
329
254
 
330
- 步驟 2:新增新實作
331
- 客戶端 → 抽象 → 舊實作
332
- └─→ 新實作(功能開關控制)
255
+ Step 2: Add New Implementation
256
+ Client → Abstraction → Old Implementation
257
+ └─→ New Implementation (feature-toggled)
333
258
 
334
- 步驟 3:切換並移除
335
- 客戶端 → 新實作
336
- [舊實作已移除]
259
+ Step 3: Switch and Remove
260
+ Client → New Implementation
261
+ [Old Implementation removed]
337
262
  ```
338
263
 
339
264
  **關鍵原則**:
340
- - 所有變更在主幹(trunk)上(沒有長期分支)
341
- - 功能開關控制哪個實作是活躍的
342
- - 兩個實作可以在過渡期共存
265
+ - 所有變更皆在 main/trunk 上(無長期分支)
266
+ - 功能開關(feature toggles)控制哪個實作生效
267
+ - 兩個實作可以在過渡期間共存
343
268
 
344
269
  ### 平行變更(Expand-Migrate-Contract)
345
270
 
346
- **定義**:透過三階段方法變更被多個客戶端使用的介面。
271
+ **定義**:透過三階段方法變更由多個客戶端使用的介面。
347
272
 
348
273
  **適用情境**:
349
274
  - 變更多個客戶端使用的介面
@@ -353,20 +278,20 @@ status: current
353
278
  **階段**:
354
279
 
355
280
  ```
356
- 階段 1: 擴展(EXPAND)
357
- ├─ 在舊的旁邊新增新欄位/方法
358
- ├─ 新程式碼使用新介面
359
- └─ 舊程式碼仍然運作
360
-
361
- 階段 2: 遷移(MIGRATE)
362
- ├─ 更新所有客戶端使用新介面
363
- ├─ 驗證所有客戶端已遷移
364
- └─ 資料遷移(如需要)
365
-
366
- 階段 3: 收縮(CONTRACT)
367
- ├─ 移除舊欄位/方法
368
- ├─ 清理遷移程式碼
369
- └─ 更新文件
281
+ Phase 1: EXPAND
282
+ ├─ Add new field/method alongside old
283
+ ├─ New code uses new interface
284
+ └─ Old code still works
285
+
286
+ Phase 2: MIGRATE
287
+ ├─ Update all clients to use new interface
288
+ ├─ Verify all clients migrated
289
+ └─ Data migration (if needed)
290
+
291
+ Phase 3: CONTRACT
292
+ ├─ Remove old field/method
293
+ ├─ Clean up migration code
294
+ └─ Update documentation
370
295
  ```
371
296
 
372
297
  ---
@@ -395,26 +320,26 @@ status: current
395
320
  **流程**:
396
321
 
397
322
  ```
398
- 1. 呼叫你想了解的程式碼
399
- 2. 寫一個你預期會失敗的斷言
400
- 3. 執行測試看實際發生什麼
401
- 4. 更新斷言以符合實際行為
402
- 5. 重複直到覆蓋你需要修改的行為
323
+ 1. Call the code you want to understand
324
+ 2. Write an assertion you expect to FAIL
325
+ 3. Run the test and see what actually happens
326
+ 4. Update the assertion to match actual behavior
327
+ 5. Repeat until you've covered the behavior you need to change
403
328
  ```
404
329
 
405
330
  **範例**:
406
331
 
407
332
  ```javascript
408
- // 步驟 1:初始(預期會失敗)
409
- test('calculateDiscount 回傳... 某個值', () => {
333
+ // Step 1: Initial (expected to fail)
334
+ test('calculateDiscount returns... something', () => {
410
335
  const result = calculateDiscount(100, 'GOLD');
411
- expect(result).toBe(0); // 猜測 - 可能會失敗
336
+ expect(result).toBe(0); // Guess - will probably fail
412
337
  });
413
338
 
414
- // 步驟 2:執行後,更新為實際值
415
- test('calculateDiscount 對 GOLD 客戶回傳 15', () => {
339
+ // Step 2: After running, update with actual value
340
+ test('calculateDiscount returns 15 for GOLD customers', () => {
416
341
  const result = calculateDiscount(100, 'GOLD');
417
- expect(result).toBe(15); // 實際行為
342
+ expect(result).toBe(15); // Actual behavior
418
343
  });
419
344
  ```
420
345
 
@@ -429,11 +354,11 @@ test('calculateDiscount 對 GOLD 客戶回傳 15', () => {
429
354
  **工作流程**:
430
355
 
431
356
  ```
432
- 1. 建立探針分支(或使用 git stash)
433
- 2. 大膽重構以理解程式碼
434
- 3. 記錄學到的內容
435
- 4. 捨棄所有變更(git reset --hard)
436
- 5. 將學習成果應用於撰寫特徵測試
357
+ 1. Create a scratch branch (or use git stash)
358
+ 2. Aggressively refactor to understand the code
359
+ 3. Take notes on what you learn
360
+ 4. Discard all changes (git reset --hard)
361
+ 5. Apply learnings to write characterization tests
437
362
  ```
438
363
 
439
364
  **適用情境**:
@@ -448,7 +373,7 @@ test('calculateDiscount 對 GOLD 客戶回傳 15', () => {
448
373
  **定義**:接縫是可以在不編輯程式碼的情況下改變行為的地方。
449
374
 
450
375
  | 接縫類型 | 運作方式 | 範例 |
451
- |---------|---------|------|
376
+ |----------|--------------|---------|
452
377
  | **物件接縫** | 透過多型覆寫 | 透過介面注入測試替身 |
453
378
  | **預處理接縫** | 編譯時替換 | 條件編譯、巨集 |
454
379
  | **連結接縫** | 連結時替換 | 依賴注入、模組替換 |
@@ -458,7 +383,7 @@ test('calculateDiscount 對 GOLD 客戶回傳 15', () => {
458
383
  ### Sprout 與 Wrap 技術
459
384
 
460
385
  | 技術 | 使用時機 | 做法 |
461
- |-----|---------|-----|
386
+ |-----------|-------------|-----|
462
387
  | **Sprout Method** | 在現有方法中加入新邏輯 | 建立新方法,從舊方法呼叫 |
463
388
  | **Sprout Class** | 新邏輯需要獨立演進 | 建立新類別,從舊程式碼參照 |
464
389
  | **Wrap Method** | 需要在前後加入行為 | 重命名原方法,建立包裝器 |
@@ -471,52 +396,52 @@ test('calculateDiscount 對 GOLD 客戶回傳 15', () => {
471
396
  理解無文件程式碼的技術:
472
397
 
473
398
  ```
474
- 1. 探針式重構(見上方)
475
- ├─ 重構以理解,不是保留
476
- ├─ 使用 git stash 或分支
477
- └─ 完成後捨棄(git reset --hard)
478
-
479
- 2. 追蹤變數流動
480
- ├─ 從輸入追蹤到輸出
481
- ├─ 標記關鍵轉換點
482
- └─ 邊發現邊記錄
483
-
484
- 3. 執行時觀察
485
- ├─ 加入暫時性日誌
486
- ├─ 使用除錯器逐步執行
487
- └─ 建立心智模型
488
-
489
- 4. Git 考古
490
- ├─ git log -p <file>(查看所有變更)
491
- ├─ git blame(找到原作者)
492
- └─ 搜尋提交訊息找脈絡
399
+ 1. Scratch Refactoring (see above)
400
+ ├─ Refactor to understand, not to keep
401
+ ├─ Use git stash or branch
402
+ └─ Discard when done (git reset --hard)
403
+
404
+ 2. Trace Variable Flow
405
+ ├─ Follow data from input to output
406
+ ├─ Mark key transformation points
407
+ └─ Document as you discover
408
+
409
+ 3. Runtime Observation
410
+ ├─ Add temporary logging
411
+ ├─ Use debugger step-through
412
+ └─ Build mental model
413
+
414
+ 4. Git Archaeology
415
+ ├─ git log -p <file> (see all changes)
416
+ ├─ git blame (find original author)
417
+ └─ Search commit messages for context
493
418
  ```
494
419
 
495
420
  ---
496
421
 
497
- ## 資料庫重構
422
+ ## 資料庫重構模式
498
423
 
499
424
  ### Schema 變更的 Expand-Contract 模式
500
425
 
501
426
  ```
502
427
  ┌─────────────────────────────────────────────────────────────────┐
503
- │ 資料庫重構(Expand-Contract) │
428
+ │ Database Refactoring (Expand-Contract) │
504
429
  ├─────────────────────────────────────────────────────────────────┤
505
430
  │ │
506
- │ 階段 1: 擴展(新增新的,保留舊的) │
507
- │ ├─ 新增新欄位/表 │
508
- │ ├─ 應用程式同時寫入新舊 │
509
- │ └─ 此時可安全回滾 │
431
+ │ Phase 1: EXPAND (Add new, keep old) │
432
+ │ ├─ Add new column/table │
433
+ │ ├─ Application writes to BOTH old and new │
434
+ │ └─ Safe to rollback at this point │
510
435
  │ │
511
- │ 階段 2: 遷移(搬移資料) │
512
- │ ├─ 從舊複製資料到新 │
513
- │ ├─ 驗證資料一致性 │
514
- │ └─ 應用程式開始從新讀取 │
436
+ │ Phase 2: MIGRATE (Move data) │
437
+ │ ├─ Copy data from old to new │
438
+ │ ├─ Verify data consistency │
439
+ │ └─ Application starts reading from new │
515
440
  │ │
516
- │ 階段 3: 收縮(移除舊的) │
517
- │ ├─ 確認舊欄位/表不再被讀取 │
518
- │ ├─ 移除舊欄位/表 │
519
- │ └─ 清理雙寫程式碼 │
441
+ │ Phase 3: CONTRACT (Remove old) │
442
+ │ ├─ Confirm old column/table no longer read │
443
+ │ ├─ Remove old column/table │
444
+ │ └─ Clean up dual-write code │
520
445
  │ │
521
446
  └─────────────────────────────────────────────────────────────────┘
522
447
  ```
@@ -524,7 +449,7 @@ test('calculateDiscount 對 GOLD 客戶回傳 15', () => {
524
449
  ### 常見 Schema 重構場景
525
450
 
526
451
  | 場景 | 策略 | 風險等級 |
527
- |-----|------|---------|
452
+ |----------|----------|------------|
528
453
  | **重命名欄位** | 新增新的 → 遷移 → 刪除舊的 | 中 |
529
454
  | **拆分表格** | 新表 + 外鍵 → 遷移 → 調整應用程式 | 高 |
530
455
  | **合併表格** | 新表 → 合併資料 → 切換應用程式 | 高 |
@@ -534,29 +459,29 @@ test('calculateDiscount 對 GOLD 客戶回傳 15', () => {
534
459
  ### 資料庫遷移安全檢查清單
535
460
 
536
461
  ```
537
- 遷移前:
538
- □ 完整備份已完成
539
- □ 遷移腳本已在測試環境驗證
540
- □ 回滾腳本已準備
541
- □ 遷移時間已估算(考慮資料量)
542
- □ 維護視窗已通知
543
-
544
- 遷移中:
545
- □ 監控資料庫效能
546
- □ 增量驗證資料完整性
547
- □ 應用程式健康檢查通過
548
-
549
- 遷移後:
550
- □ 資料一致性驗證
551
- □ 應用程式功能驗證
552
- □ 效能基線比較
553
- □ 備份保留一段時間以供回滾
462
+ Pre-Migration:
463
+ □ Full backup completed
464
+ □ Migration script tested in staging
465
+ □ Rollback script prepared
466
+ □ Migration time estimated (consider data volume)
467
+ □ Maintenance window communicated
468
+
469
+ During Migration:
470
+ □ Monitor database performance
471
+ □ Verify data integrity incrementally
472
+ □ Application health checks passing
473
+
474
+ Post-Migration:
475
+ □ Data consistency verification
476
+ □ Application functionality verification
477
+ □ Performance baseline comparison
478
+ □ Backup retained for rollback period
554
479
  ```
555
480
 
556
481
  ### 零停機遷移技術
557
482
 
558
483
  | 技術 | 說明 | 使用場景 |
559
- |-----|------|---------|
484
+ |-----------|-------------|----------|
560
485
  | **Online Schema Change** | pt-osc, gh-ost | MySQL 大表變更 |
561
486
  | **Blue-Green Database** | 雙資料庫切換 | 高可用需求 |
562
487
  | **Shadow Write** | 同時寫入兩個資料庫並比較 | 驗證遷移正確性 |
@@ -564,157 +489,57 @@ test('calculateDiscount 對 GOLD 客戶回傳 15', () => {
564
489
 
565
490
  ---
566
491
 
567
- ## 安全重構工作流程
568
-
569
- ### 重構前
570
-
571
- ```
572
- □ 定義成功標準(可衡量的)
573
- □ 確保足夠的測試覆蓋率(建議 >80%)
574
- □ 提交/暫存當前工作(乾淨的工作目錄)
575
- □ 建立功能分支(或在主幹上使用功能開關)
576
- □ 與團隊溝通以避免衝突
577
- ```
578
-
579
- ### 重構中
580
-
581
- ```
582
- □ 一次只做一個小變更
583
- □ 每次變更後執行測試
584
- □ 如果測試失敗,立即復原
585
- □ 頻繁提交(每次測試通過都是一個存檔點)
586
- □ 重構時絕不加入新功能
587
- ```
588
-
589
- ### 重構後
590
-
591
- ```
592
- □ 所有測試通過(與之前相同)
593
- □ 程式碼可衡量地更好(複雜度、重複等)
594
- □ 如需要則更新文件
595
- □ 團隊審查完成
596
- □ 沒有新增功能
597
- ```
598
-
599
- ---
600
-
601
- ## 重構度量指標
602
-
603
- ### 程式碼品質指標
492
+ ## 團隊協作實踐
604
493
 
605
- | 指標 | 測量方式 | 目標 |
606
- |-----|---------|-----|
607
- | **循環複雜度** | 靜態分析工具 | 每函式 < 10 |
608
- | **認知複雜度** | SonarQube 等 | 越低越好 |
609
- | **耦合度** | 模組間依賴數 | 降低 |
610
- | **內聚性** | LCOM 指標 | 提高 |
611
- | **程式碼重複** | 重複程式碼百分比 | < 3% |
612
- | **程式碼行數** | 僅供參考 | 較少 ≠ 一定更好 |
613
-
614
- ### 測試品質指標
615
-
616
- | 指標 | 目標 | 備註 |
617
- |-----|-----|------|
618
- | **測試覆蓋率** | ≥ 80% | 重構期間不要降低 |
619
- | **測試速度** | 更快 | 重構應改善可測試性 |
620
- | **不穩定測試數** | 降低 | 穩定性改善 |
621
-
622
- ### 運維指標(DORA 指標)
623
-
624
- | 指標 | 測量方式 | 預期改善 |
625
- |-----|---------|---------|
626
- | **部署頻率** | CI/CD 記錄 | 提高(可維護性改善)|
627
- | **變更失敗率** | 回滾次數 | 降低 |
628
- | **平均恢復時間** | 事故記錄 | 縮短 |
629
- | **前置時間** | 從提交到部署 | 縮短 |
630
-
631
- ### 團隊效率指標
632
-
633
- | 指標 | 測量方式 | 備註 |
634
- |-----|---------|------|
635
- | **新人上手時間** | 新員工熟悉時間 | 縮短 = 更好的可讀性 |
636
- | **PR 審查時間** | Git 記錄 | 縮短 = 更好的可理解性 |
637
- | **Bug 修復時間** | Issue 追蹤 | 縮短 = 更好的可維護性 |
638
-
639
- ### 重構 ROI 框架
494
+ ### 重構專案啟動
640
495
 
641
496
  ```
642
- 成本:
643
- ├─ 開發時間 × 時薪
644
- ├─ 測試時間
645
- ├─ 部署風險成本
646
- └─ 機會成本(未建置的功能)
647
-
648
- 收益:
649
- ├─ 減少的維護時間 × 未來年數
650
- ├─ 減少的 Bug × 修復成本
651
- ├─ 更快的功能開發
652
- └─ 更低的人員流動成本
653
- ```
497
+ Kickoff Meeting Agenda:
498
+ 1. Scope Definition
499
+ ├─ What modules/files are in scope
500
+ └─ What is explicitly excluded
654
501
 
655
- ---
656
-
657
- ## 團隊協作
502
+ 2. Success Criteria Alignment
503
+ ├─ Quantitative goals (complexity reduction X%)
504
+ └─ Functional goals (behavior unchanged)
658
505
 
659
- ### 重構專案啟動
506
+ 3. Work Division
507
+ ├─ By module (vertical slicing)
508
+ └─ By layer (horizontal slicing)
660
509
 
661
- ```
662
- 啟動會議議程:
663
- 1. 範圍定義
664
- ├─ 哪些模組/檔案在範圍內
665
- └─ 明確排除什麼
666
-
667
- 2. 成功標準對齊
668
- ├─ 量化目標(複雜度降低 X%)
669
- └─ 功能目標(行為不變)
670
-
671
- 3. 工作分配
672
- ├─ 按模組(垂直切分)
673
- └─ 按層級(水平切分)
674
-
675
- 4. 風險評估
676
- ├─ 最高風險區域
677
- └─ 回滾策略
510
+ 4. Risk Assessment
511
+ ├─ Highest-risk areas
512
+ └─ Rollback strategy
678
513
  ```
679
514
 
680
515
  ### 分工策略
681
516
 
682
517
  | 策略 | 使用時機 | 注意事項 |
683
- |-----|---------|---------|
684
- | **垂直切分** | 獨立模組 | 確保介面不變 |
685
- | **水平切分** | 跨模組重構(如命名規範)| 需嚴格同步 |
686
- | **Strangler 分工** | 大型系統替換 | 一人一個 Strangler 切片 |
687
- | **Mob Programming** | 核心/高風險區域 | 全團隊一起,降低風險 |
518
+ |------|----------|---------|
519
+ | **垂直切片(Vertical Slicing)** | 獨立模組 | 確保介面不變 |
520
+ | **水平切片(Horizontal Slicing)** | 跨模組重構(例如命名慣例) | 需要嚴格同步 |
521
+ | **絞殺榕分工(Strangler Division)** | 大型系統替換 | 每一絞殺切片一人負責 |
522
+ | **暴民程式設計(Mob Programming)** | 核心/高風險區域 | 全員參與,降低風險 |
688
523
 
689
524
  ### 溝通機制
690
525
 
691
526
  ```
692
- 日常溝通:
693
- ├─ 站立會議同步重構進度
694
- ├─ 共享的重構看板(Kanban)
695
- └─ 專用頻道(#refactoring-xxx)
696
-
697
- PR 規範:
698
- ├─ 標題加 [Refactor] 前綴
699
- ├─ 說明改了什麼以及為什麼
700
- ├─ 包含前後複雜度比較
701
- └─ 遺留程式碼需要特徵測試
702
-
703
- 衝突處理:
704
- ├─ 小範圍:立即解決
705
- ├─ 中範圍:每日同步會議
706
- └─ 大範圍:考慮 Branch by Abstraction
707
- ```
708
-
709
- ### PR 大小指引
527
+ Daily Communication:
528
+ ├─ Sync refactoring progress in standup
529
+ ├─ Shared Refactoring Board (Kanban)
530
+ └─ Dedicated channel (#refactoring-xxx)
710
531
 
711
- | 大小 | 變更行數 | 審查時間 |
712
- |-----|---------|---------|
713
- | 小 | < 200 | < 30 分鐘 |
714
- | 中 | 200-500 | < 1 小時 |
715
- | 大 | > 500 | **應該拆分** |
532
+ PR Standards:
533
+ ├─ [Refactor] prefix in title
534
+ ├─ Explain what changed and why
535
+ ├─ Include before/after complexity comparison
536
+ └─ Require Characterization Tests for legacy code
716
537
 
717
- **原則**:多個小 PR > 一個大 PR
538
+ Conflict Resolution:
539
+ ├─ Small scope: Resolve immediately
540
+ ├─ Medium scope: Daily sync meeting
541
+ └─ Large scope: Consider Branch by Abstraction
542
+ ```
718
543
 
719
544
  ---
720
545
 
@@ -722,117 +547,54 @@ PR 規範:
722
547
 
723
548
  ### 技術債象限
724
549
 
725
- 基於 Martin Fowler 的技術債象限:
726
-
727
- ```
728
- 刻意的
729
- │
730
- ┌────────────────┼────────────────┐
731
- │ │ │
732
- │ 審慎的 │ 魯莽的 │
733
- │ 「我們知道 │ 「我們沒時間 │
734
- │ 這是債務」 │ 做設計」 │
735
- │ │ │
736
- 審慎的 ├────────────────┼────────────────┤ 魯莽的
737
- │ │ │
738
- │ 審慎的 │ 魯莽的 │
739
- │ 「現在我們 │ 「什麼是 │
740
- │ 知道該怎麼 │ 分層?」 │
741
- │ 做了」 │ │
742
- │ │ │
743
- └────────────────┼────────────────┘
744
- │
745
- 無意的
550
+ 基於 Martin Fowler 的技術債象限(Technical Debt Quadrant):
551
+
552
+ ```
553
+ Deliberate
554
+ │
555
+ ┌───────────────┼───────────────┐
556
+ │ │ │
557
+ │ Prudent │ Reckless │
558
+ │ "We know │ "We don't │
559
+ │ this is │ have time │
560
+ │ debt" │ for design" │
561
+ │ │ │
562
+ Prudent ├───────────────┼───────────────┤ Reckless
563
+ │ │ │
564
+ │ Prudent │ Reckless │
565
+ │ "Now we │ "What's │
566
+ │ know how │ layering?" │
567
+ │ we should │ │
568
+ │ have done it"│ │
569
+ │ │ │
570
+ └───────────────┼───────────────┘
571
+ │
572
+ Inadvertent
746
573
  ```
747
574
 
748
- ### 債務優先順序
749
-
750
- | 優先級 | 標準 | 行動 |
751
- |-------|------|-----|
752
- | **高** | 阻擋開發、導致頻繁 Bug | 立即處理 |
753
- | **中** | 拖慢開發、增加複雜度 | 排入下個 Sprint |
754
- | **低** | 小煩惱、影響隔離 | 隨機處理 |
755
-
756
575
  ### 追蹤技術債
757
576
 
758
577
  ```
759
- 每個債務項目記錄:
760
- ├─ 描述:問題是什麼?
761
- ├─ 影響:如何影響開發?
762
- ├─ 估計工作量:修復需要多久?
763
- ├─ 忽視的風險:不處理會怎樣?
764
- └─ 相關程式碼:受影響的檔案/模組連結
578
+ For each debt item, record:
579
+ ├─ Description: What is the issue?
580
+ ├─ Impact: How does it affect development?
581
+ ├─ Estimated Effort: How long to fix?
582
+ ├─ Risk if Ignored: What happens if not addressed?
583
+ └─ Related Code: Links to affected files/modules
765
584
  ```
766
585
 
767
586
  ---
768
587
 
769
- ## 決策矩陣摘要
770
-
771
- 選擇適當重構策略的快速參考:
772
-
773
- | 策略 | 規模 | 風險 | 關鍵用途 |
774
- |------|------|------|----------|
775
- | **預備性重構** | 小 | 低 | 降低功能開發阻力 |
776
- | **童子軍規則** | 極小 | 低 | 持續償還技術債 |
777
- | **紅-綠-重構** | 小 | 低 | TDD 開發循環 |
778
- | **絞殺榕模式** | 大 | 中 | 系統汰換、架構遷移 |
779
- | **防腐層** | 中 | 低 | 新舊系統共存 |
780
- | **抽象分支** | 大 | 中 | 主幹上的長期重構 |
781
- | **平行變更** | 中 | 低 | 介面/Schema 遷移 |
782
- | **特徵測試** | — | — | **所有遺留重構的前置條件** |
783
- | **探針式重構** | 小 | 低 | 理解黑盒程式碼 |
784
-
785
- ### 策略選擇指南
786
-
787
- ```
788
- 你的情境是什麼?
789
-
790
- 功能開發被混亂程式碼阻擋?
791
- └─► 預備性重構
792
-
793
- 在 Bug 修復中接觸程式碼?
794
- └─► 童子軍規則
795
-
796
- 用 TDD 寫新程式碼?
797
- └─► 紅-綠-重構
798
-
799
- 取代整個遺留系統?
800
- └─► 絞殺榕模式
801
-
802
- 需要整合遺留而不被污染?
803
- └─► 防腐層
804
-
805
- 在主幹上重構共享程式碼?
806
- └─► 抽象分支
807
-
808
- 變更被廣泛使用的介面?
809
- └─► 平行變更(Expand-Migrate-Contract)
810
-
811
- 處理未測試的遺留程式碼?
812
- └─► 先用特徵測試 + 探針式重構
813
- ```
814
-
815
- ---
816
-
817
- ## 相關標準
818
-
819
- - [測試驅動開發](../test-driven-development.md) - TDD 循環包含重構階段
820
- - [程式碼審查清單](../code-review-checklist.md) - 重構 PR 審查指引
821
- - [提交訊息指南](../commit-message-guide.md) - `refactor` 提交類型
822
- - [程式碼簽入標準](../checkin-standards.md) - 提交前要求
823
-
824
- ---
825
-
826
588
  ## 參考資料
827
589
 
828
590
  ### 書籍
829
591
 
830
- - Martin Fowler -《重構:改善既有程式的設計》第二版(2018)
831
- - Michael Feathers -《Working Effectively with Legacy Code》(2004)
832
- - Joshua Kerievsky -《Refactoring to Patterns》(2004)
833
- - Kent Beck -《Implementation Patterns》(2007)
834
- - Robert C. Martin -《Clean Code》(2008)
835
- - Eric Evans -《Domain-Driven Design》(2003)
592
+ - Martin Fowler - "Refactoring: Improving the Design of Existing Code" (2nd Edition, 2018)
593
+ - Michael Feathers - "Working Effectively with Legacy Code" (2004)
594
+ - Joshua Kerievsky - "Refactoring to Patterns" (2004)
595
+ - Kent Beck - "Implementation Patterns" (2007)
596
+ - Robert C. Martin - "Clean Code" (2008)
597
+ - Eric Evans - "Domain-Driven Design" (2003)
836
598
 
837
599
  ### 文章
838
600
 
@@ -850,15 +612,6 @@ PR 規範:
850
612
 
851
613
  ---
852
614
 
853
- ## 版本歷程
854
-
855
- | 版本 | 日期 | 變更 |
856
- |-----|------|------|
857
- | 2.0.0 | 2026-01-21 | 重大重構:新增戰術性策略(預備性重構、童子軍規則)、防腐層、決策矩陣摘要。重組為戰術性/戰略性/安全防護三層分類。 |
858
- | 1.0.0 | 2026-01-12 | 初始重構標準定義 |
859
-
860
- ---
861
-
862
- ## 授權
615
+ ## 授權條款
863
616
 
864
- 本標準以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權釋出。
617
+ 本指引依 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授權條款釋出。