@accelerator-mzq/forge 1.4.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 (663) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE-THIRD-PARTY.md +50 -0
  3. package/README.md +159 -0
  4. package/dist/cli/commands/ack.d.ts +7 -0
  5. package/dist/cli/commands/ack.d.ts.map +1 -0
  6. package/dist/cli/commands/ack.js +223 -0
  7. package/dist/cli/commands/ack.js.map +1 -0
  8. package/dist/cli/commands/archive.d.ts +44 -0
  9. package/dist/cli/commands/archive.d.ts.map +1 -0
  10. package/dist/cli/commands/archive.js +689 -0
  11. package/dist/cli/commands/archive.js.map +1 -0
  12. package/dist/cli/commands/backlog.d.ts +3 -0
  13. package/dist/cli/commands/backlog.d.ts.map +1 -0
  14. package/dist/cli/commands/backlog.js +55 -0
  15. package/dist/cli/commands/backlog.js.map +1 -0
  16. package/dist/cli/commands/config.d.ts +3 -0
  17. package/dist/cli/commands/config.d.ts.map +1 -0
  18. package/dist/cli/commands/config.js +107 -0
  19. package/dist/cli/commands/config.js.map +1 -0
  20. package/dist/cli/commands/evidence.d.ts +7 -0
  21. package/dist/cli/commands/evidence.d.ts.map +1 -0
  22. package/dist/cli/commands/evidence.js +662 -0
  23. package/dist/cli/commands/evidence.js.map +1 -0
  24. package/dist/cli/commands/finding.d.ts +3 -0
  25. package/dist/cli/commands/finding.d.ts.map +1 -0
  26. package/dist/cli/commands/finding.js +93 -0
  27. package/dist/cli/commands/finding.js.map +1 -0
  28. package/dist/cli/commands/init.d.ts +3 -0
  29. package/dist/cli/commands/init.d.ts.map +1 -0
  30. package/dist/cli/commands/init.js +126 -0
  31. package/dist/cli/commands/init.js.map +1 -0
  32. package/dist/cli/commands/legacy-bridge.d.ts +11 -0
  33. package/dist/cli/commands/legacy-bridge.d.ts.map +1 -0
  34. package/dist/cli/commands/legacy-bridge.js +586 -0
  35. package/dist/cli/commands/legacy-bridge.js.map +1 -0
  36. package/dist/cli/commands/migrate.d.ts +3 -0
  37. package/dist/cli/commands/migrate.d.ts.map +1 -0
  38. package/dist/cli/commands/migrate.js +34 -0
  39. package/dist/cli/commands/migrate.js.map +1 -0
  40. package/dist/cli/commands/monitor.d.ts +3 -0
  41. package/dist/cli/commands/monitor.d.ts.map +1 -0
  42. package/dist/cli/commands/monitor.js +113 -0
  43. package/dist/cli/commands/monitor.js.map +1 -0
  44. package/dist/cli/commands/preflight.d.ts +7 -0
  45. package/dist/cli/commands/preflight.d.ts.map +1 -0
  46. package/dist/cli/commands/preflight.js +63 -0
  47. package/dist/cli/commands/preflight.js.map +1 -0
  48. package/dist/cli/commands/scope.d.ts +3 -0
  49. package/dist/cli/commands/scope.d.ts.map +1 -0
  50. package/dist/cli/commands/scope.js +32 -0
  51. package/dist/cli/commands/scope.js.map +1 -0
  52. package/dist/cli/commands/stage-extensions.d.ts +45 -0
  53. package/dist/cli/commands/stage-extensions.d.ts.map +1 -0
  54. package/dist/cli/commands/stage-extensions.js +590 -0
  55. package/dist/cli/commands/stage-extensions.js.map +1 -0
  56. package/dist/cli/commands/update.d.ts +3 -0
  57. package/dist/cli/commands/update.d.ts.map +1 -0
  58. package/dist/cli/commands/update.js +98 -0
  59. package/dist/cli/commands/update.js.map +1 -0
  60. package/dist/cli/commands/upgrade.d.ts +3 -0
  61. package/dist/cli/commands/upgrade.d.ts.map +1 -0
  62. package/dist/cli/commands/upgrade.js +277 -0
  63. package/dist/cli/commands/upgrade.js.map +1 -0
  64. package/dist/cli/commands/validate.d.ts +3 -0
  65. package/dist/cli/commands/validate.d.ts.map +1 -0
  66. package/dist/cli/commands/validate.js +66 -0
  67. package/dist/cli/commands/validate.js.map +1 -0
  68. package/dist/cli/index.d.ts +3 -0
  69. package/dist/cli/index.d.ts.map +1 -0
  70. package/dist/cli/index.js +69 -0
  71. package/dist/cli/index.js.map +1 -0
  72. package/dist/core/ack-log.d.ts +107 -0
  73. package/dist/core/ack-log.d.ts.map +1 -0
  74. package/dist/core/ack-log.js +197 -0
  75. package/dist/core/ack-log.js.map +1 -0
  76. package/dist/core/archive/ack-log-consistency.d.ts +15 -0
  77. package/dist/core/archive/ack-log-consistency.d.ts.map +1 -0
  78. package/dist/core/archive/ack-log-consistency.js +164 -0
  79. package/dist/core/archive/ack-log-consistency.js.map +1 -0
  80. package/dist/core/archive/fence.d.ts +66 -0
  81. package/dist/core/archive/fence.d.ts.map +1 -0
  82. package/dist/core/archive/fence.js +218 -0
  83. package/dist/core/archive/fence.js.map +1 -0
  84. package/dist/core/archive/index.d.ts +4 -0
  85. package/dist/core/archive/index.d.ts.map +1 -0
  86. package/dist/core/archive/index.js +6 -0
  87. package/dist/core/archive/index.js.map +1 -0
  88. package/dist/core/archive/legacy-exemption.d.ts +14 -0
  89. package/dist/core/archive/legacy-exemption.d.ts.map +1 -0
  90. package/dist/core/archive/legacy-exemption.js +82 -0
  91. package/dist/core/archive/legacy-exemption.js.map +1 -0
  92. package/dist/core/archive/lock.d.ts +46 -0
  93. package/dist/core/archive/lock.d.ts.map +1 -0
  94. package/dist/core/archive/lock.js +98 -0
  95. package/dist/core/archive/lock.js.map +1 -0
  96. package/dist/core/archive/pause-decisions-fence.d.ts +13 -0
  97. package/dist/core/archive/pause-decisions-fence.d.ts.map +1 -0
  98. package/dist/core/archive/pause-decisions-fence.js +384 -0
  99. package/dist/core/archive/pause-decisions-fence.js.map +1 -0
  100. package/dist/core/archive/process-evidence-fence.d.ts +110 -0
  101. package/dist/core/archive/process-evidence-fence.d.ts.map +1 -0
  102. package/dist/core/archive/process-evidence-fence.js +449 -0
  103. package/dist/core/archive/process-evidence-fence.js.map +1 -0
  104. package/dist/core/archive/process-evidence-rerun.d.ts +9 -0
  105. package/dist/core/archive/process-evidence-rerun.d.ts.map +1 -0
  106. package/dist/core/archive/process-evidence-rerun.js +238 -0
  107. package/dist/core/archive/process-evidence-rerun.js.map +1 -0
  108. package/dist/core/archive/recover-prompt.d.ts +10 -0
  109. package/dist/core/archive/recover-prompt.d.ts.map +1 -0
  110. package/dist/core/archive/recover-prompt.js +29 -0
  111. package/dist/core/archive/recover-prompt.js.map +1 -0
  112. package/dist/core/archive/recover.d.ts +83 -0
  113. package/dist/core/archive/recover.d.ts.map +1 -0
  114. package/dist/core/archive/recover.js +219 -0
  115. package/dist/core/archive/recover.js.map +1 -0
  116. package/dist/core/archive/resume-summary.d.ts +22 -0
  117. package/dist/core/archive/resume-summary.d.ts.map +1 -0
  118. package/dist/core/archive/resume-summary.js +82 -0
  119. package/dist/core/archive/resume-summary.js.map +1 -0
  120. package/dist/core/archive/summary-builder.d.ts +28 -0
  121. package/dist/core/archive/summary-builder.d.ts.map +1 -0
  122. package/dist/core/archive/summary-builder.js +287 -0
  123. package/dist/core/archive/summary-builder.js.map +1 -0
  124. package/dist/core/archive/summary-render.d.ts +8 -0
  125. package/dist/core/archive/summary-render.d.ts.map +1 -0
  126. package/dist/core/archive/summary-render.js +64 -0
  127. package/dist/core/archive/summary-render.js.map +1 -0
  128. package/dist/core/archive/three-level-fence.d.ts +10 -0
  129. package/dist/core/archive/three-level-fence.d.ts.map +1 -0
  130. package/dist/core/archive/three-level-fence.js +93 -0
  131. package/dist/core/archive/three-level-fence.js.map +1 -0
  132. package/dist/core/archive/transaction.d.ts +41 -0
  133. package/dist/core/archive/transaction.d.ts.map +1 -0
  134. package/dist/core/archive/transaction.js +184 -0
  135. package/dist/core/archive/transaction.js.map +1 -0
  136. package/dist/core/archive/verify-findings-fence.d.ts +11 -0
  137. package/dist/core/archive/verify-findings-fence.d.ts.map +1 -0
  138. package/dist/core/archive/verify-findings-fence.js +80 -0
  139. package/dist/core/archive/verify-findings-fence.js.map +1 -0
  140. package/dist/core/archive/version-retrograde-fence.d.ts +10 -0
  141. package/dist/core/archive/version-retrograde-fence.d.ts.map +1 -0
  142. package/dist/core/archive/version-retrograde-fence.js +103 -0
  143. package/dist/core/archive/version-retrograde-fence.js.map +1 -0
  144. package/dist/core/artifact-graph/builder.d.ts +16 -0
  145. package/dist/core/artifact-graph/builder.d.ts.map +1 -0
  146. package/dist/core/artifact-graph/builder.js +32 -0
  147. package/dist/core/artifact-graph/builder.js.map +1 -0
  148. package/dist/core/artifact-graph/index.d.ts +3 -0
  149. package/dist/core/artifact-graph/index.d.ts.map +1 -0
  150. package/dist/core/artifact-graph/index.js +4 -0
  151. package/dist/core/artifact-graph/index.js.map +1 -0
  152. package/dist/core/artifact-graph/types.d.ts +14 -0
  153. package/dist/core/artifact-graph/types.d.ts.map +1 -0
  154. package/dist/core/artifact-graph/types.js +2 -0
  155. package/dist/core/artifact-graph/types.js.map +1 -0
  156. package/dist/core/backlog/assets/backlog-readme.md +11 -0
  157. package/dist/core/backlog/index.d.ts +20 -0
  158. package/dist/core/backlog/index.d.ts.map +1 -0
  159. package/dist/core/backlog/index.js +60 -0
  160. package/dist/core/backlog/index.js.map +1 -0
  161. package/dist/core/backlog/render.d.ts +51 -0
  162. package/dist/core/backlog/render.d.ts.map +1 -0
  163. package/dist/core/backlog/render.js +196 -0
  164. package/dist/core/backlog/render.js.map +1 -0
  165. package/dist/core/bootstrap/index.d.ts +2 -0
  166. package/dist/core/bootstrap/index.d.ts.map +1 -0
  167. package/dist/core/bootstrap/index.js +5 -0
  168. package/dist/core/bootstrap/index.js.map +1 -0
  169. package/dist/core/canonical-json.d.ts +11 -0
  170. package/dist/core/canonical-json.d.ts.map +1 -0
  171. package/dist/core/canonical-json.js +43 -0
  172. package/dist/core/canonical-json.js.map +1 -0
  173. package/dist/core/git/utils.d.ts +27 -0
  174. package/dist/core/git/utils.d.ts.map +1 -0
  175. package/dist/core/git/utils.js +53 -0
  176. package/dist/core/git/utils.js.map +1 -0
  177. package/dist/core/harness-adapters/claude.d.ts +13 -0
  178. package/dist/core/harness-adapters/claude.d.ts.map +1 -0
  179. package/dist/core/harness-adapters/claude.js +53 -0
  180. package/dist/core/harness-adapters/claude.js.map +1 -0
  181. package/dist/core/harness-adapters/codex.d.ts +14 -0
  182. package/dist/core/harness-adapters/codex.d.ts.map +1 -0
  183. package/dist/core/harness-adapters/codex.js +60 -0
  184. package/dist/core/harness-adapters/codex.js.map +1 -0
  185. package/dist/core/harness-adapters/detector.d.ts +15 -0
  186. package/dist/core/harness-adapters/detector.d.ts.map +1 -0
  187. package/dist/core/harness-adapters/detector.js +45 -0
  188. package/dist/core/harness-adapters/detector.js.map +1 -0
  189. package/dist/core/harness-adapters/hash-compare.d.ts +21 -0
  190. package/dist/core/harness-adapters/hash-compare.d.ts.map +1 -0
  191. package/dist/core/harness-adapters/hash-compare.js +49 -0
  192. package/dist/core/harness-adapters/hash-compare.js.map +1 -0
  193. package/dist/core/harness-adapters/index.d.ts +8 -0
  194. package/dist/core/harness-adapters/index.d.ts.map +1 -0
  195. package/dist/core/harness-adapters/index.js +8 -0
  196. package/dist/core/harness-adapters/index.js.map +1 -0
  197. package/dist/core/harness-adapters/interface.d.ts +52 -0
  198. package/dist/core/harness-adapters/interface.d.ts.map +1 -0
  199. package/dist/core/harness-adapters/interface.js +3 -0
  200. package/dist/core/harness-adapters/interface.js.map +1 -0
  201. package/dist/core/harness-adapters/legacy-detector.d.ts +14 -0
  202. package/dist/core/harness-adapters/legacy-detector.d.ts.map +1 -0
  203. package/dist/core/harness-adapters/legacy-detector.js +83 -0
  204. package/dist/core/harness-adapters/legacy-detector.js.map +1 -0
  205. package/dist/core/harness-adapters/transaction.d.ts +12 -0
  206. package/dist/core/harness-adapters/transaction.d.ts.map +1 -0
  207. package/dist/core/harness-adapters/transaction.js +113 -0
  208. package/dist/core/harness-adapters/transaction.js.map +1 -0
  209. package/dist/core/harness-adapters/types.d.ts +45 -0
  210. package/dist/core/harness-adapters/types.d.ts.map +1 -0
  211. package/dist/core/harness-adapters/types.js +3 -0
  212. package/dist/core/harness-adapters/types.js.map +1 -0
  213. package/dist/core/hash/content.d.ts +10 -0
  214. package/dist/core/hash/content.d.ts.map +1 -0
  215. package/dist/core/hash/content.js +131 -0
  216. package/dist/core/hash/content.js.map +1 -0
  217. package/dist/core/hash/diff.d.ts +26 -0
  218. package/dist/core/hash/diff.d.ts.map +1 -0
  219. package/dist/core/hash/diff.js +40 -0
  220. package/dist/core/hash/diff.js.map +1 -0
  221. package/dist/core/hash/index.d.ts +6 -0
  222. package/dist/core/hash/index.d.ts.map +1 -0
  223. package/dist/core/hash/index.js +7 -0
  224. package/dist/core/hash/index.js.map +1 -0
  225. package/dist/core/hash/log.d.ts +7 -0
  226. package/dist/core/hash/log.d.ts.map +1 -0
  227. package/dist/core/hash/log.js +14 -0
  228. package/dist/core/hash/log.js.map +1 -0
  229. package/dist/core/hash/tasks.d.ts +9 -0
  230. package/dist/core/hash/tasks.d.ts.map +1 -0
  231. package/dist/core/hash/tasks.js +20 -0
  232. package/dist/core/hash/tasks.js.map +1 -0
  233. package/dist/core/legacy-bridge/ack.d.ts +30 -0
  234. package/dist/core/legacy-bridge/ack.d.ts.map +1 -0
  235. package/dist/core/legacy-bridge/ack.js +133 -0
  236. package/dist/core/legacy-bridge/ack.js.map +1 -0
  237. package/dist/core/legacy-bridge/anchors.d.ts +15 -0
  238. package/dist/core/legacy-bridge/anchors.d.ts.map +1 -0
  239. package/dist/core/legacy-bridge/anchors.js +119 -0
  240. package/dist/core/legacy-bridge/anchors.js.map +1 -0
  241. package/dist/core/legacy-bridge/budget.d.ts +39 -0
  242. package/dist/core/legacy-bridge/budget.d.ts.map +1 -0
  243. package/dist/core/legacy-bridge/budget.js +83 -0
  244. package/dist/core/legacy-bridge/budget.js.map +1 -0
  245. package/dist/core/legacy-bridge/conflict.d.ts +44 -0
  246. package/dist/core/legacy-bridge/conflict.d.ts.map +1 -0
  247. package/dist/core/legacy-bridge/conflict.js +105 -0
  248. package/dist/core/legacy-bridge/conflict.js.map +1 -0
  249. package/dist/core/legacy-bridge/diff-report.d.ts +14 -0
  250. package/dist/core/legacy-bridge/diff-report.d.ts.map +1 -0
  251. package/dist/core/legacy-bridge/diff-report.js +105 -0
  252. package/dist/core/legacy-bridge/diff-report.js.map +1 -0
  253. package/dist/core/legacy-bridge/encoding.d.ts +42 -0
  254. package/dist/core/legacy-bridge/encoding.d.ts.map +1 -0
  255. package/dist/core/legacy-bridge/encoding.js +104 -0
  256. package/dist/core/legacy-bridge/encoding.js.map +1 -0
  257. package/dist/core/legacy-bridge/excel.d.ts +32 -0
  258. package/dist/core/legacy-bridge/excel.d.ts.map +1 -0
  259. package/dist/core/legacy-bridge/excel.js +124 -0
  260. package/dist/core/legacy-bridge/excel.js.map +1 -0
  261. package/dist/core/legacy-bridge/hash-anchor.d.ts +23 -0
  262. package/dist/core/legacy-bridge/hash-anchor.d.ts.map +1 -0
  263. package/dist/core/legacy-bridge/hash-anchor.js +55 -0
  264. package/dist/core/legacy-bridge/hash-anchor.js.map +1 -0
  265. package/dist/core/legacy-bridge/indexer.d.ts +28 -0
  266. package/dist/core/legacy-bridge/indexer.d.ts.map +1 -0
  267. package/dist/core/legacy-bridge/indexer.js +145 -0
  268. package/dist/core/legacy-bridge/indexer.js.map +1 -0
  269. package/dist/core/legacy-bridge/mapper.d.ts +40 -0
  270. package/dist/core/legacy-bridge/mapper.d.ts.map +1 -0
  271. package/dist/core/legacy-bridge/mapper.js +241 -0
  272. package/dist/core/legacy-bridge/mapper.js.map +1 -0
  273. package/dist/core/legacy-bridge/quality-judge.d.ts +65 -0
  274. package/dist/core/legacy-bridge/quality-judge.d.ts.map +1 -0
  275. package/dist/core/legacy-bridge/quality-judge.js +277 -0
  276. package/dist/core/legacy-bridge/quality-judge.js.map +1 -0
  277. package/dist/core/legacy-bridge/redact.d.ts +28 -0
  278. package/dist/core/legacy-bridge/redact.d.ts.map +1 -0
  279. package/dist/core/legacy-bridge/redact.js +121 -0
  280. package/dist/core/legacy-bridge/redact.js.map +1 -0
  281. package/dist/core/legacy-bridge/regenerator.d.ts +50 -0
  282. package/dist/core/legacy-bridge/regenerator.d.ts.map +1 -0
  283. package/dist/core/legacy-bridge/regenerator.js +193 -0
  284. package/dist/core/legacy-bridge/regenerator.js.map +1 -0
  285. package/dist/core/legacy-bridge/resolve.d.ts +28 -0
  286. package/dist/core/legacy-bridge/resolve.d.ts.map +1 -0
  287. package/dist/core/legacy-bridge/resolve.js +75 -0
  288. package/dist/core/legacy-bridge/resolve.js.map +1 -0
  289. package/dist/core/legacy-bridge/sync-check.d.ts +47 -0
  290. package/dist/core/legacy-bridge/sync-check.d.ts.map +1 -0
  291. package/dist/core/legacy-bridge/sync-check.js +198 -0
  292. package/dist/core/legacy-bridge/sync-check.js.map +1 -0
  293. package/dist/core/legacy-bridge/types.d.ts +114 -0
  294. package/dist/core/legacy-bridge/types.d.ts.map +1 -0
  295. package/dist/core/legacy-bridge/types.js +4 -0
  296. package/dist/core/legacy-bridge/types.js.map +1 -0
  297. package/dist/core/markers/index.d.ts +3 -0
  298. package/dist/core/markers/index.d.ts.map +1 -0
  299. package/dist/core/markers/index.js +3 -0
  300. package/dist/core/markers/index.js.map +1 -0
  301. package/dist/core/markers/parse.d.ts +12 -0
  302. package/dist/core/markers/parse.d.ts.map +1 -0
  303. package/dist/core/markers/parse.js +31 -0
  304. package/dist/core/markers/parse.js.map +1 -0
  305. package/dist/core/markers/types.d.ts +142 -0
  306. package/dist/core/markers/types.d.ts.map +1 -0
  307. package/dist/core/markers/types.js +3 -0
  308. package/dist/core/markers/types.js.map +1 -0
  309. package/dist/core/migrate/ack.d.ts +13 -0
  310. package/dist/core/migrate/ack.d.ts.map +1 -0
  311. package/dist/core/migrate/ack.js +62 -0
  312. package/dist/core/migrate/ack.js.map +1 -0
  313. package/dist/core/migrate/archive-detect.d.ts +19 -0
  314. package/dist/core/migrate/archive-detect.d.ts.map +1 -0
  315. package/dist/core/migrate/archive-detect.js +89 -0
  316. package/dist/core/migrate/archive-detect.js.map +1 -0
  317. package/dist/core/migrate/budget.d.ts +7 -0
  318. package/dist/core/migrate/budget.d.ts.map +1 -0
  319. package/dist/core/migrate/budget.js +25 -0
  320. package/dist/core/migrate/budget.js.map +1 -0
  321. package/dist/core/migrate/conflict.d.ts +49 -0
  322. package/dist/core/migrate/conflict.d.ts.map +1 -0
  323. package/dist/core/migrate/conflict.js +99 -0
  324. package/dist/core/migrate/conflict.js.map +1 -0
  325. package/dist/core/migrate/index.d.ts +7 -0
  326. package/dist/core/migrate/index.d.ts.map +1 -0
  327. package/dist/core/migrate/index.js +389 -0
  328. package/dist/core/migrate/index.js.map +1 -0
  329. package/dist/core/migrate/markdown-aware.d.ts +27 -0
  330. package/dist/core/migrate/markdown-aware.d.ts.map +1 -0
  331. package/dist/core/migrate/markdown-aware.js +112 -0
  332. package/dist/core/migrate/markdown-aware.js.map +1 -0
  333. package/dist/core/migrate/quality.d.ts +66 -0
  334. package/dist/core/migrate/quality.d.ts.map +1 -0
  335. package/dist/core/migrate/quality.js +302 -0
  336. package/dist/core/migrate/quality.js.map +1 -0
  337. package/dist/core/migrate/regenerate.d.ts +24 -0
  338. package/dist/core/migrate/regenerate.d.ts.map +1 -0
  339. package/dist/core/migrate/regenerate.js +145 -0
  340. package/dist/core/migrate/regenerate.js.map +1 -0
  341. package/dist/core/migrate/report.d.ts +36 -0
  342. package/dist/core/migrate/report.d.ts.map +1 -0
  343. package/dist/core/migrate/report.js +154 -0
  344. package/dist/core/migrate/report.js.map +1 -0
  345. package/dist/core/migrate/sources/index.d.ts +4 -0
  346. package/dist/core/migrate/sources/index.d.ts.map +1 -0
  347. package/dist/core/migrate/sources/index.js +17 -0
  348. package/dist/core/migrate/sources/index.js.map +1 -0
  349. package/dist/core/migrate/sources/openspec.d.ts +14 -0
  350. package/dist/core/migrate/sources/openspec.d.ts.map +1 -0
  351. package/dist/core/migrate/sources/openspec.js +453 -0
  352. package/dist/core/migrate/sources/openspec.js.map +1 -0
  353. package/dist/core/migrate/sources/superpowers.d.ts +12 -0
  354. package/dist/core/migrate/sources/superpowers.d.ts.map +1 -0
  355. package/dist/core/migrate/sources/superpowers.js +310 -0
  356. package/dist/core/migrate/sources/superpowers.js.map +1 -0
  357. package/dist/core/migrate/types.d.ts +183 -0
  358. package/dist/core/migrate/types.d.ts.map +1 -0
  359. package/dist/core/migrate/types.js +5 -0
  360. package/dist/core/migrate/types.js.map +1 -0
  361. package/dist/core/migrate/utils.d.ts +2 -0
  362. package/dist/core/migrate/utils.d.ts.map +1 -0
  363. package/dist/core/migrate/utils.js +28 -0
  364. package/dist/core/migrate/utils.js.map +1 -0
  365. package/dist/core/monitor/artifact-observer.d.ts +9 -0
  366. package/dist/core/monitor/artifact-observer.d.ts.map +1 -0
  367. package/dist/core/monitor/artifact-observer.js +180 -0
  368. package/dist/core/monitor/artifact-observer.js.map +1 -0
  369. package/dist/core/monitor/config.d.ts +16 -0
  370. package/dist/core/monitor/config.d.ts.map +1 -0
  371. package/dist/core/monitor/config.js +48 -0
  372. package/dist/core/monitor/config.js.map +1 -0
  373. package/dist/core/monitor/divergence-map.d.ts +5 -0
  374. package/dist/core/monitor/divergence-map.d.ts.map +1 -0
  375. package/dist/core/monitor/divergence-map.js +92 -0
  376. package/dist/core/monitor/divergence-map.js.map +1 -0
  377. package/dist/core/monitor/exit-handler.d.ts +6 -0
  378. package/dist/core/monitor/exit-handler.d.ts.map +1 -0
  379. package/dist/core/monitor/exit-handler.js +27 -0
  380. package/dist/core/monitor/exit-handler.js.map +1 -0
  381. package/dist/core/monitor/health-verdict.d.ts +9 -0
  382. package/dist/core/monitor/health-verdict.d.ts.map +1 -0
  383. package/dist/core/monitor/health-verdict.js +55 -0
  384. package/dist/core/monitor/health-verdict.js.map +1 -0
  385. package/dist/core/monitor/report-renderer.d.ts +4 -0
  386. package/dist/core/monitor/report-renderer.d.ts.map +1 -0
  387. package/dist/core/monitor/report-renderer.js +82 -0
  388. package/dist/core/monitor/report-renderer.js.map +1 -0
  389. package/dist/core/monitor/trace-store.d.ts +39 -0
  390. package/dist/core/monitor/trace-store.d.ts.map +1 -0
  391. package/dist/core/monitor/trace-store.js +130 -0
  392. package/dist/core/monitor/trace-store.js.map +1 -0
  393. package/dist/core/monitor/types.d.ts +63 -0
  394. package/dist/core/monitor/types.d.ts.map +1 -0
  395. package/dist/core/monitor/types.js +26 -0
  396. package/dist/core/monitor/types.js.map +1 -0
  397. package/dist/core/parse/design.d.ts +14 -0
  398. package/dist/core/parse/design.d.ts.map +1 -0
  399. package/dist/core/parse/design.js +17 -0
  400. package/dist/core/parse/design.js.map +1 -0
  401. package/dist/core/parse/fenced-yaml.d.ts +18 -0
  402. package/dist/core/parse/fenced-yaml.d.ts.map +1 -0
  403. package/dist/core/parse/fenced-yaml.js +45 -0
  404. package/dist/core/parse/fenced-yaml.js.map +1 -0
  405. package/dist/core/parse/index.d.ts +7 -0
  406. package/dist/core/parse/index.d.ts.map +1 -0
  407. package/dist/core/parse/index.js +8 -0
  408. package/dist/core/parse/index.js.map +1 -0
  409. package/dist/core/parse/markdown.d.ts +30 -0
  410. package/dist/core/parse/markdown.d.ts.map +1 -0
  411. package/dist/core/parse/markdown.js +66 -0
  412. package/dist/core/parse/markdown.js.map +1 -0
  413. package/dist/core/parse/proposal.d.ts +18 -0
  414. package/dist/core/parse/proposal.d.ts.map +1 -0
  415. package/dist/core/parse/proposal.js +22 -0
  416. package/dist/core/parse/proposal.js.map +1 -0
  417. package/dist/core/parse/specs.d.ts +25 -0
  418. package/dist/core/parse/specs.d.ts.map +1 -0
  419. package/dist/core/parse/specs.js +58 -0
  420. package/dist/core/parse/specs.js.map +1 -0
  421. package/dist/core/parse/tasks.d.ts +33 -0
  422. package/dist/core/parse/tasks.d.ts.map +1 -0
  423. package/dist/core/parse/tasks.js +82 -0
  424. package/dist/core/parse/tasks.js.map +1 -0
  425. package/dist/core/parse/yaml.d.ts +13 -0
  426. package/dist/core/parse/yaml.d.ts.map +1 -0
  427. package/dist/core/parse/yaml.js +39 -0
  428. package/dist/core/parse/yaml.js.map +1 -0
  429. package/dist/core/process-evidence-freeze-warnings.d.ts +24 -0
  430. package/dist/core/process-evidence-freeze-warnings.d.ts.map +1 -0
  431. package/dist/core/process-evidence-freeze-warnings.js +153 -0
  432. package/dist/core/process-evidence-freeze-warnings.js.map +1 -0
  433. package/dist/core/schema/index.d.ts +5 -0
  434. package/dist/core/schema/index.d.ts.map +1 -0
  435. package/dist/core/schema/index.js +6 -0
  436. package/dist/core/schema/index.js.map +1 -0
  437. package/dist/core/schema/model-tiers-config.d.ts +41 -0
  438. package/dist/core/schema/model-tiers-config.d.ts.map +1 -0
  439. package/dist/core/schema/model-tiers-config.js +85 -0
  440. package/dist/core/schema/model-tiers-config.js.map +1 -0
  441. package/dist/core/schema/process-verification-config.d.ts +18 -0
  442. package/dist/core/schema/process-verification-config.d.ts.map +1 -0
  443. package/dist/core/schema/process-verification-config.js +74 -0
  444. package/dist/core/schema/process-verification-config.js.map +1 -0
  445. package/dist/core/schema/stage-extensions-config.d.ts +28 -0
  446. package/dist/core/schema/stage-extensions-config.d.ts.map +1 -0
  447. package/dist/core/schema/stage-extensions-config.js +228 -0
  448. package/dist/core/schema/stage-extensions-config.js.map +1 -0
  449. package/dist/core/schema/types.d.ts +262 -0
  450. package/dist/core/schema/types.d.ts.map +1 -0
  451. package/dist/core/schema/types.js +51 -0
  452. package/dist/core/schema/types.js.map +1 -0
  453. package/dist/core/schema/writing-plans-config.d.ts +11 -0
  454. package/dist/core/schema/writing-plans-config.d.ts.map +1 -0
  455. package/dist/core/schema/writing-plans-config.js +40 -0
  456. package/dist/core/schema/writing-plans-config.js.map +1 -0
  457. package/dist/core/schemas/archive-summary.d.ts +131 -0
  458. package/dist/core/schemas/archive-summary.d.ts.map +1 -0
  459. package/dist/core/schemas/archive-summary.js +31 -0
  460. package/dist/core/schemas/archive-summary.js.map +1 -0
  461. package/dist/core/schemas/process-evidence.d.ts +156 -0
  462. package/dist/core/schemas/process-evidence.d.ts.map +1 -0
  463. package/dist/core/schemas/process-evidence.js +12 -0
  464. package/dist/core/schemas/process-evidence.js.map +1 -0
  465. package/dist/core/schemas/scope-entries.d.ts +68 -0
  466. package/dist/core/schemas/scope-entries.d.ts.map +1 -0
  467. package/dist/core/schemas/scope-entries.js +47 -0
  468. package/dist/core/schemas/scope-entries.js.map +1 -0
  469. package/dist/core/schemas/severity.d.ts +58 -0
  470. package/dist/core/schemas/severity.d.ts.map +1 -0
  471. package/dist/core/schemas/severity.js +26 -0
  472. package/dist/core/schemas/severity.js.map +1 -0
  473. package/dist/core/scope/aggregator.d.ts +49 -0
  474. package/dist/core/scope/aggregator.d.ts.map +1 -0
  475. package/dist/core/scope/aggregator.js +141 -0
  476. package/dist/core/scope/aggregator.js.map +1 -0
  477. package/dist/core/scope/index.d.ts +2 -0
  478. package/dist/core/scope/index.d.ts.map +1 -0
  479. package/dist/core/scope/index.js +2 -0
  480. package/dist/core/scope/index.js.map +1 -0
  481. package/dist/core/specs-sync/apply.d.ts +8 -0
  482. package/dist/core/specs-sync/apply.d.ts.map +1 -0
  483. package/dist/core/specs-sync/apply.js +26 -0
  484. package/dist/core/specs-sync/apply.js.map +1 -0
  485. package/dist/core/specs-sync/deltas.d.ts +15 -0
  486. package/dist/core/specs-sync/deltas.d.ts.map +1 -0
  487. package/dist/core/specs-sync/deltas.js +27 -0
  488. package/dist/core/specs-sync/deltas.js.map +1 -0
  489. package/dist/core/specs-sync/index.d.ts +3 -0
  490. package/dist/core/specs-sync/index.d.ts.map +1 -0
  491. package/dist/core/specs-sync/index.js +4 -0
  492. package/dist/core/specs-sync/index.js.map +1 -0
  493. package/dist/core/stage-extensions/convergence-judge.d.ts +35 -0
  494. package/dist/core/stage-extensions/convergence-judge.d.ts.map +1 -0
  495. package/dist/core/stage-extensions/convergence-judge.js +47 -0
  496. package/dist/core/stage-extensions/convergence-judge.js.map +1 -0
  497. package/dist/core/stage-extensions/index.d.ts +13 -0
  498. package/dist/core/stage-extensions/index.d.ts.map +1 -0
  499. package/dist/core/stage-extensions/index.js +11 -0
  500. package/dist/core/stage-extensions/index.js.map +1 -0
  501. package/dist/core/stage-extensions/output-watcher.d.ts +93 -0
  502. package/dist/core/stage-extensions/output-watcher.d.ts.map +1 -0
  503. package/dist/core/stage-extensions/output-watcher.js +163 -0
  504. package/dist/core/stage-extensions/output-watcher.js.map +1 -0
  505. package/dist/core/stage-extensions/severity-mapper.d.ts +21 -0
  506. package/dist/core/stage-extensions/severity-mapper.d.ts.map +1 -0
  507. package/dist/core/stage-extensions/severity-mapper.js +26 -0
  508. package/dist/core/stage-extensions/severity-mapper.js.map +1 -0
  509. package/dist/core/stage-extensions/state-machine.d.ts +43 -0
  510. package/dist/core/stage-extensions/state-machine.d.ts.map +1 -0
  511. package/dist/core/stage-extensions/state-machine.js +19 -0
  512. package/dist/core/stage-extensions/state-machine.js.map +1 -0
  513. package/dist/core/stage-extensions/thread-map.d.ts +60 -0
  514. package/dist/core/stage-extensions/thread-map.d.ts.map +1 -0
  515. package/dist/core/stage-extensions/thread-map.js +107 -0
  516. package/dist/core/stage-extensions/thread-map.js.map +1 -0
  517. package/dist/core/stage-extensions/trend-analyzer.d.ts +29 -0
  518. package/dist/core/stage-extensions/trend-analyzer.d.ts.map +1 -0
  519. package/dist/core/stage-extensions/trend-analyzer.js +60 -0
  520. package/dist/core/stage-extensions/trend-analyzer.js.map +1 -0
  521. package/dist/core/stage-extensions/types.d.ts +39 -0
  522. package/dist/core/stage-extensions/types.d.ts.map +1 -0
  523. package/dist/core/stage-extensions/types.js +5 -0
  524. package/dist/core/stage-extensions/types.js.map +1 -0
  525. package/dist/core/staging-lock.d.ts +36 -0
  526. package/dist/core/staging-lock.d.ts.map +1 -0
  527. package/dist/core/staging-lock.js +122 -0
  528. package/dist/core/staging-lock.js.map +1 -0
  529. package/dist/core/templates/commands/ack-confirm.md +32 -0
  530. package/dist/core/templates/commands/apply.md +220 -0
  531. package/dist/core/templates/commands/archive.md +178 -0
  532. package/dist/core/templates/commands/brainstorm.md +58 -0
  533. package/dist/core/templates/commands/codex-adversarial.md +95 -0
  534. package/dist/core/templates/commands/explore.md +29 -0
  535. package/dist/core/templates/commands/index.d.ts +12 -0
  536. package/dist/core/templates/commands/index.d.ts.map +1 -0
  537. package/dist/core/templates/commands/index.js +26 -0
  538. package/dist/core/templates/commands/index.js.map +1 -0
  539. package/dist/core/templates/commands/propose.md +90 -0
  540. package/dist/core/templates/commands/review.md +105 -0
  541. package/dist/core/templates/commands/upgrade.md +58 -0
  542. package/dist/core/templates/commands/verify.md +186 -0
  543. package/dist/core/templates/index.d.ts +3 -0
  544. package/dist/core/templates/index.d.ts.map +1 -0
  545. package/dist/core/templates/index.js +5 -0
  546. package/dist/core/templates/index.js.map +1 -0
  547. package/dist/core/templates/skills/_shared/scope-category-guidance.md +40 -0
  548. package/dist/core/templates/skills/brainstorming.md +161 -0
  549. package/dist/core/templates/skills/dispatching-parallel-agents.md +209 -0
  550. package/dist/core/templates/skills/exploring.md +476 -0
  551. package/dist/core/templates/skills/finishing-a-development-branch.md +251 -0
  552. package/dist/core/templates/skills/index.d.ts +17 -0
  553. package/dist/core/templates/skills/index.d.ts.map +1 -0
  554. package/dist/core/templates/skills/index.js +53 -0
  555. package/dist/core/templates/skills/index.js.map +1 -0
  556. package/dist/core/templates/skills/process-evidence.md +146 -0
  557. package/dist/core/templates/skills/receiving-code-review.md +294 -0
  558. package/dist/core/templates/skills/requesting-code-review.md +108 -0
  559. package/dist/core/templates/skills/subagent-driven-development.md +405 -0
  560. package/dist/core/templates/skills/subagent-driven-discipline/references/codex-tools.md +72 -0
  561. package/dist/core/templates/skills/subagent-driven-discipline/references/opencode-tools.md +104 -0
  562. package/dist/core/templates/skills/subagent-driven-discipline.md +725 -0
  563. package/dist/core/templates/skills/systematic-debugging.md +297 -0
  564. package/dist/core/templates/skills/test-driven-development.md +402 -0
  565. package/dist/core/templates/skills/using-forge.md +163 -0
  566. package/dist/core/templates/skills/using-git-worktrees.md +229 -0
  567. package/dist/core/templates/skills/verification-before-completion.md +175 -0
  568. package/dist/core/templates/skills/verifying-three-dimensions.md +245 -0
  569. package/dist/core/templates/skills/writing-plans.md +259 -0
  570. package/dist/core/templates/skills/writing-skills.md +214 -0
  571. package/dist/core/test-reporters/index.d.ts +41 -0
  572. package/dist/core/test-reporters/index.d.ts.map +1 -0
  573. package/dist/core/test-reporters/index.js +39 -0
  574. package/dist/core/test-reporters/index.js.map +1 -0
  575. package/dist/core/test-reporters/junit.d.ts +8 -0
  576. package/dist/core/test-reporters/junit.d.ts.map +1 -0
  577. package/dist/core/test-reporters/junit.js +94 -0
  578. package/dist/core/test-reporters/junit.js.map +1 -0
  579. package/dist/core/test-reporters/tap.d.ts +18 -0
  580. package/dist/core/test-reporters/tap.d.ts.map +1 -0
  581. package/dist/core/test-reporters/tap.js +73 -0
  582. package/dist/core/test-reporters/tap.js.map +1 -0
  583. package/dist/core/test-reporters/vitest-json.d.ts +8 -0
  584. package/dist/core/test-reporters/vitest-json.d.ts.map +1 -0
  585. package/dist/core/test-reporters/vitest-json.js +56 -0
  586. package/dist/core/test-reporters/vitest-json.js.map +1 -0
  587. package/dist/core/upgrade/resign-markers.d.ts +14 -0
  588. package/dist/core/upgrade/resign-markers.d.ts.map +1 -0
  589. package/dist/core/upgrade/resign-markers.js +245 -0
  590. package/dist/core/upgrade/resign-markers.js.map +1 -0
  591. package/dist/core/validate/archive-summary-schema.d.ts +8 -0
  592. package/dist/core/validate/archive-summary-schema.d.ts.map +1 -0
  593. package/dist/core/validate/archive-summary-schema.js +186 -0
  594. package/dist/core/validate/archive-summary-schema.js.map +1 -0
  595. package/dist/core/validate/auto-findings.d.ts +36 -0
  596. package/dist/core/validate/auto-findings.d.ts.map +1 -0
  597. package/dist/core/validate/auto-findings.js +38 -0
  598. package/dist/core/validate/auto-findings.js.map +1 -0
  599. package/dist/core/validate/candidate-validators.d.ts +22 -0
  600. package/dist/core/validate/candidate-validators.d.ts.map +1 -0
  601. package/dist/core/validate/candidate-validators.js +46 -0
  602. package/dist/core/validate/candidate-validators.js.map +1 -0
  603. package/dist/core/validate/change.d.ts +3 -0
  604. package/dist/core/validate/change.d.ts.map +1 -0
  605. package/dist/core/validate/change.js +205 -0
  606. package/dist/core/validate/change.js.map +1 -0
  607. package/dist/core/validate/coverage-gap.d.ts +37 -0
  608. package/dist/core/validate/coverage-gap.d.ts.map +1 -0
  609. package/dist/core/validate/coverage-gap.js +181 -0
  610. package/dist/core/validate/coverage-gap.js.map +1 -0
  611. package/dist/core/validate/finding-hash.d.ts +14 -0
  612. package/dist/core/validate/finding-hash.d.ts.map +1 -0
  613. package/dist/core/validate/finding-hash.js +29 -0
  614. package/dist/core/validate/finding-hash.js.map +1 -0
  615. package/dist/core/validate/index.d.ts +15 -0
  616. package/dist/core/validate/index.d.ts.map +1 -0
  617. package/dist/core/validate/index.js +19 -0
  618. package/dist/core/validate/index.js.map +1 -0
  619. package/dist/core/validate/marker-integrity.d.ts +28 -0
  620. package/dist/core/validate/marker-integrity.d.ts.map +1 -0
  621. package/dist/core/validate/marker-integrity.js +170 -0
  622. package/dist/core/validate/marker-integrity.js.map +1 -0
  623. package/dist/core/validate/marker-schema.d.ts +10 -0
  624. package/dist/core/validate/marker-schema.d.ts.map +1 -0
  625. package/dist/core/validate/marker-schema.js +661 -0
  626. package/dist/core/validate/marker-schema.js.map +1 -0
  627. package/dist/core/validate/orphan-tmp.d.ts +13 -0
  628. package/dist/core/validate/orphan-tmp.d.ts.map +1 -0
  629. package/dist/core/validate/orphan-tmp.js +49 -0
  630. package/dist/core/validate/orphan-tmp.js.map +1 -0
  631. package/dist/core/validate/proposal.d.ts +4 -0
  632. package/dist/core/validate/proposal.d.ts.map +1 -0
  633. package/dist/core/validate/proposal.js +40 -0
  634. package/dist/core/validate/proposal.js.map +1 -0
  635. package/dist/core/validate/scope-entries.d.ts +23 -0
  636. package/dist/core/validate/scope-entries.d.ts.map +1 -0
  637. package/dist/core/validate/scope-entries.js +108 -0
  638. package/dist/core/validate/scope-entries.js.map +1 -0
  639. package/dist/core/validate/specs.d.ts +4 -0
  640. package/dist/core/validate/specs.d.ts.map +1 -0
  641. package/dist/core/validate/specs.js +74 -0
  642. package/dist/core/validate/specs.js.map +1 -0
  643. package/dist/core/validate/tasks.d.ts +4 -0
  644. package/dist/core/validate/tasks.d.ts.map +1 -0
  645. package/dist/core/validate/tasks.js +48 -0
  646. package/dist/core/validate/tasks.js.map +1 -0
  647. package/dist/core/validate/test-failure-stub.d.ts +23 -0
  648. package/dist/core/validate/test-failure-stub.d.ts.map +1 -0
  649. package/dist/core/validate/test-failure-stub.js +21 -0
  650. package/dist/core/validate/test-failure-stub.js.map +1 -0
  651. package/dist/core/validate/types.d.ts +33 -0
  652. package/dist/core/validate/types.d.ts.map +1 -0
  653. package/dist/core/validate/types.js +20 -0
  654. package/dist/core/validate/types.js.map +1 -0
  655. package/dist/core/worktree.d.ts +52 -0
  656. package/dist/core/worktree.d.ts.map +1 -0
  657. package/dist/core/worktree.js +145 -0
  658. package/dist/core/worktree.js.map +1 -0
  659. package/dist/index.d.ts +12 -0
  660. package/dist/index.d.ts.map +1 -0
  661. package/dist/index.js +14 -0
  662. package/dist/index.js.map +1 -0
  663. package/package.json +82 -0
@@ -0,0 +1,297 @@
1
+ ---
2
+ name: forge:systematic-debugging
3
+ description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
4
+ ---
5
+
6
+ # Systematic Debugging
7
+
8
+ ## Overview
9
+
10
+ Random fixes waste time and create new bugs. Quick patches mask underlying issues.
11
+
12
+ **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
13
+
14
+ **Violating the letter of this process is violating the spirit of debugging.**
15
+
16
+ ## The Iron Law
17
+
18
+ ```
19
+ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
20
+ ```
21
+
22
+ If you haven't completed Phase 1, you cannot propose fixes.
23
+
24
+ ## When to Use
25
+
26
+ Use for ANY technical issue:
27
+
28
+ - Test failures
29
+ - Bugs in production
30
+ - Unexpected behavior
31
+ - Performance problems
32
+ - Build failures
33
+ - Integration issues
34
+
35
+ **Use this ESPECIALLY when:**
36
+
37
+ - Under time pressure (emergencies make guessing tempting)
38
+ - "Just one quick fix" seems obvious
39
+ - You've already tried multiple fixes
40
+ - Previous fix didn't work
41
+ - You don't fully understand the issue
42
+
43
+ **Don't skip when:**
44
+
45
+ - Issue seems simple (simple bugs have root causes too)
46
+ - You're in a hurry (rushing guarantees rework)
47
+ - Manager wants it fixed NOW (systematic is faster than thrashing)
48
+
49
+ ## The Four Phases
50
+
51
+ You MUST complete each phase before proceeding to the next.
52
+
53
+ ### Phase 1: Root Cause Investigation
54
+
55
+ **BEFORE attempting ANY fix:**
56
+
57
+ 1. **Read Error Messages Carefully**
58
+ - Don't skip past errors or warnings
59
+ - They often contain the exact solution
60
+ - Read stack traces completely
61
+ - Note line numbers, file paths, error codes
62
+
63
+ 2. **Reproduce Consistently**
64
+ - Can you trigger it reliably?
65
+ - What are the exact steps?
66
+ - Does it happen every time?
67
+ - If not reproducible → gather more data, don't guess
68
+
69
+ 3. **Check Recent Changes**
70
+ - What changed that could cause this?
71
+ - Git diff, recent commits
72
+ - New dependencies, config changes
73
+ - Environmental differences
74
+
75
+ 4. **Gather Evidence in Multi-Component Systems**
76
+
77
+ **WHEN system has multiple components (CI → build → signing, API → service → database):**
78
+
79
+ **BEFORE proposing fixes, add diagnostic instrumentation:**
80
+
81
+ ```
82
+ For EACH component boundary:
83
+ - Log what data enters component
84
+ - Log what data exits component
85
+ - Verify environment/config propagation
86
+ - Check state at each layer
87
+
88
+ Run once to gather evidence showing WHERE it breaks
89
+ THEN analyze evidence to identify failing component
90
+ THEN investigate that specific component
91
+ ```
92
+
93
+ **Example (multi-layer system):**
94
+
95
+ ```bash
96
+ # Layer 1: Workflow
97
+ echo "=== Secrets available in workflow: ==="
98
+ echo "IDENTITY: ${IDENTITY:+SET}${IDENTITY:-UNSET}"
99
+
100
+ # Layer 2: Build script
101
+ echo "=== Env vars in build script: ==="
102
+ env | grep IDENTITY || echo "IDENTITY not in environment"
103
+
104
+ # Layer 3: Signing script
105
+ echo "=== Keychain state: ==="
106
+ security list-keychains
107
+ security find-identity -v
108
+
109
+ # Layer 4: Actual signing
110
+ codesign --sign "$IDENTITY" --verbose=4 "$APP"
111
+ ```
112
+
113
+ **This reveals:** Which layer fails (secrets → workflow ✓, workflow → build ✗)
114
+
115
+ 5. **Trace Data Flow**
116
+
117
+ **WHEN error is deep in call stack:**
118
+
119
+ **Quick version:**
120
+ - Where does bad value originate?
121
+ - What called this with bad value?
122
+ - Keep tracing up until you find the source
123
+ - Fix at source, not at symptom
124
+
125
+ ### Phase 2: Pattern Analysis
126
+
127
+ **Find the pattern before fixing:**
128
+
129
+ 1. **Find Working Examples**
130
+ - Locate similar working code in same codebase
131
+ - What works that's similar to what's broken?
132
+
133
+ 2. **Compare Against References**
134
+ - If implementing pattern, read reference implementation COMPLETELY
135
+ - Don't skim - read every line
136
+ - Understand the pattern fully before applying
137
+
138
+ 3. **Identify Differences**
139
+ - What's different between working and broken?
140
+ - List every difference, however small
141
+ - Don't assume "that can't matter"
142
+
143
+ 4. **Understand Dependencies**
144
+ - What other components does this need?
145
+ - What settings, config, environment?
146
+ - What assumptions does it make?
147
+
148
+ ### Phase 3: Hypothesis and Testing
149
+
150
+ **Scientific method:**
151
+
152
+ 1. **Form Single Hypothesis**
153
+ - State clearly: "I think X is the root cause because Y"
154
+ - Write it down
155
+ - Be specific, not vague
156
+
157
+ 2. **Test Minimally**
158
+ - Make the SMALLEST possible change to test hypothesis
159
+ - One variable at a time
160
+ - Don't fix multiple things at once
161
+
162
+ 3. **Verify Before Continuing**
163
+ - Did it work? Yes → Phase 4
164
+ - Didn't work? Form NEW hypothesis
165
+ - DON'T add more fixes on top
166
+
167
+ 4. **When You Don't Know**
168
+ - Say "I don't understand X"
169
+ - Don't pretend to know
170
+ - Ask for help
171
+ - Research more
172
+
173
+ ### Phase 4: Implementation
174
+
175
+ **Fix the root cause, not the symptom:**
176
+
177
+ 1. **Create Failing Test Case**
178
+ - Simplest possible reproduction
179
+ - Automated test if possible
180
+ - One-off test script if no framework
181
+ - MUST have before fixing
182
+ - Use the `forge:test-driven-development` skill for writing proper failing tests
183
+
184
+ 2. **Implement Single Fix**
185
+ - Address the root cause identified
186
+ - ONE change at a time
187
+ - No "while I'm here" improvements
188
+ - No bundled refactoring
189
+
190
+ 3. **Verify Fix**
191
+ - Test passes now?
192
+ - No other tests broken?
193
+ - Issue actually resolved?
194
+
195
+ 4. **If Fix Doesn't Work**
196
+ - STOP
197
+ - Count: How many fixes have you tried?
198
+ - If < 3: Return to Phase 1, re-analyze with new information
199
+ - **If ≥ 3: STOP and question the architecture (step 5 below)**
200
+ - DON'T attempt Fix #4 without architectural discussion
201
+
202
+ 5. **If 3+ Fixes Failed: Question Architecture**
203
+
204
+ **Pattern indicating architectural problem:**
205
+ - Each fix reveals new shared state/coupling/problem in different place
206
+ - Fixes require "massive refactoring" to implement
207
+ - Each fix creates new symptoms elsewhere
208
+
209
+ **STOP and question fundamentals:**
210
+ - Is this pattern fundamentally sound?
211
+ - Are we "sticking with it through sheer inertia"?
212
+ - Should we refactor architecture vs. continue fixing symptoms?
213
+
214
+ **Discuss with your human partner before attempting more fixes**
215
+
216
+ This is NOT a failed hypothesis - this is a wrong architecture.
217
+
218
+ ## Red Flags - STOP and Follow Process
219
+
220
+ If you catch yourself thinking:
221
+
222
+ - "Quick fix for now, investigate later"
223
+ - "Just try changing X and see if it works"
224
+ - "Add multiple changes, run tests"
225
+ - "Skip the test, I'll manually verify"
226
+ - "It's probably X, let me fix that"
227
+ - "I don't fully understand but this might work"
228
+ - "Pattern says X but I'll adapt it differently"
229
+ - "Here are the main problems: [lists fixes without investigation]"
230
+ - Proposing solutions before tracing data flow
231
+ - **"One more fix attempt" (when already tried 2+)**
232
+ - **Each fix reveals new problem in different place**
233
+
234
+ **ALL of these mean: STOP. Return to Phase 1.**
235
+
236
+ **If 3+ fixes failed:** Question the architecture (see Phase 4.5)
237
+
238
+ ## your human partner's Signals You're Doing It Wrong
239
+
240
+ **Watch for these redirections:**
241
+
242
+ - "Is that not happening?" - You assumed without verifying
243
+ - "Will it show us...?" - You should have added evidence gathering
244
+ - "Stop guessing" - You're proposing fixes without understanding
245
+ - "Ultrathink this" - Question fundamentals, not just symptoms
246
+ - "We're stuck?" (frustrated) - Your approach isn't working
247
+
248
+ **When you see these:** STOP. Return to Phase 1.
249
+
250
+ ## Common Rationalizations
251
+
252
+ | Excuse | Reality |
253
+ | -------------------------------------------- | ----------------------------------------------------------------------- |
254
+ | "Issue is simple, don't need process" | Simple issues have root causes too. Process is fast for simple bugs. |
255
+ | "Emergency, no time for process" | Systematic debugging is FASTER than guess-and-check thrashing. |
256
+ | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
257
+ | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
258
+ | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
259
+ | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
260
+ | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
261
+ | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
262
+
263
+ ## Quick Reference
264
+
265
+ | Phase | Key Activities | Success Criteria |
266
+ | --------------------- | ------------------------------------------------------ | --------------------------- |
267
+ | **1. Root Cause** | Read errors, reproduce, check changes, gather evidence | Understand WHAT and WHY |
268
+ | **2. Pattern** | Find working examples, compare | Identify differences |
269
+ | **3. Hypothesis** | Form theory, test minimally | Confirmed or new hypothesis |
270
+ | **4. Implementation** | Create test, fix, verify | Bug resolved, tests pass |
271
+
272
+ ## When Process Reveals "No Root Cause"
273
+
274
+ If systematic investigation reveals issue is truly environmental, timing-dependent, or external:
275
+
276
+ 1. You've completed the process
277
+ 2. Document what you investigated
278
+ 3. Implement appropriate handling (retry, timeout, error message)
279
+ 4. Add monitoring/logging for future investigation
280
+
281
+ **But:** 95% of "no root cause" cases are incomplete investigation.
282
+
283
+ <!-- root-cause-tracing / defense-in-depth / condition-based-waiting 支持文件在 forge v0.1 不提供 -->
284
+
285
+ ## Related Skills
286
+
287
+ - **forge:test-driven-development** - For creating failing test case (Phase 4, Step 1)
288
+ - **forge:verification-before-completion** - Verify fix worked before claiming success
289
+
290
+ ## Real-World Impact
291
+
292
+ From debugging sessions:
293
+
294
+ - Systematic approach: 15-30 minutes to fix
295
+ - Random fixes approach: 2-3 hours of thrashing
296
+ - First-time fix rate: 95% vs 40%
297
+ - New bugs introduced: Near zero vs common
@@ -0,0 +1,402 @@
1
+ ---
2
+ name: forge:test-driven-development
3
+ description: Use when implementing any feature or bugfix, before writing implementation code
4
+ ---
5
+
6
+ # Test-Driven Development (TDD)
7
+
8
+ ## Overview
9
+
10
+ Write the test first. Watch it fail. Write minimal code to pass.
11
+
12
+ **Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.
13
+
14
+ **Violating the letter of the rules is violating the spirit of the rules.**
15
+
16
+ ## When to Use
17
+
18
+ **Always:**
19
+
20
+ - New features
21
+ - Bug fixes
22
+ - Refactoring
23
+ - Behavior changes
24
+
25
+ **Exceptions (ask your human partner):**
26
+
27
+ - Throwaway prototypes
28
+ - Generated code
29
+ - Configuration files
30
+
31
+ Thinking "skip TDD just this once"? Stop. That's rationalization.
32
+
33
+ ## The Iron Law
34
+
35
+ ```
36
+ NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
37
+ ```
38
+
39
+ Write code before the test? Delete it. Start over.
40
+
41
+ **No exceptions:**
42
+
43
+ - Don't keep it as "reference"
44
+ - Don't "adapt" it while writing tests
45
+ - Don't look at it
46
+ - Delete means delete
47
+
48
+ Implement fresh from tests. Period.
49
+
50
+ ## Red-Green-Refactor
51
+
52
+ ```dot
53
+ digraph tdd_cycle {
54
+ rankdir=LR;
55
+ red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
56
+ verify_red [label="Verify fails\ncorrectly", shape=diamond];
57
+ green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
58
+ verify_green [label="Verify passes\nAll green", shape=diamond];
59
+ refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
60
+ next [label="Next", shape=ellipse];
61
+
62
+ red -> verify_red;
63
+ verify_red -> green [label="yes"];
64
+ verify_red -> red [label="wrong\nfailure"];
65
+ green -> verify_green;
66
+ verify_green -> refactor [label="yes"];
67
+ verify_green -> green [label="no"];
68
+ refactor -> verify_green [label="stay\ngreen"];
69
+ verify_green -> next;
70
+ next -> red;
71
+ }
72
+ ```
73
+
74
+ ### RED - Write Failing Test
75
+
76
+ Write one minimal test showing what should happen.
77
+
78
+ <Good>
79
+ ```typescript
80
+ test('retries failed operations 3 times', async () => {
81
+ let attempts = 0;
82
+ const operation = () => {
83
+ attempts++;
84
+ if (attempts < 3) throw new Error('fail');
85
+ return 'success';
86
+ };
87
+
88
+ const result = await retryOperation(operation);
89
+
90
+ expect(result).toBe('success');
91
+ expect(attempts).toBe(3);
92
+ });
93
+
94
+ ````
95
+ Clear name, tests real behavior, one thing
96
+ </Good>
97
+
98
+ <Bad>
99
+ ```typescript
100
+ test('retry works', async () => {
101
+ const mock = jest.fn()
102
+ .mockRejectedValueOnce(new Error())
103
+ .mockRejectedValueOnce(new Error())
104
+ .mockResolvedValueOnce('success');
105
+ await retryOperation(mock);
106
+ expect(mock).toHaveBeenCalledTimes(3);
107
+ });
108
+ ````
109
+
110
+ Vague name, tests mock not code
111
+ </Bad>
112
+
113
+ **Requirements:**
114
+
115
+ - One behavior
116
+ - Clear name
117
+ - Real code (no mocks unless unavoidable)
118
+
119
+ ### Verify RED - Watch It Fail
120
+
121
+ **MANDATORY. Never skip.**
122
+
123
+ ```bash
124
+ npm test path/to/test.test.ts
125
+ ```
126
+
127
+ Confirm:
128
+
129
+ - Test fails (not errors)
130
+ - Failure message is expected
131
+ - Fails because feature missing (not typos)
132
+
133
+ **Test passes?** You're testing existing behavior. Fix test.
134
+
135
+ **Test errors?** Fix error, re-run until it fails correctly.
136
+
137
+ ### GREEN - Minimal Code
138
+
139
+ Write simplest code to pass the test.
140
+
141
+ <Good>
142
+ ```typescript
143
+ async function retryOperation<T>(fn: () => Promise<T>): Promise<T> {
144
+ for (let i = 0; i < 3; i++) {
145
+ try {
146
+ return await fn();
147
+ } catch (e) {
148
+ if (i === 2) throw e;
149
+ }
150
+ }
151
+ throw new Error('unreachable');
152
+ }
153
+ ```
154
+ Just enough to pass
155
+ </Good>
156
+
157
+ <Bad>
158
+ ```typescript
159
+ async function retryOperation<T>(
160
+ fn: () => Promise<T>,
161
+ options?: {
162
+ maxRetries?: number;
163
+ backoff?: 'linear' | 'exponential';
164
+ onRetry?: (attempt: number) => void;
165
+ }
166
+ ): Promise<T> {
167
+ // YAGNI
168
+ }
169
+ ```
170
+ Over-engineered
171
+ </Bad>
172
+
173
+ Don't add features, refactor other code, or "improve" beyond the test.
174
+
175
+ ### Verify GREEN - Watch It Pass
176
+
177
+ **MANDATORY.**
178
+
179
+ ```bash
180
+ npm test path/to/test.test.ts
181
+ ```
182
+
183
+ Confirm:
184
+
185
+ - Test passes
186
+ - Other tests still pass
187
+ - Output pristine (no errors, warnings)
188
+
189
+ **Test fails?** Fix code, not test.
190
+
191
+ **Other tests fail?** Fix now.
192
+
193
+ ### REFACTOR - Clean Up
194
+
195
+ After green only:
196
+
197
+ - Remove duplication
198
+ - Improve names
199
+ - Extract helpers
200
+
201
+ Keep tests green. Don't add behavior.
202
+
203
+ ### Repeat
204
+
205
+ Next failing test for next feature.
206
+
207
+ ## Good Tests
208
+
209
+ | Quality | Good | Bad |
210
+ | ---------------- | ----------------------------------- | --------------------------------------------------- |
211
+ | **Minimal** | One thing. "and" in name? Split it. | `test('validates email and domain and whitespace')` |
212
+ | **Clear** | Name describes behavior | `test('test1')` |
213
+ | **Shows intent** | Demonstrates desired API | Obscures what code should do |
214
+
215
+ ## Why Order Matters
216
+
217
+ **"I'll write tests after to verify it works"**
218
+
219
+ Tests written after code pass immediately. Passing immediately proves nothing:
220
+
221
+ - Might test wrong thing
222
+ - Might test implementation, not behavior
223
+ - Might miss edge cases you forgot
224
+ - You never saw it catch the bug
225
+
226
+ Test-first forces you to see the test fail, proving it actually tests something.
227
+
228
+ **"I already manually tested all the edge cases"**
229
+
230
+ Manual testing is ad-hoc. You think you tested everything but:
231
+
232
+ - No record of what you tested
233
+ - Can't re-run when code changes
234
+ - Easy to forget cases under pressure
235
+ - "It worked when I tried it" ≠ comprehensive
236
+
237
+ Automated tests are systematic. They run the same way every time.
238
+
239
+ **"Deleting X hours of work is wasteful"**
240
+
241
+ Sunk cost fallacy. The time is already gone. Your choice now:
242
+
243
+ - Delete and rewrite with TDD (X more hours, high confidence)
244
+ - Keep it and add tests after (30 min, low confidence, likely bugs)
245
+
246
+ The "waste" is keeping code you can't trust. Working code without real tests is technical debt.
247
+
248
+ **"TDD is dogmatic, being pragmatic means adapting"**
249
+
250
+ TDD IS pragmatic:
251
+
252
+ - Finds bugs before commit (faster than debugging after)
253
+ - Prevents regressions (tests catch breaks immediately)
254
+ - Documents behavior (tests show how to use code)
255
+ - Enables refactoring (change freely, tests catch breaks)
256
+
257
+ "Pragmatic" shortcuts = debugging in production = slower.
258
+
259
+ **"Tests after achieve the same goals - it's spirit not ritual"**
260
+
261
+ No. Tests-after answer "What does this do?" Tests-first answer "What should this do?"
262
+
263
+ Tests-after are biased by your implementation. You test what you built, not what's required. You verify remembered edge cases, not discovered ones.
264
+
265
+ Tests-first force edge case discovery before implementing. Tests-after verify you remembered everything (you didn't).
266
+
267
+ 30 minutes of tests after ≠ TDD. You get coverage, lose proof tests work.
268
+
269
+ ## Common Rationalizations
270
+
271
+ | Excuse | Reality |
272
+ | -------------------------------------- | ----------------------------------------------------------------------- |
273
+ | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
274
+ | "I'll test after" | Tests passing immediately prove nothing. |
275
+ | "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
276
+ | "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
277
+ | "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. |
278
+ | "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
279
+ | "Need to explore first" | Fine. Throw away exploration, start with TDD. |
280
+ | "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
281
+ | "TDD will slow me down" | TDD faster than debugging. Pragmatic = test-first. |
282
+ | "Manual test faster" | Manual doesn't prove edge cases. You'll re-test every change. |
283
+ | "Existing code has no tests" | You're improving it. Add tests for existing code. |
284
+
285
+ ## Red Flags - STOP and Start Over
286
+
287
+ - Code before test
288
+ - Test after implementation
289
+ - Test passes immediately
290
+ - Can't explain why test failed
291
+ - Tests added "later"
292
+ - Rationalizing "just this once"
293
+ - "I already manually tested it"
294
+ - "Tests after achieve the same purpose"
295
+ - "It's about spirit not ritual"
296
+ - "Keep as reference" or "adapt existing code"
297
+ - "Already spent X hours, deleting is wasteful"
298
+ - "TDD is dogmatic, I'm being pragmatic"
299
+ - "This is different because..."
300
+
301
+ **All of these mean: Delete code. Start over with TDD.**
302
+
303
+ ## Example: Bug Fix
304
+
305
+ **Bug:** Empty email accepted
306
+
307
+ **RED**
308
+
309
+ ```typescript
310
+ test('rejects empty email', async () => {
311
+ const result = await submitForm({ email: '' });
312
+ expect(result.error).toBe('Email required');
313
+ });
314
+ ```
315
+
316
+ **Verify RED**
317
+
318
+ ```bash
319
+ $ npm test
320
+ FAIL: expected 'Email required', got undefined
321
+ ```
322
+
323
+ **GREEN**
324
+
325
+ ```typescript
326
+ function submitForm(data: FormData) {
327
+ if (!data.email?.trim()) {
328
+ return { error: 'Email required' };
329
+ }
330
+ // ...
331
+ }
332
+ ```
333
+
334
+ **Verify GREEN**
335
+
336
+ ```bash
337
+ $ npm test
338
+ PASS
339
+ ```
340
+
341
+ **REFACTOR**
342
+ Extract validation for multiple fields if needed.
343
+
344
+ ## Verification Checklist
345
+
346
+ Before marking work complete:
347
+
348
+ - [ ] Every new function/method has a test
349
+ - [ ] Watched each test fail before implementing
350
+ - [ ] Each test failed for expected reason (feature missing, not typo)
351
+ - [ ] Wrote minimal code to pass each test
352
+ - [ ] All tests pass
353
+ - [ ] Output pristine (no errors, warnings)
354
+ - [ ] Tests use real code (mocks only if unavoidable)
355
+ - [ ] Edge cases and errors covered
356
+
357
+ Can't check all boxes? You skipped TDD. Start over.
358
+
359
+ ## When Stuck
360
+
361
+ | Problem | Solution |
362
+ | ---------------------- | -------------------------------------------------------------------- |
363
+ | Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. |
364
+ | Test too complicated | Design too complicated. Simplify interface. |
365
+ | Must mock everything | Code too coupled. Use dependency injection. |
366
+ | Test setup huge | Extract helpers. Still complex? Simplify design. |
367
+
368
+ ## Debugging Integration
369
+
370
+ Bug found? Write failing test reproducing it. Follow TDD cycle. Test proves fix and prevents regression.
371
+
372
+ Never fix bugs without a test.
373
+
374
+ ## Testing Anti-Patterns
375
+
376
+ When adding mocks or test utilities, avoid common pitfalls:
377
+
378
+ - Testing mock behavior instead of real behavior
379
+ - Adding test-only methods to production classes
380
+ - Mocking without understanding dependencies
381
+
382
+ <!-- testing-anti-patterns 支持文件在 forge v0.1 不提供 -->
383
+
384
+ ## plan-9g 新增:RED commit 不可省略硬约束
385
+
386
+ ✗ **禁止**同 commit 写测试 + 实现(违反 process_evidence 不变量 3 + 5)
387
+ ✓ **必须**:
388
+
389
+ - 先建 RED commit(测试 fail + 实现未写 / 不通过)
390
+ - 后建 GREEN commit(实现写 + 测试 pass)
391
+ - writing-plans light mode trivial change(< writing_plans.light_threshold 行)允许走 `tdd_exemption: light-mode-trivial`,但**必须**先调 `forge ack propose --action ack-tdd-exemption`(沿 process_evidence 不变量 11)
392
+
393
+ 详细 process_evidence 协议见 `skills/process-evidence/SKILL.md`。
394
+
395
+ ## Final Rule
396
+
397
+ ```
398
+ Production code → test exists and failed first
399
+ Otherwise → not TDD
400
+ ```
401
+
402
+ No exceptions without your human partner's permission.