rafcode 1.2.0 → 2.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 (398) hide show
  1. package/CLAUDE.md +118 -22
  2. package/RAF/aaaabt-verbose-chronicle/decisions.md +25 -0
  3. package/RAF/aaaabt-verbose-chronicle/input.md +3 -0
  4. package/RAF/aaaabt-verbose-chronicle/outcomes/01-amend-iteration-references.md +25 -0
  5. package/RAF/aaaabt-verbose-chronicle/outcomes/02-verbose-task-name-display.md +31 -0
  6. package/RAF/aaaabt-verbose-chronicle/outcomes/03-verbose-streaming-fix.md +48 -0
  7. package/RAF/aaaabt-verbose-chronicle/outcomes/04-commit-verification-before-halt.md +56 -0
  8. package/RAF/aaaabt-verbose-chronicle/plans/01-amend-iteration-references.md +35 -0
  9. package/RAF/aaaabt-verbose-chronicle/plans/02-verbose-task-name-display.md +38 -0
  10. package/RAF/aaaabt-verbose-chronicle/plans/03-verbose-streaming-fix.md +45 -0
  11. package/RAF/aaaabt-verbose-chronicle/plans/04-commit-verification-before-halt.md +62 -0
  12. package/RAF/aaaacu-worktree-weaver/decisions.md +88 -0
  13. package/RAF/aaaacu-worktree-weaver/input.md +27 -0
  14. package/RAF/aaaacu-worktree-weaver/outcomes/01-git-worktree-utilities.md +41 -0
  15. package/RAF/aaaacu-worktree-weaver/outcomes/02-worktree-plan-command.md +44 -0
  16. package/RAF/aaaacu-worktree-weaver/outcomes/03-worktree-do-command.md +58 -0
  17. package/RAF/aaaacu-worktree-weaver/outcomes/04-auto-merge-and-cleanup.md +40 -0
  18. package/RAF/aaaacu-worktree-weaver/outcomes/05-worktree-tests.md +43 -0
  19. package/RAF/aaaacu-worktree-weaver/outcomes/06-update-documentation.md +33 -0
  20. package/RAF/aaaacu-worktree-weaver/plans/01-git-worktree-utilities.md +51 -0
  21. package/RAF/aaaacu-worktree-weaver/plans/02-worktree-plan-command.md +93 -0
  22. package/RAF/aaaacu-worktree-weaver/plans/03-worktree-do-command.md +81 -0
  23. package/RAF/aaaacu-worktree-weaver/plans/04-auto-merge-and-cleanup.md +51 -0
  24. package/RAF/aaaacu-worktree-weaver/plans/05-worktree-tests.md +52 -0
  25. package/RAF/aaaacu-worktree-weaver/plans/06-update-documentation.md +55 -0
  26. package/RAF/aaaacv-trim-the-fat/decisions.md +34 -0
  27. package/RAF/aaaacv-trim-the-fat/input.md +5 -0
  28. package/RAF/aaaacv-trim-the-fat/outcomes/01-add-worktree-support-to-status.md +43 -0
  29. package/RAF/aaaacv-trim-the-fat/outcomes/02-remove-multi-project-from-do.md +50 -0
  30. package/RAF/aaaacv-trim-the-fat/outcomes/03-commit-artifacts-on-amend.md +35 -0
  31. package/RAF/aaaacv-trim-the-fat/outcomes/04-worktree-aware-exit-messages.md +36 -0
  32. package/RAF/aaaacv-trim-the-fat/plans/01-add-worktree-support-to-status.md +43 -0
  33. package/RAF/aaaacv-trim-the-fat/plans/02-remove-multi-project-from-do.md +44 -0
  34. package/RAF/aaaacv-trim-the-fat/plans/03-commit-artifacts-on-amend.md +38 -0
  35. package/RAF/aaaacv-trim-the-fat/plans/04-worktree-aware-exit-messages.md +38 -0
  36. package/RAF/aaaacw-prune-cycle/decisions.md +25 -0
  37. package/RAF/aaaacw-prune-cycle/input.md +5 -0
  38. package/RAF/aaaacw-prune-cycle/outcomes/01-create-worktree-from-branch.md +32 -0
  39. package/RAF/aaaacw-prune-cycle/outcomes/02-cleanup-worktree-on-success.md +33 -0
  40. package/RAF/aaaacw-prune-cycle/outcomes/03-amend-recreate-worktree.md +40 -0
  41. package/RAF/aaaacw-prune-cycle/plans/01-create-worktree-from-branch.md +31 -0
  42. package/RAF/aaaacw-prune-cycle/plans/02-cleanup-worktree-on-success.md +38 -0
  43. package/RAF/aaaacw-prune-cycle/plans/03-amend-recreate-worktree.md +50 -0
  44. package/RAF/aaaacx-epoch-shift/decisions.md +25 -0
  45. package/RAF/aaaacx-epoch-shift/input.md +1 -0
  46. package/RAF/aaaacx-epoch-shift/outcomes/01-epoch-id-generation.md +34 -0
  47. package/RAF/aaaacx-epoch-shift/outcomes/02-update-pattern-matching.md +32 -0
  48. package/RAF/aaaacx-epoch-shift/outcomes/03-update-tests.md +59 -0
  49. package/RAF/aaaacx-epoch-shift/outcomes/04-update-documentation.md +30 -0
  50. package/RAF/aaaacx-epoch-shift/plans/01-epoch-id-generation.md +40 -0
  51. package/RAF/aaaacx-epoch-shift/plans/02-update-pattern-matching.md +60 -0
  52. package/RAF/aaaacx-epoch-shift/plans/03-update-tests.md +48 -0
  53. package/RAF/aaaacx-epoch-shift/plans/04-update-documentation.md +44 -0
  54. package/RAF/ahmpro-merge-guardian/decisions.md +25 -0
  55. package/RAF/ahmpro-merge-guardian/input.md +4 -0
  56. package/RAF/ahmpro-merge-guardian/outcomes/001-fix-amend-worktree-commit.md +45 -0
  57. package/RAF/ahmpro-merge-guardian/outcomes/002-base36-task-ids.md +55 -0
  58. package/RAF/ahmpro-merge-guardian/outcomes/003-worktree-pr-creation.md +41 -0
  59. package/RAF/ahmpro-merge-guardian/outcomes/004-post-execution-picker.md +53 -0
  60. package/RAF/ahmpro-merge-guardian/plans/001-fix-amend-worktree-commit.md +39 -0
  61. package/RAF/ahmpro-merge-guardian/plans/002-base36-task-ids.md +43 -0
  62. package/RAF/ahmpro-merge-guardian/plans/003-worktree-pr-creation.md +43 -0
  63. package/RAF/ahmpro-merge-guardian/plans/004-post-execution-picker.md +51 -0
  64. package/RAF/ahnbcu-letterjam/decisions.md +13 -0
  65. package/RAF/ahnbcu-letterjam/input.md +3 -0
  66. package/RAF/ahnbcu-letterjam/outcomes/01-base26-encoding.md +42 -0
  67. package/RAF/ahnbcu-letterjam/outcomes/02-update-tests.md +38 -0
  68. package/RAF/ahnbcu-letterjam/outcomes/03-migrate-command.md +51 -0
  69. package/RAF/ahnbcu-letterjam/outcomes/04-update-documentation.md +29 -0
  70. package/RAF/ahnbcu-letterjam/plans/01-base26-encoding.md +36 -0
  71. package/RAF/ahnbcu-letterjam/plans/02-update-tests.md +37 -0
  72. package/RAF/ahnbcu-letterjam/plans/03-migrate-command.md +49 -0
  73. package/RAF/ahnbcu-letterjam/plans/04-update-documentation.md +39 -0
  74. package/RAF/ahnwrk-worktree-weaver/decisions.md +19 -0
  75. package/RAF/ahnwrk-worktree-weaver/input.md +4 -0
  76. package/RAF/ahnwrk-worktree-weaver/outcomes/01-remove-co-authored-by.md +20 -0
  77. package/RAF/ahnwrk-worktree-weaver/outcomes/02-update-task-status-format.md +21 -0
  78. package/RAF/ahnwrk-worktree-weaver/outcomes/03-worktree-auto-discovery.md +34 -0
  79. package/RAF/ahnwrk-worktree-weaver/outcomes/04-fix-pr-description.md +30 -0
  80. package/RAF/ahnwrk-worktree-weaver/plans/01-remove-co-authored-by.md +26 -0
  81. package/RAF/ahnwrk-worktree-weaver/plans/02-update-task-status-format.md +27 -0
  82. package/RAF/ahnwrk-worktree-weaver/plans/03-worktree-auto-discovery.md +37 -0
  83. package/RAF/ahnwrk-worktree-weaver/plans/04-fix-pr-description.md +50 -0
  84. package/README.md +56 -10
  85. package/dist/commands/do.d.ts +15 -0
  86. package/dist/commands/do.d.ts.map +1 -1
  87. package/dist/commands/do.js +400 -131
  88. package/dist/commands/do.js.map +1 -1
  89. package/dist/commands/migrate.d.ts +14 -0
  90. package/dist/commands/migrate.d.ts.map +1 -0
  91. package/dist/commands/migrate.js +228 -0
  92. package/dist/commands/migrate.js.map +1 -0
  93. package/dist/commands/plan.d.ts.map +1 -1
  94. package/dist/commands/plan.js +237 -40
  95. package/dist/commands/plan.js.map +1 -1
  96. package/dist/commands/status.d.ts.map +1 -1
  97. package/dist/commands/status.js +221 -47
  98. package/dist/commands/status.js.map +1 -1
  99. package/dist/core/claude-runner.d.ts +52 -1
  100. package/dist/core/claude-runner.d.ts.map +1 -1
  101. package/dist/core/claude-runner.js +195 -17
  102. package/dist/core/claude-runner.js.map +1 -1
  103. package/dist/core/git.d.ts +29 -5
  104. package/dist/core/git.d.ts.map +1 -1
  105. package/dist/core/git.js +95 -18
  106. package/dist/core/git.js.map +1 -1
  107. package/dist/core/project-manager.d.ts.map +1 -1
  108. package/dist/core/project-manager.js +2 -2
  109. package/dist/core/project-manager.js.map +1 -1
  110. package/dist/core/pull-request.d.ts +84 -0
  111. package/dist/core/pull-request.d.ts.map +1 -0
  112. package/dist/core/pull-request.js +414 -0
  113. package/dist/core/pull-request.js.map +1 -0
  114. package/dist/core/state-derivation.d.ts +3 -3
  115. package/dist/core/state-derivation.d.ts.map +1 -1
  116. package/dist/core/state-derivation.js +18 -14
  117. package/dist/core/state-derivation.js.map +1 -1
  118. package/dist/core/worktree.d.ts +120 -0
  119. package/dist/core/worktree.d.ts.map +1 -0
  120. package/dist/core/worktree.js +322 -0
  121. package/dist/core/worktree.js.map +1 -0
  122. package/dist/index.js +2 -0
  123. package/dist/index.js.map +1 -1
  124. package/dist/parsers/stream-renderer.d.ts +42 -0
  125. package/dist/parsers/stream-renderer.d.ts.map +1 -0
  126. package/dist/parsers/stream-renderer.js +100 -0
  127. package/dist/parsers/stream-renderer.js.map +1 -0
  128. package/dist/prompts/amend.d.ts +1 -0
  129. package/dist/prompts/amend.d.ts.map +1 -1
  130. package/dist/prompts/amend.js +25 -10
  131. package/dist/prompts/amend.js.map +1 -1
  132. package/dist/prompts/execution.js +5 -5
  133. package/dist/prompts/execution.js.map +1 -1
  134. package/dist/prompts/planning.d.ts +1 -0
  135. package/dist/prompts/planning.d.ts.map +1 -1
  136. package/dist/prompts/planning.js +11 -10
  137. package/dist/prompts/planning.js.map +1 -1
  138. package/dist/types/config.d.ts +5 -0
  139. package/dist/types/config.d.ts.map +1 -1
  140. package/dist/ui/project-picker.d.ts +34 -3
  141. package/dist/ui/project-picker.d.ts.map +1 -1
  142. package/dist/ui/project-picker.js +78 -10
  143. package/dist/ui/project-picker.js.map +1 -1
  144. package/dist/utils/paths.d.ts +38 -43
  145. package/dist/utils/paths.d.ts.map +1 -1
  146. package/dist/utils/paths.js +123 -193
  147. package/dist/utils/paths.js.map +1 -1
  148. package/dist/utils/terminal-symbols.d.ts +2 -2
  149. package/dist/utils/terminal-symbols.js +3 -3
  150. package/dist/utils/terminal-symbols.js.map +1 -1
  151. package/dist/utils/validation.d.ts.map +1 -1
  152. package/dist/utils/validation.js +2 -8
  153. package/dist/utils/validation.js.map +1 -1
  154. package/package.json +1 -1
  155. package/src/commands/do.ts +471 -142
  156. package/src/commands/migrate.ts +269 -0
  157. package/src/commands/plan.ts +264 -40
  158. package/src/commands/status.ts +252 -45
  159. package/src/core/claude-runner.ts +270 -17
  160. package/src/core/git.ts +99 -19
  161. package/src/core/project-manager.ts +2 -1
  162. package/src/core/pull-request.ts +480 -0
  163. package/src/core/state-derivation.ts +18 -14
  164. package/src/core/worktree.ts +357 -0
  165. package/src/index.ts +2 -0
  166. package/src/parsers/stream-renderer.ts +139 -0
  167. package/src/prompts/amend.ts +27 -9
  168. package/src/prompts/execution.ts +5 -5
  169. package/src/prompts/planning.ts +12 -10
  170. package/src/types/config.ts +6 -0
  171. package/src/ui/project-picker.ts +110 -10
  172. package/src/utils/paths.ts +129 -214
  173. package/src/utils/terminal-symbols.ts +3 -3
  174. package/src/utils/validation.ts +2 -9
  175. package/tests/unit/amend-prompt.test.ts +85 -0
  176. package/tests/unit/claude-runner.test.ts +567 -1
  177. package/tests/unit/commit-planning-artifacts-worktree.test.ts +327 -0
  178. package/tests/unit/commit-planning-artifacts.test.ts +303 -35
  179. package/tests/unit/dependency-integration.test.ts +95 -95
  180. package/tests/unit/do-blocked-tasks.test.ts +53 -53
  181. package/tests/unit/do-command.test.ts +39 -132
  182. package/tests/unit/do-rerun.test.ts +65 -65
  183. package/tests/unit/do-worktree-cleanup.test.ts +151 -0
  184. package/tests/unit/execution-prompt.test.ts +71 -60
  185. package/tests/unit/failure-history.test.ts +19 -19
  186. package/tests/unit/git-commit-helpers.test.ts +103 -0
  187. package/tests/unit/git-stash.test.ts +4 -4
  188. package/tests/unit/migrate-command.test.ts +197 -0
  189. package/tests/unit/outcome-content.test.ts +20 -20
  190. package/tests/unit/paths.test.ts +269 -467
  191. package/tests/unit/plan-amend-worktree-recreate.test.ts +246 -0
  192. package/tests/unit/plan-command.test.ts +144 -93
  193. package/tests/unit/planning-prompt.test.ts +41 -4
  194. package/tests/unit/post-execution-picker.test.ts +251 -0
  195. package/tests/unit/project-manager.test.ts +20 -8
  196. package/tests/unit/project-picker.test.ts +425 -42
  197. package/tests/unit/pull-request.test.ts +852 -0
  198. package/tests/unit/state-derivation.test.ts +138 -137
  199. package/tests/unit/status-command.test.ts +344 -76
  200. package/tests/unit/stream-renderer.test.ts +286 -0
  201. package/tests/unit/terminal-symbols.test.ts +4 -4
  202. package/tests/unit/worktree-integration.test.ts +405 -0
  203. package/tests/unit/worktree.test.ts +523 -0
  204. package/tests/unit/do-multiproject.test.ts +0 -270
  205. /package/RAF/{001-raf-task-improvements → aaaaab-raf-task-improvements}/input.md +0 -0
  206. /package/RAF/{001-raf-task-improvements/outcomes/001-add-decisions-folder.md → aaaaab-raf-task-improvements/outcomes/01-add-decisions-folder.md} +0 -0
  207. /package/RAF/{001-raf-task-improvements/outcomes/002-fix-write-error-on-shutdown.md → aaaaab-raf-task-improvements/outcomes/02-fix-write-error-on-shutdown.md} +0 -0
  208. /package/RAF/{001-raf-task-improvements/outcomes/003-stash-changes-on-failure.md → aaaaab-raf-task-improvements/outcomes/03-stash-changes-on-failure.md} +0 -0
  209. /package/RAF/{001-raf-task-improvements/outcomes/004-add-project-name-to-commits.md → aaaaab-raf-task-improvements/outcomes/04-add-project-name-to-commits.md} +0 -0
  210. /package/RAF/{001-raf-task-improvements/outcomes/005-add-running-time-display.md → aaaaab-raf-task-improvements/outcomes/05-add-running-time-display.md} +0 -0
  211. /package/RAF/{001-raf-task-improvements/outcomes/006-add-task-name-to-logs.md → aaaaab-raf-task-improvements/outcomes/06-add-task-name-to-logs.md} +0 -0
  212. /package/RAF/{001-raf-task-improvements/outcomes/007-show-model-at-task-start.md → aaaaab-raf-task-improvements/outcomes/07-show-model-at-task-start.md} +0 -0
  213. /package/RAF/{001-raf-task-improvements/outcomes/009-remove-editor-placeholder-text.md → aaaaab-raf-task-improvements/outcomes/09-remove-editor-placeholder-text.md} +0 -0
  214. /package/RAF/{001-raf-task-improvements → aaaaab-raf-task-improvements}/outcomes/SUMMARY.md +0 -0
  215. /package/RAF/{001-raf-task-improvements/plans/001-add-decisions-folder.md → aaaaab-raf-task-improvements/plans/01-add-decisions-folder.md} +0 -0
  216. /package/RAF/{001-raf-task-improvements/plans/002-fix-write-error-on-shutdown.md → aaaaab-raf-task-improvements/plans/02-fix-write-error-on-shutdown.md} +0 -0
  217. /package/RAF/{001-raf-task-improvements/plans/003-stash-changes-on-failure.md → aaaaab-raf-task-improvements/plans/03-stash-changes-on-failure.md} +0 -0
  218. /package/RAF/{001-raf-task-improvements/plans/004-add-project-name-to-commits.md → aaaaab-raf-task-improvements/plans/04-add-project-name-to-commits.md} +0 -0
  219. /package/RAF/{001-raf-task-improvements/plans/005-add-running-time-display.md → aaaaab-raf-task-improvements/plans/05-add-running-time-display.md} +0 -0
  220. /package/RAF/{001-raf-task-improvements/plans/006-add-task-name-to-logs.md → aaaaab-raf-task-improvements/plans/06-add-task-name-to-logs.md} +0 -0
  221. /package/RAF/{001-raf-task-improvements/plans/009-remove-editor-placeholder-text.md → aaaaab-raf-task-improvements/plans/09-remove-editor-placeholder-text.md} +0 -0
  222. /package/RAF/{002-raf-task-improvements-execution → aaaaac-raf-task-improvements-execution}/decisions/DECISIONS.md +0 -0
  223. /package/RAF/{002-raf-task-improvements-execution → aaaaac-raf-task-improvements-execution}/input.md +0 -0
  224. /package/RAF/{002-raf-task-improvements-execution/outcomes/001-commit-show-model-at-task-start.md → aaaaac-raf-task-improvements-execution/outcomes/01-commit-show-model-at-task-start.md} +0 -0
  225. /package/RAF/{002-raf-task-improvements-execution/outcomes/002-delete-skipped-plan.md → aaaaac-raf-task-improvements-execution/outcomes/02-delete-skipped-plan.md} +0 -0
  226. /package/RAF/{002-raf-task-improvements-execution → aaaaac-raf-task-improvements-execution}/outcomes/SUMMARY.md +0 -0
  227. /package/RAF/{002-raf-task-improvements-execution/plans/001-commit-show-model-at-task-start.md → aaaaac-raf-task-improvements-execution/plans/01-commit-show-model-at-task-start.md} +0 -0
  228. /package/RAF/{002-raf-task-improvements-execution/plans/002-delete-skipped-plan.md → aaaaac-raf-task-improvements-execution/plans/02-delete-skipped-plan.md} +0 -0
  229. /package/RAF/{003-multi-project-execution → aaaaad-multi-project-execution}/decisions/DECISIONS.md +0 -0
  230. /package/RAF/{003-multi-project-execution → aaaaad-multi-project-execution}/input.md +0 -0
  231. /package/RAF/{003-multi-project-execution/outcomes/001-remove-state-json.md → aaaaad-multi-project-execution/outcomes/01-remove-state-json.md} +0 -0
  232. /package/RAF/{003-multi-project-execution/outcomes/002-update-raf-status.md → aaaaad-multi-project-execution/outcomes/02-update-raf-status.md} +0 -0
  233. /package/RAF/{003-multi-project-execution/outcomes/003-simplify-git-logic.md → aaaaad-multi-project-execution/outcomes/03-simplify-git-logic.md} +0 -0
  234. /package/RAF/{003-multi-project-execution/outcomes/004-auto-commit-planning.md → aaaaad-multi-project-execution/outcomes/04-auto-commit-planning.md} +0 -0
  235. /package/RAF/{003-multi-project-execution/outcomes/005-rerun-failed-tasks.md → aaaaad-multi-project-execution/outcomes/05-rerun-failed-tasks.md} +0 -0
  236. /package/RAF/{003-multi-project-execution/outcomes/006-multi-project-execution.md → aaaaad-multi-project-execution/outcomes/06-multi-project-execution.md} +0 -0
  237. /package/RAF/{003-multi-project-execution/outcomes/007-verify-timeout.md → aaaaad-multi-project-execution/outcomes/07-verify-timeout.md} +0 -0
  238. /package/RAF/{003-multi-project-execution/outcomes/008-move-decisions-file.md → aaaaad-multi-project-execution/outcomes/08-move-decisions-file.md} +0 -0
  239. /package/RAF/{003-multi-project-execution → aaaaad-multi-project-execution}/outcomes/SUMMARY.md +0 -0
  240. /package/RAF/{003-multi-project-execution/plans/001-remove-state-json.md → aaaaad-multi-project-execution/plans/01-remove-state-json.md} +0 -0
  241. /package/RAF/{003-multi-project-execution/plans/002-update-raf-status.md → aaaaad-multi-project-execution/plans/02-update-raf-status.md} +0 -0
  242. /package/RAF/{003-multi-project-execution/plans/003-simplify-git-logic.md → aaaaad-multi-project-execution/plans/03-simplify-git-logic.md} +0 -0
  243. /package/RAF/{003-multi-project-execution/plans/004-auto-commit-planning.md → aaaaad-multi-project-execution/plans/04-auto-commit-planning.md} +0 -0
  244. /package/RAF/{003-multi-project-execution/plans/005-rerun-failed-tasks.md → aaaaad-multi-project-execution/plans/05-rerun-failed-tasks.md} +0 -0
  245. /package/RAF/{003-multi-project-execution/plans/006-multi-project-execution.md → aaaaad-multi-project-execution/plans/06-multi-project-execution.md} +0 -0
  246. /package/RAF/{003-multi-project-execution/plans/007-verify-timeout.md → aaaaad-multi-project-execution/plans/07-verify-timeout.md} +0 -0
  247. /package/RAF/{003-multi-project-execution/plans/008-move-decisions-file.md → aaaaad-multi-project-execution/plans/08-move-decisions-file.md} +0 -0
  248. /package/RAF/{004-task-naming-optimization → aaaaae-task-naming-optimization}/decisions.md +0 -0
  249. /package/RAF/{004-task-naming-optimization → aaaaae-task-naming-optimization}/input.md +0 -0
  250. /package/RAF/{004-task-naming-optimization/outcomes/001-remove-summary-file.md → aaaaae-task-naming-optimization/outcomes/01-remove-summary-file.md} +0 -0
  251. /package/RAF/{004-task-naming-optimization/outcomes/002-base36-project-numbering.md → aaaaae-task-naming-optimization/outcomes/02-base36-project-numbering.md} +0 -0
  252. /package/RAF/{004-task-naming-optimization/outcomes/003-improve-haiku-prompt.md → aaaaae-task-naming-optimization/outcomes/03-improve-haiku-prompt.md} +0 -0
  253. /package/RAF/{004-task-naming-optimization → aaaaae-task-naming-optimization}/outcomes/SUMMARY.md +0 -0
  254. /package/RAF/{004-task-naming-optimization/plans/001-remove-summary-file.md → aaaaae-task-naming-optimization/plans/01-remove-summary-file.md} +0 -0
  255. /package/RAF/{004-task-naming-optimization/plans/002-base36-project-numbering.md → aaaaae-task-naming-optimization/plans/02-base36-project-numbering.md} +0 -0
  256. /package/RAF/{004-task-naming-optimization/plans/003-improve-haiku-prompt.md → aaaaae-task-naming-optimization/plans/03-improve-haiku-prompt.md} +0 -0
  257. /package/RAF/{005-task-naming-improvements → aaaaaf-task-naming-improvements}/decisions.md +0 -0
  258. /package/RAF/{005-task-naming-improvements → aaaaaf-task-naming-improvements}/input.md +0 -0
  259. /package/RAF/{005-task-naming-improvements/outcomes/001-enhance-identifier-resolution.md → aaaaaf-task-naming-improvements/outcomes/01-enhance-identifier-resolution.md} +0 -0
  260. /package/RAF/{005-task-naming-improvements/outcomes/002-add-identifier-support-to-status.md → aaaaaf-task-naming-improvements/outcomes/02-add-identifier-support-to-status.md} +0 -0
  261. /package/RAF/{005-task-naming-improvements/outcomes/003-update-do-for-full-folder-names.md → aaaaaf-task-naming-improvements/outcomes/03-update-do-for-full-folder-names.md} +0 -0
  262. /package/RAF/{005-task-naming-improvements/outcomes/004-implement-amend-flag-for-plan.md → aaaaaf-task-naming-improvements/outcomes/04-implement-amend-flag-for-plan.md} +0 -0
  263. /package/RAF/{005-task-naming-improvements/outcomes/005-commit-outcomes-on-complete.md → aaaaaf-task-naming-improvements/outcomes/05-commit-outcomes-on-complete.md} +0 -0
  264. /package/RAF/{005-task-naming-improvements/outcomes/006-update-execution-prompt-commit-schema.md → aaaaaf-task-naming-improvements/outcomes/06-update-execution-prompt-commit-schema.md} +0 -0
  265. /package/RAF/{005-task-naming-improvements/outcomes/007-allow-pending-task-amendments.md → aaaaaf-task-naming-improvements/outcomes/07-allow-pending-task-amendments.md} +0 -0
  266. /package/RAF/{005-task-naming-improvements/outcomes/008-fix-timeout-label.md → aaaaaf-task-naming-improvements/outcomes/08-fix-timeout-label.md} +0 -0
  267. /package/RAF/{005-task-naming-improvements/plans/001-enhance-identifier-resolution.md → aaaaaf-task-naming-improvements/plans/01-enhance-identifier-resolution.md} +0 -0
  268. /package/RAF/{005-task-naming-improvements/plans/002-add-identifier-support-to-status.md → aaaaaf-task-naming-improvements/plans/02-add-identifier-support-to-status.md} +0 -0
  269. /package/RAF/{005-task-naming-improvements/plans/003-update-do-for-full-folder-names.md → aaaaaf-task-naming-improvements/plans/03-update-do-for-full-folder-names.md} +0 -0
  270. /package/RAF/{005-task-naming-improvements/plans/004-implement-amend-flag-for-plan.md → aaaaaf-task-naming-improvements/plans/04-implement-amend-flag-for-plan.md} +0 -0
  271. /package/RAF/{005-task-naming-improvements/plans/005-commit-outcomes-on-complete.md → aaaaaf-task-naming-improvements/plans/05-commit-outcomes-on-complete.md} +0 -0
  272. /package/RAF/{005-task-naming-improvements/plans/006-update-execution-prompt-commit-schema.md → aaaaaf-task-naming-improvements/plans/06-update-execution-prompt-commit-schema.md} +0 -0
  273. /package/RAF/{005-task-naming-improvements/plans/007-allow-pending-task-amendments.md → aaaaaf-task-naming-improvements/plans/07-allow-pending-task-amendments.md} +0 -0
  274. /package/RAF/{005-task-naming-improvements/plans/008-fix-timeout-label.md → aaaaaf-task-naming-improvements/plans/08-fix-timeout-label.md} +0 -0
  275. /package/RAF/{006-fix-double-summary-headers → aaaaag-fix-double-summary-headers}/decisions.md +0 -0
  276. /package/RAF/{006-fix-double-summary-headers → aaaaag-fix-double-summary-headers}/input.md +0 -0
  277. /package/RAF/{006-fix-double-summary-headers/outcomes/001-fix-double-summary-headers.md → aaaaag-fix-double-summary-headers/outcomes/01-fix-double-summary-headers.md} +0 -0
  278. /package/RAF/{006-fix-double-summary-headers/outcomes/002-update-readme-for-npm.md → aaaaag-fix-double-summary-headers/outcomes/02-update-readme-for-npm.md} +0 -0
  279. /package/RAF/{006-fix-double-summary-headers/outcomes/003-npm-publish-instructions.md → aaaaag-fix-double-summary-headers/outcomes/03-npm-publish-instructions.md} +0 -0
  280. /package/RAF/{006-fix-double-summary-headers/outcomes/004-flexible-project-lookup.md → aaaaag-fix-double-summary-headers/outcomes/04-flexible-project-lookup.md} +0 -0
  281. /package/RAF/{006-fix-double-summary-headers/plans/001-fix-double-summary-headers.md → aaaaag-fix-double-summary-headers/plans/01-fix-double-summary-headers.md} +0 -0
  282. /package/RAF/{006-fix-double-summary-headers/plans/002-update-readme-for-npm.md → aaaaag-fix-double-summary-headers/plans/02-update-readme-for-npm.md} +0 -0
  283. /package/RAF/{006-fix-double-summary-headers/plans/003-npm-publish-instructions.md → aaaaag-fix-double-summary-headers/plans/03-npm-publish-instructions.md} +0 -0
  284. /package/RAF/{006-fix-double-summary-headers/plans/004-flexible-project-lookup.md → aaaaag-fix-double-summary-headers/plans/04-flexible-project-lookup.md} +0 -0
  285. /package/RAF/{007-improve-outcome-format → aaaaah-improve-outcome-format}/decisions.md +0 -0
  286. /package/RAF/{007-improve-outcome-format → aaaaah-improve-outcome-format}/input.md +0 -0
  287. /package/RAF/{007-improve-outcome-format/outcomes/001-update-execution-prompt.md → aaaaah-improve-outcome-format/outcomes/01-update-execution-prompt.md} +0 -0
  288. /package/RAF/{007-improve-outcome-format/outcomes/002-update-state-derivation.md → aaaaah-improve-outcome-format/outcomes/02-update-state-derivation.md} +0 -0
  289. /package/RAF/{007-improve-outcome-format/outcomes/003-update-do-command-outcome-handling.md → aaaaah-improve-outcome-format/outcomes/03-update-do-command-outcome-handling.md} +0 -0
  290. /package/RAF/{007-improve-outcome-format/outcomes/004-implement-failure-analysis.md → aaaaah-improve-outcome-format/outcomes/04-implement-failure-analysis.md} +0 -0
  291. /package/RAF/{007-improve-outcome-format/outcomes/005-update-documentation.md → aaaaah-improve-outcome-format/outcomes/05-update-documentation.md} +0 -0
  292. /package/RAF/{007-improve-outcome-format/plans/001-update-execution-prompt.md → aaaaah-improve-outcome-format/plans/01-update-execution-prompt.md} +0 -0
  293. /package/RAF/{007-improve-outcome-format/plans/002-update-state-derivation.md → aaaaah-improve-outcome-format/plans/02-update-state-derivation.md} +0 -0
  294. /package/RAF/{007-improve-outcome-format/plans/003-update-do-command-outcome-handling.md → aaaaah-improve-outcome-format/plans/03-update-do-command-outcome-handling.md} +0 -0
  295. /package/RAF/{007-improve-outcome-format/plans/004-implement-failure-analysis.md → aaaaah-improve-outcome-format/plans/04-implement-failure-analysis.md} +0 -0
  296. /package/RAF/{007-improve-outcome-format/plans/005-update-documentation.md → aaaaah-improve-outcome-format/plans/05-update-documentation.md} +0 -0
  297. /package/RAF/{008-beautiful-do → aaaaai-beautiful-do}/decisions.md +0 -0
  298. /package/RAF/{008-beautiful-do → aaaaai-beautiful-do}/input.md +0 -0
  299. /package/RAF/{008-beautiful-do/outcomes/001-terminal-symbols.md → aaaaai-beautiful-do/outcomes/01-terminal-symbols.md} +0 -0
  300. /package/RAF/{008-beautiful-do/outcomes/002-refactor-do-output.md → aaaaai-beautiful-do/outcomes/02-refactor-do-output.md} +0 -0
  301. /package/RAF/{008-beautiful-do/outcomes/003-refactor-status-output.md → aaaaai-beautiful-do/outcomes/03-refactor-status-output.md} +0 -0
  302. /package/RAF/{008-beautiful-do/outcomes/004-simplify-logger.md → aaaaai-beautiful-do/outcomes/04-simplify-logger.md} +0 -0
  303. /package/RAF/{008-beautiful-do/outcomes/005-add-tests.md → aaaaai-beautiful-do/outcomes/05-add-tests.md} +0 -0
  304. /package/RAF/{008-beautiful-do/plans/001-terminal-symbols.md → aaaaai-beautiful-do/plans/01-terminal-symbols.md} +0 -0
  305. /package/RAF/{008-beautiful-do/plans/002-refactor-do-output.md → aaaaai-beautiful-do/plans/02-refactor-do-output.md} +0 -0
  306. /package/RAF/{008-beautiful-do/plans/003-refactor-status-output.md → aaaaai-beautiful-do/plans/03-refactor-status-output.md} +0 -0
  307. /package/RAF/{008-beautiful-do/plans/004-simplify-logger.md → aaaaai-beautiful-do/plans/04-simplify-logger.md} +0 -0
  308. /package/RAF/{008-beautiful-do/plans/005-add-tests.md → aaaaai-beautiful-do/plans/05-add-tests.md} +0 -0
  309. /package/RAF/{009-system-promt-ammend → aaaaaj-system-promt-ammend}/decisions.md +0 -0
  310. /package/RAF/{009-system-promt-ammend → aaaaaj-system-promt-ammend}/input.md +0 -0
  311. /package/RAF/{009-system-promt-ammend/outcomes/001-model-override.md → aaaaaj-system-promt-ammend/outcomes/01-model-override.md} +0 -0
  312. /package/RAF/{009-system-promt-ammend/outcomes/002-system-prompt-append.md → aaaaaj-system-promt-ammend/outcomes/02-system-prompt-append.md} +0 -0
  313. /package/RAF/{009-system-promt-ammend/outcomes/003-retry-context.md → aaaaaj-system-promt-ammend/outcomes/03-retry-context.md} +0 -0
  314. /package/RAF/{009-system-promt-ammend/plans/001-model-override.md → aaaaaj-system-promt-ammend/plans/01-model-override.md} +0 -0
  315. /package/RAF/{009-system-promt-ammend/plans/002-system-prompt-append.md → aaaaaj-system-promt-ammend/plans/02-system-prompt-append.md} +0 -0
  316. /package/RAF/{009-system-promt-ammend/plans/003-retry-context.md → aaaaaj-system-promt-ammend/plans/03-retry-context.md} +0 -0
  317. /package/RAF/{010-outcome-marker-fallback → aaaabk-outcome-marker-fallback}/decisions.md +0 -0
  318. /package/RAF/{010-outcome-marker-fallback → aaaabk-outcome-marker-fallback}/input.md +0 -0
  319. /package/RAF/{010-outcome-marker-fallback/outcomes/001-outcome-file-marker-fallback.md → aaaabk-outcome-marker-fallback/outcomes/01-outcome-file-marker-fallback.md} +0 -0
  320. /package/RAF/{010-outcome-marker-fallback/outcomes/002-creative-project-naming.md → aaaabk-outcome-marker-fallback/outcomes/02-creative-project-naming.md} +0 -0
  321. /package/RAF/{010-outcome-marker-fallback/plans/001-outcome-file-marker-fallback.md → aaaabk-outcome-marker-fallback/plans/01-outcome-file-marker-fallback.md} +0 -0
  322. /package/RAF/{010-outcome-marker-fallback/plans/002-creative-project-naming.md → aaaabk-outcome-marker-fallback/plans/02-creative-project-naming.md} +0 -0
  323. /package/RAF/{011-do-task-in-commit → aaaabl-do-task-in-commit}/decisions.md +0 -0
  324. /package/RAF/{011-do-task-in-commit → aaaabl-do-task-in-commit}/input.md +0 -0
  325. /package/RAF/{011-do-task-in-commit/outcomes/001-update-execution-prompt.md → aaaabl-do-task-in-commit/outcomes/01-update-execution-prompt.md} +0 -0
  326. /package/RAF/{011-do-task-in-commit/outcomes/002-update-tests.md → aaaabl-do-task-in-commit/outcomes/02-update-tests.md} +0 -0
  327. /package/RAF/{011-do-task-in-commit/outcomes/003-update-documentation.md → aaaabl-do-task-in-commit/outcomes/03-update-documentation.md} +0 -0
  328. /package/RAF/{011-do-task-in-commit/plans/001-update-execution-prompt.md → aaaabl-do-task-in-commit/plans/01-update-execution-prompt.md} +0 -0
  329. /package/RAF/{011-do-task-in-commit/plans/002-update-tests.md → aaaabl-do-task-in-commit/plans/02-update-tests.md} +0 -0
  330. /package/RAF/{011-do-task-in-commit/plans/003-update-documentation.md → aaaabl-do-task-in-commit/plans/03-update-documentation.md} +0 -0
  331. /package/RAF/{012-name-picker-buffet → aaaabm-name-picker-buffet}/decisions.md +0 -0
  332. /package/RAF/{012-name-picker-buffet → aaaabm-name-picker-buffet}/input.md +0 -0
  333. /package/RAF/{012-name-picker-buffet/outcomes/001-name-picker-for-raf-plan.md → aaaabm-name-picker-buffet/outcomes/01-name-picker-for-raf-plan.md} +0 -0
  334. /package/RAF/{012-name-picker-buffet/outcomes/002-interactive-project-picker-for-raf-do.md → aaaabm-name-picker-buffet/outcomes/02-interactive-project-picker-for-raf-do.md} +0 -0
  335. /package/RAF/{012-name-picker-buffet/outcomes/003-raf-status-truncation.md → aaaabm-name-picker-buffet/outcomes/03-raf-status-truncation.md} +0 -0
  336. /package/RAF/{012-name-picker-buffet/outcomes/004-failure-reason-details.md → aaaabm-name-picker-buffet/outcomes/04-failure-reason-details.md} +0 -0
  337. /package/RAF/{012-name-picker-buffet/outcomes/005-remove-raf-commits.md → aaaabm-name-picker-buffet/outcomes/05-remove-raf-commits.md} +0 -0
  338. /package/RAF/{012-name-picker-buffet/outcomes/006-update-execution-prompt-for-commits.md → aaaabm-name-picker-buffet/outcomes/06-update-execution-prompt-for-commits.md} +0 -0
  339. /package/RAF/{012-name-picker-buffet/outcomes/007-fix-plan-mode-user-prompt.md → aaaabm-name-picker-buffet/outcomes/07-fix-plan-mode-user-prompt.md} +0 -0
  340. /package/RAF/{012-name-picker-buffet/outcomes/008-add-auto-flag-for-plan-mode.md → aaaabm-name-picker-buffet/outcomes/08-add-auto-flag-for-plan-mode.md} +0 -0
  341. /package/RAF/{012-name-picker-buffet/plans/001-name-picker-for-raf-plan.md → aaaabm-name-picker-buffet/plans/01-name-picker-for-raf-plan.md} +0 -0
  342. /package/RAF/{012-name-picker-buffet/plans/002-interactive-project-picker-for-raf-do.md → aaaabm-name-picker-buffet/plans/02-interactive-project-picker-for-raf-do.md} +0 -0
  343. /package/RAF/{012-name-picker-buffet/plans/003-raf-status-truncation.md → aaaabm-name-picker-buffet/plans/03-raf-status-truncation.md} +0 -0
  344. /package/RAF/{012-name-picker-buffet/plans/004-failure-reason-details.md → aaaabm-name-picker-buffet/plans/04-failure-reason-details.md} +0 -0
  345. /package/RAF/{012-name-picker-buffet/plans/005-remove-raf-commits.md → aaaabm-name-picker-buffet/plans/05-remove-raf-commits.md} +0 -0
  346. /package/RAF/{012-name-picker-buffet/plans/006-update-execution-prompt-for-commits.md → aaaabm-name-picker-buffet/plans/06-update-execution-prompt-for-commits.md} +0 -0
  347. /package/RAF/{012-name-picker-buffet/plans/007-fix-plan-mode-user-prompt.md → aaaabm-name-picker-buffet/plans/07-fix-plan-mode-user-prompt.md} +0 -0
  348. /package/RAF/{012-name-picker-buffet/plans/008-add-auto-flag-for-plan-mode.md → aaaabm-name-picker-buffet/plans/08-add-auto-flag-for-plan-mode.md} +0 -0
  349. /package/RAF/{013-dependencies-watchdog → aaaabn-dependencies-watchdog}/decisions.md +0 -0
  350. /package/RAF/{013-dependencies-watchdog → aaaabn-dependencies-watchdog}/input.md +0 -0
  351. /package/RAF/{013-dependencies-watchdog/outcomes/001-define-dependency-syntax.md → aaaabn-dependencies-watchdog/outcomes/01-define-dependency-syntax.md} +0 -0
  352. /package/RAF/{013-dependencies-watchdog/outcomes/002-update-planning-prompts.md → aaaabn-dependencies-watchdog/outcomes/02-update-planning-prompts.md} +0 -0
  353. /package/RAF/{013-dependencies-watchdog/outcomes/003-parse-dependencies-update-state.md → aaaabn-dependencies-watchdog/outcomes/03-parse-dependencies-update-state.md} +0 -0
  354. /package/RAF/{013-dependencies-watchdog/outcomes/004-implement-dependency-checking-in-do.md → aaaabn-dependencies-watchdog/outcomes/04-implement-dependency-checking-in-do.md} +0 -0
  355. /package/RAF/{013-dependencies-watchdog/outcomes/005-update-execution-prompts.md → aaaabn-dependencies-watchdog/outcomes/05-update-execution-prompts.md} +0 -0
  356. /package/RAF/{013-dependencies-watchdog/outcomes/006-add-tests.md → aaaabn-dependencies-watchdog/outcomes/06-add-tests.md} +0 -0
  357. /package/RAF/{013-dependencies-watchdog/outcomes/007-add-act-alias.md → aaaabn-dependencies-watchdog/outcomes/07-add-act-alias.md} +0 -0
  358. /package/RAF/{013-dependencies-watchdog/outcomes/008-add-exit-message.md → aaaabn-dependencies-watchdog/outcomes/08-add-exit-message.md} +0 -0
  359. /package/RAF/{013-dependencies-watchdog/plans/001-define-dependency-syntax.md → aaaabn-dependencies-watchdog/plans/01-define-dependency-syntax.md} +0 -0
  360. /package/RAF/{013-dependencies-watchdog/plans/002-update-planning-prompts.md → aaaabn-dependencies-watchdog/plans/02-update-planning-prompts.md} +0 -0
  361. /package/RAF/{013-dependencies-watchdog/plans/003-parse-dependencies-update-state.md → aaaabn-dependencies-watchdog/plans/03-parse-dependencies-update-state.md} +0 -0
  362. /package/RAF/{013-dependencies-watchdog/plans/004-implement-dependency-checking-in-do.md → aaaabn-dependencies-watchdog/plans/04-implement-dependency-checking-in-do.md} +0 -0
  363. /package/RAF/{013-dependencies-watchdog/plans/005-update-execution-prompts.md → aaaabn-dependencies-watchdog/plans/05-update-execution-prompts.md} +0 -0
  364. /package/RAF/{013-dependencies-watchdog/plans/006-add-tests.md → aaaabn-dependencies-watchdog/plans/06-add-tests.md} +0 -0
  365. /package/RAF/{013-dependencies-watchdog/plans/007-add-act-alias.md → aaaabn-dependencies-watchdog/plans/07-add-act-alias.md} +0 -0
  366. /package/RAF/{013-dependencies-watchdog/plans/008-add-exit-message.md → aaaabn-dependencies-watchdog/plans/08-add-exit-message.md} +0 -0
  367. /package/RAF/{014-watchdog → aaaabo-watchdog}/decisions.md +0 -0
  368. /package/RAF/{014-watchdog → aaaabo-watchdog}/input.md +0 -0
  369. /package/RAF/{014-watchdog/outcomes/001-amend-flag-position.md → aaaabo-watchdog/outcomes/01-amend-flag-position.md} +0 -0
  370. /package/RAF/{014-watchdog/outcomes/002-details-only-on-failure.md → aaaabo-watchdog/outcomes/02-details-only-on-failure.md} +0 -0
  371. /package/RAF/{014-watchdog/plans/001-amend-flag-position.md → aaaabo-watchdog/plans/01-amend-flag-position.md} +0 -0
  372. /package/RAF/{014-watchdog/plans/002-details-only-on-failure.md → aaaabo-watchdog/plans/02-details-only-on-failure.md} +0 -0
  373. /package/RAF/{015-name-lottery → aaaabp-name-lottery}/decisions.md +0 -0
  374. /package/RAF/{015-name-lottery → aaaabp-name-lottery}/input.md +0 -0
  375. /package/RAF/{015-name-lottery/outcomes/001-auto-pick-project-name.md → aaaabp-name-lottery/outcomes/01-auto-pick-project-name.md} +0 -0
  376. /package/RAF/{015-name-lottery/outcomes/002-mention-plan-files-in-commit.md → aaaabp-name-lottery/outcomes/02-mention-plan-files-in-commit.md} +0 -0
  377. /package/RAF/{015-name-lottery/outcomes/003-fix-input-md-in-amend-flow.md → aaaabp-name-lottery/outcomes/03-fix-input-md-in-amend-flow.md} +0 -0
  378. /package/RAF/{015-name-lottery/plans/001-auto-pick-project-name.md → aaaabp-name-lottery/plans/01-auto-pick-project-name.md} +0 -0
  379. /package/RAF/{015-name-lottery/plans/002-mention-plan-files-in-commit.md → aaaabp-name-lottery/plans/02-mention-plan-files-in-commit.md} +0 -0
  380. /package/RAF/{015-name-lottery/plans/003-fix-input-md-in-amend-flow.md → aaaabp-name-lottery/plans/03-fix-input-md-in-amend-flow.md} +0 -0
  381. /package/RAF/{016-planning-scalpel → aaaabq-planning-scalpel}/decisions.md +0 -0
  382. /package/RAF/{016-planning-scalpel → aaaabq-planning-scalpel}/input.md +0 -0
  383. /package/RAF/{016-planning-scalpel/outcomes/001-update-git-commit-instructions.md → aaaabq-planning-scalpel/outcomes/01-update-git-commit-instructions.md} +0 -0
  384. /package/RAF/{016-planning-scalpel/plans/001-update-git-commit-instructions.md → aaaabq-planning-scalpel/plans/01-update-git-commit-instructions.md} +0 -0
  385. /package/RAF/{017-decision-vault → aaaabr-decision-vault}/decisions.md +0 -0
  386. /package/RAF/{017-decision-vault → aaaabr-decision-vault}/input.md +0 -0
  387. /package/RAF/{017-decision-vault/outcomes/001-create-git-commit-utility.md → aaaabr-decision-vault/outcomes/01-create-git-commit-utility.md} +0 -0
  388. /package/RAF/{017-decision-vault/outcomes/002-integrate-commit-into-plan.md → aaaabr-decision-vault/outcomes/02-integrate-commit-into-plan.md} +0 -0
  389. /package/RAF/{017-decision-vault/outcomes/003-add-tests-for-planning-commit.md → aaaabr-decision-vault/outcomes/03-add-tests-for-planning-commit.md} +0 -0
  390. /package/RAF/{017-decision-vault/plans/001-create-git-commit-utility.md → aaaabr-decision-vault/plans/01-create-git-commit-utility.md} +0 -0
  391. /package/RAF/{017-decision-vault/plans/002-integrate-commit-into-plan.md → aaaabr-decision-vault/plans/02-integrate-commit-into-plan.md} +0 -0
  392. /package/RAF/{017-decision-vault/plans/003-add-tests-for-planning-commit.md → aaaabr-decision-vault/plans/03-add-tests-for-planning-commit.md} +0 -0
  393. /package/RAF/{018-workflow-forge → aaaabs-workflow-forge}/decisions.md +0 -0
  394. /package/RAF/{018-workflow-forge → aaaabs-workflow-forge}/input.md +0 -0
  395. /package/RAF/{018-workflow-forge/outcomes/001-add-task-number-progress.md → aaaabs-workflow-forge/outcomes/01-add-task-number-progress.md} +0 -0
  396. /package/RAF/{018-workflow-forge/outcomes/002-update-plan-do-prompts.md → aaaabs-workflow-forge/outcomes/02-update-plan-do-prompts.md} +0 -0
  397. /package/RAF/{018-workflow-forge/plans/001-add-task-number-progress.md → aaaabs-workflow-forge/plans/01-add-task-number-progress.md} +0 -0
  398. /package/RAF/{018-workflow-forge/plans/002-update-plan-do-prompts.md → aaaabs-workflow-forge/plans/02-update-plan-do-prompts.md} +0 -0
@@ -0,0 +1,88 @@
1
+ # Project Decisions
2
+
3
+ ## How should the --worktree flag be persisted so `raf do` knows the project uses worktree mode?
4
+ By naming convention - if a worktree directory matching `<repo>-<project id>` exists in `../<repo>-worktrees/`, the project is in worktree mode. No config file needed; existence of the worktree directory is the signal.
5
+
6
+ ## What branch name format should be used for the worktree branch?
7
+ Full project folder name (e.g., `020-worktree-weaver`) - matches the project folder exactly.
8
+
9
+ ## Should planning also happen inside the worktree directory, or only execution?
10
+ Both plan and execute in worktree. Create worktree first, then run planning inside it. Plans, decisions, input all live in the worktree.
11
+
12
+ ## What should happen during auto-merge on project completion if there are merge conflicts?
13
+ ~~Fast-forward only, warn on conflict. Only auto-merge if fast-forward is possible. If not, print a warning and leave the branch for manual merge.~~ UPDATED: Merge is controlled by `--merge` flag. Try ff first, fall back to merge-commit. On conflicts, run `git merge --abort` and warn the user to merge manually.
14
+
15
+ ## Should the project folder structure inside the worktree mirror the same relative path?
16
+ Yes, same relative path. The worktree is a full repo clone. Project folder lives at the same `RAF/020-project-name/` path inside the worktree, so Claude works normally.
17
+
18
+ ## Should the worktree directory be cleaned up after a successful merge?
19
+ ~~Auto-cleanup after merge. Run `git worktree remove` and delete the worktree directory after successful merge.~~ UPDATED: No cleanup after merge. Worktrees persist indefinitely. No `raf cleanup` command needed.
20
+
21
+ ## For `raf do` without --worktree flag: should it auto-detect worktree mode?
22
+ Require `--worktree` flag explicitly. Since it allows RAF to `cd` into the worktree dir and find project plans there. Both `raf plan` and `raf do` need the flag.
23
+
24
+ ## When should the git worktree be created during `raf plan --worktree`?
25
+ ~~Require the project name upfront when `--worktree` flag is present.~~ UPDATED: Project name is NOT required upfront for `--worktree`. The normal name picker/auto-generation flow works. The editor uses a temp file (never touches the main tree), so the worktree is created AFTER the project name is known. Flow: editor (temp file) → name resolution → create worktree → create project folder inside worktree → save input.md inside worktree.
26
+
27
+ ## Should `raf do --worktree` validate the worktree exists before execution?
28
+ Yes, validate and fail with a helpful message. Check that: (1) the worktree directory exists, (2) the project folder and plan files exist inside the worktree. If not, error with guidance like "No worktree found. Did you plan with --worktree?"
29
+
30
+ ## Should `raf status` show worktree information?
31
+ No, keep status output simple. No worktree-specific display.
32
+
33
+ ## Should `raf do --worktree` support multiple projects?
34
+ No, `--worktree` only supports a single project at a time. Multi-project execution is not compatible with worktree mode.
35
+
36
+ ## How should the CLI syntax work for `raf plan --worktree`?
37
+ ~~Name is required when `--worktree` is used.~~ UPDATED: Name is optional, same as non-worktree mode. `raf plan --worktree` works without a name — the name picker/auto-generation runs as normal. `raf plan my-feature --worktree` also works (skips name picker). The `--auto` flag works the same (auto-selects first generated name).
38
+
39
+ ## Should planning artifacts be committed in worktree mode?
40
+ Yes, commit in the worktree branch. Same commit behavior as today, but the commit lands in the worktree's branch instead of the main branch.
41
+
42
+ ## Where should worktree directories be stored?
43
+ In `~/.raf/worktrees/<repo-basename>/<project-id>`, where `<repo-basename>` is the basename of the repo root directory (e.g., `myapp` from `/Users/me/projects/myapp`), and `<project-id>` is the full project folder name (e.g., `020-worktree-weaver`). This keeps worktrees outside the repo entirely — no `.gitignore` changes needed.
44
+
45
+ ## Should the parent `<repo>` directory under `~/.raf/worktrees/` be cleaned up when empty?
46
+ No. Leave `~/.raf/worktrees/<repo>/` in place. No separate cleanup command needed.
47
+
48
+ ## How should `raf plan --amend --worktree` resolve the project identifier?
49
+ Resolve from the worktree. Since plans only exist inside the worktree in worktree mode, project identifier resolution should look inside `~/.raf/worktrees/<repo-basename>/` to find the matching project. This is part of task 002 (worktree-plan-command).
50
+
51
+ ## When multiple uncompleted worktree projects are found (for `raf do --worktree` without project identifier), what should happen?
52
+ Show an interactive picker (like the existing non-worktree flow) to let the user choose one project.
53
+
54
+ ## Should `raf do --worktree` without a project identifier be a new task or modify existing task 003?
55
+ Modify task 003 directly to support optional project identifier with auto-discovery. Keeps related logic together.
56
+
57
+ ## What defines "latest completed project in main tree"?
58
+ The project with the highest ID where all tasks are completed (project status = 'completed').
59
+
60
+ ## Should auto-discovery include worktree projects with failed tasks?
61
+ Yes, include both pending and failed worktree projects in the picker - they're all "uncompleted".
62
+
63
+ ## If only one uncompleted worktree project is found, should it auto-select?
64
+ No, still show the picker/confirmation even for a single project, so the user can cancel.
65
+
66
+ ## Should auto-discovery utility functions be added to task 001 (worktree utilities)?
67
+ Yes, add a utility function like `listWorktreeProjects()` to task 001, and have task 003 call it. Keeps worktree scanning logic reusable.
68
+
69
+ ## What should the starting point for worktree scanning be?
70
+ Start from "highest completed project in main tree minus 3" instead of "after the latest completed". This accounts for amended projects — e.g., if the highest completed main-tree project is 008, scan worktrees starting from 006 (006, 007, 008, 009, 010, ...). This catches worktrees for projects that were amended after completion and now have new uncompleted tasks.
71
+
72
+ ## Should worktrees be cleaned up after task completion or merge?
73
+ No. No cleanup, no deletion of worktree, no prune after task completion. No `raf cleanup` command is needed. Worktrees stay in place indefinitely.
74
+
75
+ ## How should merging work after project completion in worktree mode?
76
+ Merge is controlled by a `--merge` flag on `raf do`. When `--merge` is present, attempt merge after all tasks complete. Allow merge-commits (not ff-only). On merge conflicts, notify the user. Without `--merge`, no merge happens.
77
+
78
+ ## Should failed planning still clean up the worktree?
79
+ Yes. If planning fails or is interrupted and no plans were created, clean up the worktree that was just created. This is different from post-completion cleanup — it's cleaning up a half-created state.
80
+
81
+ ## Should the worktree removal utility remain in task 001?
82
+ Yes. It's still needed for the failed-plan cleanup in task 002. Just remove post-completion cleanup references from task 004.
83
+
84
+ ## Should `--merge` only work with `--worktree`?
85
+ Yes. `--merge` is only valid when `--worktree` is also present. Error if used without `--worktree`.
86
+
87
+ ## What should happen on merge conflicts?
88
+ Abort the merge (`git merge --abort`) to leave the repo in a clean state, then tell the user to merge manually.
@@ -0,0 +1,27 @@
1
+ add support for git worktree if you pass --worktree flag to "do" or "plan". plan should be created
2
+ with --worktree for raf do to work in worktree mode. --worktree means worktree folder will be
3
+ created with git. use path "../<current folder name>-worktrees/<current folder name>-<project id
4
+ like 001>". based on thether worktree dir exists in git we can validate if "raf do" can work in
5
+ worktree mode. in worktree mode raf switches to worktree dir (in created branch with project name) and plans, commits and do work there.
6
+ on project completion if it's possible to merge <project name> branch into original branch from with
7
+ raf was called - it does so
8
+
9
+ ---
10
+
11
+ use .raf/worktrees/<repo> as a place for raf worktrees
12
+
13
+ ---
14
+
15
+ make it possible to not specify project name in "raf do --worktree" command, for that raf will go to
16
+ worktrees repo and list uncompleted projects AFTER latest completed project in main tree
17
+
18
+ ---
19
+
20
+ task 004 mentiones this:
21
+
22
+ When `raf do <project> --worktree` finishes with all tasks completed, the project branch should be merged back into the branch from which `raf` was originally called. This is the final step in the worktree lifecycle: plan in worktree -> execute in worktree -> merge back -> remove worktree. The parent directory (`~/.raf/worktrees/<repo>/`) is NOT cleaned up here — that is handled by `raf cleanup`.
23
+
24
+ ---
25
+ let's clarify cleanup situation (and remove mentionse about clean up from project plans)
26
+ the situation is this: no cleanup, no delition of worktree, prune etc after task completion. AND no
27
+ raf cleanup command need to be implemeted. look through all the plans and update
@@ -0,0 +1,41 @@
1
+ # Outcome: Git Worktree Utility Functions
2
+
3
+ ## Summary
4
+ Created `src/core/worktree.ts` module with all git worktree utility functions needed as the foundation for worktree support in RAF.
5
+
6
+ ## Changes Made
7
+
8
+ ### New Files
9
+ - **`src/core/worktree.ts`** - Core worktree utility module with 11 exported functions:
10
+ - `getRepoRoot()` - Get the git toplevel directory
11
+ - `getRepoBasename()` - Get the basename of the repo root (e.g., "myapp")
12
+ - `getCurrentBranch()` - Get the current branch name
13
+ - `computeWorktreePath(repoBasename, projectId)` - Compute `~/.raf/worktrees/<repo>/<project>` path
14
+ - `computeWorktreeBaseDir(repoBasename)` - Compute `~/.raf/worktrees/<repo>/` path
15
+ - `getWorktreeProjectPath(worktreePath, projectRelativePath)` - Compute project path inside worktree
16
+ - `createWorktree(repoBasename, projectId)` - Create worktree with auto-created parent dir and new branch
17
+ - `validateWorktree(worktreePath, projectRelativePath)` - Validate worktree existence, git status, project content
18
+ - `mergeWorktreeBranch(branch, originalBranch)` - Merge with ff-first, fallback to merge-commit, abort on conflicts
19
+ - `removeWorktree(worktreePath)` - Remove a single worktree (for failed-plan cleanup)
20
+ - `listWorktreeProjects(repoBasename)` - List all worktree project directories for a repo
21
+
22
+ - **`tests/unit/worktree.test.ts`** - 30 unit tests covering all functions, error paths, and edge cases
23
+
24
+ ### Interfaces Exported
25
+ - `WorktreeCreateResult` - Result of worktree creation
26
+ - `WorktreeMergeResult` - Result of branch merge (includes fastForward flag)
27
+ - `WorktreeValidation` - Validation result with exists/isValidWorktree/hasProjectFolder/hasPlans/projectPath
28
+
29
+ ## Acceptance Criteria Verification
30
+ - [x] Worktree path computation returns `~/.raf/worktrees/<repo-basename>/<project-id>`
31
+ - [x] Parent directory `~/.raf/worktrees/<repo-basename>/` is created automatically
32
+ - [x] Worktree creation creates the directory and branch with correct names
33
+ - [x] Validation correctly identifies existing vs missing worktrees and checks for project content
34
+ - [x] Merge function tries fast-forward first, falls back to merge-commit, aborts on conflicts
35
+ - [x] Removal function removes a single worktree (for failed-plan cleanup only)
36
+ - [x] Listing function returns all worktree project directories for the current repo
37
+ - [x] Listing function returns empty array when no worktrees exist
38
+ - [x] All functions handle non-git-repo scenario gracefully
39
+ - [x] All functions handle errors and return meaningful messages
40
+
41
+ <promise>COMPLETE</promise>
@@ -0,0 +1,44 @@
1
+ # Outcome: Add --worktree Flag to Plan Command
2
+
3
+ ## Summary
4
+ Added `--worktree` (`-w`) flag to `raf plan` that creates a git worktree for isolated planning. Supports both new project creation and amendment of existing worktree projects.
5
+
6
+ ## Changes Made
7
+
8
+ ### Modified Files
9
+ - **`src/commands/plan.ts`** - Added `--worktree` flag to the plan command with full support in both new project and amend flows:
10
+ - Added `-w, --worktree` option to Commander command definition
11
+ - Updated `PlanCommandOptions` interface with `worktree?: boolean`
12
+ - `runPlanCommand`: When `--worktree` is set, creates a worktree AFTER name resolution, creates project folder inside worktree at the correct relative path, saves input.md only in the worktree, runs Claude with `cwd` set to the worktree root, commits artifacts in the worktree branch, and shows success message with worktree path and `--worktree` suggestion for `raf do`
13
+ - `runAmendCommand`: When `--worktree` is set, resolves project from `~/.raf/worktrees/<repo>/` instead of main repo, validates worktree exists and is valid, runs amend flow with paths pointing into the worktree, commits amendment artifacts in the worktree branch
14
+ - Cleanup: failed planning with no plan files cleans up the worktree (new project only), amend does not create or clean up worktrees
15
+ - Added imports for worktree utilities, path utilities, and validation
16
+
17
+ - **`src/core/git.ts`** - Updated `commitPlanningArtifacts` to accept optional `{ cwd }` parameter so git commands can run from the worktree directory instead of the main repo
18
+
19
+ ## Acceptance Criteria Verification
20
+ - [x] `raf plan --worktree` without project name works (name picker/auto-generation runs)
21
+ - [x] `raf plan my-feature --worktree` works with explicit name (skips name picker)
22
+ - [x] `raf plan --worktree --auto` works (auto-selects generated name)
23
+ - [x] Worktree is created AFTER name is resolved, not before
24
+ - [x] input.md is only saved inside the worktree, never in the main tree
25
+ - [x] Project folder is created at correct relative path inside worktree
26
+ - [x] Planning session runs with cwd set to worktree root
27
+ - [x] Planning artifacts are committed in the worktree branch
28
+ - [x] Success message mentions the worktree path and suggests `--worktree` flag for `raf do`
29
+ - [x] Without `--worktree`, behavior is unchanged
30
+ - [x] Failed planning cleans up the worktree (new project only)
31
+ - [x] Compatible with `--auto` and `--model` flags
32
+ - [x] `raf plan --amend <project> --worktree` resolves project from worktree directory
33
+ - [x] `raf plan --amend <project> --worktree` with no worktree shows helpful error
34
+ - [x] Amend flow reads existing plans/state from inside the worktree
35
+ - [x] New plan files from amend are committed in the worktree branch
36
+ - [x] Amend does NOT attempt to create or clean up the worktree
37
+
38
+ ## Test Results
39
+ - Build: passes cleanly (no TypeScript errors)
40
+ - All 835 tests pass (834 pass, 1 pre-existing failure in planning-prompt.test.ts unrelated to this change)
41
+ - All 64 plan command tests pass
42
+ - All 8 commit-planning-artifacts tests pass
43
+
44
+ <promise>COMPLETE</promise>
@@ -0,0 +1,58 @@
1
+ # Outcome: Add --worktree Flag to Do Command
2
+
3
+ ## Summary
4
+ Added `--worktree` (`-w`) flag to `raf do` that validates worktree existence and executes all tasks inside the worktree directory. Supports both explicit project identifier and auto-discovery of uncompleted worktree projects when no identifier is given.
5
+
6
+ ## Changes Made
7
+
8
+ ### Modified Files
9
+ - **`src/commands/do.ts`** - Added `--worktree` flag with full worktree support:
10
+ - Added `-w, --worktree` option to Commander command definition
11
+ - When `--worktree` with no identifier: auto-discovery flow via `discoverAndPickWorktreeProject()`:
12
+ - Lists worktree projects using `listWorktreeProjects()`
13
+ - Finds highest-numbered completed project in main tree
14
+ - Filters worktrees by threshold (highest completed - 3)
15
+ - Derives state for remaining worktrees, keeps uncompleted ones
16
+ - Shows interactive picker (even for single project)
17
+ - Shows appropriate messages for no projects / all completed
18
+ - When `--worktree` with explicit identifier:
19
+ - Validates single project only (errors if multiple)
20
+ - Resolves project from main repo or searches worktrees directly
21
+ - Validates worktree existence, git worktree status, project content, and plans
22
+ - Shows helpful error messages on validation failure
23
+ - When `--worktree` with identifier: validates worktree, resolves project path inside it
24
+ - Passes `worktreeCwd` to `executeSingleProject` which flows to `ClaudeRunner.run()`/`runVerbose()`
25
+ - Git operations (commit verification, stash) use worktree cwd
26
+ - Added imports for worktree utilities, path utilities, inquirer select, and discoverProjects
27
+
28
+ - **`src/core/git.ts`** - Added optional `cwd` parameter to git utility functions:
29
+ - `isGitRepo(cwd?)` - accepts optional cwd for worktree context
30
+ - `hasUncommittedChanges(cwd?)` - accepts optional cwd
31
+ - `getHeadCommitHash(cwd?)` - accepts optional cwd
32
+ - `stashChanges(name, cwd?)` - accepts optional cwd, propagates to internal calls
33
+
34
+ - **`src/types/config.ts`** - Added `worktree?: boolean` to `DoCommandOptions` interface
35
+
36
+ ## Acceptance Criteria Verification
37
+ - [x] `raf do --worktree` without project identifier triggers auto-discovery flow
38
+ - [x] Auto-discovery lists worktree projects, finds latest completed main-tree project, filters correctly
39
+ - [x] Auto-discovery shows picker even when only one uncompleted project is found
40
+ - [x] Auto-discovery shows "No worktree projects found" when none exist
41
+ - [x] Auto-discovery shows "All worktree projects are completed" when all are done
42
+ - [x] `raf do proj1 proj2 --worktree` shows error about single project only
43
+ - [x] `raf do my-feature --worktree` with no worktree shows helpful error
44
+ - [x] `raf do my-feature --worktree` with valid worktree executes tasks in worktree
45
+ - [x] Claude runs with cwd set to worktree root
46
+ - [x] State derivation reads from worktree project path
47
+ - [x] Outcome files are written to worktree project path
48
+ - [x] Git commits land in the worktree branch
49
+ - [x] Compatible with `--verbose`, `--timeout`, `--force`, `--debug`, `--model`
50
+ - [x] Without `--worktree`, behavior is unchanged
51
+
52
+ ## Test Results
53
+ - Build: passes cleanly (no TypeScript errors)
54
+ - All 835 tests pass (834 pass, 1 pre-existing failure in planning-prompt.test.ts unrelated to this change)
55
+ - All 67 do command tests pass (do-command, do-multiproject, do-rerun, do-blocked-tasks)
56
+ - All 29 git tests pass (git, git-stash, git-commit-helpers)
57
+
58
+ <promise>COMPLETE</promise>
@@ -0,0 +1,40 @@
1
+ # Outcome: Auto-merge on Project Completion
2
+
3
+ ## Summary
4
+ Added `--merge` flag to `raf do` that automatically merges the worktree branch back into the original branch after all tasks complete successfully. The merge uses fast-forward first, falls back to merge-commit, and aborts on conflicts with helpful manual merge instructions.
5
+
6
+ ## Changes Made
7
+
8
+ ### Modified Files
9
+ - **`src/commands/do.ts`** - Added `--merge` flag with full merge-on-completion support:
10
+ - Added `--merge` option to Commander command definition
11
+ - Added validation that `--merge` requires `--worktree` (errors otherwise)
12
+ - Records the original branch name (`getCurrentBranch()`) at the start of worktree execution, before any worktree operations
13
+ - After task execution loop completes, checks if `--merge` is set:
14
+ - If all results succeeded: attempts merge via `mergeWorktreeBranch()` from the original repo directory
15
+ - On successful merge: logs success message with merge type (fast-forward or merge commit)
16
+ - On merge conflict: `mergeWorktreeBranch` aborts the merge, logs warning with branch name and manual merge instructions
17
+ - If project has failures: skips merge entirely, logs message about worktree branch being available for inspection
18
+ - Worktree is NOT removed or cleaned up after merge
19
+ - Added imports for `getCurrentBranch` and `mergeWorktreeBranch` from worktree module
20
+
21
+ - **`src/types/config.ts`** - Added `merge?: boolean` to `DoCommandOptions` interface
22
+
23
+ ## Acceptance Criteria Verification
24
+ - [x] `--merge` flag is added to the do command
25
+ - [x] `--merge` without `--worktree` shows an error
26
+ - [x] On full project completion with `--merge`, merge is attempted
27
+ - [x] Successful merge logs a clear success message
28
+ - [x] Merge conflicts trigger `git merge --abort` and show warning with branch name and manual merge instructions
29
+ - [x] Incomplete projects (failures) skip merge and mention the branch
30
+ - [x] Original branch is correctly recorded and restored
31
+ - [x] Worktree is NOT removed or cleaned up after merge
32
+ - [x] Without `--merge`, no merge is attempted even if project completes
33
+
34
+ ## Test Results
35
+ - Build: passes cleanly (no TypeScript errors)
36
+ - All 835 tests pass (834 pass, 1 pre-existing failure in planning-prompt.test.ts unrelated to this change)
37
+ - All 50 do-command and worktree tests pass
38
+ - All 30 worktree utility tests pass
39
+
40
+ <promise>COMPLETE</promise>
@@ -0,0 +1,43 @@
1
+ # Outcome: Add Tests for Worktree Functionality
2
+
3
+ ## Summary
4
+ Added comprehensive tests covering worktree utilities and CLI validation for `--worktree` and `--merge` flags. Tests include both unit tests with mocked dependencies and integration tests using real temporary git repos.
5
+
6
+ ## Changes Made
7
+
8
+ ### Modified Files
9
+ - **`tests/unit/worktree.test.ts`** - Added 6 new unit tests for path computation with various repo/project names:
10
+ - `computeWorktreePath`: repo names with dots, underscores, hyphens; base36 project IDs
11
+ - `computeWorktreeBaseDir`: repo names with special characters
12
+ - `getWorktreeProjectPath`: nested relative paths
13
+
14
+ ### New Files
15
+ - **`tests/unit/worktree-integration.test.ts`** - 22 integration tests in two sections:
16
+
17
+ **Real git repo tests** (12 tests):
18
+ - `createWorktree`: worktree creation with real git, branch conflict detection
19
+ - `validateWorktree`: valid worktree with project/plans, nonexistent path, non-worktree directory, missing project folder
20
+ - `mergeWorktreeBranch`: fast-forward merge, merge-commit fallback on divergence, conflict detection with abort, checkout failure
21
+ - `removeWorktree`: successful removal for failed-plan cleanup, nonexistent worktree failure
22
+
23
+ **CLI validation tests** (10 tests):
24
+ - `--merge requires --worktree`: validates the constraint, allows valid combos
25
+ - `--worktree supports only single project`: rejects multiple projects, allows single/none
26
+ - `--worktree validation for missing worktree`: missing path, non-worktree dir, missing content, valid worktree
27
+
28
+ ## Test Results
29
+ - All 58 worktree tests pass (36 unit + 22 integration)
30
+ - All 862 project tests pass (1 pre-existing failure in planning-prompt.test.ts unrelated to this change)
31
+ - Temp directories and worktrees are properly cleaned up after each test
32
+
33
+ ## Acceptance Criteria Verification
34
+ - [x] All worktree utility functions have unit tests
35
+ - [x] Path computation tested with various repo and project names
36
+ - [x] Worktree creation tested with real temporary git repo
37
+ - [x] Merge tested for ff success, merge-commit fallback, and conflict/abort
38
+ - [x] Removal tested for failed-plan cleanup scenario
39
+ - [x] CLI validation tests for error cases (--merge without --worktree, etc.)
40
+ - [x] All tests pass with `npm test`
41
+ - [x] Tests clean up temporary files/directories
42
+
43
+ <promise>COMPLETE</promise>
@@ -0,0 +1,33 @@
1
+ # Outcome: Update Documentation for Worktree Support
2
+
3
+ ## Summary
4
+ Updated both README.md (user-facing) and CLAUDE.md (internal developer docs) with comprehensive documentation for the `--worktree` and `--merge` flags.
5
+
6
+ ## Changes Made
7
+
8
+ ### Modified Files
9
+ - **`README.md`** - Added worktree documentation in four places:
10
+ - **Features section**: Added "Worktree Mode" bullet describing isolated branch execution
11
+ - **Commands section**: Added `raf plan --worktree` and `raf do --worktree --merge` examples to both plan and do command blocks
12
+ - **Worktree Mode section** (new, after Project Structure): Explains the workflow, worktree path convention, merge behavior, conflict handling, persistence, and single-project limitation
13
+ - **Command Reference tables**: Added `-w, --worktree` row to plan table; added `-w, --worktree` and `--merge` rows to do table
14
+
15
+ - **`CLAUDE.md`** - Added "Worktree Mode" subsection under "Architectural Decisions" covering:
16
+ - Worktree path convention (`~/.raf/worktrees/<repo-basename>/<project-id>`)
17
+ - Branch naming (matches project folder name)
18
+ - Flag requirement (explicit `--worktree` on both plan and do)
19
+ - Full lifecycle: create -> plan -> execute -> merge
20
+ - Merge strategy details
21
+ - Cleanup behavior (no auto-cleanup except on plan failure)
22
+ - Constraints (`--worktree` single project only, `--merge` requires `--worktree`)
23
+ - Core module reference (`src/core/worktree.ts`)
24
+
25
+ ## Acceptance Criteria Verification
26
+ - [x] README.md has `--worktree` and `--merge` in Features, Commands, and Command Reference
27
+ - [x] README.md has a "Worktree Mode" section with workflow explanation
28
+ - [x] CLAUDE.md has a "Worktree Mode" architectural decision section
29
+ - [x] Documentation mentions that worktrees persist (no auto-cleanup)
30
+ - [x] Documentation matches the implemented behavior (verified against source code)
31
+ - [x] No existing documentation is broken or contradicted
32
+
33
+ <promise>COMPLETE</promise>
@@ -0,0 +1,51 @@
1
+ # Task: Git Worktree Utility Functions
2
+
3
+ ## Objective
4
+ Create a new module with git worktree utility functions that handle path computation, worktree creation, validation, merge, and removal.
5
+
6
+ ## Context
7
+ This is the foundation task for worktree support. All other worktree tasks depend on these utilities. The module follows the pattern of the existing `src/core/git.ts` module - standalone functions using `execSync` for git operations.
8
+
9
+ ## Requirements
10
+ - Compute worktree path: `~/.raf/worktrees/<repo-basename>/<project-id>` where `<repo-basename>` is the basename of `process.cwd()` (the repo root, e.g., `myapp`) and `<project-id>` is the full project folder name (e.g., `020-worktree-weaver`)
11
+ - Create the `~/.raf/worktrees/<repo-basename>/` directory automatically if it doesn't exist
12
+ - Create a git worktree at the computed path with a new branch named after the full project folder (e.g., `020-worktree-weaver`)
13
+ - Validate that a worktree directory exists and is a valid git worktree (check `git worktree list`)
14
+ - Validate that the project folder and plan files exist inside the worktree
15
+ - Compute the project path inside the worktree (same relative path from repo root as in the main repo)
16
+ - Merge: merge the worktree branch into the original branch. Attempt fast-forward first; if not possible, allow a merge-commit. On merge conflicts, run `git merge --abort` and return failure with a message for the user to merge manually
17
+ - Remove a worktree: run `git worktree remove` to remove a single worktree directory (used only for failed-plan cleanup, NOT for post-completion cleanup)
18
+ - Get current branch name (for recording which branch the worktree was created from)
19
+ - List all worktree project directories for a given repo: scan `~/.raf/worktrees/<repo-basename>/` and return the list of project folder names (e.g., `['020-worktree-weaver', '021-another-feature']`). Return an empty array if the directory doesn't exist or is empty
20
+ - All functions should handle errors gracefully and return meaningful error messages
21
+ - Follow the same patterns as `src/core/git.ts` - use `execSync` with `stdio: 'pipe'`, wrap in try/catch
22
+
23
+ ## Implementation Steps
24
+ 1. Create `src/core/worktree.ts` module
25
+ 2. Implement path computation function that derives `~/.raf/worktrees/<repo-basename>/<project-id>` using `os.homedir()`, the basename of the git toplevel, and the project folder name
26
+ 3. Implement worktree creation function that ensures the parent directory exists and runs `git worktree add <path> -b <branch-name>`
27
+ 4. Implement validation function that checks worktree existence in `git worktree list` output AND checks for project folder + plans inside
28
+ 5. Implement merge function that: switches to the original branch, runs `git merge --ff-only <project-branch>`, if ff fails tries `git merge <project-branch>`, if conflicts arise runs `git merge --abort` and returns failure with manual-merge instructions
29
+ 6. Implement removal function that runs `git worktree remove <path>` for a single worktree (used only for failed-plan cleanup)
30
+ 7. Implement helper to get the repo root directory name (basename of git toplevel)
31
+ 8. Implement function to list all worktree project directories under `~/.raf/worktrees/<repo-basename>/` - read the directory, filter to valid project folder names, return sorted list
32
+ 9. Export all functions as named exports
33
+
34
+ ## Acceptance Criteria
35
+ - [ ] Worktree path computation returns `~/.raf/worktrees/<repo-basename>/<project-id>`
36
+ - [ ] Parent directory `~/.raf/worktrees/<repo-basename>/` is created automatically
37
+ - [ ] Worktree creation creates the directory and branch with correct names
38
+ - [ ] Validation correctly identifies existing vs missing worktrees and checks for project content
39
+ - [ ] Merge function tries fast-forward first, falls back to merge-commit, aborts on conflicts
40
+ - [ ] Removal function removes a single worktree (for failed-plan cleanup only)
41
+ - [ ] Listing function returns all worktree project directories for the current repo
42
+ - [ ] Listing function returns empty array when no worktrees exist
43
+ - [ ] All functions handle non-git-repo scenario gracefully
44
+ - [ ] All functions handle errors and return meaningful messages
45
+
46
+ ## Notes
47
+ - The worktree path is now under the user's home directory (`~/.raf/worktrees/`), not relative to the repo. For example, if the repo is at `/Users/me/projects/myapp`, the worktree would be at `~/.raf/worktrees/myapp/020-worktree-weaver`
48
+ - The merge function needs to be called from the ORIGINAL repo (not the worktree) because it needs to switch to the original branch
49
+ - The branch name is the full project folder name (e.g., `020-worktree-weaver`), not just the project name
50
+ - Use `os.homedir()` to resolve `~` to the actual home directory path
51
+ - The removal function is only used for cleaning up failed/cancelled planning — NOT for post-completion cleanup. Worktrees persist after task completion and merge
@@ -0,0 +1,93 @@
1
+ # Task: Add --worktree Flag to Plan Command
2
+
3
+ ## Objective
4
+ Add `--worktree` flag to `raf plan` that creates a git worktree and runs the entire planning session inside it, including support for `--amend` to add tasks to existing worktree projects.
5
+
6
+ ## Context
7
+ When a user runs `raf plan --worktree` (with or without a project name), RAF should create a git worktree under `~/.raf/worktrees/<repo-basename>/`, then create the project folder inside the worktree and run the interactive planning session there. The project name is optional — the normal name picker/auto-generation works since the editor uses a temp file and the worktree is only created after the name is known. When combined with `--amend`, RAF should find the existing worktree, switch into it, and run the amendment flow there.
8
+
9
+ ## Dependencies
10
+ 001
11
+
12
+ ## Requirements
13
+
14
+ ### New project flow (`raf plan [name] --worktree`)
15
+ - Add `--worktree` boolean flag to the plan command in Commander.js (both in `src/commands/plan.ts` and `src/index.ts` if needed)
16
+ - Project name is OPTIONAL with `--worktree` — same behavior as non-worktree mode:
17
+ - If name is provided: use it directly (skip name picker)
18
+ - If name is NOT provided: generate suggestions from input content, then picker or auto-select (same as today)
19
+ - The worktree is created AFTER the project name is determined (not before), because the worktree path includes the project ID
20
+ - Flow with `--worktree`:
21
+ 1. Validate environment
22
+ 2. Open editor for input (writes to temp file — nothing touches the main tree)
23
+ 3. Resolve project name: use provided name, or generate/pick from input content (same as today)
24
+ 4. Compute project number from the main repo's RAF directory (to get the sequential ID)
25
+ 5. Create git worktree at `~/.raf/worktrees/<repo-basename>/<project-id>` using utilities from task 001
26
+ 6. Create the project folder structure inside the worktree (at the same relative path as it would be in the main repo)
27
+ 7. Save input.md inside the worktree project folder (never in the main tree)
28
+ 8. Run interactive Claude planning session with `cwd` set to the worktree directory
29
+ 9. Commit planning artifacts (input.md, decisions.md, plan files) inside the worktree branch
30
+ 10. Show success message including the worktree path and branch name
31
+ - When `--worktree` is NOT used, behavior is exactly the same as today (no changes)
32
+ - The `--worktree` flag should be compatible with `--auto` and `--model` flags
33
+ - If worktree creation fails, error out with a clear message
34
+ - Cleanup: if planning fails or is interrupted and no plans were created, clean up the worktree
35
+
36
+ ### Amend flow (`raf plan --amend <project> --worktree`)
37
+ - When `--amend` and `--worktree` are both used, the project identifier must be resolved from the worktree directory (`~/.raf/worktrees/<repo-basename>/`), NOT from the main repo — because plans only exist inside the worktree
38
+ - The worktree must already exist (it was created during initial `raf plan --worktree`) — error if not found
39
+ - Flow with `--amend --worktree`:
40
+ 1. Resolve project identifier against the worktree's project directories
41
+ 2. Validate the worktree exists and contains the project with existing plans
42
+ 3. Switch working context to the worktree directory
43
+ 4. Run the standard amend flow (derive project state, show existing tasks, open editor, run Claude amendment interview) with all paths pointing into the worktree
44
+ 5. Commit amendment artifacts (updated input.md, decisions.md, new plan files) in the worktree branch
45
+ - The project state derivation (`deriveProjectState`) should read from the worktree project path
46
+ - The amend system prompt should receive task information from the worktree project
47
+ - No worktree creation or cleanup needed for amend — the worktree already exists
48
+
49
+ ## Implementation Steps
50
+ 1. Add `--worktree` option to the Commander command definition in `src/commands/plan.ts`
51
+ 2. Update `PlanCommandOptions` interface to include `worktree?: boolean`
52
+ 3. **New project path**: When `--worktree` is set (without `--amend`):
53
+ - Run editor (temp file) and name resolution exactly as today
54
+ - After name is finalized, compute project number from main repo
55
+ - Create worktree, then create project folder inside worktree
56
+ - Save input.md inside worktree project folder
57
+ - Run planning with cwd set to worktree root
58
+ 4. **Amend path**: When `--worktree` and `--amend` are both set:
59
+ - Resolve project identifier from `~/.raf/worktrees/<repo-basename>/` instead of main repo
60
+ - Validate the worktree exists
61
+ - Set all paths to worktree project path and run standard amend flow
62
+ 5. For both paths, set the working directory for Claude's interactive session to the worktree root
63
+ 6. After planning/amending, commit artifacts in the worktree branch
64
+ 7. Add cleanup logic for worktree on failure/interruption for new projects (not for amend — worktree already existed)
65
+ 8. Update the success message to mention worktree path and suggest `raf do <name> --worktree`
66
+
67
+ ## Acceptance Criteria
68
+ - [ ] `raf plan --worktree` without project name works (name picker/auto-generation runs)
69
+ - [ ] `raf plan my-feature --worktree` works with explicit name (skips name picker)
70
+ - [ ] `raf plan --worktree --auto` works (auto-selects generated name)
71
+ - [ ] Worktree is created AFTER name is resolved, not before
72
+ - [ ] input.md is only saved inside the worktree, never in the main tree
73
+ - [ ] Project folder is created at correct relative path inside worktree
74
+ - [ ] Planning session runs with cwd set to worktree root
75
+ - [ ] Planning artifacts are committed in the worktree branch
76
+ - [ ] Success message mentions the worktree path and suggests `--worktree` flag for `raf do`
77
+ - [ ] Without `--worktree`, behavior is unchanged
78
+ - [ ] Failed planning cleans up the worktree (new project only)
79
+ - [ ] Compatible with `--auto` and `--model` flags
80
+ - [ ] `raf plan --amend <project> --worktree` resolves project from worktree directory
81
+ - [ ] `raf plan --amend <project> --worktree` with no worktree shows helpful error
82
+ - [ ] Amend flow reads existing plans/state from inside the worktree
83
+ - [ ] New plan files from amend are committed in the worktree branch
84
+ - [ ] Amend does NOT attempt to create or clean up the worktree
85
+
86
+ ## Notes
87
+ - The project folder path inside the worktree should be identical to what it would be in the main repo (e.g., `<worktree>/RAF/020-my-feature/plans/`)
88
+ - The interactive Claude session needs to run with its working directory set to the worktree root so Claude sees the correct file paths
89
+ - The `commitPlanningArtifacts` function from `src/core/git.ts` should work inside the worktree since git operations are branch-aware
90
+ - For amend, `resolveProjectIdentifierWithDetails()` from `src/utils/paths.ts` likely needs a way to point at the worktree's RAF directory instead of the main repo's. This could be an optional parameter or a wrapper that computes the worktree RAF path
91
+ - The project number still comes from the main repo's RAF directory (to maintain sequential numbering), but the project folder itself only exists in the worktree
92
+ - The editor already uses a temp file (`os.tmpdir()`), so nothing touches the main tree before the worktree is created
93
+ - Reference existing plan command at `src/commands/plan.ts` for the current flow
@@ -0,0 +1,81 @@
1
+ # Task: Add --worktree Flag to Do Command
2
+
3
+ ## Objective
4
+ Add `--worktree` flag to `raf do` that validates the worktree exists and executes all tasks inside the worktree directory, with optional auto-discovery of worktree projects when no project identifier is given.
5
+
6
+ ## Context
7
+ After planning with `--worktree`, the user runs `raf do <project> --worktree` to execute tasks. RAF needs to validate the worktree exists at `~/.raf/worktrees/<repo-basename>/<project-id>`, find the project inside it, and run all Claude execution sessions with cwd set to the worktree root.
8
+
9
+ Additionally, `raf do --worktree` (without a project identifier) should auto-discover uncompleted worktree projects by scanning the worktrees directory and filtering to projects that come after the latest completed project in the main tree.
10
+
11
+ ## Dependencies
12
+ 001
13
+
14
+ ## Requirements
15
+ - Add `--worktree` boolean flag to the do command in Commander.js
16
+ - When `--worktree` is used with a project identifier, only a SINGLE project is supported - error if multiple projects are specified
17
+ - When `--worktree` is used WITHOUT a project identifier, perform auto-discovery:
18
+ 1. Use the listing utility from task 001 to get all worktree project directories for this repo
19
+ 2. If no worktree projects exist, show error: "No worktree projects found. Did you plan with --worktree?"
20
+ 3. Find the highest-numbered completed project in the MAIN tree (using `deriveProjectState`)
21
+ 4. Filter worktree projects to those with a project number >= (highest completed - 3). For example, if the highest completed main-tree project is 008, include worktree projects 006 and above. This accounts for amended projects that may have new uncompleted tasks added via `--amend`
22
+ 5. For each remaining worktree project, derive its state and keep only uncompleted ones (pending, failed, or in-progress — anything that is NOT fully completed)
23
+ 6. If no uncompleted worktree projects remain after filtering, show message: "All worktree projects are completed"
24
+ 7. Show an interactive picker with the uncompleted worktree projects (even if there's only one), allowing the user to cancel with Ctrl+C
25
+ 8. Execute the selected project
26
+ - When `--worktree` is used with an explicit project identifier, validate:
27
+ 1. The worktree directory exists at `~/.raf/worktrees/<repo-basename>/<project-id>`
28
+ 2. The worktree is a valid git worktree (listed in `git worktree list`)
29
+ 3. The project folder exists inside the worktree with plan files
30
+ 4. If any validation fails, show a helpful error message (e.g., "No worktree found for project X. Did you plan with --worktree?")
31
+ - Execution flow with `--worktree` (after project is selected/resolved):
32
+ 1. Resolve project identifier to get project folder name
33
+ 2. Compute worktree path using utilities from task 001
34
+ 3. Validate worktree and project content
35
+ 4. Derive project state from the worktree project path (not the main repo)
36
+ 5. Execute each task with Claude's cwd set to the worktree root
37
+ 6. All commits, stashes, and git operations happen in the worktree branch
38
+ 7. State derivation, outcome files, logs - all use the worktree project path
39
+ - When `--worktree` is NOT used, behavior is exactly the same as today
40
+ - The `--worktree` flag should be compatible with all existing flags (`--timeout`, `--verbose`, `--debug`, `--force`, `--model`, `--sonnet`)
41
+ - Update `DoCommandOptions` type in `src/types/config.ts` to include `worktree?: boolean`
42
+
43
+ ## Implementation Steps
44
+ 1. Add `--worktree` option to the Commander command definition in `src/commands/do.ts`
45
+ 2. Update `DoCommandOptions` interface in `src/types/config.ts`
46
+ 3. In `runDoCommand`, branch on whether a project identifier was provided:
47
+ - **With identifier**: validate single project only, compute worktree path, validate it exists
48
+ - **Without identifier**: run auto-discovery flow (list worktrees, find latest completed main-tree project, filter, derive states, show picker)
49
+ 4. For auto-discovery: scan main tree projects to find the highest-numbered fully-completed project using `deriveProjectState`
50
+ 5. For auto-discovery: filter worktree projects to those with IDs >= (highest completed - 3), then derive each project's state to find uncompleted ones
51
+ 6. For auto-discovery: show interactive picker using the existing `pickPendingProject` pattern (or similar UI) for the user to select one
52
+ 7. After project selection/resolution, replace the `projectPath` with the worktree project path for all operations
53
+ 8. Pass the worktree root as the working directory to `ClaudeRunner.run` and `ClaudeRunner.runVerbose`
54
+ 9. Ensure `executeSingleProject` uses the worktree project path for state derivation, outcome files, and all file operations
55
+ 10. The `ClaudeRunner` likely needs a `cwd` option - check if it already supports it, add if not
56
+ 11. All git operations (commit verification, stash, etc.) should naturally work in the worktree since cwd is set there
57
+
58
+ ## Acceptance Criteria
59
+ - [ ] `raf do --worktree` without project identifier triggers auto-discovery flow
60
+ - [ ] Auto-discovery lists worktree projects, finds latest completed main-tree project, filters correctly
61
+ - [ ] Auto-discovery shows picker even when only one uncompleted project is found
62
+ - [ ] Auto-discovery shows "No worktree projects found" when none exist
63
+ - [ ] Auto-discovery shows "All worktree projects are completed" when all are done
64
+ - [ ] `raf do proj1 proj2 --worktree` shows error about single project only
65
+ - [ ] `raf do my-feature --worktree` with no worktree shows helpful error
66
+ - [ ] `raf do my-feature --worktree` with valid worktree executes tasks in worktree
67
+ - [ ] Claude runs with cwd set to worktree root
68
+ - [ ] State derivation reads from worktree project path
69
+ - [ ] Outcome files are written to worktree project path
70
+ - [ ] Git commits land in the worktree branch
71
+ - [ ] Compatible with `--verbose`, `--timeout`, `--force`, `--debug`, `--model`
72
+ - [ ] Without `--worktree`, behavior is unchanged
73
+
74
+ ## Notes
75
+ - The key change is that all paths point to the worktree version of the project, and Claude's working directory is the worktree root
76
+ - The `ClaudeRunner` class in `src/core/claude-runner.ts` likely needs a `cwd` option passed to `spawn` / `node-pty` - check if this already exists
77
+ - When a project identifier IS given, resolution still works against the MAIN repo's RAF directory to get the folder name, but then the actual project path used for execution is inside the worktree
78
+ - For auto-discovery, project identifier resolution works against the worktree directory listing — these projects only exist in worktrees, not the main tree
79
+ - The scanning threshold is: highest completed main-tree project number minus 3. E.g., if project 008 is the highest completed, scan worktrees from 006 onward. This catches amended projects that had new tasks added after completion. If no main-tree projects are completed, scan all worktrees (threshold = 0)
80
+ - Reference existing do command at `src/commands/do.ts` and `ClaudeRunner` at `src/core/claude-runner.ts`
81
+ - Reference `getPendingProjects` and `pickPendingProject` from `src/ui/project-picker.js` for the picker pattern