rafcode 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/.claude/settings.local.json +32 -0
  2. package/CLAUDE.md +187 -0
  3. package/LICENSE +21 -0
  4. package/RAF/001-raf-task-improvements/input.md +9 -0
  5. package/RAF/001-raf-task-improvements/outcomes/001-add-decisions-folder.md +21 -0
  6. package/RAF/001-raf-task-improvements/outcomes/002-fix-write-error-on-shutdown.md +22 -0
  7. package/RAF/001-raf-task-improvements/outcomes/003-stash-changes-on-failure.md +34 -0
  8. package/RAF/001-raf-task-improvements/outcomes/004-add-project-name-to-commits.md +28 -0
  9. package/RAF/001-raf-task-improvements/outcomes/005-add-running-time-display.md +36 -0
  10. package/RAF/001-raf-task-improvements/outcomes/006-add-task-name-to-logs.md +22 -0
  11. package/RAF/001-raf-task-improvements/outcomes/007-show-model-at-task-start.md +52 -0
  12. package/RAF/001-raf-task-improvements/outcomes/009-remove-editor-placeholder-text.md +20 -0
  13. package/RAF/001-raf-task-improvements/outcomes/SUMMARY.md +83 -0
  14. package/RAF/001-raf-task-improvements/plans/001-add-decisions-folder.md +38 -0
  15. package/RAF/001-raf-task-improvements/plans/002-fix-write-error-on-shutdown.md +33 -0
  16. package/RAF/001-raf-task-improvements/plans/003-stash-changes-on-failure.md +37 -0
  17. package/RAF/001-raf-task-improvements/plans/004-add-project-name-to-commits.md +34 -0
  18. package/RAF/001-raf-task-improvements/plans/005-add-running-time-display.md +39 -0
  19. package/RAF/001-raf-task-improvements/plans/006-add-task-name-to-logs.md +37 -0
  20. package/RAF/001-raf-task-improvements/plans/009-remove-editor-placeholder-text.md +34 -0
  21. package/RAF/002-raf-task-improvements-execution/decisions/DECISIONS.md +13 -0
  22. package/RAF/002-raf-task-improvements-execution/input.md +3 -0
  23. package/RAF/002-raf-task-improvements-execution/outcomes/001-commit-show-model-at-task-start.md +17 -0
  24. package/RAF/002-raf-task-improvements-execution/outcomes/002-delete-skipped-plan.md +23 -0
  25. package/RAF/002-raf-task-improvements-execution/outcomes/SUMMARY.md +32 -0
  26. package/RAF/002-raf-task-improvements-execution/plans/001-commit-show-model-at-task-start.md +37 -0
  27. package/RAF/002-raf-task-improvements-execution/plans/002-delete-skipped-plan.md +23 -0
  28. package/RAF/003-multi-project-execution/decisions/DECISIONS.md +68 -0
  29. package/RAF/003-multi-project-execution/input.md +6 -0
  30. package/RAF/003-multi-project-execution/outcomes/001-remove-state-json.md +52 -0
  31. package/RAF/003-multi-project-execution/outcomes/002-update-raf-status.md +50 -0
  32. package/RAF/003-multi-project-execution/outcomes/003-simplify-git-logic.md +35 -0
  33. package/RAF/003-multi-project-execution/outcomes/004-auto-commit-planning.md +43 -0
  34. package/RAF/003-multi-project-execution/outcomes/005-rerun-failed-tasks.md +43 -0
  35. package/RAF/003-multi-project-execution/outcomes/006-multi-project-execution.md +42 -0
  36. package/RAF/003-multi-project-execution/outcomes/007-verify-timeout.md +54 -0
  37. package/RAF/003-multi-project-execution/outcomes/008-move-decisions-file.md +38 -0
  38. package/RAF/003-multi-project-execution/outcomes/SUMMARY.md +79 -0
  39. package/RAF/003-multi-project-execution/plans/001-remove-state-json.md +71 -0
  40. package/RAF/003-multi-project-execution/plans/002-update-raf-status.md +65 -0
  41. package/RAF/003-multi-project-execution/plans/003-simplify-git-logic.md +74 -0
  42. package/RAF/003-multi-project-execution/plans/004-auto-commit-planning.md +57 -0
  43. package/RAF/003-multi-project-execution/plans/005-rerun-failed-tasks.md +69 -0
  44. package/RAF/003-multi-project-execution/plans/006-multi-project-execution.md +81 -0
  45. package/RAF/003-multi-project-execution/plans/007-verify-timeout.md +63 -0
  46. package/RAF/003-multi-project-execution/plans/008-move-decisions-file.md +78 -0
  47. package/RAF/004-task-naming-optimization/decisions.md +22 -0
  48. package/RAF/004-task-naming-optimization/input.md +6 -0
  49. package/RAF/004-task-naming-optimization/outcomes/001-remove-summary-file.md +17 -0
  50. package/RAF/004-task-naming-optimization/outcomes/002-base36-project-numbering.md +32 -0
  51. package/RAF/004-task-naming-optimization/outcomes/003-improve-haiku-prompt.md +20 -0
  52. package/RAF/004-task-naming-optimization/outcomes/SUMMARY.md +28 -0
  53. package/RAF/004-task-naming-optimization/plans/001-remove-summary-file.md +34 -0
  54. package/RAF/004-task-naming-optimization/plans/002-base36-project-numbering.md +56 -0
  55. package/RAF/004-task-naming-optimization/plans/003-improve-haiku-prompt.md +50 -0
  56. package/RAF/005-task-naming-improvements/decisions.md +60 -0
  57. package/RAF/005-task-naming-improvements/input.md +2 -0
  58. package/RAF/005-task-naming-improvements/outcomes/001-enhance-identifier-resolution.md +42 -0
  59. package/RAF/005-task-naming-improvements/outcomes/002-add-identifier-support-to-status.md +38 -0
  60. package/RAF/005-task-naming-improvements/outcomes/003-update-do-for-full-folder-names.md +44 -0
  61. package/RAF/005-task-naming-improvements/outcomes/004-implement-amend-flag-for-plan.md +55 -0
  62. package/RAF/005-task-naming-improvements/outcomes/005-commit-outcomes-on-complete.md +47 -0
  63. package/RAF/005-task-naming-improvements/outcomes/006-update-execution-prompt-commit-schema.md +40 -0
  64. package/RAF/005-task-naming-improvements/outcomes/007-allow-pending-task-amendments.md +38 -0
  65. package/RAF/005-task-naming-improvements/outcomes/008-fix-timeout-label.md +24 -0
  66. package/RAF/005-task-naming-improvements/plans/001-enhance-identifier-resolution.md +46 -0
  67. package/RAF/005-task-naming-improvements/plans/002-add-identifier-support-to-status.md +36 -0
  68. package/RAF/005-task-naming-improvements/plans/003-update-do-for-full-folder-names.md +38 -0
  69. package/RAF/005-task-naming-improvements/plans/004-implement-amend-flag-for-plan.md +67 -0
  70. package/RAF/005-task-naming-improvements/plans/005-commit-outcomes-on-complete.md +86 -0
  71. package/RAF/005-task-naming-improvements/plans/006-update-execution-prompt-commit-schema.md +60 -0
  72. package/RAF/005-task-naming-improvements/plans/007-allow-pending-task-amendments.md +60 -0
  73. package/RAF/005-task-naming-improvements/plans/008-fix-timeout-label.md +31 -0
  74. package/RAF/006-fix-double-summary-headers/decisions.md +28 -0
  75. package/RAF/006-fix-double-summary-headers/input.md +3 -0
  76. package/RAF/006-fix-double-summary-headers/outcomes/001-fix-double-summary-headers.md +29 -0
  77. package/RAF/006-fix-double-summary-headers/outcomes/002-update-readme-for-npm.md +31 -0
  78. package/RAF/006-fix-double-summary-headers/outcomes/003-npm-publish-instructions.md +30 -0
  79. package/RAF/006-fix-double-summary-headers/outcomes/004-flexible-project-lookup.md +47 -0
  80. package/RAF/006-fix-double-summary-headers/plans/001-fix-double-summary-headers.md +42 -0
  81. package/RAF/006-fix-double-summary-headers/plans/002-update-readme-for-npm.md +44 -0
  82. package/RAF/006-fix-double-summary-headers/plans/003-npm-publish-instructions.md +45 -0
  83. package/RAF/006-fix-double-summary-headers/plans/004-flexible-project-lookup.md +40 -0
  84. package/RAF/007-improve-outcome-format/decisions.md +28 -0
  85. package/RAF/007-improve-outcome-format/input.md +2 -0
  86. package/RAF/007-improve-outcome-format/outcomes/001-update-execution-prompt.md +10 -0
  87. package/RAF/007-improve-outcome-format/outcomes/002-update-state-derivation.md +17 -0
  88. package/RAF/007-improve-outcome-format/outcomes/003-update-do-command-outcome-handling.md +16 -0
  89. package/RAF/007-improve-outcome-format/outcomes/004-implement-failure-analysis.md +16 -0
  90. package/RAF/007-improve-outcome-format/outcomes/005-update-documentation.md +15 -0
  91. package/RAF/007-improve-outcome-format/plans/001-update-execution-prompt.md +36 -0
  92. package/RAF/007-improve-outcome-format/plans/002-update-state-derivation.md +35 -0
  93. package/RAF/007-improve-outcome-format/plans/003-update-do-command-outcome-handling.md +37 -0
  94. package/RAF/007-improve-outcome-format/plans/004-implement-failure-analysis.md +44 -0
  95. package/RAF/007-improve-outcome-format/plans/005-update-documentation.md +33 -0
  96. package/RAF/008-beautiful-do/decisions.md +31 -0
  97. package/RAF/008-beautiful-do/input.md +1 -0
  98. package/RAF/008-beautiful-do/outcomes/001-terminal-symbols.md +55 -0
  99. package/RAF/008-beautiful-do/outcomes/002-refactor-do-output.md +95 -0
  100. package/RAF/008-beautiful-do/outcomes/003-refactor-status-output.md +71 -0
  101. package/RAF/008-beautiful-do/outcomes/004-simplify-logger.md +53 -0
  102. package/RAF/008-beautiful-do/outcomes/005-add-tests.md +41 -0
  103. package/RAF/008-beautiful-do/plans/001-terminal-symbols.md +41 -0
  104. package/RAF/008-beautiful-do/plans/002-refactor-do-output.md +44 -0
  105. package/RAF/008-beautiful-do/plans/003-refactor-status-output.md +37 -0
  106. package/RAF/008-beautiful-do/plans/004-simplify-logger.md +32 -0
  107. package/RAF/008-beautiful-do/plans/005-add-tests.md +40 -0
  108. package/RAF/009-system-promt-ammend/decisions.md +13 -0
  109. package/RAF/009-system-promt-ammend/input.md +9 -0
  110. package/RAF/009-system-promt-ammend/outcomes/001-model-override.md +79 -0
  111. package/RAF/009-system-promt-ammend/outcomes/002-system-prompt-append.md +51 -0
  112. package/RAF/009-system-promt-ammend/outcomes/003-retry-context.md +60 -0
  113. package/RAF/009-system-promt-ammend/plans/001-model-override.md +61 -0
  114. package/RAF/009-system-promt-ammend/plans/002-system-prompt-append.md +56 -0
  115. package/RAF/009-system-promt-ammend/plans/003-retry-context.md +76 -0
  116. package/RAF/010-outcome-marker-fallback/decisions.md +19 -0
  117. package/RAF/010-outcome-marker-fallback/input.md +1 -0
  118. package/RAF/010-outcome-marker-fallback/outcomes/001-outcome-file-marker-fallback.md +35 -0
  119. package/RAF/010-outcome-marker-fallback/outcomes/002-creative-project-naming.md +47 -0
  120. package/RAF/010-outcome-marker-fallback/plans/001-outcome-file-marker-fallback.md +58 -0
  121. package/RAF/010-outcome-marker-fallback/plans/002-creative-project-naming.md +68 -0
  122. package/RAF/011-do-task-in-commit/decisions.md +22 -0
  123. package/RAF/011-do-task-in-commit/input.md +1 -0
  124. package/RAF/011-do-task-in-commit/outcomes/001-update-execution-prompt.md +54 -0
  125. package/RAF/011-do-task-in-commit/outcomes/002-update-tests.md +61 -0
  126. package/RAF/011-do-task-in-commit/outcomes/003-update-documentation.md +51 -0
  127. package/RAF/011-do-task-in-commit/plans/001-update-execution-prompt.md +46 -0
  128. package/RAF/011-do-task-in-commit/plans/002-update-tests.md +51 -0
  129. package/RAF/011-do-task-in-commit/plans/003-update-documentation.md +45 -0
  130. package/RAF/012-name-picker-buffet/decisions.md +40 -0
  131. package/RAF/012-name-picker-buffet/input.md +6 -0
  132. package/RAF/012-name-picker-buffet/outcomes/001-name-picker-for-raf-plan.md +49 -0
  133. package/RAF/012-name-picker-buffet/outcomes/002-interactive-project-picker-for-raf-do.md +49 -0
  134. package/RAF/012-name-picker-buffet/outcomes/003-raf-status-truncation.md +55 -0
  135. package/RAF/012-name-picker-buffet/outcomes/004-failure-reason-details.md +65 -0
  136. package/RAF/012-name-picker-buffet/outcomes/005-remove-raf-commits.md +57 -0
  137. package/RAF/012-name-picker-buffet/outcomes/006-update-execution-prompt-for-commits.md +47 -0
  138. package/RAF/012-name-picker-buffet/outcomes/007-fix-plan-mode-user-prompt.md +83 -0
  139. package/RAF/012-name-picker-buffet/outcomes/008-add-auto-flag-for-plan-mode.md +77 -0
  140. package/RAF/012-name-picker-buffet/plans/001-name-picker-for-raf-plan.md +47 -0
  141. package/RAF/012-name-picker-buffet/plans/002-interactive-project-picker-for-raf-do.md +43 -0
  142. package/RAF/012-name-picker-buffet/plans/003-raf-status-truncation.md +36 -0
  143. package/RAF/012-name-picker-buffet/plans/004-failure-reason-details.md +46 -0
  144. package/RAF/012-name-picker-buffet/plans/005-remove-raf-commits.md +42 -0
  145. package/RAF/012-name-picker-buffet/plans/006-update-execution-prompt-for-commits.md +47 -0
  146. package/RAF/012-name-picker-buffet/plans/007-fix-plan-mode-user-prompt.md +55 -0
  147. package/RAF/012-name-picker-buffet/plans/008-add-auto-flag-for-plan-mode.md +49 -0
  148. package/RAF/013-dependencies-watchdog/decisions.md +37 -0
  149. package/RAF/013-dependencies-watchdog/input.md +1 -0
  150. package/RAF/013-dependencies-watchdog/outcomes/001-define-dependency-syntax.md +56 -0
  151. package/RAF/013-dependencies-watchdog/outcomes/002-update-planning-prompts.md +60 -0
  152. package/RAF/013-dependencies-watchdog/outcomes/003-parse-dependencies-update-state.md +81 -0
  153. package/RAF/013-dependencies-watchdog/outcomes/004-implement-dependency-checking-in-do.md +116 -0
  154. package/RAF/013-dependencies-watchdog/outcomes/005-update-execution-prompts.md +75 -0
  155. package/RAF/013-dependencies-watchdog/outcomes/006-add-tests.md +100 -0
  156. package/RAF/013-dependencies-watchdog/outcomes/007-add-act-alias.md +46 -0
  157. package/RAF/013-dependencies-watchdog/outcomes/008-add-exit-message.md +52 -0
  158. package/RAF/013-dependencies-watchdog/plans/001-define-dependency-syntax.md +32 -0
  159. package/RAF/013-dependencies-watchdog/plans/002-update-planning-prompts.md +38 -0
  160. package/RAF/013-dependencies-watchdog/plans/003-parse-dependencies-update-state.md +46 -0
  161. package/RAF/013-dependencies-watchdog/plans/004-implement-dependency-checking-in-do.md +48 -0
  162. package/RAF/013-dependencies-watchdog/plans/005-update-execution-prompts.md +44 -0
  163. package/RAF/013-dependencies-watchdog/plans/006-add-tests.md +54 -0
  164. package/RAF/013-dependencies-watchdog/plans/007-add-act-alias.md +26 -0
  165. package/RAF/013-dependencies-watchdog/plans/008-add-exit-message.md +31 -0
  166. package/RAF/014-watchdog/decisions.md +16 -0
  167. package/RAF/014-watchdog/input.md +2 -0
  168. package/RAF/014-watchdog/outcomes/001-amend-flag-position.md +50 -0
  169. package/RAF/014-watchdog/outcomes/002-details-only-on-failure.md +58 -0
  170. package/RAF/014-watchdog/plans/001-amend-flag-position.md +34 -0
  171. package/RAF/014-watchdog/plans/002-details-only-on-failure.md +46 -0
  172. package/RAF/015-name-lottery/decisions.md +14 -0
  173. package/RAF/015-name-lottery/input.md +3 -0
  174. package/RAF/015-name-lottery/outcomes/001-auto-pick-project-name.md +31 -0
  175. package/RAF/015-name-lottery/outcomes/002-mention-plan-files-in-commit.md +23 -0
  176. package/RAF/015-name-lottery/outcomes/003-fix-input-md-in-amend-flow.md +44 -0
  177. package/RAF/015-name-lottery/plans/001-auto-pick-project-name.md +38 -0
  178. package/RAF/015-name-lottery/plans/002-mention-plan-files-in-commit.md +32 -0
  179. package/RAF/015-name-lottery/plans/003-fix-input-md-in-amend-flow.md +44 -0
  180. package/README.md +116 -0
  181. package/dist/commands/do.d.ts +12 -0
  182. package/dist/commands/do.d.ts.map +1 -0
  183. package/dist/commands/do.js +684 -0
  184. package/dist/commands/do.js.map +1 -0
  185. package/dist/commands/plan.d.ts +3 -0
  186. package/dist/commands/plan.d.ts.map +1 -0
  187. package/dist/commands/plan.js +345 -0
  188. package/dist/commands/plan.js.map +1 -0
  189. package/dist/commands/status.d.ts +3 -0
  190. package/dist/commands/status.d.ts.map +1 -0
  191. package/dist/commands/status.js +117 -0
  192. package/dist/commands/status.js.map +1 -0
  193. package/dist/core/claude-runner.d.ts +78 -0
  194. package/dist/core/claude-runner.d.ts.map +1 -0
  195. package/dist/core/claude-runner.js +297 -0
  196. package/dist/core/claude-runner.js.map +1 -0
  197. package/dist/core/editor.d.ts +10 -0
  198. package/dist/core/editor.d.ts.map +1 -0
  199. package/dist/core/editor.js +77 -0
  200. package/dist/core/editor.js.map +1 -0
  201. package/dist/core/failure-analyzer.d.ts +28 -0
  202. package/dist/core/failure-analyzer.d.ts.map +1 -0
  203. package/dist/core/failure-analyzer.js +305 -0
  204. package/dist/core/failure-analyzer.js.map +1 -0
  205. package/dist/core/git.d.ts +42 -0
  206. package/dist/core/git.d.ts.map +1 -0
  207. package/dist/core/git.js +148 -0
  208. package/dist/core/git.js.map +1 -0
  209. package/dist/core/project-manager.d.ts +72 -0
  210. package/dist/core/project-manager.d.ts.map +1 -0
  211. package/dist/core/project-manager.js +193 -0
  212. package/dist/core/project-manager.js.map +1 -0
  213. package/dist/core/retry-handler.d.ts +19 -0
  214. package/dist/core/retry-handler.d.ts.map +1 -0
  215. package/dist/core/retry-handler.js +51 -0
  216. package/dist/core/retry-handler.js.map +1 -0
  217. package/dist/core/shutdown-handler.d.ts +30 -0
  218. package/dist/core/shutdown-handler.d.ts.map +1 -0
  219. package/dist/core/shutdown-handler.js +79 -0
  220. package/dist/core/shutdown-handler.js.map +1 -0
  221. package/dist/core/state-derivation.d.ts +82 -0
  222. package/dist/core/state-derivation.d.ts.map +1 -0
  223. package/dist/core/state-derivation.js +271 -0
  224. package/dist/core/state-derivation.js.map +1 -0
  225. package/dist/core/state-manager.d.ts +54 -0
  226. package/dist/core/state-manager.d.ts.map +1 -0
  227. package/dist/core/state-manager.js +198 -0
  228. package/dist/core/state-manager.js.map +1 -0
  229. package/dist/index.d.ts +3 -0
  230. package/dist/index.d.ts.map +1 -0
  231. package/dist/index.js +16 -0
  232. package/dist/index.js.map +1 -0
  233. package/dist/parsers/output-parser.d.ts +19 -0
  234. package/dist/parsers/output-parser.d.ts.map +1 -0
  235. package/dist/parsers/output-parser.js +137 -0
  236. package/dist/parsers/output-parser.js.map +1 -0
  237. package/dist/prompts/amend.d.ts +20 -0
  238. package/dist/prompts/amend.d.ts.map +1 -0
  239. package/dist/prompts/amend.js +166 -0
  240. package/dist/prompts/amend.js.map +1 -0
  241. package/dist/prompts/execution.d.ts +30 -0
  242. package/dist/prompts/execution.d.ts.map +1 -0
  243. package/dist/prompts/execution.js +179 -0
  244. package/dist/prompts/execution.js.map +1 -0
  245. package/dist/prompts/planning.d.ts +15 -0
  246. package/dist/prompts/planning.d.ts.map +1 -0
  247. package/dist/prompts/planning.js +163 -0
  248. package/dist/prompts/planning.js.map +1 -0
  249. package/dist/types/config.d.ts +26 -0
  250. package/dist/types/config.d.ts.map +1 -0
  251. package/dist/types/config.js +7 -0
  252. package/dist/types/config.js.map +1 -0
  253. package/dist/types/state.d.ts +33 -0
  254. package/dist/types/state.d.ts.map +1 -0
  255. package/dist/types/state.js +28 -0
  256. package/dist/types/state.js.map +1 -0
  257. package/dist/ui/name-picker-subprocess.d.ts +11 -0
  258. package/dist/ui/name-picker-subprocess.d.ts.map +1 -0
  259. package/dist/ui/name-picker-subprocess.js +83 -0
  260. package/dist/ui/name-picker-subprocess.js.map +1 -0
  261. package/dist/ui/name-picker.d.ts +19 -0
  262. package/dist/ui/name-picker.d.ts.map +1 -0
  263. package/dist/ui/name-picker.js +173 -0
  264. package/dist/ui/name-picker.js.map +1 -0
  265. package/dist/ui/project-picker.d.ts +27 -0
  266. package/dist/ui/project-picker.d.ts.map +1 -0
  267. package/dist/ui/project-picker.js +58 -0
  268. package/dist/ui/project-picker.js.map +1 -0
  269. package/dist/utils/config.d.ts +24 -0
  270. package/dist/utils/config.d.ts.map +1 -0
  271. package/dist/utils/config.js +63 -0
  272. package/dist/utils/config.js.map +1 -0
  273. package/dist/utils/logger.d.ts +32 -0
  274. package/dist/utils/logger.d.ts.map +1 -0
  275. package/dist/utils/logger.js +60 -0
  276. package/dist/utils/logger.js.map +1 -0
  277. package/dist/utils/name-generator.d.ts +20 -0
  278. package/dist/utils/name-generator.d.ts.map +1 -0
  279. package/dist/utils/name-generator.js +183 -0
  280. package/dist/utils/name-generator.js.map +1 -0
  281. package/dist/utils/paths.d.ts +132 -0
  282. package/dist/utils/paths.d.ts.map +1 -0
  283. package/dist/utils/paths.js +412 -0
  284. package/dist/utils/paths.js.map +1 -0
  285. package/dist/utils/status-line.d.ts +14 -0
  286. package/dist/utils/status-line.d.ts.map +1 -0
  287. package/dist/utils/status-line.js +36 -0
  288. package/dist/utils/status-line.js.map +1 -0
  289. package/dist/utils/terminal-symbols.d.ts +50 -0
  290. package/dist/utils/terminal-symbols.d.ts.map +1 -0
  291. package/dist/utils/terminal-symbols.js +97 -0
  292. package/dist/utils/terminal-symbols.js.map +1 -0
  293. package/dist/utils/timer.d.ts +17 -0
  294. package/dist/utils/timer.d.ts.map +1 -0
  295. package/dist/utils/timer.js +56 -0
  296. package/dist/utils/timer.js.map +1 -0
  297. package/dist/utils/validation.d.ts +17 -0
  298. package/dist/utils/validation.d.ts.map +1 -0
  299. package/dist/utils/validation.js +106 -0
  300. package/dist/utils/validation.js.map +1 -0
  301. package/dist/utils/version.d.ts +2 -0
  302. package/dist/utils/version.d.ts.map +1 -0
  303. package/dist/utils/version.js +12 -0
  304. package/dist/utils/version.js.map +1 -0
  305. package/jest.config.ts +30 -0
  306. package/package.json +55 -0
  307. package/src/commands/do.ts +829 -0
  308. package/src/commands/plan.ts +422 -0
  309. package/src/commands/status.ts +146 -0
  310. package/src/core/claude-runner.ts +374 -0
  311. package/src/core/editor.ts +85 -0
  312. package/src/core/failure-analyzer.ts +372 -0
  313. package/src/core/git.ts +166 -0
  314. package/src/core/project-manager.ts +243 -0
  315. package/src/core/retry-handler.ts +72 -0
  316. package/src/core/shutdown-handler.ts +93 -0
  317. package/src/core/state-derivation.ts +343 -0
  318. package/src/index.ts +20 -0
  319. package/src/parsers/output-parser.ts +164 -0
  320. package/src/prompts/amend.ts +194 -0
  321. package/src/prompts/execution.ts +223 -0
  322. package/src/prompts/planning.ts +175 -0
  323. package/src/types/config.ts +35 -0
  324. package/src/ui/name-picker-subprocess.ts +96 -0
  325. package/src/ui/name-picker.ts +198 -0
  326. package/src/ui/project-picker.ts +80 -0
  327. package/src/utils/config.ts +69 -0
  328. package/src/utils/logger.ts +81 -0
  329. package/src/utils/name-generator.ts +211 -0
  330. package/src/utils/paths.ts +497 -0
  331. package/src/utils/status-line.ts +45 -0
  332. package/src/utils/terminal-symbols.ts +124 -0
  333. package/src/utils/timer.ts +64 -0
  334. package/src/utils/validation.ts +132 -0
  335. package/src/utils/version.ts +12 -0
  336. package/tests/unit/claude-runner-interactive.test.ts +343 -0
  337. package/tests/unit/claude-runner.test.ts +629 -0
  338. package/tests/unit/command-output.test.ts +295 -0
  339. package/tests/unit/config.test.ts +72 -0
  340. package/tests/unit/dependency-integration.test.ts +559 -0
  341. package/tests/unit/do-blocked-tasks.test.ts +323 -0
  342. package/tests/unit/do-command.test.ts +198 -0
  343. package/tests/unit/do-multiproject.test.ts +270 -0
  344. package/tests/unit/do-rerun.test.ts +270 -0
  345. package/tests/unit/execution-prompt.test.ts +406 -0
  346. package/tests/unit/failure-analyzer.test.ts +276 -0
  347. package/tests/unit/failure-history.test.ts +143 -0
  348. package/tests/unit/git-stash.test.ts +138 -0
  349. package/tests/unit/git.test.ts +80 -0
  350. package/tests/unit/logger.test.ts +132 -0
  351. package/tests/unit/name-generator.test.ts +283 -0
  352. package/tests/unit/name-picker.test.ts +179 -0
  353. package/tests/unit/outcome-content.test.ts +166 -0
  354. package/tests/unit/output-parser.test.ts +178 -0
  355. package/tests/unit/paths.test.ts +741 -0
  356. package/tests/unit/plan-command-amend-flag.test.ts +115 -0
  357. package/tests/unit/plan-command-amend-input.test.ts +156 -0
  358. package/tests/unit/plan-command-auto-flag.test.ts +112 -0
  359. package/tests/unit/plan-command.test.ts +580 -0
  360. package/tests/unit/planning-prompt.test.ts +137 -0
  361. package/tests/unit/project-manager.test.ts +265 -0
  362. package/tests/unit/project-picker.test.ts +338 -0
  363. package/tests/unit/retry-handler.test.ts +89 -0
  364. package/tests/unit/state-derivation.test.ts +714 -0
  365. package/tests/unit/status-command.test.ts +271 -0
  366. package/tests/unit/status-line.test.ts +92 -0
  367. package/tests/unit/terminal-symbols.test.ts +214 -0
  368. package/tests/unit/timer.test.ts +102 -0
  369. package/tests/unit/validation.test.ts +118 -0
  370. package/tsconfig.json +26 -0
@@ -0,0 +1,42 @@
1
+ # Task 006 - Completed
2
+
3
+ ## Summary
4
+ ## Task 006 Complete
5
+ ### Summary
6
+ Implemented multi-project execution support for the `raf do` command, allowing users to execute multiple projects in a single command.
7
+ ### Changes Made
8
+ 1. **Updated `src/utils/paths.ts`**:
9
+ - Added `resolveProjectIdentifier(rafDir, identifier)` function
10
+ - Supports numeric identifiers (e.g., "003", "3") - looks up by project number
11
+ - Supports name identifiers (e.g., "my-project") - looks up by project name
12
+ - Returns project path or null if not found
13
+ 2. **Updated `src/commands/do.ts`**:
14
+ - Changed argument from `<projectName>` to variadic `<projects...>`
15
+ - Resolves all project identifiers at start, removing duplicates
16
+ - Reports resolution errors but continues with valid projects
17
+ - Executes projects sequentially in specified order
18
+ - Wraps each project in try-catch for continue-on-failure behavior
19
+ - Shows project header: `=== Project 1/3: project-name ===`
20
+ - Displays multi-project summary after all complete:
21
+ - Exit code 1 if any project fails, 0 if all succeed
22
+ 3. **Added `tests/unit/do-multiproject.test.ts`** (12 tests):
23
+ - Project resolution tests (by number, by name, mixed)
24
+ - Duplicate detection tests (same project, number+name, different formats)
25
+ - Edge cases (empty list, all invalid, single project, similar names)
26
+ - Order preservation tests
27
+ 4. **Updated `tests/unit/paths.test.ts`** (11 new tests):
28
+ - Tests for `resolveProjectIdentifier` function
29
+ ### Acceptance Criteria Met
30
+ - ✅ `raf do project1 project2` executes both projects
31
+ - ✅ `raf do 003 004` resolves numbers to project names
32
+ - ✅ Projects execute sequentially
33
+ - ✅ Failure in one project doesn't stop others
34
+ - ✅ Summary shows results for all projects
35
+ - ✅ Tests cover multi-project scenarios (23 new tests, 219 total passing)
36
+ <promise>COMPLETE</promise>
37
+
38
+ ## Details
39
+ - Attempts: 1
40
+ - Elapsed time: 3m 51s
41
+ - Completed at: 2026-01-30T18:20:12.500Z
42
+
@@ -0,0 +1,54 @@
1
+ # Task 007 - Completed
2
+
3
+ ## Summary
4
+ ## Task 007 Complete
5
+ ### Summary
6
+ Verified that the 60-minute timeout is correctly applied per task (not per project or per retry) and added comprehensive tests to ensure this behavior.
7
+ ### Changes Made
8
+ 1. **Code Review and Verification**:
9
+ - Reviewed `src/core/claude-runner.ts` timeout handling
10
+ - Confirmed that `setTimeout` is set up independently for each call to `run()` or `runVerbose()`
11
+ - Verified that each retry attempt in `do.ts` gets a fresh timeout (new call to run methods)
12
+ - Timeout is at lines 143-148 (`run()`) and 235-240 (`runVerbose()`)
13
+ 2. **Added Documentation to `src/core/claude-runner.ts`**:
14
+ - Added detailed JSDoc comments to `ClaudeRunnerOptions.timeout` explaining:
15
+ - Timeout is per individual call (not shared)
16
+ - Retries get fresh timeout (elapsed time NOT accumulated)
17
+ - Default is 60 minutes
18
+ - Added TIMEOUT BEHAVIOR comments to `run()` and `runVerbose()` methods
19
+ 3. **Added Timeout Validation**:
20
+ - Added validation for edge cases where timeout is 0, negative, or NaN
21
+ - Falls back to 60 minutes default in these cases
22
+ 4. **Created `tests/unit/claude-runner.test.ts`** with 16 tests covering:
23
+ - **Timeout handling tests** (10 tests):
24
+ - Timeout set up for each run() call
25
+ - Timeout set up for each runVerbose() call
26
+ - Default timeout of 60 minutes when not specified
27
+ - Timeout cleared when process completes normally
28
+ - Fresh timeout for consecutive calls
29
+ - timedOut flag set correctly on timeout
30
+ - timedOut flag not set when completed before timeout
31
+ - Default timeout used when timeout is 0
32
+ - Default timeout used when timeout is negative
33
+ - Default timeout used when timeout is NaN
34
+ - **Context overflow detection tests** (2 tests)
35
+ - **Output collection tests** (2 tests)
36
+ - **Retry isolation tests** (2 tests):
37
+ - Fresh timeout for each retry attempt
38
+ - Elapsed time NOT shared between attempts
39
+ ### Acceptance Criteria Met
40
+ - ✅ Code review confirms timeout is per-task execution
41
+ - ✅ Code review confirms retries get fresh timeout
42
+ - ✅ Unit tests verify timeout behavior (16 tests)
43
+ - ✅ Integration tests verify multi-task timeout independence (retry isolation tests)
44
+ - ✅ Documentation updated with timeout behavior (JSDoc comments)
45
+ - ✅ Edge cases handled appropriately (0, negative, NaN → fallback to 60 min)
46
+ ### Test Results
47
+ All 235 tests pass (16 new tests for claude-runner.test.ts).
48
+ <promise>COMPLETE</promise>
49
+
50
+ ## Details
51
+ - Attempts: 1
52
+ - Elapsed time: 4m 30s
53
+ - Completed at: 2026-01-30T18:24:42.738Z
54
+
@@ -0,0 +1,38 @@
1
+ # Task 008 - Completed
2
+
3
+ ## Summary
4
+ ## Task 008 Complete
5
+ ### Summary
6
+ Simplified project structure by moving the decisions file from `decisions/DECISIONS.md` to `decisions.md` at the project root.
7
+ ### Changes Made
8
+ 1. **Updated `src/utils/paths.ts`**:
9
+ - Renamed `getDecisionsDir()` to `getDecisionsPath()`
10
+ - Returns `path.join(projectPath, 'decisions.md')` instead of `path.join(projectPath, 'decisions')`
11
+ 2. **Updated `src/core/project-manager.ts`**:
12
+ - Removed `decisions/` folder creation
13
+ - Creates `decisions.md` file directly at project root with initial content `# Project Decisions\n`
14
+ - Updated import from `getDecisionsDir` to `getDecisionsPath`
15
+ 3. **Updated `src/prompts/planning.ts`**:
16
+ - Changed path reference from `${projectPath}/decisions/DECISIONS.md` to `${projectPath}/decisions.md`
17
+ 4. **Updated `README.md`**:
18
+ - Updated project structure to show `decisions.md` at project root
19
+ - Removed outdated `.raf/` folder reference (which was removed in earlier tasks)
20
+ 5. **Updated tests**:
21
+ - `tests/unit/project-manager.test.ts`: Changed test to verify `decisions.md` file instead of `decisions` directory
22
+ - `tests/unit/paths.test.ts`: Added test for `getDecisionsPath()` function
23
+ ### Acceptance Criteria Met
24
+ - ✅ New projects create `decisions.md` at project root
25
+ - ✅ `decisions/` folder is not created for new projects
26
+ - ✅ Planning prompt references correct path
27
+ - ✅ Path utilities return correct location
28
+ - ✅ Documentation updated
29
+ - ✅ Tests updated (236 tests pass)
30
+ ### Test Results
31
+ All 236 tests pass.
32
+ <promise>COMPLETE</promise>
33
+
34
+ ## Details
35
+ - Attempts: 1
36
+ - Elapsed time: 2m 43s
37
+ - Completed at: 2026-01-30T18:27:26.044Z
38
+
@@ -0,0 +1,79 @@
1
+ # Project Summary: multi-project-execution
2
+
3
+ **Status:** executing
4
+ **Created:** 2026-01-30T17:35:55.018Z
5
+ **Updated:** 2026-01-30T18:27:26.044Z
6
+
7
+ ## Statistics
8
+
9
+ - Completed: 8
10
+ - Failed: 0
11
+ - Skipped: 0
12
+ - Pending: 0
13
+
14
+ ## Tasks
15
+
16
+ ### [x] Task 001
17
+
18
+ - **Plan:** plans/001-remove-state-json.md
19
+ - **Status:** completed
20
+ - **Attempts:** 1
21
+ - **Started:** 2026-01-30T17:55:55.719Z
22
+ - **Completed:** 2026-01-30T18:03:28.628Z
23
+
24
+ ### [x] Task 002
25
+
26
+ - **Plan:** plans/002-update-raf-status.md
27
+ - **Status:** completed
28
+ - **Attempts:** 1
29
+ - **Started:** 2026-01-30T18:03:28.656Z
30
+ - **Completed:** 2026-01-30T18:07:19.042Z
31
+
32
+ ### [x] Task 003
33
+
34
+ - **Plan:** plans/003-simplify-git-logic.md
35
+ - **Status:** completed
36
+ - **Attempts:** 1
37
+ - **Started:** 2026-01-30T18:07:19.064Z
38
+ - **Completed:** 2026-01-30T18:10:57.209Z
39
+
40
+ ### [x] Task 004
41
+
42
+ - **Plan:** plans/004-auto-commit-planning.md
43
+ - **Status:** completed
44
+ - **Attempts:** 1
45
+ - **Started:** 2026-01-30T18:10:57.232Z
46
+ - **Completed:** 2026-01-30T18:13:18.833Z
47
+
48
+ ### [x] Task 005
49
+
50
+ - **Plan:** plans/005-rerun-failed-tasks.md
51
+ - **Status:** completed
52
+ - **Attempts:** 1
53
+ - **Started:** 2026-01-30T18:13:18.857Z
54
+ - **Completed:** 2026-01-30T18:16:20.525Z
55
+
56
+ ### [x] Task 006
57
+
58
+ - **Plan:** plans/006-multi-project-execution.md
59
+ - **Status:** completed
60
+ - **Attempts:** 1
61
+ - **Started:** 2026-01-30T18:16:20.547Z
62
+ - **Completed:** 2026-01-30T18:20:12.503Z
63
+
64
+ ### [x] Task 007
65
+
66
+ - **Plan:** plans/007-verify-timeout.md
67
+ - **Status:** completed
68
+ - **Attempts:** 1
69
+ - **Started:** 2026-01-30T18:20:12.530Z
70
+ - **Completed:** 2026-01-30T18:24:42.738Z
71
+
72
+ ### [x] Task 008
73
+
74
+ - **Plan:** plans/008-move-decisions-file.md
75
+ - **Status:** completed
76
+ - **Attempts:** 1
77
+ - **Started:** 2026-01-30T18:24:42.761Z
78
+ - **Completed:** 2026-01-30T18:27:26.044Z
79
+
@@ -0,0 +1,71 @@
1
+ # Task: Remove .raf Folder and State-Based Logic
2
+
3
+ ## Objective
4
+ Remove the `.raf` folder and `state.json` entirely, deriving all state from the RAF project folder structure and outcome files.
5
+
6
+ ## Context
7
+ Currently, RAF maintains state in `.raf/state.json` which tracks project status, task states, and execution metadata. This creates a dependency on a technical artifact that can become out of sync with actual project state. By deriving state from the folder structure and outcome files, we make the system more resilient and transparent.
8
+
9
+ ## Requirements
10
+ - Remove all usage of `.raf/state.json`
11
+ - Remove the `.raf` folder entirely (including logs directory - logs will be console-only)
12
+ - State must be derived from:
13
+ - Project existence: `RAF/NNN-project-name/` folder exists
14
+ - Task status: determined by outcome file existence and content
15
+ - Outcome file format must include status marker: `## Status: SUCCESS` or `## Status: FAILED` at the top
16
+ - No execution logs will be persisted - console output only
17
+
18
+ ## Implementation Steps
19
+
20
+ 1. **Update outcome file format** (`src/core/outcomes.ts` or similar)
21
+ - Modify outcome generation to include `## Status: SUCCESS` or `## Status: FAILED` as first line
22
+ - Create a parser function to read outcome files and extract status
23
+
24
+ 2. **Create state derivation module** (`src/core/state-derivation.ts`)
25
+ - Function `deriveProjectState(projectPath)` that:
26
+ - Scans `plans/` directory for plan files
27
+ - Scans `outcomes/` directory for outcome files
28
+ - Matches plan files to outcome files by task ID (NNN prefix)
29
+ - Parses outcome files for SUCCESS/FAILED status
30
+ - Returns derived state object with task statuses
31
+
32
+ 3. **Remove StateManager class** (`src/core/state-manager.ts`)
33
+ - Delete the entire StateManager class
34
+ - Remove all imports and usages throughout codebase
35
+
36
+ 4. **Update `raf do` command** (`src/commands/do.ts`)
37
+ - Replace StateManager usage with state derivation
38
+ - Get pending/failed tasks from derived state
39
+ - Remove state saving logic
40
+
41
+ 5. **Update `raf plan` command** (`src/commands/plan.ts`)
42
+ - Remove StateManager initialization
43
+ - Remove state saving after planning
44
+
45
+ 6. **Update `raf status` command** (`src/commands/status.ts`)
46
+ - Will be updated in subsequent task (002)
47
+
48
+ 7. **Remove .raf path utilities** (`src/utils/paths.ts`)
49
+ - Remove functions related to `.raf` directory
50
+ - Remove state file path constants
51
+
52
+ 8. **Clean up imports and dependencies**
53
+ - Remove state-manager from all imports
54
+ - Update any type definitions that reference state types
55
+
56
+ 9. **Add migration note**
57
+ - Document that `.raf` folder can be safely deleted from existing projects
58
+
59
+ ## Acceptance Criteria
60
+ - [ ] `.raf` folder is not created or used by any command
61
+ - [ ] `state.json` is not created or read
62
+ - [ ] Project state can be derived from `RAF/project/` folder structure
63
+ - [ ] Outcome files contain `## Status: SUCCESS` or `## Status: FAILED` marker
64
+ - [ ] All existing tests updated or removed as appropriate
65
+ - [ ] New tests for state derivation logic
66
+ - [ ] Code compiles without errors
67
+
68
+ ## Notes
69
+ - This is a breaking change - existing `.raf` folders will be ignored
70
+ - The `raf status` command will be updated in task 002 to work with derived state
71
+ - Consider backward compatibility: old outcome files without status markers should be treated as incomplete
@@ -0,0 +1,65 @@
1
+ # Task: Update raf status Command for Stateless Operation
2
+
3
+ ## Objective
4
+ Update the `raf status` command to work without `state.json`, deriving all status information from the RAF folder structure and outcome files.
5
+
6
+ ## Context
7
+ With the removal of `state.json` in task 001, the `raf status` command needs to scan the `RAF/` directory and derive project and task statuses from the folder structure and outcome file contents.
8
+
9
+ ## Requirements
10
+ - Scan `RAF/` folder to discover all projects
11
+ - Derive project status from task outcomes:
12
+ - `planning`: has `input.md` but no `plans/` folder or empty plans
13
+ - `ready`: has plan files but no outcome files
14
+ - `executing`: has some outcome files but not all (or has failed outcomes without SUCCESS)
15
+ - `completed`: all plan files have corresponding SUCCESS outcomes
16
+ - `failed`: has FAILED outcome files
17
+ - Derive task status from outcome files:
18
+ - `pending`: no outcome file exists
19
+ - `completed`: outcome file exists with `## Status: SUCCESS`
20
+ - `failed`: outcome file exists with `## Status: FAILED`
21
+ - Display same user-friendly output as before (badges, stats)
22
+ - Support `--json` flag for machine-readable output
23
+
24
+ ## Implementation Steps
25
+
26
+ 1. **Create project scanner** (in `src/core/state-derivation.ts` or new file)
27
+ - Function `discoverProjects(rafPath)` that:
28
+ - Lists all directories in `RAF/` matching pattern `NNN-project-name`
29
+ - Returns array of project info objects
30
+
31
+ 2. **Update `deriveProjectState`** function
32
+ - Accept project path
33
+ - Scan plans directory
34
+ - Scan outcomes directory
35
+ - Match and determine task statuses
36
+ - Calculate overall project status
37
+
38
+ 3. **Update status command** (`src/commands/status.ts`)
39
+ - Remove StateManager dependency
40
+ - Use `discoverProjects()` for listing all projects
41
+ - Use `deriveProjectState()` for individual project details
42
+ - Maintain existing output format and badges
43
+
44
+ 4. **Update stats calculation**
45
+ - Calculate completed/failed/pending/skipped counts from derived state
46
+ - No changes to display logic needed
47
+
48
+ 5. **Handle edge cases**
49
+ - Project folder exists but is empty
50
+ - Plans folder exists but is empty
51
+ - Outcome file exists but has no status marker (treat as incomplete)
52
+ - Malformed outcome files
53
+
54
+ ## Acceptance Criteria
55
+ - [ ] `raf status` lists all projects from RAF folder
56
+ - [ ] `raf status <project>` shows detailed task status derived from files
57
+ - [ ] Status badges display correctly: `[ ]` pending, `[x]` completed, `[!]` failed
58
+ - [ ] `--json` flag outputs valid JSON with derived state
59
+ - [ ] No dependency on StateManager or state.json
60
+ - [ ] Tests cover status derivation scenarios
61
+
62
+ ## Notes
63
+ - Depends on task 001 (state derivation logic)
64
+ - Skipped tasks (`[-]` badge) may not be supported without state - consider removing or deriving differently
65
+ - Performance: scanning files should be fast enough for typical project sizes (< 20 tasks)
@@ -0,0 +1,74 @@
1
+ # Task: Simplify Git Logic - Claude Commits Changes
2
+
3
+ ## Objective
4
+ Simplify git operations by instructing Claude to commit its own changes during task execution, removing the smart commit logic from RAF.
5
+
6
+ ## Context
7
+ Currently, RAF captures a "baseline" of changed files before each task, then commits only the delta after task completion. This adds complexity and can miss files or include unrelated changes. By instructing Claude to commit after making changes, we simplify the codebase and give Claude more control over what gets committed.
8
+
9
+ ## Requirements
10
+ - Claude must be instructed to commit changes after completing task work
11
+ - Commit message format: `[project-name] task description` (no task numbers)
12
+ - Outcome file should be included in Claude's commit
13
+ - Remove smart commit logic (baseline tracking, delta filtering)
14
+ - Remove `commitTaskChanges`, `setTaskBaseline`, `getTaskBaseline` functions
15
+ - RAF should NOT commit after task completion (Claude does it)
16
+ - Keep stash functionality for failure cases
17
+
18
+ ## Implementation Steps
19
+
20
+ 1. **Update execution prompt** (`src/prompts/execution-prompt.ts` or similar)
21
+ - Add explicit instructions for Claude to commit after making changes
22
+ - Specify commit message format: `[project-name] task description`
23
+ - Instruct to include outcome file in the commit
24
+ - Example instruction:
25
+ ```
26
+ After completing your work, commit all changes with:
27
+ git add -A && git commit -m "[project-name] brief description of changes"
28
+
29
+ Include the outcome file in your commit.
30
+ ```
31
+
32
+ 2. **Remove smart commit logic** (`src/core/git.ts`)
33
+ - Remove `commitTaskChanges` function
34
+ - Remove baseline-related functions:
35
+ - `getTaskChangedFiles`
36
+ - Any baseline tracking utilities
37
+ - Keep `stashChanges` for failure handling
38
+ - Keep `isGitRepo` for validation
39
+
40
+ 3. **Update `raf do` command** (`src/commands/do.ts`)
41
+ - Remove baseline capture before task execution
42
+ - Remove commit call after task success
43
+ - Keep stash call on task failure
44
+ - Remove commit hash tracking (no longer relevant)
45
+
46
+ 4. **Update outcome generation**
47
+ - Ensure outcome file is written BEFORE Claude is asked to commit
48
+ - Or instruct Claude to write the outcome as part of its work
49
+
50
+ 5. **Simplify git.ts exports**
51
+ - Export only necessary functions:
52
+ - `isGitRepo`
53
+ - `stashChanges`
54
+ - `getChangedFiles` (for status display if needed)
55
+
56
+ 6. **Update tests**
57
+ - Remove tests for smart commit logic
58
+ - Add tests for new prompt instructions
59
+ - Update integration tests
60
+
61
+ ## Acceptance Criteria
62
+ - [ ] Execution prompt includes commit instructions for Claude
63
+ - [ ] Commit message format is `[project-name] task description`
64
+ - [ ] Smart commit logic (baseline tracking) is removed
65
+ - [ ] RAF does not commit after task completion
66
+ - [ ] Outcome file is committed by Claude
67
+ - [ ] Stash functionality still works on task failure
68
+ - [ ] All tests pass
69
+
70
+ ## Notes
71
+ - This changes the responsibility model: Claude commits, RAF orchestrates
72
+ - If Claude fails to commit, changes remain uncommitted (user can handle manually)
73
+ - Consider adding a fallback commit in RAF if Claude didn't commit - but user chose not to do this
74
+ - Outcome file path needs to be passed to Claude so it knows what to include
@@ -0,0 +1,57 @@
1
+ # Task: Auto-Commit After Planning
2
+
3
+ ## Objective
4
+ Automatically commit the RAF project folder (input, decisions, plans) after the planning step completes successfully.
5
+
6
+ ## Context
7
+ When a project is planned, the `RAF/NNN-project-name/` folder is created with `input.md`, `decisions/DECISIONS.md`, and plan files in `plans/`. These should be committed to preserve the planning work and make it easy to share or review the project plan.
8
+
9
+ ## Requirements
10
+ - After `raf plan` completes successfully, commit the project folder
11
+ - Commit message format: `RAF(project-name): Plan complete`
12
+ - Only commit files within the project folder: `RAF/NNN-project-name/**`
13
+ - Do not commit if planning was cancelled or failed
14
+ - Do not commit unrelated changes in the repository
15
+
16
+ ## Implementation Steps
17
+
18
+ 1. **Add commit function for planning** (`src/core/git.ts`)
19
+ - Create `commitProjectFolder(projectPath, projectName)` function
20
+ - Stage only files within the project folder
21
+ - Use commit message: `RAF(project-name): Plan complete`
22
+
23
+ 2. **Update `raf plan` command** (`src/commands/plan.ts`)
24
+ - After successful Claude interactive session completion
25
+ - After plan files are created
26
+ - Call `commitProjectFolder` with project path and name
27
+ - Handle commit failure gracefully (log warning, don't fail the command)
28
+
29
+ 3. **Implement selective staging**
30
+ - Use `git add RAF/NNN-project-name/` to stage only project files
31
+ - Verify files are staged before committing
32
+ - Skip commit if no files to commit (edge case)
33
+
34
+ 4. **Add error handling**
35
+ - Catch git errors and log them
36
+ - Don't fail the plan command if commit fails
37
+ - Inform user that commit failed but planning succeeded
38
+
39
+ 5. **Update tests**
40
+ - Test that commit happens after successful planning
41
+ - Test commit message format
42
+ - Test that only project files are committed
43
+ - Test graceful handling of commit failures
44
+
45
+ ## Acceptance Criteria
46
+ - [ ] After successful `raf plan`, project folder is committed
47
+ - [ ] Commit message is `RAF(project-name): Plan complete`
48
+ - [ ] Only files in `RAF/NNN-project-name/` are committed
49
+ - [ ] Unrelated changes in repo are not committed
50
+ - [ ] Planning doesn't fail if commit fails
51
+ - [ ] User is informed of commit success/failure
52
+ - [ ] Tests cover commit scenarios
53
+
54
+ ## Notes
55
+ - This runs after the interactive Claude session, not during
56
+ - If user manually committed during planning, this will be a no-op (nothing to commit)
57
+ - Consider: what if there are staged changes before planning? Should we stash first? Decision: No, just commit project folder specifically
@@ -0,0 +1,69 @@
1
+ # Task: Support Re-Running Failed/Pending Tasks
2
+
3
+ ## Objective
4
+ Allow users to re-run `raf do project-name` on a project that has already been executed, automatically resuming from failed or pending tasks.
5
+
6
+ ## Context
7
+ Currently, running `raf do` on a project that has been executed just shows statistics. Users need the ability to retry failed tasks (e.g., after API unavailability, token limits reached) without manually tracking state. The system should derive what needs to be done from the folder structure.
8
+
9
+ ## Requirements
10
+ - `raf do project-name` on an existing project should:
11
+ - Skip tasks with `## Status: SUCCESS` in their outcome files
12
+ - Re-run tasks with `## Status: FAILED` in their outcome files
13
+ - Run tasks with no outcome file (pending)
14
+ - Add `--force` flag to re-run even completed projects (all tasks)
15
+ - If all tasks are complete and no `--force` flag, show message and exit
16
+ - Derive task status from outcome files (implemented in task 001)
17
+
18
+ ## Implementation Steps
19
+
20
+ 1. **Update task selection logic** (`src/commands/do.ts`)
21
+ - Use derived state to get task statuses
22
+ - Filter for tasks that are NOT completed (no SUCCESS outcome)
23
+ - Include failed tasks (FAILED outcome) for retry
24
+ - Include pending tasks (no outcome file)
25
+
26
+ 2. **Add `--force` flag**
27
+ - Add `-f, --force` option to `raf do` command
28
+ - When `--force` is set, run all tasks regardless of status
29
+ - Consider: should `--force` delete existing outcome files first? Decision: No, let Claude overwrite
30
+
31
+ 3. **Handle already-complete projects**
32
+ - Check if all tasks have SUCCESS outcomes
33
+ - If yes and no `--force`, display message: "All tasks completed. Use --force to re-run."
34
+ - Exit gracefully (exit code 0)
35
+
36
+ 4. **Update execution loop**
37
+ - Before running a task, check if it should be skipped (SUCCESS outcome exists)
38
+ - Log which tasks are being skipped
39
+ - Log which tasks are being retried (had FAILED outcome)
40
+
41
+ 5. **Handle outcome file updates**
42
+ - When retrying a failed task, the new outcome will overwrite the old one
43
+ - Ensure outcome file path is consistent
44
+
45
+ 6. **Update console output**
46
+ - Show clear indication of:
47
+ - "Skipping task X (already completed)"
48
+ - "Retrying task X (previously failed)"
49
+ - "Running task X"
50
+
51
+ 7. **Update tests**
52
+ - Test resume from failed task
53
+ - Test skip completed tasks
54
+ - Test `--force` flag behavior
55
+ - Test "all complete" message
56
+
57
+ ## Acceptance Criteria
58
+ - [ ] `raf do project-name` skips tasks with SUCCESS outcome
59
+ - [ ] `raf do project-name` retries tasks with FAILED outcome
60
+ - [ ] `raf do project-name` runs tasks without outcome files
61
+ - [ ] `--force` flag runs all tasks regardless of status
62
+ - [ ] Clear console output indicates skip/retry/run status
63
+ - [ ] All tests pass
64
+
65
+ ## Notes
66
+ - Depends on task 001 (state derivation)
67
+ - Task order is determined by plan file numbering (001, 002, etc.)
68
+ - Consider: should we clear FAILED outcome before retry? Decision: No, let new outcome overwrite
69
+ - Edge case: outcome file exists but is empty or malformed - treat as pending
@@ -0,0 +1,81 @@
1
+ # Task: Multi-Project Execution Support
2
+
3
+ ## Objective
4
+ Allow `raf do` command to accept multiple project names or numbers, executing them sequentially.
5
+
6
+ ## Context
7
+ Users may want to run multiple projects in sequence without manually invoking `raf do` for each one. This is useful for batch processing or running related projects together.
8
+
9
+ ## Requirements
10
+ - Support syntax: `raf do project1 project2 project3`
11
+ - Support number syntax: `raf do 003 004 005`
12
+ - Support mixed syntax: `raf do 003 my-project 005`
13
+ - No range support (e.g., `003-005` is NOT supported)
14
+ - Projects run sequentially (one after another)
15
+ - If a project fails, continue with remaining projects
16
+ - Report summary at end showing status of all projects
17
+ - Each project uses its own timeout (per-task timeout preserved)
18
+
19
+ ## Implementation Steps
20
+
21
+ 1. **Update command argument parsing** (`src/commands/do.ts`)
22
+ - Change from single `<projectName>` to variadic `<projects...>`
23
+ - Update Commander.js argument: `.argument('<projects...>', 'Project name(s) or number(s) to execute')`
24
+
25
+ 2. **Create project resolver function**
26
+ - Function `resolveProjectIdentifier(identifier)` that:
27
+ - If identifier is numeric (e.g., "003"), find matching project folder
28
+ - If identifier is a name, use as-is
29
+ - Return full project name or throw if not found
30
+
31
+ 3. **Update main execution flow**
32
+ - Loop through all project identifiers
33
+ - Resolve each to full project name
34
+ - Execute each project using existing single-project logic
35
+ - Collect results for each project
36
+
37
+ 4. **Implement continue-on-failure**
38
+ - Wrap single project execution in try-catch
39
+ - Log failure and continue to next project
40
+ - Track which projects succeeded/failed
41
+
42
+ 5. **Create multi-project summary**
43
+ - After all projects complete, show summary:
44
+ ```
45
+ === Multi-Project Summary ===
46
+ ✓ 003-project-a: Completed (5/5 tasks)
47
+ ✗ 004-project-b: Failed (3/5 tasks)
48
+ ✓ 005-project-c: Completed (3/3 tasks)
49
+
50
+ Total: 2 completed, 1 failed
51
+ ```
52
+
53
+ 6. **Handle edge cases**
54
+ - Project not found by number
55
+ - Duplicate projects in list (skip duplicates)
56
+ - Empty project list (show usage help)
57
+
58
+ 7. **Update help text and documentation**
59
+ - Update `--help` output to show multi-project usage
60
+ - Add examples: `raf do 003 004` and `raf do project-a project-b`
61
+
62
+ 8. **Update tests**
63
+ - Test multiple projects execution
64
+ - Test mixed name/number input
65
+ - Test continue-on-failure
66
+ - Test summary output
67
+ - Test project resolution
68
+
69
+ ## Acceptance Criteria
70
+ - [ ] `raf do project1 project2` executes both projects
71
+ - [ ] `raf do 003 004` resolves numbers to project names
72
+ - [ ] Projects execute sequentially
73
+ - [ ] Failure in one project doesn't stop others
74
+ - [ ] Summary shows results for all projects
75
+ - [ ] Tests cover multi-project scenarios
76
+
77
+ ## Notes
78
+ - Depends on task 005 (single project re-run support)
79
+ - Options like `--timeout` and `--force` apply to all projects
80
+ - Consider: should we support project-specific options? Decision: No, keep simple
81
+ - Exit code: 0 if all succeed, 1 if any fail