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,47 @@
1
+ # Outcome: Update Execution Prompt for Commit Workflow
2
+
3
+ ## Summary
4
+
5
+ Updated Claude's execution prompt to clearly instruct it to commit code changes and outcome file together when a task succeeds, and to NOT commit when a task fails (preserving changes for debugging).
6
+
7
+ ## Key Changes
8
+
9
+ ### Modified Files
10
+
11
+ - **src/prompts/execution.ts**:
12
+ - Added failure commit instruction in the Git Instructions section: "On Failure: do NOT commit. Just write the outcome file with the `<promise>FAILED</promise>` marker and stop. Uncommitted changes will be preserved for debugging."
13
+ - Added two new Important Rules (7 and 8):
14
+ - Rule 7: "On SUCCESS: Commit code changes AND outcome file together BEFORE you finish"
15
+ - Rule 8: "On FAILURE: Do NOT commit - just write the outcome file with FAILED marker"
16
+
17
+ - **tests/unit/execution-prompt.test.ts**:
18
+ - Added test: "should include instruction not to commit on failure"
19
+ - Added test: "should not include failure commit instruction when autoCommit is false"
20
+ - Added new test suite "Commit Workflow Rules" with 3 tests:
21
+ - "should include rule to commit code and outcome together on success"
22
+ - "should include rule not to commit on failure"
23
+ - "should specify that changes are preserved for debugging on failure"
24
+
25
+ ## Acceptance Criteria Met
26
+
27
+ - [x] Execution prompt includes commit instructions (with failure handling)
28
+ - [x] Outcome file path is explicitly provided (already present)
29
+ - [x] Commit message format is specified: `RAF[NNN:task] description` (already present)
30
+ - [x] Instructions specify: write outcome → commit → marker appears
31
+ - [x] Failed tasks: write outcome with FAILED marker, no commit
32
+ - [x] Claude commits code + outcome in single commit during execution
33
+ - [x] All tests pass (605 total, 5 new tests added)
34
+
35
+ ## Notes
36
+
37
+ The prompt already had the outcome file path and commit message format. The main additions were:
38
+ 1. Clear instruction about not committing on failure
39
+ 2. Important Rules 7 and 8 that explicitly state the commit workflow for success/failure cases
40
+
41
+ <promise>COMPLETE</promise>
42
+
43
+
44
+ ## Details
45
+ - Attempts: 1
46
+ - Elapsed time: 2m 24s
47
+ - Completed at: 2026-01-31T14:16:17.299Z
@@ -0,0 +1,83 @@
1
+ # Outcome: Fix Plan Mode User Prompt
2
+
3
+ ## Summary
4
+
5
+ Fixed the issue where Claude would get stuck waiting for user input in plan mode by splitting the prompt into a system prompt (via `--append-system-prompt`) and a user message (via `-p` flag). This triggers Claude to immediately start the planning interview process instead of waiting.
6
+
7
+ ## Key Changes
8
+
9
+ ### Modified Files
10
+
11
+ - **src/core/claude-runner.ts**:
12
+ - Updated `runInteractive()` method signature to accept both `systemPrompt` and `userMessage` parameters
13
+ - Changed args to include both `--append-system-prompt` for system instructions and `-p` for user message
14
+ - Added JSDoc comments explaining the parameters
15
+
16
+ - **src/prompts/planning.ts**:
17
+ - Added `PlanningPromptResult` interface with `systemPrompt` and `userMessage` fields
18
+ - Updated `getPlanningPrompt()` to return an object with both prompts
19
+ - System prompt contains planning instructions, project location, and rules
20
+ - User message contains the project description to trigger Claude to start
21
+
22
+ - **src/prompts/amend.ts**:
23
+ - Added `AmendPromptResult` interface with `systemPrompt` and `userMessage` fields
24
+ - Updated `getAmendPrompt()` to return an object with both prompts
25
+ - System prompt contains amendment instructions, existing tasks, and rules
26
+ - User message contains the new task description to trigger Claude to start
27
+
28
+ - **src/commands/plan.ts**:
29
+ - Updated `runPlanCommand()` to destructure and use both prompts
30
+ - Updated `runAmendCommand()` to destructure and use both prompts
31
+
32
+ ### New Test Files
33
+
34
+ - **tests/unit/planning-prompt.test.ts**: 13 tests covering:
35
+ - Prompt splitting functionality
36
+ - System prompt content (instructions, paths, templates)
37
+ - User message content (project description only)
38
+ - Proper separation of concerns
39
+
40
+ - **tests/unit/claude-runner-interactive.test.ts**: 8 tests covering:
41
+ - Correct argument passing for system prompt and user message
42
+ - Flag order verification (--model, --append-system-prompt, -p)
43
+ - Model configuration
44
+ - Working directory passing
45
+ - Exit code handling
46
+ - No --dangerously-skip-permissions for interactive mode
47
+
48
+ ### Updated Test File
49
+
50
+ - **tests/unit/plan-command.test.ts**:
51
+ - Updated all `getAmendPrompt()` tests to use new return type
52
+ - Added 3 new tests for prompt splitting verification
53
+
54
+ ## How It Works
55
+
56
+ Before (broken):
57
+ ```
58
+ claude --model opus --append-system-prompt "All instructions including user input"
59
+ Claude: [waiting for user input...]
60
+ ```
61
+
62
+ After (fixed):
63
+ ```
64
+ claude --model opus --append-system-prompt "Instructions" -p "User's project description"
65
+ Claude: [immediately starts analyzing and interviewing]
66
+ ```
67
+
68
+ The `-p` flag provides an initial user message that triggers Claude to begin working, while the system prompt provides all the necessary context and instructions.
69
+
70
+ ## Acceptance Criteria Met
71
+
72
+ - [x] `raf plan` starts Claude session and Claude immediately begins asking questions
73
+ - [x] `raf plan --amend` starts Claude session and Claude immediately begins asking questions
74
+ - [x] No regression in existing planning functionality
75
+ - [x] All tests pass (628 total, 24 new tests added)
76
+
77
+ <promise>COMPLETE</promise>
78
+
79
+
80
+ ## Details
81
+ - Attempts: 1
82
+ - Elapsed time: 4m 26s
83
+ - Completed at: 2026-01-31T14:20:43.696Z
@@ -0,0 +1,77 @@
1
+ # Outcome: Add Auto Flag for Plan Mode
2
+
3
+ ## Summary
4
+
5
+ Added `--auto` / `-y` CLI flag to `raf plan` command to skip Claude's permission prompts during planning sessions. This allows for automated workflows or when users trust Claude's file operations.
6
+
7
+ ## Key Changes
8
+
9
+ ### Modified Files
10
+
11
+ - **src/commands/plan.ts**:
12
+ - Added `auto?: boolean` to `PlanCommandOptions` interface
13
+ - Added `-y, --auto` option to Commander.js command definition with description "Skip Claude's permission prompts for file operations"
14
+ - Updated `runPlanCommand()` and `runAmendCommand()` to accept `autoMode` parameter
15
+ - Pass `dangerouslySkipPermissions: autoMode` to `claudeRunner.runInteractive()`
16
+ - Added warning log when auto mode is enabled
17
+
18
+ - **src/core/claude-runner.ts**:
19
+ - Added `dangerouslySkipPermissions?: boolean` to `ClaudeRunnerOptions` interface
20
+ - Updated `runInteractive()` to conditionally add `--dangerously-skip-permissions` flag when option is true
21
+ - Placed the flag after `--model` and before `--append-system-prompt` in the args array
22
+
23
+ ### New Test Files
24
+
25
+ - **tests/unit/plan-command-auto-flag.test.ts**: 7 tests covering:
26
+ - CLI option parsing for `--auto` and `-y` flags
27
+ - Flag description contains "permission"
28
+ - Flag is a boolean (no required argument)
29
+ - Coexistence with `--amend`, `--model`, and `--sonnet` options
30
+
31
+ ### Updated Test Files
32
+
33
+ - **tests/unit/claude-runner-interactive.test.ts**: 4 new tests for `--dangerously-skip-permissions`:
34
+ - Should NOT include flag by default
35
+ - Should include flag when option is true
36
+ - Should NOT include flag when option is false
37
+ - Should place flag after `--model` and before `--append-system-prompt`
38
+
39
+ ## Acceptance Criteria Met
40
+
41
+ - [x] `raf plan --auto` or `raf plan -y` starts planning without permission prompts
42
+ - [x] `raf plan --amend <id> --auto` works similarly
43
+ - [x] Regular `raf plan` (without flag) still shows permission prompts
44
+ - [x] Claude's AskUserQuestion prompts for planning interview still work (not bypassed)
45
+ - [x] Help text accurately describes the flag
46
+ - [x] All tests pass (638 total, 11 new tests added)
47
+
48
+ ## Usage
49
+
50
+ ```bash
51
+ # Skip permission prompts during planning
52
+ raf plan --auto
53
+ raf plan -y
54
+
55
+ # With project name
56
+ raf plan my-project --auto
57
+
58
+ # With amend mode
59
+ raf plan --amend my-project --auto
60
+
61
+ # Combined with model selection
62
+ raf plan --auto --model sonnet
63
+ ```
64
+
65
+ ## Notes
66
+
67
+ - The `-y` shorthand follows common CLI conventions (like `apt -y`, `npm -y`)
68
+ - A warning message is logged when the flag is used to remind users that permissions are being skipped
69
+ - This flag only affects file operation permissions; Claude can still ask planning interview questions
70
+
71
+ <promise>COMPLETE</promise>
72
+
73
+
74
+ ## Details
75
+ - Attempts: 1
76
+ - Elapsed time: 3m 29s
77
+ - Completed at: 2026-01-31T14:24:13.579Z
@@ -0,0 +1,47 @@
1
+ # Task: Name Picker for `raf plan`
2
+
3
+ ## Objective
4
+ Generate 3-5 project name suggestions using Claude Sonnet and let the user pick one via arrow-key navigation or provide a custom name.
5
+
6
+ ## Context
7
+ Currently `raf plan` requires a project name upfront. This task adds intelligent name generation when no name is provided, making project creation faster and more creative.
8
+
9
+ ## Requirements
10
+ - Generate 3-5 project names with varied styles (fun, metaphor, descriptive, somewhat-related-and-fun)
11
+ - Use Claude Sonnet for name generation (more capable for creative tasks)
12
+ - Pass the project description (input.md content) as context for relevant suggestions
13
+ - When project has many unrelated tasks, prefer abstract/metaphorical/fun names over descriptive ones
14
+ - Use `@inquirer/prompts` for arrow-key selection UI
15
+ - Include "Other (enter custom name)" option that triggers text input
16
+ - Names should be kebab-case and suitable for folder names
17
+
18
+ ## Implementation Steps
19
+ 1. Add `@inquirer/prompts` as a dependency if not already present
20
+ 2. Create a new module `src/core/name-generator.ts`:
21
+ - `generateProjectNames(description: string): Promise<string[]>` - calls Claude Sonnet API
22
+ - Include prompt instructions for variety in naming styles
23
+ 3. Create a new module `src/ui/name-picker.ts`:
24
+ - `pickProjectName(names: string[]): Promise<string>` - shows arrow-key list with custom option
25
+ - Handle "Other" selection by showing text input prompt
26
+ 4. Update `src/commands/plan.ts`:
27
+ - Check if name is provided in `raf plan [name]`
28
+ - If not, read input.md content
29
+ - Call name generator with description
30
+ - Show name picker UI
31
+ - Continue with selected/custom name
32
+ 5. Add unit tests for name generator (mock Claude API)
33
+ 6. Add unit tests for name picker UI (mock inquirer)
34
+
35
+ ## Acceptance Criteria
36
+ - [ ] Running `raf plan` without a name shows 3-5 generated names
37
+ - [ ] Names have variety in style (not all the same pattern)
38
+ - [ ] User can select with arrow keys and Enter
39
+ - [ ] User can choose "Other" and type custom name
40
+ - [ ] Selected name is used for project folder creation
41
+ - [ ] All tests pass
42
+
43
+ ## Notes
44
+ - Use Claude Sonnet (not Haiku) for better creative output
45
+ - Ensure names are valid for file system (no special chars, kebab-case)
46
+ - The name generator should be fast - consider streaming or timeout
47
+ - Include prompt instruction: if the project has many unrelated tasks (detected by diverse/disconnected topics in description), prefer more abstract, metaphorical, or fun names rather than trying to be descriptive about all tasks
@@ -0,0 +1,43 @@
1
+ # Task: Interactive Project Picker for `raf do`
2
+
3
+ ## Objective
4
+ Allow users to run `raf do` without specifying a project name and interactively select from pending projects using arrow-key navigation.
5
+
6
+ ## Context
7
+ Currently `raf do` requires a project identifier. This task adds an interactive picker when no identifier is provided, making it easier to continue work on pending projects.
8
+
9
+ ## Requirements
10
+ - Show all pending projects when `raf do` is called without arguments
11
+ - Use `@inquirer/prompts` for arrow-key selection UI
12
+ - Display project info: number, name, and progress (e.g., "001 fix-auth-bug (2/5 tasks)")
13
+ - Order by project number (oldest first)
14
+ - Handle case when no pending projects exist (show message, exit gracefully)
15
+
16
+ ## Implementation Steps
17
+ 1. Create a new module `src/ui/project-picker.ts`:
18
+ - `pickPendingProject(): Promise<string | null>` - shows arrow-key list of pending projects
19
+ - Format each choice with project number, name, and task progress
20
+ - Return selected project folder name or null if cancelled/empty
21
+ 2. Update `src/commands/do.ts`:
22
+ - Check if project identifier is provided
23
+ - If not, call `discoverProjects()` and filter to pending/in-progress
24
+ - If no pending projects, show message and exit
25
+ - Show project picker UI
26
+ - Continue with selected project
27
+ 3. Reuse existing state derivation logic from `src/core/state-derivation.ts`:
28
+ - `deriveProjectState()` to get task counts
29
+ - `getDerivedStats()` to get pending/completed counts
30
+ 4. Add unit tests for project picker UI (mock inquirer and file system)
31
+
32
+ ## Acceptance Criteria
33
+ - [ ] Running `raf do` without arguments shows pending projects list
34
+ - [ ] Projects show number, name, and progress (X/Y tasks)
35
+ - [ ] User can navigate with arrow keys and select with Enter
36
+ - [ ] Selected project is executed
37
+ - [ ] Empty list shows friendly message "No pending projects found"
38
+ - [ ] Ctrl+C exits gracefully
39
+ - [ ] All tests pass
40
+
41
+ ## Notes
42
+ - Consider using `@inquirer/prompts` select with separator or descriptions for better UX
43
+ - This task depends on `@inquirer/prompts` being added in task 001, but can be done in parallel if the dependency is already installed
@@ -0,0 +1,36 @@
1
+ # Task: Enhanced `raf status` with Last 10 Projects
2
+
3
+ ## Objective
4
+ Modify `raf status` to show only the last 10 projects with a "... and N more" indicator for older projects.
5
+
6
+ ## Context
7
+ As RAF accumulates more projects, the status list becomes unwieldy. Showing only recent projects with a truncation indicator keeps the output manageable while indicating more history exists.
8
+
9
+ ## Requirements
10
+ - Show last 10 projects by default (most recent at bottom)
11
+ - Display "... and N more projects" at the top when list is truncated
12
+ - Maintain existing project display format (number, name, progress, status)
13
+ - Sort by project number (ascending) within the displayed 10
14
+
15
+ ## Implementation Steps
16
+ 1. Update `src/commands/status.ts`:
17
+ - In `listAllProjects()` function, check total project count
18
+ - If > 10 projects, slice to last 10
19
+ - Add "... and N more projects" line at the top of output when truncated
20
+ - Keep existing sorting (by project number ascending)
21
+ 2. Add constant for max displayed projects (10) for easy adjustment
22
+ 3. Update any existing tests that check status output format
23
+ 4. Add new test case for truncation behavior
24
+
25
+ ## Acceptance Criteria
26
+ - [ ] `raf status` shows max 10 projects
27
+ - [ ] When > 10 projects exist, shows "... and N more projects" at top
28
+ - [ ] Projects are sorted by number (ascending) with newest at bottom
29
+ - [ ] When ≤ 10 projects, no truncation indicator shown
30
+ - [ ] Individual project status (`raf status <id>`) unchanged
31
+ - [ ] All tests pass
32
+
33
+ ## Notes
34
+ - The truncation indicator should be visually distinct (maybe dimmed or prefixed with ...)
35
+ - Consider adding a `--all` flag in a future task to show all projects
36
+ - This is a simple change - focus on clean implementation and tests
@@ -0,0 +1,46 @@
1
+ # Task: Failure Reason Details in Outcome Files
2
+
3
+ ## Objective
4
+ Add a "Failure History" section to outcome files that lists all previous failure attempts with bullet points for each failure reason.
5
+
6
+ ## Context
7
+ When tasks fail multiple times, understanding the history of failures helps debugging. Currently only the final status is tracked. This task adds detailed failure history to outcome files.
8
+
9
+ ## Requirements
10
+ - Track all failure attempts (not just the most recent)
11
+ - Display as bullet points with attempt number and reason
12
+ - Add to outcome details section in outcome files
13
+ - Include failure reasons from both programmatic failures (timeout, context overflow) and Claude analysis
14
+
15
+ ## Implementation Steps
16
+ 1. Update failure tracking in `src/core/failure-analyzer.ts`:
17
+ - Ensure failure reasons are captured from both programmatic detection and Claude analysis
18
+ - Store failure reason string (1-2 sentences max)
19
+ 2. Update `src/commands/do.ts` execution loop:
20
+ - Track failure reasons across retry attempts in an array
21
+ - Pass failure history to outcome generation
22
+ 3. Update outcome file generation (likely in `src/core/project-manager.ts` or similar):
23
+ - Add "## Failure History" section when there are any failures
24
+ - Format as:
25
+ ```markdown
26
+ ## Failure History
27
+ - **Attempt 1**: Context overflow detected after 45 minutes
28
+ - **Attempt 2**: API rate limit exceeded
29
+ - **Attempt 3**: Success
30
+ ```
31
+ - Only include this section if there were any failures (not for clean runs)
32
+ 4. Update outcome file parsing if needed to handle new section
33
+ 5. Add tests for failure history tracking and formatting
34
+
35
+ ## Acceptance Criteria
36
+ - [ ] Outcome files include failure history when any attempts failed
37
+ - [ ] Each failed attempt shows attempt number and short reason
38
+ - [ ] Successful final attempt also shows in history (if preceded by failures)
39
+ - [ ] Clean runs (no failures) don't show failure history section
40
+ - [ ] Failure reasons are concise (1-2 sentences)
41
+ - [ ] All tests pass
42
+
43
+ ## Notes
44
+ - Keep failure reasons short - full details are in the analysis section
45
+ - Consider: should successful attempt be included in history? (Yes, shows the journey)
46
+ - The failure history should appear before the `<promise>` marker
@@ -0,0 +1,42 @@
1
+ # Task: Remove All RAF-Side Git Commits
2
+
3
+ ## Objective
4
+ Remove all git commit operations from RAF since Claude will handle all commits during task execution.
5
+
6
+ ## Context
7
+ Currently RAF commits after planning and after project completion. The new workflow has Claude handle all commits as part of task execution - one commit per task containing both code changes and outcome file.
8
+
9
+ ## Requirements
10
+ - Remove the planning phase commit (`RAF[NNN:plan]`)
11
+ - Remove the outcome/completion commit (`RAF[NNN:outcome]`)
12
+ - Keep git utility functions that might be needed for other purposes (status checks, stashing)
13
+ - Update CLAUDE.md to reflect new commit workflow
14
+
15
+ ## Implementation Steps
16
+ 1. Update `src/commands/plan.ts`:
17
+ - Remove call to `commitProjectFolder(..., 'plan')`
18
+ - Remove any related error handling for commit failures
19
+ 2. Update `src/commands/do.ts`:
20
+ - Remove call to `commitProjectFolder(..., 'outcome')`
21
+ - Remove the auto-commit logic after task/project completion
22
+ - Keep stash logic for failed tasks (still useful)
23
+ 3. Review `src/core/git.ts`:
24
+ - Keep the module but remove or deprecate `commitProjectFolder` if no longer needed
25
+ - Alternatively, keep it for potential future use but remove all callers
26
+ 4. Update any tests that verify RAF commit behavior
27
+ 5. Update CLAUDE.md "Git Commit Schema" section:
28
+ - Remove "RAF-generated commits" section
29
+ - Update to show only Claude-generated commits
30
+
31
+ ## Acceptance Criteria
32
+ - [ ] `raf plan` does not create any git commits
33
+ - [ ] `raf do` does not create any git commits
34
+ - [ ] Git stashing on failure still works
35
+ - [ ] No errors when running in non-git directories
36
+ - [ ] CLAUDE.md updated to reflect new workflow
37
+ - [ ] All tests pass (update tests that expected commits)
38
+
39
+ ## Notes
40
+ - This is a simplification - less code, clearer responsibility
41
+ - Make sure to remove/update tests that verified commit behavior
42
+ - Keep git.ts utilities that are still useful (hasUncommittedChanges, stashChanges)
@@ -0,0 +1,47 @@
1
+ # Task: Update Execution Prompt for Commit Workflow
2
+
3
+ ## Objective
4
+ Update Claude's execution prompt to instruct it to commit code changes and outcome file together, then produce the completion marker.
5
+
6
+ ## Context
7
+ With RAF no longer handling commits (task 005), Claude must commit as part of task execution. The prompt needs to clearly instruct this workflow and provide file location information.
8
+
9
+ ## Requirements
10
+ - Instruct Claude to commit code changes + outcome file in ONE commit
11
+ - Provide clear file paths for where to write outcome file
12
+ - Specify commit message format: `RAF[NNN:task] description`
13
+ - Ensure `<promise>COMPLETE</promise>` comes AFTER the commit
14
+ - Handle the case where there are no code changes (outcome-only commit)
15
+
16
+ ## Implementation Steps
17
+ 1. Update `src/prompts/execution.ts`:
18
+ - Add section about git commit workflow
19
+ - Specify outcome file path explicitly: `RAF/NNN-project/outcomes/NNN-task-name.md`
20
+ - Instruct: write outcome file → git add → git commit → produce `<promise>COMPLETE</promise>`
21
+ - Include commit message format with example
22
+ 2. Add instruction about staging specific files (not `git add .`):
23
+ - Stage changed code files by name
24
+ - Stage outcome file by path
25
+ 3. Add instruction for failed tasks:
26
+ - Still write outcome file with `<promise>FAILED</promise>`
27
+ - Do NOT commit on failure (keep changes for debugging)
28
+ 4. Review and update the execution prompt template to include:
29
+ - Explicit outcome file path
30
+ - Project folder path
31
+ - Task number and name
32
+ 5. Add/update tests for prompt generation
33
+
34
+ ## Acceptance Criteria
35
+ - [ ] Execution prompt includes commit instructions
36
+ - [ ] Outcome file path is explicitly provided
37
+ - [ ] Commit message format is specified: `RAF[NNN:task] description`
38
+ - [ ] Instructions specify: write outcome → commit → output marker
39
+ - [ ] Failed tasks: write outcome with FAILED marker, no commit
40
+ - [ ] Claude commits code + outcome in single commit during execution
41
+ - [ ] All tests pass
42
+
43
+ ## Notes
44
+ - Depends on task 005 (remove RAF commits) - Claude must commit because RAF won't
45
+ - The sequence is critical: outcome file must be committed BEFORE the marker is output
46
+ - Consider adding examples in the prompt for clarity
47
+ - Test manually after implementation to verify Claude follows instructions
@@ -0,0 +1,55 @@
1
+ # Task: Fix Plan Mode User Prompt
2
+
3
+ ## Objective
4
+ Fix Claude getting stuck in plan mode by splitting the prompt into system instructions and user message, so Claude immediately starts the interview process.
5
+
6
+ ## Context
7
+ Currently, `runInteractive()` passes everything via `--append-system-prompt` without a user message. Claude waits for user input instead of starting the planning interview. Non-interactive execution (`run()`/`runVerbose()`) already works correctly because it passes a user message via `-p`.
8
+
9
+ This affects both:
10
+ - `raf plan` (regular planning)
11
+ - `raf plan --amend` (amendment mode)
12
+
13
+ ## Requirements
14
+ - Pass planning instructions via `--append-system-prompt` (system prompt)
15
+ - Pass the user's project description via `-p` flag (user message)
16
+ - This applies to both regular plan and amend modes
17
+ - Claude should immediately begin identifying tasks and preparing questions
18
+ - The prompt structure should mirror the non-interactive execution pattern
19
+
20
+ ## Implementation Steps
21
+ 1. Update `src/core/claude-runner.ts` `runInteractive()` method:
22
+ - Add a second parameter for user message content
23
+ - Pass system instructions via `--append-system-prompt`
24
+ - Pass user message via `-p` flag
25
+ - Method signature: `runInteractive(systemPrompt: string, userMessage: string, options?)`
26
+
27
+ 2. Update `src/prompts/planning.ts`:
28
+ - Split `getPlanningPrompt()` into two functions or return an object with both parts
29
+ - System prompt: Planning instructions, project location, rules
30
+ - User message: The actual project description (input.md content)
31
+
32
+ 3. Update `src/prompts/amend.ts`:
33
+ - Split `getAmendPrompt()` similarly
34
+ - System prompt: Amendment instructions, existing tasks, rules
35
+ - User message: The new task description
36
+
37
+ 4. Update `src/commands/plan.ts`:
38
+ - Update `runPlanCommand()` to call `runInteractive()` with both prompts
39
+ - Update `runAmendCommand()` to call `runInteractive()` with both prompts
40
+
41
+ 5. Add/update unit tests for:
42
+ - ClaudeRunner.runInteractive() accepting both system and user prompts
43
+ - Planning prompt split functions
44
+ - Amend prompt split functions
45
+
46
+ ## Acceptance Criteria
47
+ - [ ] `raf plan` starts Claude session and Claude immediately begins asking questions
48
+ - [ ] `raf plan --amend` starts Claude session and Claude immediately begins asking questions
49
+ - [ ] No regression in existing planning functionality
50
+ - [ ] All tests pass
51
+
52
+ ## Notes
53
+ - The user message triggers Claude to start working, while system prompt provides the context
54
+ - This mirrors how execution mode already works with the `-p 'Execute the task...'` pattern
55
+ - Keep the existing logic for processing Claude's output after the session
@@ -0,0 +1,49 @@
1
+ # Task: Add Auto Flag for Plan Mode
2
+
3
+ ## Objective
4
+ Add `--auto` / `-y` CLI flag to `raf plan` command to skip Claude's permission prompts during planning sessions.
5
+
6
+ ## Context
7
+ Execution mode (`raf do`) already uses `--dangerously-skip-permissions` for non-interactive Claude sessions. Users may want the same capability during planning to avoid manually approving file writes (decisions.md, plan files). This is useful for automated workflows or when the user trusts Claude's actions.
8
+
9
+ ## Requirements
10
+ - Add `--auto` and `-y` flags to the `raf plan` command
11
+ - When flag is set, pass `--dangerously-skip-permissions` to Claude
12
+ - Works for both regular `raf plan` and `raf plan --amend`
13
+ - Flag is opt-in (not the default behavior)
14
+ - Maintain interactive TTY behavior (Claude can still ask planning questions)
15
+
16
+ ## Implementation Steps
17
+ 1. Update `src/commands/plan.ts`:
18
+ - Add `--auto` and `-y` options to Commander.js command definition
19
+ - Pass the flag value to `runPlanCommand()` and `runAmendCommand()`
20
+
21
+ 2. Update `src/core/claude-runner.ts` `runInteractive()`:
22
+ - Add optional `dangerouslySkipPermissions` flag to options
23
+ - When true, include `--dangerously-skip-permissions` in args
24
+ - Method signature: `runInteractive(systemPrompt, userMessage, { dangerouslySkipPermissions?: boolean, ...})`
25
+
26
+ 3. Update `src/commands/plan.ts`:
27
+ - Pass the flag through to `claudeRunner.runInteractive()`
28
+
29
+ 4. Update CLI help text to explain what the flag does:
30
+ - Short description: "Skip Claude's permission prompts"
31
+ - Clarify this is for file write permissions, not for skipping the planning interview
32
+
33
+ 5. Add unit tests for:
34
+ - ClaudeRunner.runInteractive() with dangerouslySkipPermissions option
35
+ - Command option parsing for --auto and -y flags
36
+
37
+ ## Acceptance Criteria
38
+ - [ ] `raf plan --auto` or `raf plan -y` starts planning without permission prompts
39
+ - [ ] `raf plan --amend <id> --auto` works similarly
40
+ - [ ] Regular `raf plan` (without flag) still shows permission prompts
41
+ - [ ] Claude's AskUserQuestion prompts for planning interview still work (not bypassed)
42
+ - [ ] Help text accurately describes the flag
43
+ - [ ] All tests pass
44
+
45
+ ## Notes
46
+ - This flag only affects file operation permissions, not the planning interview questions
47
+ - The `-y` shorthand matches common CLI conventions (like `apt -y`, `npm -y`)
48
+ - Consider adding a warning message when flag is used to remind user that permissions are skipped
49
+ - Task 007 (fix-plan-mode-user-prompt) should be completed first as it changes runInteractive() signature
@@ -0,0 +1,37 @@
1
+ # Project Decisions
2
+
3
+ ## How should dependencies be specified in plan files? Should they use task IDs (e.g., `001`, `002`) or full task names?
4
+ Task IDs only (Recommended) - Dependencies: 001, 002 - Simple, unambiguous, and matches existing naming.
5
+
6
+ ## Where in the plan file should dependencies be placed?
7
+ New 'Dependencies' section (Recommended) - Add a dedicated ## Dependencies section after Context, before Requirements.
8
+
9
+ ## When a dependency fails, what should happen to the dependent task?
10
+ Auto-fail with explanation (Recommended) - Mark as FAILED immediately, create outcome file explaining the dependency failure.
11
+
12
+ ## Should there be a new task status 'blocked' (distinct from 'failed') shown in status displays?
13
+ Yes, add 'blocked' status (Recommended) - Shows as BLOCKED in status, distinct from tasks that failed on their own.
14
+
15
+ ## How should circular dependencies be handled (e.g., task 002 depends on 003, but 003 depends on 002)?
16
+ Add instruction in planning system prompt to order files in suggested order of execution and avoid circular dependencies. No programmatic validation - rely on Claude's planning intelligence.
17
+
18
+ ## Should Claude ask about dependencies during the planning interview, or infer them automatically from task descriptions?
19
+ Infer automatically (Recommended) - Claude analyzes task relationships and adds dependencies without asking.
20
+
21
+ ## What dependency context should Claude receive when executing a task that has dependencies?
22
+ Show dependency outcomes (Recommended) - Include outcome summaries of completed dependency tasks in execution context.
23
+
24
+ ## What marker should blocked tasks use in their outcome files?
25
+ New BLOCKED marker (Recommended) - Use `<promise>BLOCKED</promise>` - distinct from COMPLETE and FAILED.
26
+
27
+ ## [Amendment] For the 'act' alias of 'raf do': Should it be a complete alias (same options, same behavior) or just a shortcut with any differences?
28
+ Complete alias (Recommended) - raf act = raf do with all the same options and behavior.
29
+
30
+ ## [Amendment] For the ctrl-c message: When should this message be displayed?
31
+ After plan created (Recommended) - Show when planning is complete, before Claude exits.
32
+
33
+ ## [Amendment] What should the exact message say after planning?
34
+ Generic message (Recommended) - Press Ctrl-C twice to exit. Then run: raf do <project>
35
+
36
+ ## [Amendment] Should the message also mention that planning can be amended later?
37
+ No, keep it simple (Recommended) - Only show ctrl-c and raf do instructions.
@@ -0,0 +1 @@
1
+ when "raf do" add dependency check on other tasks, account for this in planning prompts. for example when building complex project plan could be dependant on each other, we order them on planning stage, that is good, but what if dependancy task fails, we need to account for that and don't do other tasks (fail them). instruct claude to check for it in system prompts