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,32 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(claude:*)",
5
+ "Bash(npm show:*)",
6
+ "WebSearch",
7
+ "Bash(npm run build:*)",
8
+ "Bash(npm test:*)",
9
+ "Bash(npm install:*)",
10
+ "Bash(node:*)",
11
+ "Bash(timeout 30 raf do fix-version:*)",
12
+ "Bash(echo:*)",
13
+ "Bash(raf do fix-version:*)",
14
+ "Bash(kill:*)",
15
+ "Bash(grep:*)",
16
+ "WebFetch(domain:github.com)",
17
+ "WebFetch(domain:raw.githubusercontent.com)",
18
+ "WebFetch(domain:api.github.com)",
19
+ "Bash(gh api:*)",
20
+ "Bash(curl:*)",
21
+ "Bash(find:*)",
22
+ "WebFetch(domain:www.npmjs.com)",
23
+ "Bash(./bin/raf plan:*)",
24
+ "Bash(gtimeout 10 node:*)",
25
+ "Bash(EDITOR=true node:*)",
26
+ "Bash(EDITOR='cp /dev/stdin' node dist/index.js plan testproj 2)",
27
+ "Bash(1 <<'EOF'\nThis is a test project description\nEOF)",
28
+ "Bash(git stash:*)",
29
+ "Bash(git checkout:*)"
30
+ ]
31
+ }
32
+ }
package/CLAUDE.md ADDED
@@ -0,0 +1,187 @@
1
+ # RAF - Claude Code Instructions
2
+
3
+ ## Project Overview
4
+
5
+ RAF (Ralph's Automation Framework) is a Node.js CLI tool that orchestrates task planning and execution using Claude Code CLI.
6
+
7
+ ## Architecture
8
+
9
+ - **Runtime**: Node.js 20+ with ESM modules
10
+ - **Language**: TypeScript (strict mode)
11
+ - **CLI Framework**: Commander.js
12
+ - **TTY Emulation**: node-pty for interactive Claude sessions
13
+ - **Testing**: Jest with ts-jest ESM preset
14
+
15
+ ## Directory Structure
16
+
17
+ ```
18
+ src/
19
+ ├── index.ts # CLI entry point
20
+ ├── commands/ # CLI commands (plan, do, status)
21
+ ├── core/ # Core business logic
22
+ ├── prompts/ # System prompts for Claude
23
+ ├── parsers/ # Output parsing utilities
24
+ ├── utils/ # Utility functions
25
+ └── types/ # TypeScript type definitions
26
+ ```
27
+
28
+ ## RAF Project Structure
29
+
30
+ Each RAF project follows this structure:
31
+ ```
32
+ RAF/
33
+ └── NNN-project-name/ # e.g., 001-fix-bug or a00-feature
34
+ ├── input.md # User requirements
35
+ ├── decisions.md # Q&A from planning interviews
36
+ ├── plans/ # Task breakdowns
37
+ │ ├── 001-task-name.md
38
+ │ └── 002-another-task.md
39
+ └── outcomes/ # Completed task results
40
+ ├── 001-task-name.md
41
+ └── 002-another-task.md
42
+ ```
43
+
44
+ ### Plan File Structure
45
+
46
+ Each plan file follows this structure:
47
+ ```markdown
48
+ # Task: [Task Name]
49
+
50
+ ## Objective
51
+ [Clear, one-sentence description]
52
+
53
+ ## Context
54
+ [Why this task is needed]
55
+
56
+ ## Dependencies
57
+ [Optional - comma-separated task IDs, e.g., "001, 002"]
58
+ [If a dependency fails, this task is blocked]
59
+
60
+ ## Requirements
61
+ - Requirement 1
62
+ - Requirement 2
63
+
64
+ ## Implementation Steps
65
+ 1. Step 1
66
+ 2. Step 2
67
+
68
+ ## Acceptance Criteria
69
+ - [ ] Criterion 1
70
+ - [ ] Criterion 2
71
+
72
+ ## Notes
73
+ [Additional context]
74
+ ```
75
+
76
+ **Dependencies Section**:
77
+ - Optional - omit if task has no dependencies
78
+ - Uses task IDs only (e.g., `001, 002`)
79
+ - If a dependency fails, dependent tasks are automatically blocked
80
+
81
+ ## Development Commands
82
+
83
+ ```bash
84
+ npm run build # Compile TypeScript
85
+ npm run dev # Watch mode compilation
86
+ npm test # Run tests
87
+ npm run lint # Type check without emit
88
+ ```
89
+
90
+ ## Code Style Guidelines
91
+
92
+ 1. **ESM Modules**: Always use `.js` extension in imports (TypeScript will resolve `.ts` files)
93
+ 2. **Strict TypeScript**: All code must pass strict type checking
94
+ 3. **Error Handling**: Use typed errors and handle edge cases explicitly
95
+ 4. **Async/Await**: Prefer async/await over raw promises
96
+ 5. **No Default Exports**: Use named exports for better refactoring support
97
+
98
+ ## Testing Requirements
99
+
100
+ - Unit tests for all core modules
101
+ - Integration tests for command flows
102
+ - Mock external dependencies (Claude CLI, file system where appropriate)
103
+ - Follow TDD approach - write tests first
104
+
105
+ ## Key Implementation Details
106
+
107
+ ### node-pty Usage
108
+ - Required for real TTY interaction with Claude's AskUserQuestionTool
109
+ - Use `setRawMode(true)` for interactive planning mode
110
+ - Graceful cleanup on process termination
111
+
112
+ ### Output Parsing
113
+ - Look for `<promise>COMPLETE</promise>` or `<promise>FAILED</promise>` markers
114
+ - Detect context overflow patterns
115
+ - Parse task completion status
116
+
117
+ ## Architectural Decisions (from completed projects)
118
+
119
+ ### State Derivation Over Persistence
120
+ - Task status determined by outcome file existence and content
121
+ - Outcome files must end with `<promise>COMPLETE</promise>` or `<promise>FAILED</promise>` marker
122
+ - Use `state-derivation.ts` module: `deriveProjectState()`, `getNextPendingTask()`, `isProjectComplete()`
123
+
124
+ ### Outcome File Flow
125
+ - Claude writes outcome files during task execution (not RAF)
126
+ - RAF validates outcome by checking for completion marker
127
+ - If no marker found, RAF generates minimal fallback outcome
128
+ - Metadata (attempts, elapsed time, timestamp) appended to outcome
129
+
130
+ ### Failure Analysis
131
+ - On task failure, RAF analyzes the failure using Claude Haiku
132
+ - Programmatic failures (API errors, timeouts, context overflow) handled without API call
133
+ - Failure reports include: Failure Reason, Analysis, Suggested Fix, Relevant Output
134
+ - All failure outcomes end with `<promise>FAILED</promise>` marker
135
+
136
+ ### Project Naming Convention
137
+ - Format: `NNN-project-name` (001-999) then base36 `XXX-project-name` (a00-zzz)
138
+ - Project name is kebab-case derived from core feature
139
+ - Supports 46,000+ projects
140
+
141
+ ### Project Identifier Resolution
142
+ Support multiple identifier formats in commands:
143
+ 1. Numeric ID: `3` or `003`
144
+ 2. Base36 ID: `a00`, `a01`
145
+ 3. Project name: `fix-stuff` (case-insensitive, partial match)
146
+ 4. Full folder name: `001-fix-stuff` (exact match)
147
+
148
+ Use `resolveProjectIdentifierWithDetails()` from `src/utils/paths.ts`
149
+
150
+ ### Git Commit Schema
151
+
152
+ All git commits are made by Claude during task execution. RAF does not create any automated commits.
153
+
154
+ **Commit format** (Claude-generated during task execution):
155
+ ```
156
+ RAF[<project-number>:<task>] <description>
157
+ ```
158
+ Claude writes a concise description of what was accomplished, focusing on the actual change rather than the task name.
159
+
160
+ Examples:
161
+ ```
162
+ RAF[005:001] Add validation for user input fields
163
+ RAF[005:002] Fix null pointer in auth handler
164
+ RAF[a01:003] Refactor database connection pooling
165
+ ```
166
+
167
+ - Claude commits code changes and outcome file together in one commit per task
168
+ - No commits on failure (changes are stashed instead)
169
+ - Handle "not in git repo" gracefully (warning, no crash)
170
+
171
+ ### Amendment Mode
172
+ - `raf plan --amend <identifier>` adds tasks to existing projects
173
+ - Existing tasks shown with status: `[COMPLETED]`, `[PENDING]`, `[FAILED]`
174
+ - New tasks numbered sequentially after last task
175
+ - No modification of existing plan files
176
+
177
+ ### Multi-Project Execution
178
+ - `raf do <projects...>` supports multiple projects
179
+ - Sequential execution (not parallel) for git safety
180
+ - Continue on failure, report results at end
181
+ - Deduplicates repeated projects
182
+
183
+ ## Important Reminders
184
+
185
+ 1. After task completion update README.md (user facing) and CLAUDE.md (internal)
186
+ 2. Cover changes with tests - use TDD approach
187
+ 3. Use Clean Architecture principles (SOLID)
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,9 @@
1
+ - [ ] add /decisions and capture there questions and answers during the interview
2
+ - [ ] fix Error: Unhandled rejection: TypeError: this.activeProcess.write is not a function
3
+ - [ ] stash changes on fail
4
+ - [ ] add project name to commit
5
+ - [ ] add running time for task during do phase
6
+ - [ ] add name of task during logs in project execution
7
+ - [ ] add the current model for execution "do" phase
8
+ - [ ] inside .raf technical folder states and logs should leave inside project like in RAF user facing folder
9
+ - [ ] remove text inside opened editor during plan phase "Describe your project here..."
@@ -0,0 +1,21 @@
1
+ # Task 001 - Completed
2
+
3
+ ## Summary
4
+ ## Task Completed
5
+ All acceptance criteria have been met:
6
+ 1. ✅ `/decisions` folder is created when a new project is created - Added `getDecisionsDir()` function to `paths.ts` and updated `project-manager.ts` to create the folder during project creation
7
+ 2. ✅ Planning prompt instructs Claude to save Q&A pairs - Added "Step 2.5: Record Decisions" to the planning prompt with clear instructions
8
+ 3. ✅ Format follows Markdown Q&A list structure - The prompt specifies the format with `## [Question asked]` followed by `[User's answer]`
9
+ 4. ✅ Existing tests pass - All 114 tests pass
10
+ 5. Manual test can be performed by running `raf plan` to verify DECISIONS.md is created with Q&A content (depends on Claude following the prompt)
11
+ Changes made:
12
+ - `src/utils/paths.ts:98-100` - Added `getDecisionsDir()` function
13
+ - `src/core/project-manager.ts:11` - Added import for `getDecisionsDir`
14
+ - `src/core/project-manager.ts:51` - Added creation of decisions directory
15
+ - `src/prompts/planning.ts:44-60` - Added Step 2.5 with instructions for recording decisions
16
+ <promise>COMPLETE</promise>
17
+
18
+ ## Details
19
+ - Attempts: 1
20
+ - Completed at: 2026-01-30T16:01:13.696Z
21
+
@@ -0,0 +1,22 @@
1
+ # Task 002 - Completed
2
+
3
+ ## Summary
4
+ Let me verify all acceptance criteria are met:
5
+ 1. **No error thrown when pressing Ctrl+C during plan or do phase** - Fixed by adding type check `typeof this.activeProcess.write === 'function'` before calling `write('\x03')`, and wrapping in try-catch.
6
+ 2. **No error on normal process completion** - The fix only adds defensive checks; normal flow is unchanged.
7
+ 3. **Graceful shutdown still kills Claude process properly** - The `kill()` method still calls the underlying `kill()` on the process (with try-catch safety), and for PTY processes it still sends Ctrl+C first.
8
+ 4. **All existing tests pass** - Verified with `npm test` - 114 tests pass.
9
+ ## Summary
10
+ The fix addresses the `TypeError: this.activeProcess.write is not a function` error that occurs during shutdown/cancel operations. The root cause was that `activeProcess` can be either:
11
+ - A `pty.IPty` instance (from `runInteractive()`) which has a `write` method
12
+ - A `ChildProcess` instance (from `run()` or `runVerbose()`) which does NOT have a `write` method
13
+ The fix in `src/core/claude-runner.ts:268-289`:
14
+ 1. Added `typeof this.activeProcess.write === 'function'` check before calling `write('\x03')`
15
+ 2. Wrapped the `write()` call in try-catch for additional safety
16
+ 3. Wrapped the `kill()` call in try-catch for additional safety
17
+ <promise>COMPLETE</promise>
18
+
19
+ ## Details
20
+ - Attempts: 1
21
+ - Completed at: 2026-01-30T16:02:43.823Z
22
+
@@ -0,0 +1,34 @@
1
+ # Task 003 - Completed
2
+
3
+ ## Summary
4
+ All tests pass and build succeeds.
5
+ ## Summary
6
+ Task 003 has been completed successfully. Here's what was implemented:
7
+ ### Changes Made:
8
+ 1. **`src/core/git.ts:320-341`** - Added `stashChanges(name: string)` function that:
9
+ - Checks if we're in a git repository
10
+ - Checks if there are uncommitted changes
11
+ - Stashes changes with `git stash push -m "{name}"`
12
+ - Returns `true` on success, `false` otherwise
13
+ 2. **`src/utils/paths.ts:71-75`** - Added `extractProjectNumber(projectPath: string)` function to extract the project number from a project path (e.g., `/RAF/001-my-project` → `"001"`)
14
+ 3. **`src/commands/do.ts:196-205`** - Modified failure handling to stash uncommitted changes when a task completely fails:
15
+ - Checks for uncommitted changes before stashing
16
+ - Creates stash name in format `raf-{projectNum}-task-{taskId}-failed`
17
+ - Logs the stash name to inform the user
18
+ - Includes stash name in failure outcome file
19
+ 4. **Tests added:**
20
+ - `tests/unit/git-stash.test.ts` - 6 tests for `stashChanges` function
21
+ - `tests/unit/paths.test.ts` - 5 tests for `extractProjectNumber` function
22
+ ### Acceptance Criteria Met:
23
+ - ✅ Changes are stashed when task fails completely (after all retries)
24
+ - ✅ Changes are NOT stashed during retry attempts
25
+ - ✅ Stash name follows format: `raf-001-task-3-failed`
26
+ - ✅ User sees log message with stash name
27
+ - ✅ No stash created if no uncommitted changes exist
28
+ - ✅ All existing tests pass (125 tests total)
29
+ <promise>COMPLETE</promise>
30
+
31
+ ## Details
32
+ - Attempts: 1
33
+ - Completed at: 2026-01-30T16:07:32.524Z
34
+
@@ -0,0 +1,28 @@
1
+ # Task 004 - Completed
2
+
3
+ ## Summary
4
+ ## Summary
5
+ Task 004 has been completed successfully. Here's what was implemented:
6
+ ### Changes Made:
7
+ 1. **`src/utils/paths.ts:82-90`** - Added `extractProjectName(projectPath: string)` function that extracts the project name from a project path (e.g., `/RAF/001-my-project` → `"my-project"`)
8
+ 2. **`src/core/git.ts:349-357`** - Added `formatCommitMessage(message: string, projectName?: string)` function that formats commit messages with the `RAF(project-name):` prefix when a project name is provided
9
+ 3. **`src/core/git.ts:365-399`** - Modified `commitTaskChanges()` to accept an optional `projectName` parameter and use `formatCommitMessage` to format the commit message
10
+ 4. **`src/commands/do.ts:10`** - Added import for `extractProjectName`
11
+ 5. **`src/commands/do.ts:101-109`** - Updated the execution prompt call to include `projectName`
12
+ 6. **`src/commands/do.ts:169-173`** - Updated the commit call to extract and pass the project name, resulting in commits like `RAF(my-project): Task 001 complete`
13
+ 7. **`src/prompts/execution.ts:8,19,33-35`** - Added `projectName` parameter to `ExecutionPromptParams` and updated commit instructions to show the new format
14
+ 8. **Tests added:**
15
+ - `tests/unit/paths.test.ts` - 7 tests for `extractProjectName` function
16
+ - `tests/unit/git.test.ts` - 6 tests for `formatCommitMessage` function
17
+ ### Acceptance Criteria Met:
18
+ - ✅ All automatic commits use format `RAF(project-name): message`
19
+ - ✅ Project name is correctly extracted from folder name (strips number prefix)
20
+ - ✅ Works with various project folder name formats (hyphens, numbers in names, 2/3-digit prefixes)
21
+ - ✅ Existing commit functionality still works
22
+ - ✅ All tests pass (138 tests total)
23
+ <promise>COMPLETE</promise>
24
+
25
+ ## Details
26
+ - Attempts: 1
27
+ - Completed at: 2026-01-30T16:10:44.727Z
28
+
@@ -0,0 +1,36 @@
1
+ # Task 005 - Completed
2
+
3
+ ## Summary
4
+ ## Summary
5
+ Task 005 has been completed successfully. Here's what was implemented:
6
+ ### Changes Made:
7
+ 1. **`src/utils/timer.ts`** - Created timer utility with:
8
+ - `formatElapsedTime(ms)` - Formats time as `Xs`, `Xm Ys`, or `Xh Ym` depending on duration
9
+ - `createTaskTimer(onTick?)` - Creates a timer with `start()`, `stop()`, `getElapsed()` methods
10
+ 2. **`src/utils/status-line.ts`** - Created status line utility with:
11
+ - `createStatusLine()` - Returns an object with `update(text)` and `clear()` methods
12
+ - Uses `\r` carriage return for in-place updates without scrolling
13
+ - Only writes to TTY terminals
14
+ 3. **`src/commands/do.ts:12-13,120-175,204,212,227,237`** - Integrated timer into task execution:
15
+ - Timer starts when task execution begins
16
+ - Status line updates every second with `⏱ Xm Ys` format (in non-verbose mode)
17
+ - Timer stops and status line clears when task completes/fails
18
+ - Elapsed time shown in success/failure log messages
19
+ - Elapsed time added to outcome files
20
+ 4. **Tests added:**
21
+ - `tests/unit/timer.test.ts` - 10 tests for timer utility
22
+ - `tests/unit/status-line.test.ts` - 6 tests for status line utility
23
+ ### Acceptance Criteria Met:
24
+ - ✅ Live timer shown during task execution
25
+ - ✅ Timer updates every second
26
+ - ✅ Format is human-readable (e.g., `⏱ 2m 34s`)
27
+ - ✅ Timer stops when task completes or fails
28
+ - ✅ Timer doesn't interfere with other output
29
+ - ✅ Works correctly with verbose mode (tracks time without displaying status line)
30
+ - ✅ All tests pass (154 tests total)
31
+ <promise>COMPLETE</promise>
32
+
33
+ ## Details
34
+ - Attempts: 1
35
+ - Completed at: 2026-01-30T16:13:52.321Z
36
+
@@ -0,0 +1,22 @@
1
+ # Task 006 - Completed
2
+
3
+ ## Summary
4
+ All acceptance criteria have been met:
5
+ 1. ✅ **Task context shown in logs during execution** - Format `[Task 2/5: fix-login-bug]` is applied to log messages via `logger.setContext()` and `formatMessage()`
6
+ 2. ✅ **Task number shows current/total** - Uses `${taskNumber}/${totalTasks}` format
7
+ 3. ✅ **Task name correctly extracted from plan filename** - `extractTaskNameFromPlanFile()` in `src/utils/paths.ts:97-103` strips the number prefix and `.md` extension
8
+ 4. ✅ **Context cleared between tasks** - `logger.clearContext()` called after each task loop iteration (line 251) and before summary (line 257)
9
+ 5. ✅ **Doesn't affect non-task logging** - Context only set during task execution loop, summary and other messages don't have prefix
10
+ 6. ✅ **All tests pass** - 170 tests pass (16 new tests added: 9 for logger context, 7 for extractTaskNameFromPlanFile)
11
+ ### Changes Made:
12
+ - **`src/utils/logger.ts:11,18-31,40,45,50,54,58`** - Added `contextPrefix` property, `setContext()`, `clearContext()`, and `formatMessage()` methods; updated `info`, `verbose_log`, `warn`, `error`, `success` methods to use `formatMessage()`
13
+ - **`src/utils/paths.ts:93-103`** - Added `extractTaskNameFromPlanFile()` function
14
+ - **`src/commands/do.ts:10,89-92,251,257`** - Integrated task context: extracts task name, sets context prefix at start of each task, clears between tasks
15
+ - **`tests/unit/logger.test.ts`** - New test file with 9 tests for logger context functionality
16
+ - **`tests/unit/paths.test.ts`** - Added 7 tests for `extractTaskNameFromPlanFile()`
17
+ <promise>COMPLETE</promise>
18
+
19
+ ## Details
20
+ - Attempts: 1
21
+ - Completed at: 2026-01-30T16:16:27.165Z
22
+
@@ -0,0 +1,52 @@
1
+ # Task: Show Model Name at Task Start
2
+
3
+ ## Objective
4
+ Log the Claude model name once when task execution begins during the "do" phase.
5
+
6
+ ## Status: COMPLETED
7
+
8
+ ## Implementation Summary
9
+
10
+ Added functionality to display the Claude model name at the start of task execution, providing transparency about which model is being used.
11
+
12
+ ### Changes Made
13
+
14
+ 1. **src/utils/config.ts**
15
+ - Added `getClaudeSettingsPath()` function to get the path to Claude CLI settings file (`~/.claude/settings.json`)
16
+ - Added `getClaudeModel()` function that reads the model from Claude CLI settings
17
+ - Returns `null` gracefully if settings file doesn't exist or model is not specified
18
+
19
+ 2. **src/commands/do.ts**
20
+ - Added import for `getClaudeModel` from config module
21
+ - Added model logging at task start: `Using model: {model-name}`
22
+ - Only logs if model is successfully detected
23
+
24
+ 3. **tests/unit/config.test.ts** (new file)
25
+ - Unit tests for `getClaudeSettingsPath()`
26
+ - Comprehensive tests for `getClaudeModel()`:
27
+ - Returns model name from settings
28
+ - Returns full model name if specified
29
+ - Returns null if settings file doesn't exist
30
+ - Returns null if model not specified
31
+ - Returns null if settings file is invalid JSON
32
+ - Uses default settings path when not provided
33
+
34
+ ### Example Output
35
+
36
+ ```
37
+ [INFO] Executing project: my-project
38
+ [INFO] Tasks: 3, Timeout: 30 minutes
39
+ [INFO] Using model: opus
40
+ ```
41
+
42
+ ## Acceptance Criteria
43
+
44
+ - [x] Model name logged at start of each task
45
+ - [x] Format: `Using model: {model-name}`
46
+ - [x] Logged only once per task, not repeated
47
+ - [x] Graceful handling if model can't be detected (returns null, no log)
48
+ - [x] All tests pass (177 tests passing)
49
+
50
+ ## Version
51
+
52
+ Updated package.json version from 0.2.5 to 0.2.6
@@ -0,0 +1,20 @@
1
+ # Task 009 - Completed
2
+
3
+ ## Summary
4
+ ## Summary
5
+ Task 009 has been completed successfully. Here's what was implemented:
6
+ ### Changes Made:
7
+ - **`src/core/editor.ts:79-85`** - Modified `getInputTemplate()` function to return an empty string instead of a placeholder template with comments and example text.
8
+ ### Acceptance Criteria Met:
9
+ - ✅ **`raf plan` opens editor with empty file** - `getInputTemplate()` now returns `''`
10
+ - ✅ **No placeholder text present** - Removed the "Describe your project here..." placeholder
11
+ - ✅ **No template or comments** - Removed the HTML comments and heading
12
+ - ✅ **Works with vim, nano, code, and other common editors** - The `openEditor()` function works with any `$EDITOR` setting
13
+ - ✅ **All tests pass** - 177 tests pass
14
+ <promise>COMPLETE</promise>
15
+
16
+ ## Details
17
+ - Attempts: 1
18
+ - Elapsed time: 1m 19s
19
+ - Completed at: 2026-01-30T17:15:14.543Z
20
+
@@ -0,0 +1,83 @@
1
+ # Project Summary: raf-task-improvements
2
+
3
+ **Status:** executing
4
+ **Created:** 2026-01-30T15:45:36.100Z
5
+ **Updated:** 2026-01-30T17:18:12.406Z
6
+
7
+ ## Statistics
8
+
9
+ - Completed: 7
10
+ - Failed: 0
11
+ - Skipped: 1
12
+ - Pending: 1
13
+
14
+ ## Tasks
15
+
16
+ ### [x] Task 001
17
+
18
+ - **Plan:** plans/001-add-decisions-folder.md
19
+ - **Status:** completed
20
+ - **Attempts:** 1
21
+ - **Started:** 2026-01-30T15:59:44.559Z
22
+ - **Completed:** 2026-01-30T16:01:13.696Z
23
+
24
+ ### [x] Task 002
25
+
26
+ - **Plan:** plans/002-fix-write-error-on-shutdown.md
27
+ - **Status:** completed
28
+ - **Attempts:** 1
29
+ - **Started:** 2026-01-30T16:01:13.722Z
30
+ - **Completed:** 2026-01-30T16:02:43.823Z
31
+
32
+ ### [x] Task 003
33
+
34
+ - **Plan:** plans/003-stash-changes-on-failure.md
35
+ - **Status:** completed
36
+ - **Attempts:** 1
37
+ - **Started:** 2026-01-30T16:02:43.847Z
38
+ - **Completed:** 2026-01-30T16:07:32.525Z
39
+
40
+ ### [x] Task 004
41
+
42
+ - **Plan:** plans/004-add-project-name-to-commits.md
43
+ - **Status:** completed
44
+ - **Attempts:** 1
45
+ - **Started:** 2026-01-30T16:07:32.549Z
46
+ - **Completed:** 2026-01-30T16:10:44.727Z
47
+
48
+ ### [x] Task 005
49
+
50
+ - **Plan:** plans/005-add-running-time-display.md
51
+ - **Status:** completed
52
+ - **Attempts:** 1
53
+ - **Started:** 2026-01-30T16:10:44.753Z
54
+ - **Completed:** 2026-01-30T16:13:52.322Z
55
+
56
+ ### [x] Task 006
57
+
58
+ - **Plan:** plans/006-add-task-name-to-logs.md
59
+ - **Status:** completed
60
+ - **Attempts:** 1
61
+ - **Started:** 2026-01-30T16:13:52.346Z
62
+ - **Completed:** 2026-01-30T16:16:27.166Z
63
+
64
+ ### [ ] Task 007
65
+
66
+ - **Plan:** plans/007-show-model-at-task-start.md
67
+ - **Status:** pending
68
+ - **Attempts:** 0
69
+
70
+ ### [-] Task 008
71
+
72
+ - **Plan:** (deleted - skipped per user decision)
73
+ - **Status:** skipped
74
+ - **Reason:** User plans to eliminate .raf usage completely in the future
75
+
76
+ ### [x] Task 009
77
+
78
+ - **Plan:** plans/009-remove-editor-placeholder-text.md
79
+ - **Status:** completed
80
+ - **Attempts:** null
81
+ - **Started:** 2026-01-30T17:13:55.249Z
82
+ - **Completed:** 2026-01-30T17:15:14.543Z
83
+
@@ -0,0 +1,38 @@
1
+ # Task: Add Decisions Folder for Interview Q&A
2
+
3
+ ## Objective
4
+ Capture questions and answers from the planning interview in a dedicated `/decisions` folder inside each project.
5
+
6
+ ## Context
7
+ During the planning phase, Claude interviews the user via `AskUserQuestion` tool to gather requirements. Currently, these valuable Q&A exchanges are not persisted anywhere. This task adds a `/decisions` folder to capture this context for future reference and documentation.
8
+
9
+ ## Requirements
10
+ - Create `/decisions` folder inside project folder (alongside `plans/` and `outcomes/`)
11
+ - Store Q&A in Markdown format using this structure:
12
+ ```markdown
13
+ ## Question
14
+ Answer
15
+
16
+ ## Question
17
+ Answer
18
+ ```
19
+ - Capture decisions during planning phase (when `AskUserQuestion` tool is used)
20
+ - File should be named `DECISIONS.md` or similar
21
+
22
+ ## Implementation Steps
23
+ 1. Update `src/core/project-manager.ts` to create `/decisions` folder during project creation
24
+ 2. Modify `src/prompts/planning.ts` to instruct Claude to save Q&A to decisions folder
25
+ 3. Add instructions in the planning prompt for Claude to write each Q&A pair to the decisions file
26
+ 4. Update the planning prompt to specify the file path: `{projectPath}/decisions/DECISIONS.md`
27
+
28
+ ## Acceptance Criteria
29
+ - [ ] `/decisions` folder is created when a new project is created
30
+ - [ ] Planning prompt instructs Claude to save Q&A pairs
31
+ - [ ] Format follows Markdown Q&A list structure
32
+ - [ ] Existing tests pass
33
+ - [ ] Manual test: run `raf plan` and verify DECISIONS.md is created with Q&A content
34
+
35
+ ## Notes
36
+ - The actual Q&A capture depends on Claude following the prompt instructions
37
+ - Consider whether to append to existing file or create fresh each planning session
38
+ - The decisions file serves as documentation of design choices made during planning
@@ -0,0 +1,33 @@
1
+ # Task: Fix TypeError on Shutdown
2
+
3
+ ## Objective
4
+ Fix the error `TypeError: this.activeProcess.write is not a function` that occurs during shutdown/cancel operations.
5
+
6
+ ## Context
7
+ When pressing Ctrl+C or during cleanup, the application throws an unhandled rejection error. This likely occurs in `shutdown-handler.ts` or `claude-runner.ts` when trying to write to an already-closed or null process.
8
+
9
+ ## Requirements
10
+ - Fix the error that occurs on shutdown/cancel (Ctrl+C)
11
+ - Handle the case where `activeProcess` is null or doesn't have a `write` method
12
+ - Ensure graceful shutdown still works correctly
13
+ - No changes to normal operation flow
14
+
15
+ ## Implementation Steps
16
+ 1. Locate the error source - likely in `src/core/shutdown-handler.ts` or `src/core/claude-runner.ts`
17
+ 2. Check `claude-runner.ts` for the `killProcess()` method that sends Ctrl+C via `write('\x03')`
18
+ 3. Add null check before calling `write()` on the process
19
+ 4. Verify `activeProcess` is a valid PTY instance with write method before calling
20
+ 5. Add try-catch around the write operation for safety
21
+ 6. Test shutdown scenarios
22
+
23
+ ## Acceptance Criteria
24
+ - [ ] No error thrown when pressing Ctrl+C during plan or do phase
25
+ - [ ] No error on normal process completion
26
+ - [ ] Graceful shutdown still kills Claude process properly
27
+ - [ ] All existing tests pass
28
+
29
+ ## Notes
30
+ - The error suggests `activeProcess` might be set to something without a `write` method
31
+ - Check if there's a race condition where process is replaced or cleared during shutdown
32
+ - Consider checking `typeof this.activeProcess.write === 'function'` before calling
33
+ - Look at both PTY (interactive) and spawn (non-interactive) code paths