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,37 @@
1
+ # Task: Stash Changes on Complete Failure
2
+
3
+ ## Objective
4
+ Automatically git stash uncommitted changes when a task completely fails (no more retries planned).
5
+
6
+ ## Context
7
+ When a task fails after all retry attempts, any changes Claude made may be left in the working directory in an incomplete state. This task adds automatic stashing of these changes to preserve them while leaving the working directory clean.
8
+
9
+ ## Requirements
10
+ - Stash changes only when task completely fails (all retries exhausted, no more attempts)
11
+ - Do NOT stash during retry attempts - only on final failure
12
+ - Use descriptive stash name: `raf-{project-number}-task-{task-number}-failed`
13
+ - Log message telling user about the stash with the stash name
14
+ - Example log: `Changes stashed as: raf-001-task-3-failed`
15
+
16
+ ## Implementation Steps
17
+ 1. Modify `src/core/git.ts` to add a `stashChanges(name: string)` function
18
+ 2. In `src/commands/do.ts`, after a task is marked as completely failed (no more retries):
19
+ - Check if there are uncommitted changes using existing `getChangedFiles()`
20
+ - If changes exist, call `stashChanges()` with formatted name
21
+ - Log the stash name to inform the user
22
+ 3. Format stash name as: `raf-{projectNumber}-task-{taskId}-failed`
23
+ 4. Use `git stash push -m "{stash-name}"` command
24
+
25
+ ## Acceptance Criteria
26
+ - [ ] Changes are stashed when task fails completely (after all retries)
27
+ - [ ] Changes are NOT stashed during retry attempts
28
+ - [ ] Stash name follows format: `raf-001-task-3-failed`
29
+ - [ ] User sees log message with stash name
30
+ - [ ] No stash created if no uncommitted changes exist
31
+ - [ ] All existing tests pass
32
+
33
+ ## Notes
34
+ - Only stash if there are actual changes (check with `git status`)
35
+ - The stash preserves both staged and unstaged changes
36
+ - User can recover with `git stash list` and `git stash pop stash@{n}`
37
+ - Consider adding the stash name to the task failure outcome for reference
@@ -0,0 +1,34 @@
1
+ # Task: Add Project Name to Commit Messages
2
+
3
+ ## Objective
4
+ Include the project name in commit messages using the format `RAF(project-name): task message`.
5
+
6
+ ## Context
7
+ Currently, commits made by RAF don't include project context in the message. This makes it harder to identify which project a commit belongs to when looking at git history. Adding a consistent prefix improves traceability.
8
+
9
+ ## Requirements
10
+ - Commit message format: `RAF(project-name): original message`
11
+ - Example: `RAF(my-project): Fix login validation bug`
12
+ - Apply to all automatic commits made during task execution
13
+ - Project name should be extracted from project folder name (without the number prefix)
14
+
15
+ ## Implementation Steps
16
+ 1. Modify `src/core/git.ts` `commitTaskChanges()` function
17
+ 2. Add a parameter for project name or pass it through the commit context
18
+ 3. Extract project name from folder: `001-my-project` -> `my-project`
19
+ 4. Format commit message as: `RAF({projectName}): {originalMessage}`
20
+ 5. Update `src/commands/do.ts` to pass project name when calling commit
21
+ 6. Update execution prompt in `src/prompts/execution.ts` to inform Claude about the new commit format
22
+
23
+ ## Acceptance Criteria
24
+ - [ ] All automatic commits use format `RAF(project-name): message`
25
+ - [ ] Project name is correctly extracted from folder name (strips number prefix)
26
+ - [ ] Works with various project folder name formats
27
+ - [ ] Existing commit functionality still works
28
+ - [ ] All tests pass
29
+
30
+ ## Notes
31
+ - The project folder format is `NNN-project-name` where NNN is a 3-digit number
32
+ - Use regex like `/^\d+-(.+)$/` to extract the name portion
33
+ - Make sure special characters in project names don't break the commit
34
+ - The original commit message from Claude should be preserved after the prefix
@@ -0,0 +1,39 @@
1
+ # Task: Add Running Time Display During Task Execution
2
+
3
+ ## Objective
4
+ Show a live timer in the status line during task execution, displaying elapsed time like `⏱ 2m 34s`.
5
+
6
+ ## Context
7
+ Currently, there's no visibility into how long a task has been running during the "do" phase. A live timer helps users understand task progress and identify potential hangs or long-running operations.
8
+
9
+ ## Requirements
10
+ - Show continuously updating timer during task execution
11
+ - Format: `⏱ 2m 34s` or similar human-readable format
12
+ - Update frequency: every second
13
+ - Display in status line (not as log spam)
14
+ - Timer starts when task begins, stops when task completes or fails
15
+
16
+ ## Implementation Steps
17
+ 1. Create a timer utility in `src/utils/timer.ts` or similar
18
+ 2. Implement a status line that can be updated in-place (using `\r` or cursor control)
19
+ 3. In `src/commands/do.ts`, start timer when task execution begins
20
+ 4. Update the display every second with current elapsed time
21
+ 5. Stop and clear timer when task completes
22
+ 6. Format time as: `Xm Ys` for minutes/seconds, `Xh Ym` for hours/minutes
23
+ 7. Ensure timer doesn't interfere with Claude's output streaming
24
+
25
+ ## Acceptance Criteria
26
+ - [ ] Live timer shown during task execution
27
+ - [ ] Timer updates every second
28
+ - [ ] Format is human-readable (e.g., `⏱ 2m 34s`)
29
+ - [ ] Timer stops when task completes or fails
30
+ - [ ] Timer doesn't interfere with other output
31
+ - [ ] Works correctly with verbose mode
32
+ - [ ] All tests pass
33
+
34
+ ## Notes
35
+ - Use `setInterval` for timer updates, clear on completion
36
+ - Consider using `process.stdout.write('\r...')` for in-place updates
37
+ - May need to handle terminal width for proper display
38
+ - Timer should be cleared/hidden before final status output
39
+ - Consider storing elapsed time in task outcome for summary
@@ -0,0 +1,37 @@
1
+ # Task: Add Task Name to Execution Logs
2
+
3
+ ## Objective
4
+ Display task number and name in log messages during project execution, formatted as `[Task 2/5: fix-login-bug]`.
5
+
6
+ ## Context
7
+ During task execution, log messages don't indicate which task they belong to. This makes it difficult to track progress and debug issues when multiple tasks run. Adding task context to logs improves clarity.
8
+
9
+ ## Requirements
10
+ - Log format: `[Task X/Y: task-name]` where X is current task, Y is total tasks
11
+ - Example: `[Task 2/5: fix-login-bug]`
12
+ - Apply to relevant log messages during task execution
13
+ - Task name extracted from plan file name (e.g., `002-fix-login-bug.md` -> `fix-login-bug`)
14
+
15
+ ## Implementation Steps
16
+ 1. Modify `src/utils/logger.ts` to support a context prefix
17
+ 2. Add method like `logger.setContext(prefix: string)` or `logger.withContext(prefix)`
18
+ 3. In `src/commands/do.ts`, when starting a task:
19
+ - Extract task name from plan file (strip number prefix and extension)
20
+ - Format prefix as `[Task {current}/{total}: {taskName}]`
21
+ - Set logger context with this prefix
22
+ 4. Clear context when task completes
23
+ 5. Update relevant log calls to include the context
24
+
25
+ ## Acceptance Criteria
26
+ - [ ] Task context shown in logs during execution: `[Task 2/5: fix-login-bug]`
27
+ - [ ] Task number shows current/total (e.g., 2/5)
28
+ - [ ] Task name correctly extracted from plan filename
29
+ - [ ] Context cleared between tasks
30
+ - [ ] Doesn't affect non-task logging
31
+ - [ ] All tests pass
32
+
33
+ ## Notes
34
+ - Plan files are named like `001-task-name.md`, `002-another-task.md`
35
+ - Total task count comes from `state.tasks.length`
36
+ - Current task number is `taskIndex + 1` (1-indexed for display)
37
+ - Consider whether all logs or only specific ones should show context
@@ -0,0 +1,34 @@
1
+ # Task: Remove Editor Placeholder Text
2
+
3
+ ## Objective
4
+ Open the editor with an empty file instead of placeholder text "Describe your project here..." during the plan phase.
5
+
6
+ ## Context
7
+ Currently, when running `raf plan`, the editor opens with placeholder text that the user must delete before writing their project description. Opening with an empty file provides a cleaner experience.
8
+
9
+ ## Requirements
10
+ - Editor opens with completely empty file (no placeholder text)
11
+ - No template, hints, or comments in the file
12
+ - User starts with a blank canvas
13
+ - Works with all supported editors ($EDITOR)
14
+
15
+ ## Implementation Steps
16
+ 1. Locate the editor template in `src/core/editor.ts` or `src/commands/plan.ts`
17
+ 2. Find where the initial content/template is defined
18
+ 3. Remove or comment out the placeholder text
19
+ 4. Ensure the file is created but with empty content (`''`)
20
+ 5. Test with different editors to ensure empty file works
21
+
22
+ ## Acceptance Criteria
23
+ - [ ] `raf plan` opens editor with empty file
24
+ - [ ] No placeholder text present
25
+ - [ ] No template or comments
26
+ - [ ] Works with vim, nano, code, and other common editors
27
+ - [ ] All tests pass
28
+
29
+ ## Notes
30
+ - This is a simple change - just remove the template content
31
+ - The placeholder text is likely defined as a string constant somewhere
32
+ - Make sure the file is still created (just empty)
33
+ - User experience is cleaner without needing to delete boilerplate
34
+ - If there were useful hints, they could be shown in terminal before editor opens instead
@@ -0,0 +1,13 @@
1
+ # Project Decisions
2
+
3
+ ## For Task 1 (Show Model at Task Start): The original plan mentions detecting the model from Claude CLI. Do you have a specific method in mind?
4
+ Task is already in progress - implementation exists in uncommitted source files. Uses `getClaudeModel()` which reads from `~/.claude/settings.json`.
5
+
6
+ ## Task 1 (Show Model) is already implemented. Should this project just commit it?
7
+ Include task to commit the existing uncommitted changes for Task 007.
8
+
9
+ ## For Task 2 (Move State/Logs to .raf/): Should we migrate existing state?
10
+ Skip this task entirely - user wants to get rid of .raf completely in the future.
11
+
12
+ ## What should we do with the 008-move-state-logs-to-project.md plan file?
13
+ Delete it - the task won't be implemented.
@@ -0,0 +1,3 @@
1
+ move RAF/001-raf-task-improvements/plans/007-show-model-at-task-start.md and RAF/001-raf-task-improvements/plans/008-move-state-logs-to-project.md
2
+ into new raf project for execution
3
+
@@ -0,0 +1,17 @@
1
+ # Task 001 - Completed
2
+
3
+ ## Summary
4
+ All acceptance criteria have been met:
5
+ 1. ✅ All tests pass (177 tests passing)
6
+ 2. ✅ Changes committed with descriptive message
7
+ 3. ✅ Version updated in package.json (0.2.5 → 0.2.6)
8
+ 4. ✅ Plan file moved to outcomes folder
9
+ 5. ✅ Outcome file documents the implementation
10
+ The task has been completed successfully.
11
+ <promise>COMPLETE</promise>
12
+
13
+ ## Details
14
+ - Attempts: 1
15
+ - Elapsed time: 1m 15s
16
+ - Completed at: 2026-01-30T17:31:19.872Z
17
+ - Commit: 904a1de
@@ -0,0 +1,23 @@
1
+ # Task 002 - Completed
2
+
3
+ ## Summary
4
+ Let me verify all acceptance criteria are met:
5
+ 1. ✅ Plan file 008-move-state-logs-to-project.md is deleted
6
+ 2. ✅ No orphaned references to this plan exist (only documentation references in DECISIONS.md, input.md, and this plan which are expected)
7
+ 3. ✅ Tests pass (177 tests passing)
8
+ 4. ✅ Changes committed
9
+ # Task 002 - Completed
10
+ ## Summary
11
+ All acceptance criteria have been met:
12
+ 1. ✅ Plan file `008-move-state-logs-to-project.md` is deleted
13
+ 2. ✅ No orphaned references exist (only documentation references)
14
+ 3. ✅ Updated SUMMARY.md to mark Task 008 as skipped
15
+ 4. ✅ All 177 tests pass
16
+ 5. ✅ Changes committed with descriptive message
17
+ <promise>COMPLETE</promise>
18
+
19
+ ## Details
20
+ - Attempts: 1
21
+ - Elapsed time: 1m 5s
22
+ - Completed at: 2026-01-30T17:32:25.642Z
23
+
@@ -0,0 +1,32 @@
1
+ # Project Summary: raf-task-improvements-execution
2
+
3
+ **Status:** executing
4
+ **Created:** 2026-01-30T17:21:17.303Z
5
+ **Updated:** 2026-01-30T17:32:25.642Z
6
+
7
+ ## Statistics
8
+
9
+ - Completed: 2
10
+ - Failed: 0
11
+ - Skipped: 0
12
+ - Pending: 0
13
+
14
+ ## Tasks
15
+
16
+ ### [x] Task 001
17
+
18
+ - **Plan:** plans/001-commit-show-model-at-task-start.md
19
+ - **Status:** completed
20
+ - **Attempts:** 1
21
+ - **Started:** 2026-01-30T17:30:04.073Z
22
+ - **Completed:** 2026-01-30T17:31:19.872Z
23
+ - **Commit:** 904a1de
24
+
25
+ ### [x] Task 002
26
+
27
+ - **Plan:** plans/002-delete-skipped-plan.md
28
+ - **Status:** completed
29
+ - **Attempts:** 1
30
+ - **Started:** 2026-01-30T17:31:19.894Z
31
+ - **Completed:** 2026-01-30T17:32:25.642Z
32
+
@@ -0,0 +1,37 @@
1
+ # Task: Commit Show Model at Task Start
2
+
3
+ ## Objective
4
+ Commit the existing implementation that logs the Claude model name when task execution begins.
5
+
6
+ ## Context
7
+ Task 007 from RAF/001-raf-task-improvements has already been implemented. The code changes exist in uncommitted files and need to be committed to complete the task.
8
+
9
+ ## Requirements
10
+ - Commit the existing implementation in `src/commands/do.ts` and `src/utils/config.ts`
11
+ - Include the test file `tests/unit/config.test.ts`
12
+ - Verify tests pass before committing
13
+ - Update version in package.json
14
+ - Move the original plan file to outcomes folder
15
+
16
+ ## Implementation Steps
17
+ 1. Run tests to verify the implementation works: `npm test`
18
+ 2. Review the uncommitted changes:
19
+ - `src/utils/config.ts`: Added `getClaudeModel()` function that reads model from `~/.claude/settings.json`
20
+ - `src/commands/do.ts`: Added logging of model name at task start
21
+ - `tests/unit/config.test.ts`: Unit tests for `getClaudeModel()`
22
+ 3. Update version in package.json (minor bump)
23
+ 4. Stage and commit the changes with appropriate commit message
24
+ 5. Move `RAF/001-raf-task-improvements/plans/007-show-model-at-task-start.md` to `RAF/001-raf-task-improvements/outcomes/007-show-model-at-task-start.md`
25
+ 6. Create outcome summary documenting what was implemented
26
+
27
+ ## Acceptance Criteria
28
+ - [ ] All tests pass
29
+ - [ ] Changes committed with descriptive message
30
+ - [ ] Version updated in package.json
31
+ - [ ] Plan file moved to outcomes folder
32
+ - [ ] Outcome file documents the implementation
33
+
34
+ ## Notes
35
+ - The implementation reads model from Claude CLI settings at `~/.claude/settings.json`
36
+ - Returns null gracefully if settings file doesn't exist or model not specified
37
+ - Model is logged once at task start: `Using model: {model-name}`
@@ -0,0 +1,23 @@
1
+ # Task: Delete Skipped Plan File
2
+
3
+ ## Objective
4
+ Remove the 008-move-state-logs-to-project.md plan file since the task will not be implemented.
5
+
6
+ ## Context
7
+ The user decided to skip the "Move State and Logs to .raf/" task entirely. They plan to eliminate .raf usage completely in the future, so this plan is no longer relevant.
8
+
9
+ ## Requirements
10
+ - Delete the plan file from RAF/001-raf-task-improvements/plans/
11
+ - Do not create any outcome file for this skipped task
12
+
13
+ ## Implementation Steps
14
+ 1. Delete `RAF/001-raf-task-improvements/plans/008-move-state-logs-to-project.md`
15
+ 2. Verify the file has been removed
16
+
17
+ ## Acceptance Criteria
18
+ - [ ] Plan file 008-move-state-logs-to-project.md is deleted
19
+ - [ ] No orphaned references to this plan exist
20
+
21
+ ## Notes
22
+ - This task was intentionally skipped per user decision, not abandoned
23
+ - The decision is documented in this project's DECISIONS.md
@@ -0,0 +1,68 @@
1
+ # Project Decisions
2
+
3
+ ## Task 1: Multi-Project Execution
4
+
5
+ ### For multi-project execution, should projects run sequentially or in parallel?
6
+ **Answer:** Sequential - Run projects one after another, safer for git commits
7
+
8
+ ### When running multiple projects, if one fails should we continue with remaining projects?
9
+ **Answer:** Continue - Continue with remaining projects, report failures at end
10
+
11
+ ### For number-based selection (e.g., 'raf do 003 004'), should we support ranges like '003-005'?
12
+ **Answer:** No, individual only - Only support listing individual numbers
13
+
14
+ ## Task 2: Auto-Commit After Planning
15
+
16
+ ### For auto-commit after planning, what commit message format should be used?
17
+ **Answer:** RAF(project-name): Plan complete - Consistent with current task commit format
18
+
19
+ ## Task 3: Commit Outcomes with Changes
20
+
21
+ ### Should the outcome be committed in the SAME commit as task changes?
22
+ **Answer:** Same commit - Outcome file included in task's commit
23
+
24
+ ## Task 4: Re-Run Failed Tasks / State Derivation
25
+
26
+ ### How should we determine if a task is 'completed'?
27
+ **Answer:** Outcome file exists - Task is complete if outcomes/NNN-task.md exists with success marker
28
+
29
+ ### Should we completely remove the .raf folder and state.json?
30
+ **Answer:** Yes, remove completely - Derive everything from RAF/project folders
31
+
32
+ ### When re-running 'raf do project-name' on a project with failures, what should happen?
33
+ **Answer:** Resume from failed/pending - Skip completed tasks, retry failed and pending tasks
34
+
35
+ ## Task 5: Simplify Git Logic
36
+
37
+ ### Should Claude be instructed to commit, or should RAF commit after task completion?
38
+ **Answer:** Claude commits (instructed) - Add instructions for Claude to commit after making changes
39
+
40
+ ### Should the 'smart commit' logic (baseline tracking, filtering) be simplified or removed?
41
+ **Answer:** Remove, commit all - Remove smart filtering, commit all changes after task
42
+
43
+ ### When Claude is instructed to commit, what commit message format should Claude use?
44
+ **Answer:** [project] task description (no numbers) - Custom format specified by user
45
+
46
+ ## Task 6: Per-Task Timeout
47
+
48
+ ### Is the timeout issue that multiple retries extend beyond 60 min total?
49
+ **Answer:** Just verify/document - Verify current implementation and add tests
50
+
51
+ ## Additional Decisions
52
+
53
+ ### Where should execution logs be stored?
54
+ **Answer:** No logs, console only - Don't persist logs, show in terminal only
55
+
56
+ ### What marker should indicate success vs failure in outcome files?
57
+ **Answer:** Content marker at top - "## Status: SUCCESS" or "## Status: FAILED" in file
58
+
59
+ ### How should 'raf status' work without state.json?
60
+ **Answer:** Scan RAF folder, derive status - List projects by scanning RAF/, derive status from files
61
+
62
+ ### Should RAF support running a project that's already fully completed?
63
+ **Answer:** Allow with --force flag - Require --force flag to re-run completed project
64
+
65
+ ## Task 8: Move Decisions File
66
+
67
+ ### Should decisions be stored in a folder or as a single file?
68
+ **Answer:** Single file at project root - Move from `decisions/DECISIONS.md` to `decisions.md`
@@ -0,0 +1,6 @@
1
+ - [ ] should be able to pass multiple project names or number to "raf do", like "raf do projectName otherProjectName" or "raf do 003 004 005"
2
+ - [ ] after plan step comlite - commit the changes in RAF (input, decisions, plans) for current project (commit project new project folder basically)
3
+ - [ ] outcomes file for project should be commited together with changes
4
+ - [ ] let user re-run failed tasks by doing "raf do project-name" command again, currently it's outputs statistic. if there are failied task or unfinished - do them. use case - takens limit reached or api unavalibility etc. we are relying on state too much, rely on .md documents instead (use claude code with sonnet model internally to derive state). i think it should be part of getting rid of ./raf technical folder and state as a concept, all state should be derived from folder structure, claude code should be used internally when it's hard to derive info from convention
5
+ - [ ] git logic (code) should be simplified, running task should commit the changes it made, add certain instructions for that
6
+ - [ ] ensure that timeout (60 min) is per task
@@ -0,0 +1,52 @@
1
+ # Task 001 - Completed
2
+
3
+ ## Summary
4
+ The task has been completed successfully. Let me provide a summary:
5
+ ## Task 001 Complete
6
+ ### Summary
7
+ Removed the `.raf` folder and `state.json` entirely, replacing them with a state derivation approach that derives all project state from the folder structure.
8
+ ### Changes Made
9
+ 1. **Created `src/core/state-derivation.ts`** - New module that:
10
+ - Parses outcome files for `## Status: SUCCESS` or `## Status: FAILED` markers
11
+ - Derives project state from `plans/` and `outcomes/` directories
12
+ - Provides functions: `deriveProjectState`, `getNextPendingTask`, `getDerivedStats`, `isProjectComplete`, `hasProjectFailed`
13
+ 2. **Updated `src/commands/do.ts`**:
14
+ - Uses state derivation instead of StateManager
15
+ - Outcome files now include status markers at the top
16
+ - Re-derives state after each task completion
17
+ 3. **Updated `src/commands/plan.ts`**:
18
+ - Removed StateManager dependency
19
+ - Simply checks for plan files directly
20
+ 4. **Updated `src/commands/status.ts`**:
21
+ - Uses state derivation for project status display
22
+ 5. **Updated `src/core/project-manager.ts`**:
23
+ - `createProject` now returns just the path (not StateManager)
24
+ - `saveSummary` accepts derived state instead of StateManager
25
+ - `listProjects` includes derived task counts
26
+ - Logs saved to project folder (`logs/`) instead of `.raf/logs/`
27
+ 6. **Updated `src/core/shutdown-handler.ts`**:
28
+ - Removed StateManager registration and save on shutdown
29
+ 7. **Updated `src/utils/paths.ts`**:
30
+ - Removed all `.raf` related utilities (`RAF_RUNTIME_DIR`, `getRafRuntimeDir`, `ensureRafRuntimeDir`, `getRuntimeStatePath`, `getRuntimeLogsDir`, `ensureRuntimeLogsDir`, `getStatePath`)
31
+ 8. **Removed**:
32
+ - `src/core/state-manager.ts`
33
+ - `src/types/state.ts`
34
+ - `tests/unit/state-manager.test.ts`
35
+ 9. **Added/Updated Tests**:
36
+ - Created `tests/unit/state-derivation.test.ts` with 20 test cases
37
+ - Updated `tests/unit/project-manager.test.ts` to work with new API
38
+ ### Acceptance Criteria Met
39
+ - ✅ `.raf` folder is not created or used by any command
40
+ - ✅ `state.json` is not created or read
41
+ - ✅ Project state can be derived from `RAF/project/` folder structure
42
+ - ✅ Outcome files contain `## Status: SUCCESS` or `## Status: FAILED` marker
43
+ - ✅ All existing tests updated or removed as appropriate
44
+ - ✅ New tests for state derivation logic
45
+ - ✅ Code compiles without errors (178 tests passing)
46
+ <promise>COMPLETE</promise>
47
+
48
+ ## Details
49
+ - Attempts: 1
50
+ - Elapsed time: 7m 32s
51
+ - Completed at: 2026-01-30T18:03:28.628Z
52
+
@@ -0,0 +1,50 @@
1
+ # Task 002 - Completed
2
+
3
+ ## Summary
4
+ ## Task 002 Complete
5
+ ### Summary
6
+ Updated the `raf status` command to work without `state.json`, deriving all status information from the RAF folder structure and outcome files.
7
+ ### Changes Made
8
+ 1. **Updated `src/core/state-derivation.ts`**:
9
+ - Added `DerivedProjectStatus` type with values: `planning`, `ready`, `executing`, `completed`, `failed`
10
+ - Added `DiscoveredProject` interface for discovered projects
11
+ - Added `discoverProjects(rafDir)` function to scan RAF directory and return all projects matching `NNN-project-name` pattern
12
+ - Added `deriveProjectStatus(projectPath, tasks)` function to derive project status from tasks:
13
+ - `planning`: no plans folder or empty plans
14
+ - `ready`: has plan files but all tasks are pending
15
+ - `executing`: some tasks completed, others pending
16
+ - `completed`: all tasks completed successfully
17
+ - `failed`: any task has failed
18
+ - Updated `DerivedProjectState` interface to include `status` field
19
+ - Updated `deriveProjectState()` to return status along with tasks
20
+ 2. **Updated `src/commands/status.ts`**:
21
+ - Replaced `listProjects` import with `discoverProjects` from state-derivation
22
+ - Simplified project status determination using `state.status` instead of inline computation
23
+ - Updated `getProjectStatusBadge()` to support all project statuses:
24
+ - `[P]` for planning
25
+ - `[R]` for ready
26
+ - `[~]` for executing
27
+ - `[x]` for completed
28
+ - `[!]` for failed
29
+ - Removed unused imports (`isProjectComplete`, `hasProjectFailed`)
30
+ 3. **Updated `tests/unit/state-derivation.test.ts`**:
31
+ - Added 4 tests for `discoverProjects()` function
32
+ - Added 6 tests for `deriveProjectStatus()` function
33
+ - Added 4 new tests for `deriveProjectState()` to verify status derivation
34
+ - Updated all existing tests to include `status` field in test state objects
35
+ ### Acceptance Criteria Met
36
+ - ✅ `raf status` lists all projects from RAF folder (uses `discoverProjects()`)
37
+ - ✅ `raf status <project>` shows detailed task status derived from files
38
+ - ✅ Status badges display correctly: `[ ]` pending, `[x]` completed, `[!]` failed
39
+ - ✅ `--json` flag outputs valid JSON with derived state including project status
40
+ - ✅ No dependency on StateManager or state.json
41
+ - ✅ Tests cover status derivation scenarios (34 tests passing)
42
+ ### Test Results
43
+ All 191 tests pass (including 34 tests for state-derivation).
44
+ <promise>COMPLETE</promise>
45
+
46
+ ## Details
47
+ - Attempts: 1
48
+ - Elapsed time: 3m 50s
49
+ - Completed at: 2026-01-30T18:07:19.042Z
50
+
@@ -0,0 +1,35 @@
1
+ # Task 003 - Completed
2
+
3
+ ## Summary
4
+ ## Task 003 Complete
5
+ ### Summary
6
+ Simplified git operations by removing smart commit logic (baseline tracking, delta filtering) from RAF and instructing Claude to commit its own changes during task execution.
7
+ ### Changes Made
8
+ 1. **Updated `src/prompts/execution.ts`**:
9
+ - Added `outcomeFilePath` optional parameter
10
+ - Updated commit instructions to use format `[project-name] brief description` (no task numbers)
11
+ - Added note about outcome file being written by RAF after Claude's commit
12
+ 2. **Simplified `src/core/git.ts`**:
13
+ - Removed: `commitChanges`, `getLastCommitHash`, `getTaskChangedFiles`, `commitSpecificFiles`, `formatCommitMessage`, `commitTaskChanges`, `FileChange` interface
14
+ - Kept: `isGitRepo`, `getGitStatus`, `hasUncommittedChanges`, `parseGitStatus`, `getChangedFiles`, `stashChanges`
15
+ 3. **Updated `src/commands/do.ts`**:
16
+ - Removed baseline tracking and commit logic
17
+ - Kept stash functionality for failure cases
18
+ 4. **Updated `tests/unit/git.test.ts`**:
19
+ - Removed tests for removed functions
20
+ - Kept tests for `parseGitStatus`
21
+ ### Acceptance Criteria Met
22
+ - ✅ Execution prompt includes commit instructions for Claude
23
+ - ✅ Commit message format is `[project-name] task description` (no task numbers)
24
+ - ✅ Smart commit logic (baseline tracking) is removed
25
+ - ✅ RAF does not commit after task completion
26
+ - ✅ Outcome file is noted in prompt (written by RAF after Claude's work)
27
+ - ✅ Stash functionality still works on task failure
28
+ - ✅ All tests pass (178 tests)
29
+ <promise>COMPLETE</promise>
30
+
31
+ ## Details
32
+ - Attempts: 1
33
+ - Elapsed time: 3m 38s
34
+ - Completed at: 2026-01-30T18:10:57.209Z
35
+
@@ -0,0 +1,43 @@
1
+ # Task 004 - Completed
2
+
3
+ ## Summary
4
+ The remaining change is to the outcome file from task 003, which is not part of this task.
5
+ ## Task 004 Complete
6
+ ### Summary
7
+ Implemented auto-commit functionality after the `raf plan` command completes successfully, committing only the project folder files.
8
+ ### Changes Made
9
+ 1. **Added `commitProjectFolder` function to `src/core/git.ts`**:
10
+ - Stages only files within the specified project folder
11
+ - Uses commit message format: `RAF(project-name): Plan complete`
12
+ - Returns `CommitResult` with success status, message, or error
13
+ - Handles edge case of no changes to commit
14
+ 2. **Updated `src/commands/plan.ts`**:
15
+ - Calls `commitProjectFolder` after plan files are created successfully
16
+ - Logs success or failure to user
17
+ - Does not fail planning if commit fails (graceful degradation)
18
+ 3. **Added `tests/unit/git-commit-project.test.ts`**:
19
+ - 7 test cases covering all commit scenarios:
20
+ - Not in git repo
21
+ - Successful commit with correct message format
22
+ - Only project files staged
23
+ - No changes to commit
24
+ - Git add failure
25
+ - Git commit failure
26
+ - Path escaping
27
+ ### Acceptance Criteria Met
28
+ - ✅ After successful `raf plan`, project folder is committed
29
+ - ✅ Commit message is `RAF(project-name): Plan complete`
30
+ - ✅ Only files in `RAF/NNN-project-name/` are committed
31
+ - ✅ Unrelated changes in repo are not committed
32
+ - ✅ Planning doesn't fail if commit fails
33
+ - ✅ User is informed of commit success/failure
34
+ - ✅ Tests cover commit scenarios (7 tests)
35
+ ### Test Results
36
+ All 185 tests pass.
37
+ <promise>COMPLETE</promise>
38
+
39
+ ## Details
40
+ - Attempts: 1
41
+ - Elapsed time: 2m 21s
42
+ - Completed at: 2026-01-30T18:13:18.833Z
43
+
@@ -0,0 +1,43 @@
1
+ # Task 005 - Completed
2
+
3
+ ## Summary
4
+ The task is complete. Let me provide a summary:
5
+ ## Task 005 Complete
6
+ ### Summary
7
+ Implemented support for re-running failed and pending tasks with the `raf do` command. Users can now resume project execution from failed or pending tasks, and use `--force` to re-run all tasks.
8
+ ### Changes Made
9
+ 1. **Updated `src/types/config.ts`**:
10
+ - Added `force?: boolean` to `DoCommandOptions` interface
11
+ 2. **Updated `src/commands/do.ts`**:
12
+ - Added `-f, --force` flag to re-run all tasks regardless of status
13
+ - Changed from `getNextPendingTask` to `getNextExecutableTask` for task selection
14
+ - Implemented force mode that tracks tasks completed in the current session
15
+ - Added console output indicating task status:
16
+ - "Retrying task X (previously failed)..." for failed tasks
17
+ - "Re-running task X (force mode)..." for completed tasks with --force
18
+ - "Executing task X..." for pending tasks
19
+ - Updated "project complete" message to suggest `--force` flag
20
+ - Track completed tasks in session for force mode iteration
21
+ 3. **Created `tests/unit/do-rerun.test.ts`**:
22
+ - 11 tests covering all rerun scenarios:
23
+ - Skip completed tasks
24
+ - Retry failed tasks
25
+ - Run pending tasks
26
+ - Handle malformed outcome files
27
+ - All complete detection
28
+ - Force mode task selection
29
+ - Task status logging
30
+ ### Acceptance Criteria Met
31
+ - ✅ `raf do project-name` skips tasks with SUCCESS outcome
32
+ - ✅ `raf do project-name` retries tasks with FAILED outcome
33
+ - ✅ `raf do project-name` runs tasks without outcome files
34
+ - ✅ `--force` flag runs all tasks regardless of status
35
+ - ✅ Clear console output indicates skip/retry/run status
36
+ - ✅ All tests pass (196 tests)
37
+ <promise>COMPLETE</promise>
38
+
39
+ ## Details
40
+ - Attempts: 1
41
+ - Elapsed time: 3m 1s
42
+ - Completed at: 2026-01-30T18:16:20.525Z
43
+