universal-dev-standards 6.14.0-beta.9 → 6.14.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 (711) 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/secret-management-standards.ai.yaml +12 -1
  5. package/bundled/core/commit-message-guide.md +22 -19
  6. package/bundled/core/secret-management-standards.md +13 -1
  7. package/bundled/extensions/locales/zh-tw.md +19 -19
  8. package/bundled/hooks/validate-commit-msg.mjs +52 -9
  9. package/bundled/locales/zh-CN/CHANGELOG.md +2309 -1110
  10. package/bundled/locales/zh-CN/CLAUDE.md +987 -101
  11. package/bundled/locales/zh-CN/README.md +3 -3
  12. package/bundled/locales/zh-CN/SECURITY.md +3 -3
  13. package/bundled/locales/zh-CN/STANDARDS-MAPPING.md +103 -6
  14. package/bundled/locales/zh-CN/adoption/ADOPTION-GUIDE.md +68 -97
  15. package/bundled/locales/zh-CN/adoption/DAILY-WORKFLOW-GUIDE.md +2 -1
  16. package/bundled/locales/zh-CN/adoption/STATIC-DYNAMIC-GUIDE.md +8 -9
  17. package/bundled/locales/zh-CN/adoption/checklists/enterprise.md +81 -80
  18. package/bundled/locales/zh-CN/adoption/checklists/minimal.md +18 -14
  19. package/bundled/locales/zh-CN/adoption/checklists/recommended.md +49 -46
  20. package/bundled/locales/zh-CN/ai/MAINTENANCE.md +44 -9
  21. package/bundled/locales/zh-CN/ai/options/commit-message/traditional-chinese.ai.yaml +63 -55
  22. package/bundled/locales/zh-CN/core/acceptance-criteria-traceability.md +61 -14
  23. package/bundled/locales/zh-CN/core/acceptance-test-driven-development.md +2 -1
  24. package/bundled/locales/zh-CN/core/accessibility-standards.md +871 -62
  25. package/bundled/locales/zh-CN/core/adr-standards.md +155 -32
  26. package/bundled/locales/zh-CN/core/agent-communication-protocol.md +2 -1
  27. package/bundled/locales/zh-CN/core/agent-dispatch.md +68 -33
  28. package/bundled/locales/zh-CN/core/ai-agreement-standards.md +23 -22
  29. package/bundled/locales/zh-CN/core/ai-command-behavior.md +2 -1
  30. package/bundled/locales/zh-CN/core/ai-friendly-architecture.md +311 -72
  31. package/bundled/locales/zh-CN/core/ai-instruction-standards.md +71 -49
  32. package/bundled/locales/zh-CN/core/ai-response-navigation.md +2 -1
  33. package/bundled/locales/zh-CN/core/alerting-standards.md +231 -36
  34. package/bundled/locales/zh-CN/core/anti-hallucination.md +116 -697
  35. package/bundled/locales/zh-CN/core/anti-sycophancy-prompting.md +34 -33
  36. package/bundled/locales/zh-CN/core/api-design-standards.md +144 -58
  37. package/bundled/locales/zh-CN/core/behavior-driven-development.md +2 -1
  38. package/bundled/locales/zh-CN/core/branch-completion.md +75 -20
  39. package/bundled/locales/zh-CN/core/capability-declaration.md +44 -94
  40. package/bundled/locales/zh-CN/core/change-batching-standards.md +2 -1
  41. package/bundled/locales/zh-CN/core/changelog-standards.md +485 -63
  42. package/bundled/locales/zh-CN/core/chaos-engineering-standards.md +141 -39
  43. package/bundled/locales/zh-CN/core/checkin-standards.md +176 -116
  44. package/bundled/locales/zh-CN/core/circuit-breaker.md +43 -77
  45. package/bundled/locales/zh-CN/core/code-review-checklist.md +37 -23
  46. package/bundled/locales/zh-CN/core/commit-message-guide.md +892 -69
  47. package/bundled/locales/zh-CN/core/containerization-standards.md +259 -57
  48. package/bundled/locales/zh-CN/core/context-aware-loading.md +103 -29
  49. package/bundled/locales/zh-CN/core/database-standards.md +115 -114
  50. package/bundled/locales/zh-CN/core/deprecation-standards.md +155 -40
  51. package/bundled/locales/zh-CN/core/design-document-standards.md +265 -55
  52. package/bundled/locales/zh-CN/core/developer-memory.md +150 -60
  53. package/bundled/locales/zh-CN/core/documentation-lifecycle.md +20 -16
  54. package/bundled/locales/zh-CN/core/documentation-structure.md +1284 -127
  55. package/bundled/locales/zh-CN/core/documentation-writing-standards.md +649 -259
  56. package/bundled/locales/zh-CN/core/dual-phase-output.md +37 -70
  57. package/bundled/locales/zh-CN/core/environment-standards.md +251 -73
  58. package/bundled/locales/zh-CN/core/error-code-standards.md +501 -60
  59. package/bundled/locales/zh-CN/core/estimation-standards.md +174 -41
  60. package/bundled/locales/zh-CN/core/execution-history.md +2 -1
  61. package/bundled/locales/zh-CN/core/failure-source-taxonomy.md +71 -84
  62. package/bundled/locales/zh-CN/core/feature-flag-standards.md +202 -57
  63. package/bundled/locales/zh-CN/core/forward-derivation-standards.md +613 -154
  64. package/bundled/locales/zh-CN/core/frontend-design-standards.md +361 -78
  65. package/bundled/locales/zh-CN/core/git-workflow.md +148 -262
  66. package/bundled/locales/zh-CN/core/git-worktree.md +59 -26
  67. package/bundled/locales/zh-CN/core/guides/file-placement-guide.md +132 -48
  68. package/bundled/locales/zh-CN/core/guides/performance-guide.md +61 -59
  69. package/bundled/locales/zh-CN/core/guides/security-guide.md +2 -0
  70. package/bundled/locales/zh-CN/core/health-check-standards.md +46 -104
  71. package/bundled/locales/zh-CN/core/immutability-first.md +83 -60
  72. package/bundled/locales/zh-CN/core/knowledge-transfer-standards.md +94 -31
  73. package/bundled/locales/zh-CN/core/mutation-testing.md +45 -6
  74. package/bundled/locales/zh-CN/core/observability-standards.md +281 -37
  75. package/bundled/locales/zh-CN/core/performance-standards.md +402 -42
  76. package/bundled/locales/zh-CN/core/pipeline-integration-standards.md +2 -1
  77. package/bundled/locales/zh-CN/core/postmortem-standards.md +358 -53
  78. package/bundled/locales/zh-CN/core/privacy-standards.md +148 -40
  79. package/bundled/locales/zh-CN/core/project-context-memory.md +182 -48
  80. package/bundled/locales/zh-CN/core/project-structure.md +550 -170
  81. package/bundled/locales/zh-CN/core/recovery-recipe-registry.md +54 -114
  82. package/bundled/locales/zh-CN/core/refactoring-standards.md +141 -556
  83. package/bundled/locales/zh-CN/core/requirement-engineering.md +7 -6
  84. package/bundled/locales/zh-CN/core/retrospective-standards.md +215 -22
  85. package/bundled/locales/zh-CN/core/retry-standards.md +46 -101
  86. package/bundled/locales/zh-CN/core/reverse-engineering-standards.md +370 -120
  87. package/bundled/locales/zh-CN/core/runbook-standards.md +294 -48
  88. package/bundled/locales/zh-CN/core/security-decision.md +45 -70
  89. package/bundled/locales/zh-CN/core/security-standards.md +169 -16
  90. package/bundled/locales/zh-CN/core/skill-standard-alignment-check.md +105 -71
  91. package/bundled/locales/zh-CN/core/slo-standards.md +296 -44
  92. package/bundled/locales/zh-CN/core/spec-driven-development.md +37 -6
  93. package/bundled/locales/zh-CN/core/standard-admission-criteria.md +25 -31
  94. package/bundled/locales/zh-CN/core/standard-lifecycle-management.md +49 -57
  95. package/bundled/locales/zh-CN/core/structured-task-definition.md +2 -1
  96. package/bundled/locales/zh-CN/core/supply-chain-security-standards.md +159 -32
  97. package/bundled/locales/zh-CN/core/systematic-debugging.md +87 -42
  98. package/bundled/locales/zh-CN/core/tech-debt-standards.md +202 -86
  99. package/bundled/locales/zh-CN/core/test-completeness-dimensions.md +262 -190
  100. package/bundled/locales/zh-CN/core/test-data-standards.md +252 -30
  101. package/bundled/locales/zh-CN/core/test-driven-development.md +21 -1022
  102. package/bundled/locales/zh-CN/core/test-governance.md +94 -43
  103. package/bundled/locales/zh-CN/core/testing-standards.md +83 -37
  104. package/bundled/locales/zh-CN/core/timeout-standards.md +45 -85
  105. package/bundled/locales/zh-CN/core/token-budget.md +44 -80
  106. package/bundled/locales/zh-CN/core/translation-lifecycle-standards.md +48 -36
  107. package/bundled/locales/zh-CN/core/verification-evidence.md +44 -22
  108. package/bundled/locales/zh-CN/core/versioning.md +737 -73
  109. package/bundled/locales/zh-CN/core/virtual-organization-standards.md +30 -29
  110. package/bundled/locales/zh-CN/core/workflow-enforcement.md +9 -8
  111. package/bundled/locales/zh-CN/core/workflow-state-protocol.md +9 -8
  112. package/bundled/locales/zh-CN/docs/CHEATSHEET.md +2 -1
  113. package/bundled/locales/zh-CN/docs/CLI-FLOW.md +2 -1
  114. package/bundled/locales/zh-CN/docs/CLI-INIT-OPTIONS.md +19 -10
  115. package/bundled/locales/zh-CN/docs/FEATURE-REFERENCE.md +8 -6
  116. package/bundled/locales/zh-CN/docs/STANDARDS-REFERENCE.md +2 -1
  117. package/bundled/locales/zh-CN/docs/USAGE-MODES-COMPARISON.md +133 -132
  118. package/bundled/locales/zh-CN/docs/USER-MANUAL.md +11 -3
  119. package/bundled/locales/zh-CN/docs/WINDOWS-GUIDE.md +5 -2
  120. package/bundled/locales/zh-CN/docs/specs/system/memory-adoption-strategy.md +2 -0
  121. package/bundled/locales/zh-CN/docs/user/FAQ.md +2 -0
  122. package/bundled/locales/zh-CN/docs/user/GETTING-STARTED.md +2 -0
  123. package/bundled/locales/zh-CN/docs/user/GLOSSARY.md +2 -0
  124. package/bundled/locales/zh-CN/docs/user/README.md +4 -2
  125. package/bundled/locales/zh-CN/docs/user/TROUBLESHOOTING.md +2 -0
  126. package/bundled/locales/zh-CN/integrations/codex/AGENTS.md +136 -2
  127. package/bundled/locales/zh-CN/integrations/codex/README.md +62 -10
  128. package/bundled/locales/zh-CN/integrations/gemini-cli/GEMINI.md +59 -1
  129. package/bundled/locales/zh-CN/integrations/gemini-cli/README.md +9 -2
  130. package/bundled/locales/zh-CN/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +7 -1
  131. package/bundled/locales/zh-CN/integrations/github-copilot/README.md +8 -2
  132. package/bundled/locales/zh-CN/integrations/github-copilot/copilot-instructions.md +146 -12
  133. package/bundled/locales/zh-CN/integrations/github-copilot/skills-mapping.md +7 -1
  134. package/bundled/locales/zh-CN/integrations/google-antigravity/AGENTS.md +110 -3
  135. package/bundled/locales/zh-CN/integrations/google-antigravity/README.md +7 -1
  136. package/bundled/locales/zh-CN/integrations/opencode/AGENTS.md +140 -2
  137. package/bundled/locales/zh-CN/integrations/opencode/README.md +7 -1
  138. package/bundled/locales/zh-CN/integrations/opencode/skills-mapping.md +8 -2
  139. package/bundled/locales/zh-CN/integrations/openspec/AGENTS.md +46 -1
  140. package/bundled/locales/zh-CN/integrations/openspec/README.md +7 -1
  141. package/bundled/locales/zh-CN/integrations/spec-kit/AGENTS.md +20 -2
  142. package/bundled/locales/zh-CN/integrations/spec-kit/README.md +7 -1
  143. package/bundled/locales/zh-CN/options/changelog/auto-generated.md +2 -0
  144. package/bundled/locales/zh-CN/options/changelog/keep-a-changelog.md +2 -0
  145. package/bundled/locales/zh-CN/options/code-review/automated-review.md +2 -0
  146. package/bundled/locales/zh-CN/options/code-review/pair-programming.md +2 -0
  147. package/bundled/locales/zh-CN/options/commit-message/bilingual.md +139 -50
  148. package/bundled/locales/zh-CN/options/commit-message/english.md +159 -42
  149. package/bundled/locales/zh-CN/options/commit-message/traditional-chinese.md +156 -75
  150. package/bundled/locales/zh-CN/options/documentation/api-docs.md +3 -1
  151. package/bundled/locales/zh-CN/options/documentation/markdown-docs.md +2 -0
  152. package/bundled/locales/zh-CN/options/documentation/wiki-style.md +2 -0
  153. package/bundled/locales/zh-CN/options/git-workflow/gitflow.md +105 -77
  154. package/bundled/locales/zh-CN/options/git-workflow/github-flow.md +75 -57
  155. package/bundled/locales/zh-CN/options/git-workflow/merge-commit.md +155 -44
  156. package/bundled/locales/zh-CN/options/git-workflow/rebase-ff.md +168 -53
  157. package/bundled/locales/zh-CN/options/git-workflow/squash-merge.md +122 -37
  158. package/bundled/locales/zh-CN/options/git-workflow/trunk-based.md +108 -61
  159. package/bundled/locales/zh-CN/options/project-structure/dotnet.md +266 -47
  160. package/bundled/locales/zh-CN/options/project-structure/go.md +301 -43
  161. package/bundled/locales/zh-CN/options/project-structure/java.md +268 -48
  162. package/bundled/locales/zh-CN/options/project-structure/kotlin.md +2 -0
  163. package/bundled/locales/zh-CN/options/project-structure/nodejs.md +168 -51
  164. package/bundled/locales/zh-CN/options/project-structure/php.md +2 -0
  165. package/bundled/locales/zh-CN/options/project-structure/python.md +210 -52
  166. package/bundled/locales/zh-CN/options/project-structure/ruby.md +2 -0
  167. package/bundled/locales/zh-CN/options/project-structure/rust.md +2 -0
  168. package/bundled/locales/zh-CN/options/project-structure/swift.md +2 -0
  169. package/bundled/locales/zh-CN/options/testing/contract-testing.md +2 -0
  170. package/bundled/locales/zh-CN/options/testing/e2e-testing.md +227 -66
  171. package/bundled/locales/zh-CN/options/testing/industry-pyramid.md +2 -0
  172. package/bundled/locales/zh-CN/options/testing/integration-testing.md +185 -73
  173. package/bundled/locales/zh-CN/options/testing/istqb-framework.md +2 -0
  174. package/bundled/locales/zh-CN/options/testing/performance-testing.md +2 -0
  175. package/bundled/locales/zh-CN/options/testing/security-testing.md +2 -0
  176. package/bundled/locales/zh-CN/options/testing/system-testing.md +270 -96
  177. package/bundled/locales/zh-CN/options/testing/unit-testing.md +185 -71
  178. package/bundled/locales/zh-CN/skills/CONTRIBUTING.template.md +43 -42
  179. package/bundled/locales/zh-CN/skills/INTEGRATION-GUIDE.md +2 -1
  180. package/bundled/locales/zh-CN/skills/README.md +2 -1
  181. package/bundled/locales/zh-CN/skills/_shared/README.md +2 -1
  182. package/bundled/locales/zh-CN/skills/adr-assistant/guide.md +240 -4
  183. package/bundled/locales/zh-CN/skills/agents/README.md +180 -82
  184. package/bundled/locales/zh-CN/skills/agents/code-architect.md +3 -1
  185. package/bundled/locales/zh-CN/skills/agents/doc-writer.md +3 -1
  186. package/bundled/locales/zh-CN/skills/agents/reviewer.md +4 -2
  187. package/bundled/locales/zh-CN/skills/agents/spec-analyst.md +3 -1
  188. package/bundled/locales/zh-CN/skills/agents/test-specialist.md +3 -1
  189. package/bundled/locales/zh-CN/skills/ai-collaboration-standards/SKILL.md +91 -81
  190. package/bundled/locales/zh-CN/skills/ai-collaboration-standards/anti-hallucination.md +79 -59
  191. package/bundled/locales/zh-CN/skills/ai-collaboration-standards/certainty-labels.md +66 -40
  192. package/bundled/locales/zh-CN/skills/ai-friendly-architecture/SKILL.md +23 -36
  193. package/bundled/locales/zh-CN/skills/ai-instruction-standards/SKILL.md +217 -137
  194. package/bundled/locales/zh-CN/skills/api-design-assistant/SKILL.md +13 -2
  195. package/bundled/locales/zh-CN/skills/atdd-assistant/SKILL.md +16 -2
  196. package/bundled/locales/zh-CN/skills/atdd-assistant/acceptance-criteria-guide.md +2 -1
  197. package/bundled/locales/zh-CN/skills/atdd-assistant/atdd-workflow.md +98 -1
  198. package/bundled/locales/zh-CN/skills/atdd-assistant/guide.md +148 -132
  199. package/bundled/locales/zh-CN/skills/audit-assistant/SKILL.md +5 -2
  200. package/bundled/locales/zh-CN/skills/bdd-assistant/SKILL.md +16 -2
  201. package/bundled/locales/zh-CN/skills/bdd-assistant/bdd-workflow.md +2 -1
  202. package/bundled/locales/zh-CN/skills/bdd-assistant/gherkin-guide.md +2 -1
  203. package/bundled/locales/zh-CN/skills/bdd-assistant/guide.md +122 -121
  204. package/bundled/locales/zh-CN/skills/changelog-guide/SKILL.md +9 -2
  205. package/bundled/locales/zh-CN/skills/changelog-guide/guide.md +91 -88
  206. package/bundled/locales/zh-CN/skills/checkin-assistant/SKILL.md +12 -2
  207. package/bundled/locales/zh-CN/skills/checkin-assistant/guide.md +211 -210
  208. package/bundled/locales/zh-CN/skills/ci-cd-assistant/SKILL.md +14 -2
  209. package/bundled/locales/zh-CN/skills/code-review-assistant/SKILL.md +12 -2
  210. package/bundled/locales/zh-CN/skills/code-review-assistant/checkin-checklist.md +79 -78
  211. package/bundled/locales/zh-CN/skills/code-review-assistant/guide.md +119 -45
  212. package/bundled/locales/zh-CN/skills/code-review-assistant/review-checklist.md +89 -88
  213. package/bundled/locales/zh-CN/skills/commands/ac-coverage.md +43 -1
  214. package/bundled/locales/zh-CN/skills/commands/api-design.md +2 -1
  215. package/bundled/locales/zh-CN/skills/commands/atdd.md +71 -1
  216. package/bundled/locales/zh-CN/skills/commands/audit.md +2 -1
  217. package/bundled/locales/zh-CN/skills/commands/bdd.md +160 -62
  218. package/bundled/locales/zh-CN/skills/commands/changelog.md +36 -1
  219. package/bundled/locales/zh-CN/skills/commands/check.md +53 -1
  220. package/bundled/locales/zh-CN/skills/commands/checkin.md +45 -1
  221. package/bundled/locales/zh-CN/skills/commands/ci-cd.md +3 -2
  222. package/bundled/locales/zh-CN/skills/commands/code-review.md +41 -1
  223. package/bundled/locales/zh-CN/skills/commands/commit.md +56 -1
  224. package/bundled/locales/zh-CN/skills/commands/config.md +50 -1
  225. package/bundled/locales/zh-CN/skills/commands/coverage.md +43 -1
  226. package/bundled/locales/zh-CN/skills/commands/database.md +4 -3
  227. package/bundled/locales/zh-CN/skills/commands/derive-all.md +42 -1
  228. package/bundled/locales/zh-CN/skills/commands/derive-atdd.md +35 -1
  229. package/bundled/locales/zh-CN/skills/commands/derive-bdd.md +41 -1
  230. package/bundled/locales/zh-CN/skills/commands/derive-tdd.md +42 -1
  231. package/bundled/locales/zh-CN/skills/commands/derive.md +60 -4
  232. package/bundled/locales/zh-CN/skills/commands/dev-workflow.md +58 -8
  233. package/bundled/locales/zh-CN/skills/commands/discover.md +41 -1
  234. package/bundled/locales/zh-CN/skills/commands/docgen.md +37 -1
  235. package/bundled/locales/zh-CN/skills/commands/docs.md +136 -5
  236. package/bundled/locales/zh-CN/skills/commands/durable.md +4 -3
  237. package/bundled/locales/zh-CN/skills/commands/e2e.md +85 -1
  238. package/bundled/locales/zh-CN/skills/commands/guide.md +2 -1
  239. package/bundled/locales/zh-CN/skills/commands/incident.md +5 -4
  240. package/bundled/locales/zh-CN/skills/commands/init.md +57 -1
  241. package/bundled/locales/zh-CN/skills/commands/methodology.md +166 -77
  242. package/bundled/locales/zh-CN/skills/commands/metrics.md +3 -2
  243. package/bundled/locales/zh-CN/skills/commands/migrate.md +5 -4
  244. package/bundled/locales/zh-CN/skills/commands/observability.md +48 -3
  245. package/bundled/locales/zh-CN/skills/commands/pr.md +4 -3
  246. package/bundled/locales/zh-CN/skills/commands/refactor.md +76 -38
  247. package/bundled/locales/zh-CN/skills/commands/release.md +82 -1
  248. package/bundled/locales/zh-CN/skills/commands/requirement.md +40 -1
  249. package/bundled/locales/zh-CN/skills/commands/reverse-bdd.md +36 -1
  250. package/bundled/locales/zh-CN/skills/commands/reverse-sdd.md +44 -1
  251. package/bundled/locales/zh-CN/skills/commands/reverse-tdd.md +42 -1
  252. package/bundled/locales/zh-CN/skills/commands/reverse.md +43 -1
  253. package/bundled/locales/zh-CN/skills/commands/runbook.md +50 -3
  254. package/bundled/locales/zh-CN/skills/commands/scan.md +3 -2
  255. package/bundled/locales/zh-CN/skills/commands/sdd-retro.md +50 -1
  256. package/bundled/locales/zh-CN/skills/commands/sdd.md +182 -1
  257. package/bundled/locales/zh-CN/skills/commands/security.md +3 -2
  258. package/bundled/locales/zh-CN/skills/commands/slo.md +51 -3
  259. package/bundled/locales/zh-CN/skills/commands/tdd.md +74 -5
  260. package/bundled/locales/zh-CN/skills/commands/update.md +70 -8
  261. package/bundled/locales/zh-CN/skills/commit-standards/SKILL.md +4 -4
  262. package/bundled/locales/zh-CN/skills/commit-standards/conventional-commits.md +45 -44
  263. package/bundled/locales/zh-CN/skills/commit-standards/guide.md +172 -52
  264. package/bundled/locales/zh-CN/skills/commit-standards/language-options.md +50 -47
  265. package/bundled/locales/zh-CN/skills/contract-test-assistant/SKILL.md +2 -2
  266. package/bundled/locales/zh-CN/skills/contract-test-assistant/guide.md +76 -1
  267. package/bundled/locales/zh-CN/skills/database-assistant/SKILL.md +18 -5
  268. package/bundled/locales/zh-CN/skills/dev-methodology/SKILL.md +4 -2
  269. package/bundled/locales/zh-CN/skills/dev-methodology/create-methodology.md +2 -0
  270. package/bundled/locales/zh-CN/skills/dev-methodology/runtime.md +2 -0
  271. package/bundled/locales/zh-CN/skills/docs-generator/SKILL.md +16 -2
  272. package/bundled/locales/zh-CN/skills/docs-generator/guide.md +8 -7
  273. package/bundled/locales/zh-CN/skills/documentation-guide/SKILL.md +209 -184
  274. package/bundled/locales/zh-CN/skills/documentation-guide/documentation-structure.md +73 -72
  275. package/bundled/locales/zh-CN/skills/documentation-guide/readme-template.md +37 -36
  276. package/bundled/locales/zh-CN/skills/durable-execution-assistant/SKILL.md +28 -2
  277. package/bundled/locales/zh-CN/skills/e2e-assistant/SKILL.md +21 -6
  278. package/bundled/locales/zh-CN/skills/error-code-guide/SKILL.md +76 -95
  279. package/bundled/locales/zh-CN/skills/git-workflow-guide/SKILL.md +80 -87
  280. package/bundled/locales/zh-CN/skills/git-workflow-guide/branch-naming.md +44 -43
  281. package/bundled/locales/zh-CN/skills/git-workflow-guide/git-workflow.md +66 -65
  282. package/bundled/locales/zh-CN/skills/incident-response-assistant/SKILL.md +31 -13
  283. package/bundled/locales/zh-CN/skills/metrics-dashboard-assistant/SKILL.md +38 -2
  284. package/bundled/locales/zh-CN/skills/observability-assistant/SKILL.md +75 -1
  285. package/bundled/locales/zh-CN/skills/pr-automation-assistant/SKILL.md +32 -6
  286. package/bundled/locales/zh-CN/skills/project-discovery/SKILL.md +8 -2
  287. package/bundled/locales/zh-CN/skills/project-discovery/guide.md +158 -157
  288. package/bundled/locales/zh-CN/skills/project-structure-guide/SKILL.md +49 -46
  289. package/bundled/locales/zh-CN/skills/project-structure-guide/language-patterns.md +8 -7
  290. package/bundled/locales/zh-CN/skills/refactoring-assistant/SKILL.md +22 -2
  291. package/bundled/locales/zh-CN/skills/refactoring-assistant/guide.md +172 -171
  292. package/bundled/locales/zh-CN/skills/release-standards/SKILL.md +66 -23
  293. package/bundled/locales/zh-CN/skills/release-standards/changelog-format.md +42 -41
  294. package/bundled/locales/zh-CN/skills/release-standards/guide.md +51 -43
  295. package/bundled/locales/zh-CN/skills/release-standards/release-workflow.md +131 -95
  296. package/bundled/locales/zh-CN/skills/release-standards/semantic-versioning.md +62 -61
  297. package/bundled/locales/zh-CN/skills/requirement-assistant/SKILL.md +24 -15
  298. package/bundled/locales/zh-CN/skills/requirement-assistant/guide.md +88 -79
  299. package/bundled/locales/zh-CN/skills/requirement-assistant/requirement-checklist.md +128 -127
  300. package/bundled/locales/zh-CN/skills/requirement-assistant/requirement-writing.md +121 -120
  301. package/bundled/locales/zh-CN/skills/retrospective-assistant/guide.md +206 -2
  302. package/bundled/locales/zh-CN/skills/reverse-engineer/SKILL.md +2 -2
  303. package/bundled/locales/zh-CN/skills/reverse-engineer/bdd-extraction.md +2 -1
  304. package/bundled/locales/zh-CN/skills/reverse-engineer/guide.md +297 -173
  305. package/bundled/locales/zh-CN/skills/reverse-engineer/tdd-analysis.md +2 -1
  306. package/bundled/locales/zh-CN/skills/reverse-engineer/workflow.md +2 -1
  307. package/bundled/locales/zh-CN/skills/runbook-assistant/SKILL.md +9 -2
  308. package/bundled/locales/zh-CN/skills/security-assistant/SKILL.md +24 -6
  309. package/bundled/locales/zh-CN/skills/security-scan-assistant/SKILL.md +34 -10
  310. package/bundled/locales/zh-CN/skills/slo-assistant/SKILL.md +2 -1
  311. package/bundled/locales/zh-CN/skills/spec-derivation/SKILL.md +2 -2
  312. package/bundled/locales/zh-CN/skills/spec-driven-dev/guide.md +38 -6
  313. package/bundled/locales/zh-CN/skills/tdd-assistant/SKILL.md +16 -3
  314. package/bundled/locales/zh-CN/skills/tdd-assistant/guide.md +217 -156
  315. package/bundled/locales/zh-CN/skills/tdd-assistant/language-examples.md +727 -82
  316. package/bundled/locales/zh-CN/skills/tdd-assistant/tdd-workflow.md +396 -214
  317. package/bundled/locales/zh-CN/skills/test-coverage-assistant/SKILL.md +14 -5
  318. package/bundled/locales/zh-CN/skills/test-coverage-assistant/guide.md +25 -12
  319. package/bundled/locales/zh-CN/skills/testing-guide/testing-pyramid.md +99 -98
  320. package/bundled/locales/zh-CN/skills/testing-guide/testing-theory.md +3 -1
  321. package/bundled/locales/zh-CN/skills/tools/cline/README.md +2 -1
  322. package/bundled/locales/zh-CN/skills/tools/copilot/README.md +65 -18
  323. package/bundled/locales/zh-CN/skills/tools/copilot/copilot-instructions.md +2 -1
  324. package/bundled/locales/zh-CN/skills/tools/cursor/README.md +2 -1
  325. package/bundled/locales/zh-CN/skills/tools/windsurf/README.md +2 -1
  326. package/bundled/locales/zh-CN/skills/workflows/README.md +4 -2
  327. package/bundled/locales/zh-CN/templates/reverse-spec-template.md +50 -1
  328. package/bundled/locales/zh-TW/CHANGELOG.md +2282 -1112
  329. package/bundled/locales/zh-TW/CLAUDE.md +962 -76
  330. package/bundled/locales/zh-TW/README.md +3 -3
  331. package/bundled/locales/zh-TW/SECURITY.md +3 -3
  332. package/bundled/locales/zh-TW/STANDARDS-MAPPING.md +103 -6
  333. package/bundled/locales/zh-TW/adoption/ADOPTION-GUIDE.md +46 -93
  334. package/bundled/locales/zh-TW/adoption/DAILY-WORKFLOW-GUIDE.md +2 -1
  335. package/bundled/locales/zh-TW/adoption/STATIC-DYNAMIC-GUIDE.md +3 -1
  336. package/bundled/locales/zh-TW/adoption/checklists/enterprise.md +10 -9
  337. package/bundled/locales/zh-TW/adoption/checklists/minimal.md +6 -2
  338. package/bundled/locales/zh-TW/adoption/checklists/recommended.md +7 -4
  339. package/bundled/locales/zh-TW/ai/MAINTENANCE.md +34 -14
  340. package/bundled/locales/zh-TW/ai/options/commit-message/traditional-chinese.ai.yaml +48 -40
  341. package/bundled/locales/zh-TW/core/acceptance-criteria-traceability.md +56 -10
  342. package/bundled/locales/zh-TW/core/acceptance-test-driven-development.md +2 -1
  343. package/bundled/locales/zh-TW/core/accessibility-standards.md +895 -46
  344. package/bundled/locales/zh-TW/core/adr-standards.md +2 -1
  345. package/bundled/locales/zh-TW/core/agent-communication-protocol.md +2 -1
  346. package/bundled/locales/zh-TW/core/agent-dispatch.md +102 -33
  347. package/bundled/locales/zh-TW/core/ai-agreement-standards.md +58 -41
  348. package/bundled/locales/zh-TW/core/ai-command-behavior.md +2 -1
  349. package/bundled/locales/zh-TW/core/ai-friendly-architecture.md +306 -67
  350. package/bundled/locales/zh-TW/core/ai-instruction-standards.md +16 -13
  351. package/bundled/locales/zh-TW/core/ai-response-navigation.md +3 -3
  352. package/bundled/locales/zh-TW/core/alerting-standards.md +257 -35
  353. package/bundled/locales/zh-TW/core/anti-hallucination.md +169 -40
  354. package/bundled/locales/zh-TW/core/anti-sycophancy-prompting.md +2 -1
  355. package/bundled/locales/zh-TW/core/api-design-standards.md +2 -1
  356. package/bundled/locales/zh-TW/core/behavior-driven-development.md +3 -17
  357. package/bundled/locales/zh-TW/core/branch-completion.md +130 -34
  358. package/bundled/locales/zh-TW/core/capability-declaration.md +41 -79
  359. package/bundled/locales/zh-TW/core/change-batching-standards.md +2 -1
  360. package/bundled/locales/zh-TW/core/changelog-standards.md +14 -9
  361. package/bundled/locales/zh-TW/core/chaos-engineering-standards.md +138 -36
  362. package/bundled/locales/zh-TW/core/checkin-standards.md +84 -26
  363. package/bundled/locales/zh-TW/core/circuit-breaker.md +48 -87
  364. package/bundled/locales/zh-TW/core/code-review-checklist.md +19 -7
  365. package/bundled/locales/zh-TW/core/commit-message-guide.md +218 -87
  366. package/bundled/locales/zh-TW/core/containerization-standards.md +259 -57
  367. package/bundled/locales/zh-TW/core/context-aware-loading.md +121 -27
  368. package/bundled/locales/zh-TW/core/database-standards.md +2 -1
  369. package/bundled/locales/zh-TW/core/deprecation-standards.md +139 -37
  370. package/bundled/locales/zh-TW/core/design-document-standards.md +265 -55
  371. package/bundled/locales/zh-TW/core/developer-memory.md +102 -12
  372. package/bundled/locales/zh-TW/core/documentation-lifecycle.md +2 -1
  373. package/bundled/locales/zh-TW/core/documentation-structure.md +17 -8
  374. package/bundled/locales/zh-TW/core/dual-phase-output.md +28 -90
  375. package/bundled/locales/zh-TW/core/environment-standards.md +250 -72
  376. package/bundled/locales/zh-TW/core/error-code-standards.md +17 -6
  377. package/bundled/locales/zh-TW/core/estimation-standards.md +177 -44
  378. package/bundled/locales/zh-TW/core/execution-history.md +2 -1
  379. package/bundled/locales/zh-TW/core/failure-source-taxonomy.md +59 -117
  380. package/bundled/locales/zh-TW/core/feature-flag-standards.md +202 -57
  381. package/bundled/locales/zh-TW/core/forward-derivation-standards.md +592 -133
  382. package/bundled/locales/zh-TW/core/frontend-design-standards.md +120 -8
  383. package/bundled/locales/zh-TW/core/git-workflow.md +197 -37
  384. package/bundled/locales/zh-TW/core/git-worktree.md +79 -49
  385. package/bundled/locales/zh-TW/core/guides/anti-hallucination-guide.md +234 -487
  386. package/bundled/locales/zh-TW/core/guides/file-placement-guide.md +86 -2
  387. package/bundled/locales/zh-TW/core/guides/git-workflow-guide.md +411 -464
  388. package/bundled/locales/zh-TW/core/guides/performance-guide.md +2 -0
  389. package/bundled/locales/zh-TW/core/guides/refactoring-guide.md +237 -484
  390. package/bundled/locales/zh-TW/core/guides/security-guide.md +2 -0
  391. package/bundled/locales/zh-TW/core/health-check-standards.md +46 -104
  392. package/bundled/locales/zh-TW/core/immutability-first.md +45 -85
  393. package/bundled/locales/zh-TW/core/knowledge-graph-memory.md +2 -1
  394. package/bundled/locales/zh-TW/core/knowledge-transfer-standards.md +103 -40
  395. package/bundled/locales/zh-TW/core/observability-standards.md +284 -40
  396. package/bundled/locales/zh-TW/core/performance-standards.md +387 -86
  397. package/bundled/locales/zh-TW/core/pipeline-integration-standards.md +2 -1
  398. package/bundled/locales/zh-TW/core/postmortem-standards.md +367 -36
  399. package/bundled/locales/zh-TW/core/privacy-standards.md +153 -46
  400. package/bundled/locales/zh-TW/core/project-context-memory.md +210 -31
  401. package/bundled/locales/zh-TW/core/project-structure.md +240 -19
  402. package/bundled/locales/zh-TW/core/recovery-recipe-registry.md +54 -114
  403. package/bundled/locales/zh-TW/core/refactoring-standards.md +153 -48
  404. package/bundled/locales/zh-TW/core/requirement-engineering.md +8 -37
  405. package/bundled/locales/zh-TW/core/retrospective-standards.md +127 -7
  406. package/bundled/locales/zh-TW/core/retry-standards.md +41 -105
  407. package/bundled/locales/zh-TW/core/reverse-engineering-standards.md +5 -1
  408. package/bundled/locales/zh-TW/core/runbook-standards.md +296 -23
  409. package/bundled/locales/zh-TW/core/secret-management-standards.md +12 -4
  410. package/bundled/locales/zh-TW/core/security-decision.md +43 -84
  411. package/bundled/locales/zh-TW/core/security-standards.md +204 -25
  412. package/bundled/locales/zh-TW/core/self-review-protocol.md +2 -1
  413. package/bundled/locales/zh-TW/core/skill-standard-alignment-check.md +103 -69
  414. package/bundled/locales/zh-TW/core/slo-standards.md +301 -49
  415. package/bundled/locales/zh-TW/core/spec-driven-development.md +36 -7
  416. package/bundled/locales/zh-TW/core/standard-admission-criteria.md +22 -28
  417. package/bundled/locales/zh-TW/core/standard-lifecycle-management.md +40 -48
  418. package/bundled/locales/zh-TW/core/structured-task-definition.md +2 -1
  419. package/bundled/locales/zh-TW/core/supply-chain-security-standards.md +137 -10
  420. package/bundled/locales/zh-TW/core/systematic-debugging.md +94 -38
  421. package/bundled/locales/zh-TW/core/tech-debt-standards.md +170 -54
  422. package/bundled/locales/zh-TW/core/test-completeness-dimensions.md +101 -12
  423. package/bundled/locales/zh-TW/core/test-data-standards.md +245 -23
  424. package/bundled/locales/zh-TW/core/test-driven-development.md +4 -1
  425. package/bundled/locales/zh-TW/core/test-governance.md +92 -32
  426. package/bundled/locales/zh-TW/core/testing-standards.md +61 -14
  427. package/bundled/locales/zh-TW/core/timeout-standards.md +45 -85
  428. package/bundled/locales/zh-TW/core/token-budget.md +41 -112
  429. package/bundled/locales/zh-TW/core/translation-lifecycle-standards.md +28 -16
  430. package/bundled/locales/zh-TW/core/verification-evidence.md +2 -1
  431. package/bundled/locales/zh-TW/core/versioning.md +6 -2
  432. package/bundled/locales/zh-TW/core/virtual-organization-standards.md +42 -36
  433. package/bundled/locales/zh-TW/core/workflow-enforcement.md +2 -1
  434. package/bundled/locales/zh-TW/core/workflow-state-protocol.md +2 -1
  435. package/bundled/locales/zh-TW/docs/CHEATSHEET.md +2 -1
  436. package/bundled/locales/zh-TW/docs/CLI-FLOW.md +2 -1
  437. package/bundled/locales/zh-TW/docs/CLI-INIT-OPTIONS.md +12 -3
  438. package/bundled/locales/zh-TW/docs/DEV-WORKFLOW-MAPPING.md +2 -1
  439. package/bundled/locales/zh-TW/docs/FEATURE-REFERENCE.md +8 -6
  440. package/bundled/locales/zh-TW/docs/STANDARDS-REFERENCE.md +2 -1
  441. package/bundled/locales/zh-TW/docs/USAGE-MODES-COMPARISON.md +2 -1
  442. package/bundled/locales/zh-TW/docs/USER-MANUAL.md +9 -1
  443. package/bundled/locales/zh-TW/docs/WINDOWS-GUIDE.md +4 -1
  444. package/bundled/locales/zh-TW/docs/specs/system/memory-adoption-strategy.md +2 -0
  445. package/bundled/locales/zh-TW/docs/user/FAQ.md +2 -0
  446. package/bundled/locales/zh-TW/docs/user/GETTING-STARTED.md +2 -0
  447. package/bundled/locales/zh-TW/docs/user/GLOSSARY.md +2 -0
  448. package/bundled/locales/zh-TW/docs/user/README.md +2 -0
  449. package/bundled/locales/zh-TW/docs/user/TROUBLESHOOTING.md +2 -0
  450. package/bundled/locales/zh-TW/integrations/claude-code/README.md +2 -1
  451. package/bundled/locales/zh-TW/integrations/codex/AGENTS.md +136 -2
  452. package/bundled/locales/zh-TW/integrations/codex/README.md +7 -1
  453. package/bundled/locales/zh-TW/integrations/gemini-cli/GEMINI.md +59 -1
  454. package/bundled/locales/zh-TW/integrations/gemini-cli/README.md +8 -1
  455. package/bundled/locales/zh-TW/integrations/github-copilot/COPILOT-CHAT-REFERENCE.md +7 -1
  456. package/bundled/locales/zh-TW/integrations/github-copilot/README.md +9 -3
  457. package/bundled/locales/zh-TW/integrations/github-copilot/copilot-instructions.md +146 -12
  458. package/bundled/locales/zh-TW/integrations/github-copilot/skills-mapping.md +7 -1
  459. package/bundled/locales/zh-TW/integrations/google-antigravity/AGENTS.md +110 -3
  460. package/bundled/locales/zh-TW/integrations/google-antigravity/README.md +7 -1
  461. package/bundled/locales/zh-TW/integrations/opencode/AGENTS.md +140 -2
  462. package/bundled/locales/zh-TW/integrations/opencode/README.md +7 -1
  463. package/bundled/locales/zh-TW/integrations/opencode/skills-mapping.md +8 -2
  464. package/bundled/locales/zh-TW/integrations/openspec/AGENTS.md +46 -1
  465. package/bundled/locales/zh-TW/integrations/openspec/README.md +7 -1
  466. package/bundled/locales/zh-TW/integrations/spec-kit/AGENTS.md +20 -2
  467. package/bundled/locales/zh-TW/integrations/spec-kit/README.md +7 -1
  468. package/bundled/locales/zh-TW/methodologies/guides/tdd-guide.md +584 -475
  469. package/bundled/locales/zh-TW/options/changelog/auto-generated.md +2 -0
  470. package/bundled/locales/zh-TW/options/changelog/keep-a-changelog.md +2 -0
  471. package/bundled/locales/zh-TW/options/code-review/automated-review.md +2 -0
  472. package/bundled/locales/zh-TW/options/code-review/pair-programming.md +2 -0
  473. package/bundled/locales/zh-TW/options/commit-message/bilingual.md +93 -5
  474. package/bundled/locales/zh-TW/options/commit-message/english.md +118 -1
  475. package/bundled/locales/zh-TW/options/commit-message/traditional-chinese.md +82 -1
  476. package/bundled/locales/zh-TW/options/documentation/api-docs.md +2 -0
  477. package/bundled/locales/zh-TW/options/documentation/markdown-docs.md +2 -0
  478. package/bundled/locales/zh-TW/options/documentation/wiki-style.md +2 -0
  479. package/bundled/locales/zh-TW/options/git-workflow/gitflow.md +99 -71
  480. package/bundled/locales/zh-TW/options/git-workflow/github-flow.md +68 -50
  481. package/bundled/locales/zh-TW/options/git-workflow/merge-commit.md +131 -20
  482. package/bundled/locales/zh-TW/options/git-workflow/rebase-ff.md +142 -27
  483. package/bundled/locales/zh-TW/options/git-workflow/squash-merge.md +100 -15
  484. package/bundled/locales/zh-TW/options/git-workflow/trunk-based.md +103 -56
  485. package/bundled/locales/zh-TW/options/project-structure/dotnet.md +233 -14
  486. package/bundled/locales/zh-TW/options/project-structure/go.md +270 -12
  487. package/bundled/locales/zh-TW/options/project-structure/java.md +235 -15
  488. package/bundled/locales/zh-TW/options/project-structure/kotlin.md +2 -0
  489. package/bundled/locales/zh-TW/options/project-structure/nodejs.md +136 -19
  490. package/bundled/locales/zh-TW/options/project-structure/php.md +2 -0
  491. package/bundled/locales/zh-TW/options/project-structure/python.md +177 -19
  492. package/bundled/locales/zh-TW/options/project-structure/ruby.md +2 -0
  493. package/bundled/locales/zh-TW/options/project-structure/rust.md +2 -0
  494. package/bundled/locales/zh-TW/options/project-structure/swift.md +2 -0
  495. package/bundled/locales/zh-TW/options/testing/contract-testing.md +2 -0
  496. package/bundled/locales/zh-TW/options/testing/e2e-testing.md +182 -21
  497. package/bundled/locales/zh-TW/options/testing/industry-pyramid.md +2 -0
  498. package/bundled/locales/zh-TW/options/testing/integration-testing.md +134 -22
  499. package/bundled/locales/zh-TW/options/testing/istqb-framework.md +2 -0
  500. package/bundled/locales/zh-TW/options/testing/performance-testing.md +2 -0
  501. package/bundled/locales/zh-TW/options/testing/security-testing.md +2 -0
  502. package/bundled/locales/zh-TW/options/testing/system-testing.md +175 -1
  503. package/bundled/locales/zh-TW/options/testing/unit-testing.md +123 -9
  504. package/bundled/locales/zh-TW/skills/CONTRIBUTING.template.md +3 -2
  505. package/bundled/locales/zh-TW/skills/INTEGRATION-GUIDE.md +2 -1
  506. package/bundled/locales/zh-TW/skills/README.md +2 -1
  507. package/bundled/locales/zh-TW/skills/_shared/README.md +2 -1
  508. package/bundled/locales/zh-TW/skills/ac-coverage/SKILL.md +15 -4
  509. package/bundled/locales/zh-TW/skills/adr-assistant/guide.md +123 -3
  510. package/bundled/locales/zh-TW/skills/agents/README.md +99 -1
  511. package/bundled/locales/zh-TW/skills/agents/code-architect.md +2 -0
  512. package/bundled/locales/zh-TW/skills/agents/doc-writer.md +2 -0
  513. package/bundled/locales/zh-TW/skills/agents/reviewer.md +3 -1
  514. package/bundled/locales/zh-TW/skills/agents/spec-analyst.md +2 -0
  515. package/bundled/locales/zh-TW/skills/agents/test-specialist.md +2 -0
  516. package/bundled/locales/zh-TW/skills/ai-collaboration-standards/SKILL.md +48 -37
  517. package/bundled/locales/zh-TW/skills/ai-collaboration-standards/anti-hallucination.md +22 -2
  518. package/bundled/locales/zh-TW/skills/ai-collaboration-standards/certainty-labels.md +29 -3
  519. package/bundled/locales/zh-TW/skills/ai-friendly-architecture/SKILL.md +23 -36
  520. package/bundled/locales/zh-TW/skills/ai-instruction-standards/SKILL.md +12 -36
  521. package/bundled/locales/zh-TW/skills/api-design-assistant/SKILL.md +21 -5
  522. package/bundled/locales/zh-TW/skills/atdd-assistant/SKILL.md +40 -15
  523. package/bundled/locales/zh-TW/skills/atdd-assistant/acceptance-criteria-guide.md +2 -1
  524. package/bundled/locales/zh-TW/skills/atdd-assistant/atdd-workflow.md +98 -1
  525. package/bundled/locales/zh-TW/skills/atdd-assistant/guide.md +24 -8
  526. package/bundled/locales/zh-TW/skills/audit-assistant/SKILL.md +8 -2
  527. package/bundled/locales/zh-TW/skills/bdd-assistant/SKILL.md +29 -6
  528. package/bundled/locales/zh-TW/skills/bdd-assistant/bdd-workflow.md +2 -1
  529. package/bundled/locales/zh-TW/skills/bdd-assistant/gherkin-guide.md +2 -1
  530. package/bundled/locales/zh-TW/skills/bdd-assistant/guide.md +9 -8
  531. package/bundled/locales/zh-TW/skills/changelog-guide/SKILL.md +12 -3
  532. package/bundled/locales/zh-TW/skills/changelog-guide/guide.md +11 -7
  533. package/bundled/locales/zh-TW/skills/checkin-assistant/SKILL.md +19 -3
  534. package/bundled/locales/zh-TW/skills/checkin-assistant/guide.md +5 -3
  535. package/bundled/locales/zh-TW/skills/ci-cd-assistant/SKILL.md +35 -16
  536. package/bundled/locales/zh-TW/skills/code-review-assistant/SKILL.md +19 -2
  537. package/bundled/locales/zh-TW/skills/code-review-assistant/checkin-checklist.md +2 -1
  538. package/bundled/locales/zh-TW/skills/code-review-assistant/guide.md +81 -6
  539. package/bundled/locales/zh-TW/skills/code-review-assistant/review-checklist.md +2 -1
  540. package/bundled/locales/zh-TW/skills/commands/ac-coverage.md +47 -2
  541. package/bundled/locales/zh-TW/skills/commands/api-design.md +3 -2
  542. package/bundled/locales/zh-TW/skills/commands/atdd.md +80 -10
  543. package/bundled/locales/zh-TW/skills/commands/audit.md +3 -2
  544. package/bundled/locales/zh-TW/skills/commands/bdd.md +114 -16
  545. package/bundled/locales/zh-TW/skills/commands/changelog.md +45 -9
  546. package/bundled/locales/zh-TW/skills/commands/check.md +74 -21
  547. package/bundled/locales/zh-TW/skills/commands/checkin.md +56 -11
  548. package/bundled/locales/zh-TW/skills/commands/ci-cd.md +2 -1
  549. package/bundled/locales/zh-TW/skills/commands/code-review.md +43 -2
  550. package/bundled/locales/zh-TW/skills/commands/commit.md +58 -4
  551. package/bundled/locales/zh-TW/skills/commands/config.md +52 -4
  552. package/bundled/locales/zh-TW/skills/commands/coverage.md +45 -4
  553. package/bundled/locales/zh-TW/skills/commands/database.md +3 -2
  554. package/bundled/locales/zh-TW/skills/commands/derive-all.md +44 -2
  555. package/bundled/locales/zh-TW/skills/commands/derive-atdd.md +37 -2
  556. package/bundled/locales/zh-TW/skills/commands/derive-bdd.md +44 -3
  557. package/bundled/locales/zh-TW/skills/commands/derive-tdd.md +45 -3
  558. package/bundled/locales/zh-TW/skills/commands/derive.md +62 -5
  559. package/bundled/locales/zh-TW/skills/commands/dev-workflow.md +60 -9
  560. package/bundled/locales/zh-TW/skills/commands/discover.md +43 -2
  561. package/bundled/locales/zh-TW/skills/commands/docgen.md +39 -2
  562. package/bundled/locales/zh-TW/skills/commands/docs.md +139 -7
  563. package/bundled/locales/zh-TW/skills/commands/durable.md +3 -2
  564. package/bundled/locales/zh-TW/skills/commands/e2e.md +86 -3
  565. package/bundled/locales/zh-TW/skills/commands/guide.md +4 -2
  566. package/bundled/locales/zh-TW/skills/commands/incident.md +3 -2
  567. package/bundled/locales/zh-TW/skills/commands/init.md +72 -15
  568. package/bundled/locales/zh-TW/skills/commands/methodology.md +117 -28
  569. package/bundled/locales/zh-TW/skills/commands/metrics.md +2 -1
  570. package/bundled/locales/zh-TW/skills/commands/migrate.md +2 -1
  571. package/bundled/locales/zh-TW/skills/commands/observability.md +45 -2
  572. package/bundled/locales/zh-TW/skills/commands/pr.md +2 -1
  573. package/bundled/locales/zh-TW/skills/commands/refactor.md +54 -13
  574. package/bundled/locales/zh-TW/skills/commands/release.md +83 -2
  575. package/bundled/locales/zh-TW/skills/commands/requirement.md +41 -2
  576. package/bundled/locales/zh-TW/skills/commands/reverse-bdd.md +37 -2
  577. package/bundled/locales/zh-TW/skills/commands/reverse-sdd.md +45 -2
  578. package/bundled/locales/zh-TW/skills/commands/reverse-tdd.md +43 -2
  579. package/bundled/locales/zh-TW/skills/commands/reverse.md +44 -2
  580. package/bundled/locales/zh-TW/skills/commands/runbook.md +47 -2
  581. package/bundled/locales/zh-TW/skills/commands/scan.md +3 -2
  582. package/bundled/locales/zh-TW/skills/commands/sdd-retro.md +52 -3
  583. package/bundled/locales/zh-TW/skills/commands/sdd.md +209 -28
  584. package/bundled/locales/zh-TW/skills/commands/security.md +3 -2
  585. package/bundled/locales/zh-TW/skills/commands/slo.md +48 -2
  586. package/bundled/locales/zh-TW/skills/commands/tdd.md +71 -2
  587. package/bundled/locales/zh-TW/skills/commands/update.md +64 -2
  588. package/bundled/locales/zh-TW/skills/commit-standards/SKILL.md +2 -2
  589. package/bundled/locales/zh-TW/skills/commit-standards/conventional-commits.md +2 -1
  590. package/bundled/locales/zh-TW/skills/commit-standards/guide.md +137 -17
  591. package/bundled/locales/zh-TW/skills/commit-standards/language-options.md +21 -18
  592. package/bundled/locales/zh-TW/skills/contract-test-assistant/SKILL.md +2 -2
  593. package/bundled/locales/zh-TW/skills/contract-test-assistant/guide.md +81 -1
  594. package/bundled/locales/zh-TW/skills/database-assistant/SKILL.md +21 -5
  595. package/bundled/locales/zh-TW/skills/deploy-assistant/SKILL.md +2 -1
  596. package/bundled/locales/zh-TW/skills/dev-methodology/SKILL.md +4 -1
  597. package/bundled/locales/zh-TW/skills/dev-methodology/create-methodology.md +2 -0
  598. package/bundled/locales/zh-TW/skills/dev-methodology/runtime.md +2 -0
  599. package/bundled/locales/zh-TW/skills/docs-generator/SKILL.md +19 -2
  600. package/bundled/locales/zh-TW/skills/docs-generator/guide.md +4 -3
  601. package/bundled/locales/zh-TW/skills/documentation-guide/SKILL.md +67 -42
  602. package/bundled/locales/zh-TW/skills/documentation-guide/documentation-structure.md +2 -1
  603. package/bundled/locales/zh-TW/skills/documentation-guide/readme-template.md +2 -1
  604. package/bundled/locales/zh-TW/skills/durable-execution-assistant/SKILL.md +32 -3
  605. package/bundled/locales/zh-TW/skills/e2e-assistant/SKILL.md +25 -7
  606. package/bundled/locales/zh-TW/skills/error-code-guide/SKILL.md +17 -34
  607. package/bundled/locales/zh-TW/skills/git-workflow-guide/SKILL.md +33 -38
  608. package/bundled/locales/zh-TW/skills/git-workflow-guide/branch-naming.md +2 -1
  609. package/bundled/locales/zh-TW/skills/git-workflow-guide/git-workflow.md +2 -1
  610. package/bundled/locales/zh-TW/skills/incident-response-assistant/SKILL.md +35 -14
  611. package/bundled/locales/zh-TW/skills/journey-test-assistant/SKILL.md +2 -14
  612. package/bundled/locales/zh-TW/skills/knowledge-graph/SKILL.md +6 -2
  613. package/bundled/locales/zh-TW/skills/metrics-dashboard-assistant/SKILL.md +42 -3
  614. package/bundled/locales/zh-TW/skills/observability-assistant/SKILL.md +85 -18
  615. package/bundled/locales/zh-TW/skills/pr-automation-assistant/SKILL.md +27 -3
  616. package/bundled/locales/zh-TW/skills/project-discovery/SKILL.md +11 -3
  617. package/bundled/locales/zh-TW/skills/project-discovery/guide.md +5 -3
  618. package/bundled/locales/zh-TW/skills/project-discovery/workflow.md +2 -1
  619. package/bundled/locales/zh-TW/skills/project-structure-guide/SKILL.md +19 -16
  620. package/bundled/locales/zh-TW/skills/project-structure-guide/language-patterns.md +2 -1
  621. package/bundled/locales/zh-TW/skills/refactoring-assistant/SKILL.md +26 -3
  622. package/bundled/locales/zh-TW/skills/refactoring-assistant/guide.md +4 -2
  623. package/bundled/locales/zh-TW/skills/release-standards/SKILL.md +91 -45
  624. package/bundled/locales/zh-TW/skills/release-standards/changelog-format.md +4 -3
  625. package/bundled/locales/zh-TW/skills/release-standards/guide.md +14 -5
  626. package/bundled/locales/zh-TW/skills/release-standards/release-workflow.md +5 -1
  627. package/bundled/locales/zh-TW/skills/release-standards/semantic-versioning.md +2 -1
  628. package/bundled/locales/zh-TW/skills/requirement-assistant/SKILL.md +15 -6
  629. package/bundled/locales/zh-TW/skills/requirement-assistant/guide.md +18 -8
  630. package/bundled/locales/zh-TW/skills/requirement-assistant/requirement-checklist.md +2 -1
  631. package/bundled/locales/zh-TW/skills/requirement-assistant/requirement-writing.md +2 -1
  632. package/bundled/locales/zh-TW/skills/retrospective-assistant/guide.md +200 -6
  633. package/bundled/locales/zh-TW/skills/reverse-engineer/bdd-extraction.md +2 -1
  634. package/bundled/locales/zh-TW/skills/reverse-engineer/guide.md +161 -36
  635. package/bundled/locales/zh-TW/skills/reverse-engineer/tdd-analysis.md +2 -1
  636. package/bundled/locales/zh-TW/skills/reverse-engineer/workflow.md +2 -1
  637. package/bundled/locales/zh-TW/skills/runbook-assistant/SKILL.md +9 -1
  638. package/bundled/locales/zh-TW/skills/security-assistant/SKILL.md +25 -5
  639. package/bundled/locales/zh-TW/skills/security-scan-assistant/SKILL.md +34 -8
  640. package/bundled/locales/zh-TW/skills/skill-builder/SKILL.md +3 -21
  641. package/bundled/locales/zh-TW/skills/slo-assistant/SKILL.md +3 -1
  642. package/bundled/locales/zh-TW/skills/spec-derivation/SKILL.md +2 -1
  643. package/bundled/locales/zh-TW/skills/spec-driven-dev/guide.md +35 -2
  644. package/bundled/locales/zh-TW/skills/sweep/SKILL.md +2 -1
  645. package/bundled/locales/zh-TW/skills/tdd-assistant/SKILL.md +10 -2
  646. package/bundled/locales/zh-TW/skills/tdd-assistant/guide.md +68 -9
  647. package/bundled/locales/zh-TW/skills/tdd-assistant/language-examples.md +693 -47
  648. package/bundled/locales/zh-TW/skills/tdd-assistant/tdd-workflow.md +183 -1
  649. package/bundled/locales/zh-TW/skills/test-coverage-assistant/SKILL.md +15 -5
  650. package/bundled/locales/zh-TW/skills/test-coverage-assistant/guide.md +26 -13
  651. package/bundled/locales/zh-TW/skills/testing-guide/testing-pyramid.md +2 -1
  652. package/bundled/locales/zh-TW/skills/testing-guide/testing-theory.md +3 -1
  653. package/bundled/locales/zh-TW/skills/tools/cline/README.md +2 -1
  654. package/bundled/locales/zh-TW/skills/tools/copilot/README.md +65 -18
  655. package/bundled/locales/zh-TW/skills/tools/copilot/copilot-instructions.md +2 -1
  656. package/bundled/locales/zh-TW/skills/tools/cursor/README.md +2 -1
  657. package/bundled/locales/zh-TW/skills/tools/windsurf/README.md +2 -1
  658. package/bundled/locales/zh-TW/skills/workflows/README.md +11 -9
  659. package/bundled/locales/zh-TW/templates/reverse-spec-template.md +50 -1
  660. package/bundled/skills/.claude-plugin/plugin.json +71 -0
  661. package/bundled/skills/commit-standards/SKILL.md +2 -2
  662. package/bundled/skills/commit-standards/guide.md +3 -2
  663. package/bundled/skills/commit-standards/language-options.md +19 -17
  664. package/package.json +2 -2
  665. package/src/commands/audit.js +28 -1
  666. package/src/commands/check.js +72 -3
  667. package/src/commands/compile.js +37 -4
  668. package/src/commands/config.js +49 -24
  669. package/src/commands/init.js +78 -30
  670. package/src/commands/open-work.js +6 -2
  671. package/src/commands/release-messages.js +228 -0
  672. package/src/commands/release.js +127 -68
  673. package/src/commands/run-intent.js +11 -0
  674. package/src/commands/spec.js +4 -2
  675. package/src/commands/update.js +173 -20
  676. package/src/compilers/claude-code-compiler.js +9 -1
  677. package/src/config/ai-agent-paths.js +14 -1
  678. package/src/core/installed-formats.js +15 -0
  679. package/src/core/open-work-config.js +20 -1
  680. package/src/core/project-config.js +55 -0
  681. package/src/i18n/messages.js +106 -2
  682. package/src/installers/hooks-installer.js +1 -1
  683. package/src/installers/manifest-installer.js +1 -1
  684. package/src/installers/skills-installer.js +1 -1
  685. package/src/installers/standards-installer.js +3 -1
  686. package/src/mcp/server.js +9 -3
  687. package/src/prompts/init.js +26 -22
  688. package/src/reconciler/actual-state-scanner.js +2 -8
  689. package/src/reconciler/backup-locations.js +5 -0
  690. package/src/reconciler/backup-manager.js +19 -11
  691. package/src/reconciler/desired-state-calculator.js +89 -57
  692. package/src/reconciler/plan-executor.js +101 -8
  693. package/src/reconciler/recorded-versions.js +49 -0
  694. package/src/reconciler/relative-path.js +23 -0
  695. package/src/uninstallers/hook-uninstaller.js +9 -1
  696. package/src/uninstallers/skills-uninstaller.js +22 -3
  697. package/src/utils/available-standards-report.js +25 -4
  698. package/src/utils/available-standards.js +13 -3
  699. package/src/utils/build-manifest.js +1 -1
  700. package/src/utils/commit-message-judge.js +60 -13
  701. package/src/utils/friction-detector.js +23 -11
  702. package/src/utils/git-hooks.js +106 -4
  703. package/src/utils/integration-generator.js +95 -67
  704. package/src/utils/legacy-hook-migration.js +121 -2
  705. package/src/utils/open-work-tracking.mjs +105 -16
  706. package/src/utils/sdd-header.js +16 -4
  707. package/src/utils/skills-installer.js +2 -1
  708. package/src/utils/spinner.js +14 -4
  709. package/src/utils/standard-validator.js +3 -2
  710. package/standards-registry.json +10 -8
  711. package/bundled/locales/zh-TW/core/guides/testing-guide.md +0 -2280
@@ -1,30 +1,33 @@
1
1
  ---
2
2
  source: ../../../core/reverse-engineering-standards.md
3
- source_version: 1.0.0
4
- translation_version: 1.0.0
5
- last_synced: 2026-01-19
6
- status: stale
3
+ source_version: 1.3.0
4
+ translation_version: 1.3.0
5
+ last_synced: 2026-10-16
6
+ source_hash: 5d4bb821ae35
7
+ status: current
7
8
  ---
8
9
 
9
- # 反向工程标准
10
+ # Reverse Engineering Standards | 反向工程标准
10
11
 
11
- **版本**: 1.0.0
12
- **最后更新**: 2026-01-19
13
- **适用范围**: 所有需要将程序码转换为规格文件的专案
12
+ **Version**: 1.3.0
13
+ **Last Updated**: 2026-08-20
14
+ **Applicability**: All projects requiring code-to-specification transformation
15
+ **Scope**: uds-specific
16
+ **Industry Standards**: IEEE 830-1998, SWEBOK v4.0 Chapter 9
14
17
 
15
- > **语言**: [English](../../../core/reverse-engineering-standards.md) | [繁体中文](../../zh-TW/core/reverse-engineering-standards.md)
18
+ > **语言**: [English](../../../core/reverse-engineering-standards.md) | [繁體中文](../../zh-TW/core/reverse-engineering-standards.md) | 简体中文
16
19
 
17
20
  ---
18
21
 
19
22
  ## 目的
20
23
 
21
- 本标准定义将现有程序码反向工程为结构化规格文件的原则、工作流程和最佳实践。反向工程是连接旧有系统与现代开发方法论(SDD → BDD → TDD)的桥梁。
24
+ 本标准定义将现有代码反向工程为结构化规格文档的原则、工作流程和最佳实践。反向工程是连接遗留系统与现代开发方法论(SDD → BDD → TDD)的桥梁。
22
25
 
23
- **主要效益**:
24
- - 将未文件化的程序码转换为可追溯的规格
25
- - 在旧有系统上启用现代开发实践
26
- - 在新团队成员与现有程序码库之间建立共同理解
27
- - 为未来增强和重构建立基础
26
+ **主要收益**:
27
+ - 将未文档化的代码转换为可追溯的规格
28
+ - 在遗留系统上启用现代开发实践
29
+ - 在新团队成员与现有代码库之间建立共同理解
30
+ - 为未来的增强与重构奠定基础
28
31
 
29
32
  ---
30
33
 
@@ -32,21 +35,21 @@ status: stale
32
35
 
33
36
  ```
34
37
  ┌──────────────────────────────────────────────────────────────────────────┐
35
- │ 反向工程工作流程 │
38
+ │ Reverse Engineering Workflow │
36
39
  ├──────────────────────────────────────────────────────────────────────────┤
37
40
  │ │
38
41
  │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ ┌───────────┐ │
39
- │ │ 程序码扫描 │───▶│ 测试分析 │───▶│ 缺口识别 │───▶│ 规格生成 │ │
42
+ │ │ Code Scan │───▶│Test Analysis│───▶│Gap Identify │───▶│ Spec Gen │ │
40
43
  │ └─────────────┘ └─────────────┘ └─────────────┘ └───────────┘ │
41
44
  │ │ │ │ │ │
42
45
  │ │ │ │ ▼ │
43
46
  │ │ │ │ ┌───────────────┐ │
44
- │ │ │ │ │ 人类审查 │ │
47
+ │ │ │ │ │ Human Review │ │
45
48
  │ │ │ │ └───────────────┘ │
46
49
  │ │ │ │ │ │
47
50
  │ ▼ ▼ ▼ ▼ │
48
- │ [已确认] [已确认] [未知] [已验证] │
49
- │ 来自程序码 来自测试 需人类输入 规格文件 │
51
+ │ [Confirmed] [Confirmed] [Unknown] [Validated] │
52
+ │ from code from tests for humans specification │
50
53
  │ │
51
54
  └──────────────────────────────────────────────────────────────────────────┘
52
55
  ```
@@ -54,54 +57,131 @@ status: stale
54
57
  ### 工作流程阶段
55
58
 
56
59
  | 阶段 | 说明 | 产出物 | 确定性层级 |
57
- |------|------|--------|-----------|
58
- | **程序码扫描** | 分析程序码结构、API、资料模型 | 技术清单 | [已确认] |
59
- | **测试分析** | 解析现有测试以取得验收条件 | 草拟验收条件 | [已确认]/[推论] |
60
- | **隐含规则扫描** | 扫描非 HTTP 持久化写入路径中未文件化的规则 | 隐含规则清单 + 三问解答 | [已确认]/[推论]/[未知] |
61
- | **缺口识别** | 列出需要人类输入的未知项目 | 缺口分析文件 | [未知] 项目 |
60
+ |-------|-------------|--------|-----------------|
61
+ | **代码扫描** | 分析代码结构、API、数据模型 | 技术清单 | [已确认] |
62
+ | **测试分析** | 解析现有测试以提取验收条件 | 草拟验收条件 | [已确认]/[推论] |
63
+ | **隐含规则扫描** | 扫描非 HTTP 持久化写入路径中未文档化的规则 | 隐含规则清单 + 三问解答 | [已确认]/[推论]/[未知] |
64
+ | **权限范围提取** | 提取所有根据操作者自身身份限定结果范围的查询谓词 | 自作用域谓词清单 + 必需的反向测试 | [已确认]/[推论]/[未知] |
65
+ | **缺口识别** | 列出需要人工输入的未知项 | 缺口分析文档 | [未知] 项 |
62
66
  | **规格生成** | 生成草拟规格 | 草拟 SPEC-XXX.md | 混合确定性 |
63
- | **人类审查** | 利害关系人验证与填补缺口 | 已验证的规格 | [已确认] |
67
+ | **人工审查** | 利益相关者验证与填补缺口 | 已验证规格 | [已确认] |
64
68
 
65
- > **注(v1.2.0)**:在程序码扫描/测试分析之后、缺口识别之前,插入一个 **隐含规则扫描** 阶段——详见下方[隐含规则扫描(非 HTTP 持久化规则)](#隐含规则扫描非-http-持久化规则)。标准程序码扫描只提取 HTTP 入口点与资料模型,但持久化栏位的值经常由**非 HTTP 路径**(cron、伫列、计算栏、trigger、ORM hook)写入,其业务规则从未被文件化——这是跨语言重写或跨 DB 迁移时遗漏逻辑的最高发来源。
69
+ > **注(v1.3.0)**:**权限范围提取**阶段与隐含规则扫描并行运行——参见下方的[权限范围提取(自引用查询谓词)](#auth-scope-extraction-self-referential-query-predicates)。隐含规则扫描涵盖那些由于在请求路径**之外**运行而不可见的规则。本阶段涵盖的则是一条虽然位于得到充分执行的请求路径**之上**却依然不可见的规则:一个根据操作者自身身份限定结果范围的 `WHERE` 谓词。它看起来只是若干过滤条件中的一个,而一旦重写时遗漏了它,返回的数据形状完全正确——却属于所有人。
70
+ >
71
+ > **注(v1.2.0)**:在代码扫描/测试分析之后、缺口识别之前插入了**隐含规则扫描**阶段——参见下方的[隐含规则扫描(非 HTTP 持久化规则)](#implicit-rule-scan-non-http-persistence-rules)。标准代码扫描提取 HTTP 入口点与数据模型,但持久化字段的值经常由**非 HTTP 路径**(cron、队列、计算列、触发器、ORM 钩子)写入,其业务规则从未被文档化——这是跨语言重写或跨数据库迁移中遗漏逻辑发生频率最高的原因。
66
72
 
67
73
  ---
68
74
 
69
75
  ## 隐含规则扫描(非 HTTP 持久化规则)
70
76
 
71
- > **工作流程位置**:在程序码扫描/测试分析之后、缺口识别之前。
77
+ > **工作流程位置**:代码扫描/测试分析之后,缺口识别之前。
72
78
 
73
- 程序码扫描提取的是透过 HTTP 可达的部分——路由、控制器、请求处理器。但一个持久化栏位的值经常在**请求路径之外**被决定:夜间 cron 翻转某个 status、伫列重试重新盖上某个 timestamp、资料库 trigger 推导出某个总额、ORM 生命周期 hook 把某个计数器归零。这些规则鲜少被写下来,因此只镜像 HTTP 表面的重写会悄悄遗漏它们。本阶段机械化地推导出每一条非 HTTP 写入路径,并把每条隐含规则锁为可验证物。
79
+ 代码扫描提取的是通过 HTTP 可达的内容——路由、控制器、请求处理器。但持久化字段的值往往是在**请求路径之外**决定的:夜间 cron 翻转状态、队列重试重新打上时间戳、数据库触发器计算总和、ORM 生命周期钩子将计数器归零。这些规则很少被记录下来,因此仅镜像 HTTP 表面的重写会静默丢失它们。本阶段机械化地推导出每一条非 HTTP 写入路径,并将每条隐含规则锁定为可验证的产物。
74
80
 
75
- ### 清单来源(derive,机械化)
81
+ ### 推导(机械化清单来源)
76
82
 
77
- 对旧系统扫描每一条**非 HTTP 持久化写入路径**,涵盖四类:
83
+ 扫描遗留系统中跨越四个类别的每一条**非 HTTP 持久化写入路径**:
78
84
 
79
- 1. **排程**——crontab 项目、scheduler 设定、`@Scheduled` 类注解、批次作业
80
- 2. **伫列**——queue consumer、job handler、背景 worker、message listener
81
- 3. **DB 层**——trigger、computed/generated column、`DEFAULT` 运算式、check constraint
82
- 4. **ORM 生命周期**——`beforeSave`/`afterSave`/observer/model-event hook、会变更持久状态的 middleware
85
+ 1. **定时任务(Scheduled)**——crontab 条目、调度器配置、`@Scheduled` 风格注解、批处理作业
86
+ 2. **队列(Queue)**——队列消费者、作业处理器、后台 worker、消息监听器
87
+ 3. **数据库层(DB-layer)**——触发器、计算列/生成列、`DEFAULT` 表达式、检查约束
88
+ 4. **ORM 生命周期(ORM lifecycle)**——`beforeSave`/`afterSave`/观察者/模型事件钩子、修改持久化状态的中间件
83
89
 
84
- ### Oracle(detect)——每栏三问
90
+ ### 预言机(检测)——每个字段的三问
85
91
 
86
- 对每个由非 HTTP 路径写入的持久化栏位,回答并锁定**三个问题**:
92
+ 针对由非 HTTP 路径写入的每个持久化字段,回答并锁定**三个问题**:
87
93
 
88
- | 问题 | 要撷取的内容 |
89
- |------|-------------|
90
- | **何时设值(SET)?** | 首次赋值的条件/触发点 |
91
- | **何时被覆写(OVERWRITE)?** | 之后每一次写入——**含非同步覆写**(连回 post-cutover 聚合对帐) |
92
- | **何时归零/重置(RESET)?** | 清除或回复为预设值的条件 |
94
+ | 问题 | 需要捕获的内容 |
95
+ |------|-----------------|
96
+ | **何时设值(SET)?** | 首次赋值的条件/触发器 |
97
+ | **何时被覆盖(OVERWRITTEN)?** | 之后每一次写入——**包括异步覆盖**(关联回割接后的聚合对账) |
98
+ | **何时重置/归零(RESET)?** | 清除或恢复为默认值的条件 |
93
99
 
94
- - 把 **Devil's Advocate(魔鬼代言人)** 质疑从 HTTP 层扩展到**涵盖非 HTTP 路径**:对 cron 条件、伫列重试、计算栏、trigger 逻辑,套用同样的五类对抗式质疑(边界、顺序、并发、失败/重试、null/预设)。
95
- - 为每条撷取的规则标注确定性层级:`[已确认]`(附 `file:line` 引用)/`[推论]`/`[未知]`。每个 `[未知]` 都交给缺口识别由人类处理——绝不臆测。
96
- - **输出**:把每条隐含规则锁为 **behavior-snapshot 场景** 或 **对帐不变量**(例如 `SUM(cost) GROUP BY status` 须跨 cutover 维持),让规则成为可重跑的 oracle 而非散文。
100
+ - 将**魔鬼代言人(Devil's Advocate)**质疑从 HTTP 层扩展到**覆盖非 HTTP 路径**:将相同的五种对抗性类别(边界、顺序、并发、失败/重试、空值/默认值)应用于 cron 条件、队列重试、计算列和触发器逻辑。
101
+ - 为每条提取的规则标注确定性层级:`[已确认]`(附 `file:line` 引用)/`[推论]`/`[未知]`。每个 `[未知]` 均移交给缺口识别由人工处理——绝不臆测。
102
+ - **产出**:将每条隐含规则锁定为**行为快照场景(behavior-snapshot scenario)**或**对账不变量(reconciliation invariant)**(例如 `SUM(cost) GROUP BY status` 必须跨割接保持一致),使规则成为可重复运行的判定准则(oracle)而非散文式描述。
97
103
 
98
- ### Gate 时机
104
+ ### 门禁时机
99
105
 
100
- pre-flight(规划期)。任何三问未获解答的非 HTTP 写入栏位会被标为 `not_implemented` 并 **block cutover**——未宣告的隐含规则视为已知遗漏风险,而非可接受的缺口。
106
+ 起飞前(规划期)。任何三个问题未获解答的非 HTTP 写入字段都会被标记为 `not_implemented` 并**阻断割接(blocks cutover)**——未声明的隐含规则被视为已知的遗漏风险,而非可接受的缺口。
101
107
 
102
- ### PHP 专属补述:宽松比较/type juggling
108
+ ### PHP 特别说明:宽松比较/type juggling
103
109
 
104
- 扫描 PHP 写入路径时,须额外标记**宽松比较/type juggling** 依赖点:`==` 比较、`"0"` / `""` / `null` / `0` 的 truthy/falsy 行为、字串自动转数字。这些在强型别目标(如 C#/.NET)下没有直接对应,因此它们所编码的隐含规则是跨语言重写时被悄悄丢失逻辑的高发来源。对每个此类位置标 `[已确认]` 并附 `file:line`,并把预期语义锁为一条明确规则。
110
+ 扫描 PHP 写入路径时,需额外标记**宽松比较/类型戏法(loose-comparison / type-juggling)**依赖项:`==` 比较、`"0"` / `""` / `null` / `0` 的真假值(truthy/falsy)行为,以及字符串到数字的自动强制转换。这些在强类型目标(例如 C#/.NET)下没有直接等价物,因此它们所编码的隐含规则是在跨语言重写期间静默丢失逻辑的高发来源。为每个此类位置标注 `[已确认]` 并附带 `file:line`,并将预期语义锁定为一条明确的规则。
111
+
112
+ ---
113
+
114
+ ## 权限范围提取(自引用查询谓词)
115
+
116
+ > **工作流程位置**:与隐含规则扫描并行——在代码扫描/测试分析之后,缺口识别之前。
117
+
118
+ **自引用谓词(self-referential predicate)**是一种根据*请求者是谁*来限定结果集范围的查询条件:`WHERE tenant_id = :current_user_tenant`、`WHERE owner = :uid`、`WHERE dept_id = (SELECT dept_id FROM member WHERE account = :uid)`。正是这行代码将“列出所有账户”变成了“列出**你的**账户”。
119
+
120
+ 本阶段所回答的问题狭窄且机械化:
121
+
122
+ > **对于遗留代码中每一个根据操作者自身身份限定结果范围的谓词,移植后的代码是否具有等价的谓词?**
123
+
124
+ 不是“它是否返回相同的结构形状”。不是“它是否返回数据”。而是一个**等价谓词**:相同的字段,绑定到对*自身(self)*相同的概念定义。
125
+
126
+ ### 为什么这需要一个独立阶段
127
+
128
+ 授权并非被遗漏的关注点——任何合格的测试分类法都早已将跨租户访问列为测试对象。该关注点并没有丢失;**它只是未被召回(un-recalled)**。以下三个特性使得这一特定缺陷能够在通常可以捕获它的所有门禁中幸存下来:
129
+
130
+ 1. **关乎安全的关键代码行看起来就像普通过滤器。** 安全边界存在于 `WHERE` 子句内部,而非请求或响应契约中。移植“获取所有账户”的人会看到 `SELECT` 和 `JOIN`;租户谓词看起来只是众多条件中的又一个而已。
131
+ 2. **基于结构形状的断言无法察觉作用域。** 一个以某个有效管理员身份调用端点并断言 `200` 以及非空列表的测试,无论作用域限定是正确的还是被彻底删除了,其通过情况都是**完全相同**的。契约测试、对等快照(parity snapshot)和响应 DTO 比较在此处结构性地失效(全然盲目):无论哪种方式,响应格式都是良好的。只不过它属于所有人。
132
+ 3. **存在共享解析器并不等同于该调用点使用了它。** 曾经吃过亏的代码库通常会发展出一个共享的作用域解析器(scope-resolver)工具类。新的或被忽视的调用点可能会从零重新实现该查询并且从未调用它——而该工具类在代码库其他地方的存在反而会产生极大的误导,因为它被误读为测试覆盖。
133
+
134
+ ### 推导(机械化清单来源)
135
+
136
+ 通过扫描遗留数据访问层来枚举候选谓词——切勿凭记忆行事。根据具体技术栈调整模式;目标是其右侧解析为**调用者自身的值**的任何条件:
137
+
138
+ | 信号 | 示例 |
139
+ |------|------|
140
+ | **直接自身绑定** | `WHERE <col> = :currentUser` / `:uid` / `$operatorId` / `session.user_id` |
141
+ | **租户/组织/所有者字段** | 与调用者派生值进行比较的 `tenant_id`、`org_id`、`master_account`、`owner_id`、`dept_id`、`company_id` |
142
+ | **解析调用者作用域的子查询** | `WHERE dept_id = (SELECT dept_id FROM member WHERE account = :uid)` |
143
+ | **按角色分支构建查询** | 基于 `role` / `account_type` 进行分支,其中**每个分支**应用不同的作用域——枚举每一个分支,而不仅仅是正常路径(happy path)所走的分支 |
144
+ | **在 SQL 之外应用的作用域** | ORM 全局作用域、查询构建器 mixin、仓储基类、行级安全策略、注入过滤器的中间件 |
145
+
146
+ 最后一行至关重要:谓词可以由 `SELECT` 语句从未提及的机制来强制执行。仅对 SQL 进行 grep 将报告一个比实际存在的集合**更小**的集合,而在这里,更小的集合看起来恰恰像是一个更安全的集合。
147
+
148
+ ### 记录(每个匹配项)
149
+
150
+ 针对每个候选谓词进行记录——`[已确认]`需要 `file:line` 引用:
151
+
152
+ | 字段 | 内容 |
153
+ |------|------|
154
+ | **位置** | 遗留源码中的 `file:line` |
155
+ | **谓词** | 确切的条件文本 |
156
+ | **自身绑定** | 解析为哪一个调用者派生值,以及该值是如何获取的 |
157
+ | **触发分支** | 哪个角色/参数/代码路径到达此谓词 |
158
+ | **确定性** | `[已确认]` / `[推论]` / `[未知]` |
159
+
160
+ 每个 `[未知]`——即无法从代码中确定的作用域——均进入缺口识别由人工处理。绝不臆测,也绝不假定其不存在。
161
+
162
+ ### 预言机(检测)——每个调用点的谓词等价性
163
+
164
+ 针对每个记录的谓词,在移植后的代码中验证:
165
+
166
+ 1. **存在字面等价物**——相同的字段,绑定到对自身(self)相同的概念定义。一个“恰好对当前数据返回相同行”的不同字段并不是等价的;它只是一个带有有效期的巧合。
167
+ 2. **覆盖每一个分支。** 如果遗留代码根据角色进行了不同的作用域限定,则每个分支都需要有自己经过验证的等价物。将五个角色分支合并为一个粗粒度的“此账户是否为管理员?”检查的移植实现,是用权限取代了边界。
168
+ 3. **该调用点调用了共享解析器。** 如果新系统将作用域限定集中在一个工具类中,请确认**该**调用点确实调用了它。该工具类在代码库其他位置的存在,并不能作为该端点已正确处理的证据。
169
+
170
+ ### 强制性反向测试
171
+
172
+ **规则 RE-AUTH-001(必需)**——每一个确认的自作用域谓词必须由一个**反向测试**锁定:操作者 **A** 发起请求,断言结果为操作者 **B** 的记录在响应中**不存在**。A 和 B 均为有效、已认证且被授权使用该端点的操作者。
173
+
174
+ 断言必须是关于**不存在(absence)**。断言 `200`、非空列表或匹配的响应模式(schema)的测试不是充分的证据,且**绝不能**被视为对该谓词的覆盖——即使删除了作用域子句,这些测试中的每一项也都能照样通过。
175
+
176
+ 在信任测试之前,一个有用的自检方法是:**在临时副本中删除作用域谓词并重新运行。**如果测试仍然通过,那么无论它的名称叫什么,它都没有在测试作用域。
177
+
178
+ ### 门禁时机
179
+
180
+ 提取阶段为起飞前(规划期);反向测试阶段为 UAT 前。
181
+
182
+ **规则 RE-AUTH-002(必需)**——任何移植等价物未经验证或没有反向测试的自作用域谓词,均被标记为 `not_implemented` 并**阻断割接**。未经验证的授权边界是已知的遗漏风险,而非可接受的缺口——其故障模式是跨租户信息泄露,而且在测试全绿(ships green)的情况下直接发布。
183
+
184
+ > **出处(Provenance)。** 本阶段源于一次真实的 PHP → C# 迁移,在该迁移中,一个按租户限定作用域的账户列表端点在重写期间丢失了其隔离谓词。移植实现用粗粒度的“该账户是否为任何已启用的管理员?”检查取代了按角色的作用域限定,并不管是哪个租户发起的请求,直接返回数据库中的所有账户。它发布了,它通过了所有现有的测试——该方法本来没有任何测试——直到有客户报告看到了不该出现的账户信息时才被发现。
105
185
 
106
186
  ---
107
187
 
@@ -109,14 +189,14 @@ pre-flight(规划期)。任何三问未获解答的非 HTTP 写入栏位会
109
189
 
110
190
  ### 1. 确定性框架
111
191
 
112
- 所有提取的资讯必须标注确定性层级:
192
+ 所有提取的信息必须标注确定性层级:
113
193
 
114
194
  | 标签 | 定义 | 范例 |
115
195
  |------|------|------|
116
- | `[已确认]` | 直接从程序码或测试验证 | "POST /api/users 端点位于 src/routes/users.ts:15" |
117
- | `[推论]` | 从观察到的模式进行逻辑推导 | "根据建构子模式,可能使用依赖注入" |
196
+ | `[已确认]` | 直接从代码或测试验证 | "POST /api/users 端点位于 src/routes/users.ts:15" |
197
+ | `[推论]` | 从观察到的模式进行逻辑推导 | "根据构造函数模式,可能使用依赖注入" |
118
198
  | `[假设]` | 需要验证的合理假设 | "根据典型模式,session 可能在 24 小时后过期" |
119
- | `[未知]` | 无法从程序码判断,需要人类输入 | "此功能的商业动机" |
199
+ | `[未知]` | 无法从代码判断,需要人类输入 | "此功能的业务动机" |
120
200
 
121
201
  **规则**:有疑问时,使用更不确定的标签,而非过度声称。
122
202
 
@@ -125,24 +205,24 @@ pre-flight(规划期)。任何三问未获解答的非 HTTP 写入栏位会
125
205
  本标准严格遵循[反幻觉标准](anti-hallucination.md):
126
206
 
127
207
  - **基于证据**:仅分析已明确读取的内容
128
- - **来源归属**:每项声明必须包含 `[来源: 程序码]` 或 `[来源: 测试]` 并附上 file:line 参考
208
+ - **来源归属**:每项声明必须包含 `[来源: 代码]` 或 `[来源: 测试]` 并附带 file:line 引用
129
209
  - **禁止捏造**:未经验证不得编造 API、配置或需求
130
- - **明确未知**:始终列出无法从程序码判断的项目
210
+ - **明确未知**:始终列出无法从代码判断的内容
131
211
 
132
- ### 3. 渐进式揭露
212
+ ### 3. 渐进式披露
133
213
 
134
- 分层提取资讯:
214
+ 分层提取信息:
135
215
 
136
- 1. **系统概览**:入口点、主要元件、高层架构
137
- 2. **元件详情**:各模组、其职责、介面
138
- 3. **实作细节**:演算法、资料流、边界情况
216
+ 1. **系统概览**:入口点、主要组件、高层架构
217
+ 2. **组件详情**:各个模块、其职责、接口
218
+ 3. **实现细节**:算法、数据流、边界情况
139
219
 
140
220
  ### 4. 测试对需求映射
141
221
 
142
- 现有测试是�的含需求的宝贵来源:
222
+ 现有测试是隐含需求的宝贵来源:
143
223
 
144
224
  ```javascript
145
- // 测试:src/tests/auth.test.ts
225
+ // Test: src/tests/auth.test.ts
146
226
  describe('Authentication', () => {
147
227
  it('should return 401 for invalid credentials', () => {...});
148
228
  it('should issue JWT token on successful login', () => {...});
@@ -152,10 +232,10 @@ describe('Authentication', () => {
152
232
  映射为:
153
233
 
154
234
  ```markdown
155
- ## 验收条件
156
- [已确认] 来自测试分析 (src/tests/auth.test.ts):
157
- - [ ] 对无效凭证回传 401 状态码 (第 3 行)
158
- - [ ] 登入成功时核发 JWT token (第 4 行)
235
+ ## Acceptance Criteria
236
+ [Confirmed] From test analysis (src/tests/auth.test.ts):
237
+ - [ ] Return 401 status code for invalid credentials (line 3)
238
+ - [ ] Issue JWT token on successful login (line 4)
159
239
  ```
160
240
 
161
241
  ---
@@ -164,26 +244,26 @@ describe('Authentication', () => {
164
244
 
165
245
  ### 可提取(AI 自动化)
166
246
 
167
- | 面向 | 确定性 | 来源 |
247
+ | 方面 | 确定性 | 来源 |
168
248
  |------|--------|------|
169
249
  | API 端点 | [已确认] | 路由定义、控制器 |
170
- | 资料模型 | [已确认] | 型别、介面、Schema |
171
- | 函数签名 | [已确认] | 参数、回传型别 |
172
- | 测试案例 | [已确认] | 测试档案 → 验收条件 |
173
- | 相依性 | [已确认] | 套件引用、汇入 |
174
- | 配置模式 | [已确认] | 配置档案 |
175
- | 行为模式 | [推论] | 程序码分析 |
250
+ | 数据模型 | [已确认] | 类型、接口、Schema |
251
+ | 函数签名 | [已确认] | 参数、返回类型 |
252
+ | 测试用例 | [已确认] | 测试文件 → 验收条件 |
253
+ | 依赖项 | [已确认] | 包引用、导入 |
254
+ | 配置模式 | [已确认] | 配置文件 |
255
+ | 行为模式 | [推论] | 代码分析 |
176
256
 
177
257
  ### 不可提取(需要人类输入)
178
258
 
179
- | 面向 | 原因 | 必要行动 |
259
+ | 方面 | 原因 | 必要行动 |
180
260
  |------|------|---------|
181
- | **动机/为什么** | 历史�的络不在程序码中 | 询问利害关系人 |
182
- | **商业背景** | 领域知识 | 询问产品负责人 |
183
- | **风险评估** | 需要领域专家 | 咨询领域专家 |
184
- | **取舍决策** | 缺少历史脉络 | 检视设计文件(如有) |
261
+ | **动机/为什么** | 历史背景不在代码中 | 询问利益相关者 |
262
+ | **业务背景** | 领域知识 | 询问产品负责人 |
263
+ | **风险评估** | 需要领域专业知识 | 咨询领域专家 |
264
+ | **取舍决策** | 缺失历史背景 | 查阅设计文档(如有) |
185
265
  | **非功能性需求** | 通常是隐含的 | 与架构师讨论 |
186
- | **范围外决策** | 被明确排除的项目 | 检视原始需求 |
266
+ | **范围外决策** | 明确排除的项目 | 审查原始需求 |
187
267
 
188
268
  ---
189
269
 
@@ -193,40 +273,40 @@ describe('Authentication', () => {
193
273
 
194
274
  ```
195
275
  ┌───────────────────────────────────────────────────────────────────────┐
196
- │ 反向工程 → 前向开发 │
276
+ │ Reverse Engineering → Forward Development │
197
277
  ├───────────────────────────────────────────────────────────────────────┤
198
278
  │ │
199
- │ 现有 │
200
- │ 程序码 + 测试 │
279
+ │ Existing │
280
+ │ Code + Tests │
201
281
  │ │ │
202
282
  │ ▼ │
203
283
  │ ┌─────────────────────────────────────────────────────────────┐ │
204
- │ │ 反向工程(本标准) │ │
205
- │ │ • 程序码扫描 → 技术清单 │ │
206
- │ │ • 测试分析 → 验收条件 │ │
207
- │ │ • 缺口识别 → [未知] 清单 │ │
284
+ │ │ Reverse Engineering (This Standard) │ │
285
+ │ │ • Code Scanning → Technical Inventory │ │
286
+ │ │ • Test Analysis → Acceptance Criteria │ │
287
+ │ │ • Gap Identification → [Unknown] List │ │
208
288
  │ └─────────────────────────────────────────────────────────────┘ │
209
289
  │ │ │
210
290
  │ ▼ │
211
291
  │ ┌─────────────────────────────────────────────────────────────┐ │
212
- │ │ SDD(规格驱动开发) │ │
213
- │ │ • 反向工程规格 = 提案草稿 │ │
214
- │ │ • 填写 [未知] 区块 → 完整提案 │ │
215
- │ │ • 正式审查 → 已核准规格 │ │
292
+ │ │ SDD (Spec-Driven Development) │ │
293
+ │ │ • Reverse-engineered spec = Proposal Draft │ │
294
+ │ │ • Fill [Unknown] sections → Complete Proposal │ │
295
+ │ │ • Formal Review → Approved Specification │ │
216
296
  │ └─────────────────────────────────────────────────────────────┘ │
217
297
  │ │ │
218
298
  │ ▼ │
219
299
  │ ┌─────────────────────────────────────────────────────────────┐ │
220
- │ │ BDD(行为驱动开发) │ │
221
- │ │ • 验收条件 → Gherkin 情境 │ │
222
- │ │ • 利害关系人验证 │ │
300
+ │ │ BDD (Behavior-Driven Development) │ │
301
+ │ │ • Acceptance Criteria → Gherkin Scenarios │ │
302
+ │ │ • Stakeholder Validation │ │
223
303
  │ └─────────────────────────────────────────────────────────────┘ │
224
304
  │ │ │
225
305
  │ ▼ │
226
306
  │ ┌─────────────────────────────────────────────────────────────┐ │
227
- │ │ TDD(测试驱动开发) │ │
228
- │ │ • Gherkin → 单元测试需求 │ │
229
- │ │ • 缺口分析 → 缺少的测试覆盖 │ │
307
+ │ │ TDD (Test-Driven Development) │ │
308
+ │ │ • Gherkin → Unit Test Requirements │ │
309
+ │ │ • Gap Analysis → Missing Test Coverage │ │
230
310
  │ └─────────────────────────────────────────────────────────────┘ │
231
311
  │ │
232
312
  └───────────────────────────────────────────────────────────────────────┘
@@ -234,31 +314,200 @@ describe('Authentication', () => {
234
314
 
235
315
  ### SDD 整合
236
316
 
237
- 反向工程的规格直接进入 SDD 工作流程:
317
+ 反向工程规格直接进入 SDD 工作流程:
238
318
 
239
319
  1. **产出 = SDD 提案草稿**:生成的规格成为提案
240
320
  2. **需要人类审查**:所有 `[未知]` 区块必须由人类填写
241
321
  3. **正式核准**:规格必须经过标准 SDD 审查流程
242
- 4. **状态追踪**:在规格元资料中标记为「反向工程」
322
+ 4. **状态追踪**:在规格元数据中标记为 "Reverse-Engineered"
323
+
324
+ ### BDD 整合
325
+
326
+ 将验收条件转换为 Gherkin 格式:
327
+
328
+ ```markdown
329
+ ## Acceptance Criteria (from reverse engineering)
330
+ [Confirmed] User can add item to empty cart
331
+ [Confirmed] Quantity increments for duplicate items
332
+ [Inferred] Maximum quantity limit: 99 items
333
+ ```
334
+
335
+ 转换为:
336
+
337
+ ```gherkin
338
+ Feature: Shopping Cart
339
+ # Source: Reverse-engineered from src/cart/
340
+
341
+ Scenario: Add item to empty cart
342
+ Given an empty shopping cart
343
+ When the user adds "Widget" to the cart
344
+ Then the cart should contain 1 "Widget"
345
+
346
+ Scenario: Add duplicate item
347
+ Given a cart with 1 "Widget"
348
+ When the user adds another "Widget"
349
+ Then the cart should contain 2 "Widget"
350
+
351
+ @needs-confirmation
352
+ Scenario: Maximum quantity limit
353
+ Given a cart with 99 "Widget"
354
+ When the user tries to add another "Widget"
355
+ Then the add should be rejected
356
+ # [Inferred] - Verify with stakeholders
357
+ ```
358
+
359
+ ### TDD 整合
360
+
361
+ 使用反向工程规格识别测试覆盖缺口:
362
+
363
+ 1. **映射现有测试**:将测试关联到验收条件
364
+ 2. **识别缺口**:找出没有对应测试的验收条件
365
+ 3. **确定优先级**:重点关注高风险且未测试的行为
366
+ 4. **编写测试**:使用 TDD 工作流程补全测试覆盖
367
+
368
+ ---
369
+
370
+ ## 反向工程规格模板
371
+
372
+ ```markdown
373
+ # [SPEC-XXX] [Feature Name] - Reverse Engineered
374
+
375
+ ## Metadata
376
+ - **Status**: Draft (Reverse-Engineered)
377
+ - **Source**: [directory or file path]
378
+ - **Generated**: [date]
379
+ - **Reviewed By**: [pending]
380
+
381
+ ## Summary
382
+ [Brief description - [Inferred] or [Confirmed]]
383
+
384
+ ## Motivation
385
+ [Unknown] - Requires human input
386
+ - Why was this feature originally built?
387
+ - What problem does it solve?
388
+
389
+ ## Technical Design
390
+
391
+ ### API Endpoints
392
+ [Confirmed] From code analysis:
393
+ - `POST /api/resource` - [Source: Code] src/routes/resource.ts:15
394
+ - `GET /api/resource/:id` - [Source: Code] src/routes/resource.ts:25
395
+
396
+ ### Data Models
397
+ [Confirmed] From type definitions:
398
+ - `Resource` interface - [Source: Code] src/types/resource.ts:5-20
399
+
400
+ ### Dependencies
401
+ [Confirmed] From import analysis:
402
+ - Database: PostgreSQL (knex client)
403
+ - Cache: Redis
404
+
405
+ ## Acceptance Criteria
406
+ [Confirmed] From test analysis (src/tests/resource.test.ts):
407
+ - [ ] Create resource with valid data (line 10)
408
+ - [ ] Return 400 for invalid input (line 25)
409
+ - [ ] Return 404 for non-existent resource (line 40)
410
+
411
+ [Unknown] Not covered by tests:
412
+ - [ ] [Need Confirmation] Rate limiting behavior
413
+ - [ ] [Need Confirmation] Cache invalidation strategy
414
+
415
+ ## Risks
416
+ [Unknown] - Requires domain expertise
417
+
418
+ ## Out of Scope
419
+ [Unknown] - Requires historical context
420
+
421
+ ## Source Citations
422
+ | Item | File | Line | Certainty |
423
+ |------|------|------|-----------|
424
+ | POST /api/resource | src/routes/resource.ts | 15 | [Confirmed] |
425
+ | Resource interface | src/types/resource.ts | 5-20 | [Confirmed] |
426
+ | 400 on invalid | src/tests/resource.test.ts | 25 | [Confirmed] |
427
+ ```
428
+
429
+ ---
430
+
431
+ ## 失败处理与升级
432
+
433
+ 反向工程从现有代码中推断意图;某些输入无法被安全地分析。本节定义了“失败 → 升级 → 重新验证”路径,以确保低置信度或无法解析的输入绝不会产生看似权威的规格。
434
+
435
+ | 条件 | 触发点 | 操作 | 重新验证 |
436
+ |-----------|---------|--------|-----------|
437
+ | **解析失败** | 源代码无法解析(不支持的语言、损坏的语法树) | 将该单元标记为 `[Unknown]` 并报告语言/文件;升级至人类领域专家。不为其生成任何推断行为。 | 工具修复/补丁后源代码可正常解析 |
438
+ | **未知比例过高** | `[Unknown]` 项超出置信度阈值(默认 > 50% 的行为) | 暂停规格定稿;要求先对业务领域专家进行访谈以填补 `[Unknown]` 项。绝不交付大部分靠猜测的规格。 | 未知比例低于阈值 |
439
+ | **推断冲突** | 代码与先前推断的行为相冲突 | 将该项降级为 `[Assumption]` 并升级给代码所有者;切勿将存在冲突的推断记录为 `[Confirmed]`。 | 所有者确认或修正 |
440
+ | **测试分析失败** | 现有测试无法运行/解析以提取行为 | 回退为仅进行静态分析;将受影响的行为标记为 `[Inferred]`(较低确定性),绝不标记为 `[Confirmed]`。 | — |
441
+
442
+ **规则 RE-FAIL-001(强制)**:解析失败或超出阈值的 `[Unknown]` 比例必须阻断规格定稿并升级至人类处理——绝不能将低于置信度阈值的规格作为权威规格呈现。
443
+
444
+ ---
445
+
446
+ ## 应避免的反模式
447
+
448
+ ### 代码分析反模式
449
+
450
+ | 反模式 | 影响 | 正确方法 |
451
+ |--------------|--------|------------------|
452
+ | **捏造动机** | 误导性规格 | 标记为 `[Unknown]` |
453
+ | **臆测需求** | 虚假信心 | 标记为 `[Need Confirmation]` |
454
+ | **臆想未读代码** | 幻觉 | 仅分析已读取的内容 |
455
+ | **将推断作为事实呈现** | 破坏信任 | 始终使用适当的标签 |
456
+ | **跳过人类审查** | 规格不完整 | 始终要求审查阶段 |
457
+
458
+ ### 流程反模式
459
+
460
+ | 反模式 | 影响 | 正确方法 |
461
+ |--------------|--------|------------------|
462
+ | **为未读代码生成规格** | 无效输出 | 先读取所有相关文件 |
463
+ | **未经人类参与填补 [Unknown]** | 无效规格 | 始终获取人类输入 |
464
+ | **跳过测试分析** | 遗漏标准 | 始终分析现有测试 |
465
+ | **单次通过生成** | 规格肤浅 | 使用渐进式揭露 |
243
466
 
244
467
  ---
245
468
 
246
- ## 工具整合
469
+ ## 最佳实践
247
470
 
248
- ### 命令列工具
471
+ ### 应做事项
472
+
473
+ - ✅ 在提出任何论断之前阅读所有相关文件
474
+ - ✅ 为每项陈述标注确定性层级
475
+ - ✅ 包含附带 file:line 引用的来源出处
476
+ - ✅ 清楚列出需要人类输入的内容
477
+ - ✅ 保留原始代码注释作为上下文
478
+ - ✅ 将测试映射至验收条件
479
+ - ✅ 使用渐进式揭露(概览 → 详情)
480
+ - ✅ 与利益相关者验证推断
481
+
482
+ ### 避免事项
483
+
484
+ - ❌ 臆测动机或业务上下文
485
+ - ❌ 将推断作为已确认的事实呈现
486
+ - ❌ 跳过来源归属
487
+ - ❌ 为未读取的代码生成规格
488
+ - ❌ 未经人类输入即填补 `[Unknown]` 部分
489
+ - ❌ 忽视现有测试
490
+ - ❌ 跳过人类审查阶段
491
+ - ❌ 过度设计规格
492
+
493
+ ---
494
+
495
+ ## 工具集成
496
+
497
+ ### 命令行工具
249
498
 
250
499
  | 工具 | 命令 | 用途 |
251
- |------|------|------|
252
- | **Claude Code** | `/reverse-spec` | 从程序码生成 SDD 规格 |
253
- | **Claude Code** | `/reverse-bdd` | 将 AC 转换为 Gherkin 情境 |
254
- | **Claude Code** | `/reverse-tdd` | 分析 BDD 的测试覆盖 |
500
+ |------|---------|---------|
501
+ | **Claude Code** | `/reverse-spec` | 从代码生成 SDD 规格 |
502
+ | **Claude Code** | `/reverse-bdd` | 将 AC 转换为 Gherkin 场景 |
503
+ | **Claude Code** | `/reverse-tdd` | 针对 BDD 分析测试覆盖率 |
255
504
 
256
505
  ### 技能参考
257
506
 
258
- - [反向工程技能](../../../skills/reverse-engineer/SKILL.md) - 详细工作流程实作
259
- - [规格驱动开发技能](../../../skills/spec-driven-dev/SKILL.md) - SDD 整合
260
- - [BDD 助手技能](../../../skills/bdd-assistant/SKILL.md) - Gherkin 撰写
261
- - [TDD 助手技能](../../../skills/tdd-assistant/SKILL.md) - 测试覆盖分析
507
+ - [反向工程技能](../skills/reverse-engineer/SKILL.md) - 详细工作流程实现
508
+ - [规格驱动开发技能](../skills/spec-driven-dev/SKILL.md) - SDD 集成
509
+ - [BDD 助手技能](../skills/bdd-assistant/SKILL.md) - Gherkin 编写
510
+ - [TDD 助手技能](../skills/tdd-assistant/SKILL.md) - 测试覆盖率分析
262
511
 
263
512
  ---
264
513
 
@@ -266,33 +515,34 @@ describe('Authentication', () => {
266
515
 
267
516
  - [反幻觉指南](anti-hallucination.md) - 基于证据的分析要求
268
517
  - [规格驱动开发](spec-driven-development.md) - 规格工作流程
269
- - [行为驱动开发](../../../core/behavior-driven-development.md) - Given-When-Then 情境
518
+ - [行为驱动开发](behavior-driven-development.md) - Given-When-Then 场景
270
519
  - [测试驱动开发](test-driven-development.md) - 红-绿-重构循环
271
- - [验收测试驱动开发](../../../core/acceptance-test-driven-development.md) - 验收条件
272
- - [程序码审查清单](code-review-checklist.md) - 审查指南
520
+ - [验收测试驱动开发](acceptance-test-driven-development.md) - 验收条件
521
+ - [代码审查清单](code-review-checklist.md) - 审查指南
522
+ - [测试完备性维度](test-completeness-dimensions.md) - 维度 4(授权)指定了跨租户测试;权限范围提取是确定需要哪些测试的发现步骤
273
523
 
274
524
  ---
275
525
 
276
526
  ## 版本历史
277
527
 
278
528
  | 版本 | 日期 | 变更内容 |
279
- |------|------|----------|
280
- | 1.2.0 | 2026-06-27 | 新增:隐含规则扫描阶段(非 HTTP 持久化写入路径撷取)——4 类 derive 清单 + 三问 oracle + 非 HTTP Devil's Advocate + PHP type-juggling 补述 + 确定性/`file:line`(XSPEC-284 R4/AC-8) |
529
+ |---------|------|---------|
530
+ | 1.3.0 | 2026-08-20 | 新增:权限范围提取阶段(自引用查询谓词)——派生信号包括非 SQL 范围强制执行、附带 `file:line` 的逐匹配记录、覆盖每个角色分支和每个调用点解析器使用的谓词等价 oracle、规则 RE-AUTH-001(强制性反向测试断言不存在另一操作员的记录)和 RE-AUTH-002(未验证的谓词阻断切换)(issue [#166](https://github.com/AsiaOstrich/universal-dev-standards/issues/166)) |
531
+ | 1.2.0 | 2026-06-27 | 新增:隐含规则扫描阶段(非 HTTP 持久化写入路径提取)——4 类 derive 分类 + 三问 oracle + 非 HTTP 魔鬼代言人 + PHP 类型杂耍(type-juggling)说明 + 确定性/`file:line`(XSPEC-284 R4/AC-8) |
532
+ | 1.1.0 | 2026-06-18 | 新增:失败处理与升级章节——解析失败 / 未知比例过高 / 推断冲突升级 + 规则 RE-FAIL-001(XSPEC-292 T7) |
281
533
  | 1.0.0 | 2026-01-19 | 初始发布 |
282
534
 
283
- > **翻译同步注**:本简体译本仍落后于英文源(缺 1.0.0 的 BDD/TDD 整合、规格范本、反模式、最佳实践,及 1.1.0 的失败处理与升级章节),属既有翻译欠债,需后续完整重译;故前置 metadata 暂保留 `source_version: 1.0.0 / status: stale`。本次仅补入 R4 隐含规则扫描新内容。
284
-
285
535
  ---
286
536
 
287
537
  ## 参考资料
288
538
 
289
539
  - [反幻觉标准](anti-hallucination.md) - 核心合规要求
290
- - [IEEE 830-1998 - 软体需求规格](https://standards.ieee.org/ieee/830/1222/)
291
- - [SWEBOK v4.0 - 第 9 章:软体维护](https://www.computer.org/education/bodies-of-knowledge/software-engineering)
292
- - [与旧有程序码有效协作 - Michael Feathers](https://www.oreilly.com/library/view/working-effectively-with/0131177052/)
540
+ - [IEEE 830-1998 - 软件需求规格](https://standards.ieee.org/ieee/830/1222/)
541
+ - [SWEBOK v4.0 - 第 9 章:软件维护](https://www.computer.org/education/bodies-of-knowledge/software-engineering)
542
+ - [与旧有代码有效协作 - Michael Feathers](https://www.oreilly.com/library/view/working-effectively-with/0131177052/)
293
543
 
294
544
  ---
295
545
 
296
- ## 授权
546
+ ## 许可证
297
547
 
298
- 本标准以 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 授权发布。
548
+ 本标准依据 [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) 许可发布。