rafcode 3.0.0 → 3.8.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 (235) hide show
  1. package/.claude/settings.local.json +3 -1
  2. package/CLAUDE.md +0 -1
  3. package/RAF/38-dual-wielder/decisions.md +9 -0
  4. package/RAF/38-dual-wielder/input.md +6 -1
  5. package/RAF/38-dual-wielder/outcomes/8-e2e-test-codex-provider.md +139 -0
  6. package/RAF/38-dual-wielder/plans/8-e2e-test-codex-provider.md +95 -0
  7. package/RAF/39-pathless-rover/decisions.md +16 -0
  8. package/RAF/39-pathless-rover/input.md +2 -0
  9. package/RAF/39-pathless-rover/outcomes/1-fix-codex-stream-renderer.md +21 -0
  10. package/RAF/39-pathless-rover/outcomes/2-wire-provider-flag.md +28 -0
  11. package/RAF/39-pathless-rover/outcomes/3-remove-worktree-flag-do.md +41 -0
  12. package/RAF/39-pathless-rover/outcomes/4-remove-worktree-flag-plan-amend.md +30 -0
  13. package/RAF/39-pathless-rover/outcomes/5-update-prompts-and-docs.md +26 -0
  14. package/RAF/39-pathless-rover/plans/1-fix-codex-stream-renderer.md +43 -0
  15. package/RAF/39-pathless-rover/plans/2-wire-provider-flag.md +48 -0
  16. package/RAF/39-pathless-rover/plans/3-remove-worktree-flag-do.md +41 -0
  17. package/RAF/39-pathless-rover/plans/4-remove-worktree-flag-plan-amend.md +43 -0
  18. package/RAF/39-pathless-rover/plans/5-update-prompts-and-docs.md +31 -0
  19. package/RAF/40-numeric-order-fix/decisions.md +7 -0
  20. package/RAF/40-numeric-order-fix/input.md +19 -0
  21. package/RAF/40-numeric-order-fix/outcomes/1-fix-numeric-sort-order.md +18 -0
  22. package/RAF/40-numeric-order-fix/outcomes/2-add-npm-keywords.md +10 -0
  23. package/RAF/40-numeric-order-fix/plans/1-fix-numeric-sort-order.md +48 -0
  24. package/RAF/40-numeric-order-fix/plans/2-add-npm-keywords.md +23 -0
  25. package/RAF/41-echo-chamber/decisions.md +13 -0
  26. package/RAF/41-echo-chamber/input.md +4 -0
  27. package/RAF/41-echo-chamber/outcomes/1-update-codex-model-defaults.md +24 -0
  28. package/RAF/41-echo-chamber/outcomes/2-e2e-test-codex-provider.md +74 -0
  29. package/RAF/41-echo-chamber/plans/1-update-codex-model-defaults.md +28 -0
  30. package/RAF/41-echo-chamber/plans/2-e2e-test-codex-provider.md +103 -0
  31. package/RAF/42-patch-parade/decisions.md +29 -0
  32. package/RAF/42-patch-parade/input.md +9 -0
  33. package/RAF/42-patch-parade/outcomes/1-fix-codex-model-resolution.md +36 -0
  34. package/RAF/42-patch-parade/outcomes/2-fix-provider-aware-name-generation.md +31 -0
  35. package/RAF/42-patch-parade/outcomes/3-fix-codex-error-event-rendering.md +32 -0
  36. package/RAF/42-patch-parade/outcomes/4-update-cli-help-docs.md +28 -0
  37. package/RAF/42-patch-parade/outcomes/5-update-default-codex-models-to-gpt-5-4.md +33 -0
  38. package/RAF/42-patch-parade/outcomes/6-unify-model-config-schema.md +89 -0
  39. package/RAF/42-patch-parade/plans/1-fix-codex-model-resolution.md +35 -0
  40. package/RAF/42-patch-parade/plans/2-fix-provider-aware-name-generation.md +38 -0
  41. package/RAF/42-patch-parade/plans/3-fix-codex-error-event-rendering.md +32 -0
  42. package/RAF/42-patch-parade/plans/4-update-cli-help-docs.md +31 -0
  43. package/RAF/42-patch-parade/plans/5-update-default-codex-models-to-gpt-5-4.md +35 -0
  44. package/RAF/42-patch-parade/plans/6-unify-model-config-schema.md +46 -0
  45. package/RAF/43-swiss-army/decisions.md +34 -0
  46. package/RAF/43-swiss-army/input.md +7 -0
  47. package/RAF/43-swiss-army/outcomes/1-fix-model-validation.md +21 -0
  48. package/RAF/43-swiss-army/outcomes/2-update-commit-format.md +31 -0
  49. package/RAF/43-swiss-army/outcomes/3-wire-reasoning-effort.md +28 -0
  50. package/RAF/43-swiss-army/outcomes/4-remove-provider-flag.md +27 -0
  51. package/RAF/43-swiss-army/outcomes/5-config-wizard-validation.md +23 -0
  52. package/RAF/43-swiss-army/outcomes/6-add-fast-mode.md +32 -0
  53. package/RAF/43-swiss-army/outcomes/7-config-preset.md +31 -0
  54. package/RAF/43-swiss-army/plans/1-fix-model-validation.md +38 -0
  55. package/RAF/43-swiss-army/plans/2-update-commit-format.md +46 -0
  56. package/RAF/43-swiss-army/plans/3-wire-reasoning-effort.md +39 -0
  57. package/RAF/43-swiss-army/plans/4-remove-provider-flag.md +43 -0
  58. package/RAF/43-swiss-army/plans/5-config-wizard-validation.md +42 -0
  59. package/RAF/43-swiss-army/plans/6-add-fast-mode.md +46 -0
  60. package/RAF/43-swiss-army/plans/7-config-preset.md +51 -0
  61. package/RAF/44-config-api-change/decisions.md +22 -0
  62. package/RAF/44-config-api-change/input.md +5 -0
  63. package/RAF/44-config-api-change/outcomes/1-restructure-config-subcommands.md +19 -0
  64. package/RAF/44-config-api-change/outcomes/2-move-preset-under-config.md +17 -0
  65. package/RAF/44-config-api-change/outcomes/3-update-existing-tests-for-config-api.md +14 -0
  66. package/RAF/44-config-api-change/outcomes/4-update-config-command-docs.md +11 -0
  67. package/RAF/44-config-api-change/outcomes/5-fix-codex-name-generation.md +18 -0
  68. package/RAF/44-config-api-change/plans/1-restructure-config-subcommands.md +37 -0
  69. package/RAF/44-config-api-change/plans/2-move-preset-under-config.md +38 -0
  70. package/RAF/44-config-api-change/plans/3-update-existing-tests-for-config-api.md +38 -0
  71. package/RAF/44-config-api-change/plans/4-update-config-command-docs.md +36 -0
  72. package/RAF/44-config-api-change/plans/5-fix-codex-name-generation.md +49 -0
  73. package/RAF/45-signal-cairn/decisions.md +7 -0
  74. package/RAF/45-signal-cairn/input.md +2 -0
  75. package/RAF/45-signal-cairn/outcomes/1-rename-provider-to-harness.md +19 -0
  76. package/RAF/45-signal-cairn/outcomes/2-normalize-model-display-names.md +18 -0
  77. package/RAF/45-signal-cairn/plans/1-rename-provider-to-harness.md +40 -0
  78. package/RAF/45-signal-cairn/plans/2-normalize-model-display-names.md +41 -0
  79. package/RAF/45-signal-lantern/decisions.md +10 -0
  80. package/RAF/45-signal-lantern/input.md +2 -0
  81. package/RAF/45-signal-lantern/outcomes/1-add-effort-and-fast-to-do-model-display.md +15 -0
  82. package/RAF/45-signal-lantern/outcomes/2-capture-codex-post-run-token-usage.md +15 -0
  83. package/RAF/45-signal-lantern/outcomes/3-show-codex-token-summaries-without-fake-cost.md +14 -0
  84. package/RAF/45-signal-lantern/plans/1-add-effort-and-fast-to-do-model-display.md +38 -0
  85. package/RAF/45-signal-lantern/plans/2-capture-codex-post-run-token-usage.md +37 -0
  86. package/RAF/45-signal-lantern/plans/3-show-codex-token-summaries-without-fake-cost.md +40 -0
  87. package/RAF/46-lantern-arc/decisions.md +19 -0
  88. package/RAF/46-lantern-arc/input.md +6 -0
  89. package/RAF/46-lantern-arc/outcomes/1-remove-spark-alias.md +16 -0
  90. package/RAF/46-lantern-arc/outcomes/2-clean-up-worktree-plan-command.md +30 -0
  91. package/RAF/46-lantern-arc/outcomes/3-fix-token-usage-accumulation.md +32 -0
  92. package/RAF/46-lantern-arc/outcomes/4-display-effort-in-compact-mode.md +22 -0
  93. package/RAF/46-lantern-arc/outcomes/5-codex-fast-mode-research.md +38 -0
  94. package/RAF/46-lantern-arc/outcomes/6-optimize-llm-prompts.md +39 -0
  95. package/RAF/46-lantern-arc/plans/1-remove-spark-alias.md +38 -0
  96. package/RAF/46-lantern-arc/plans/2-clean-up-worktree-plan-command.md +33 -0
  97. package/RAF/46-lantern-arc/plans/3-fix-token-usage-accumulation.md +33 -0
  98. package/RAF/46-lantern-arc/plans/4-display-effort-in-compact-mode.md +28 -0
  99. package/RAF/46-lantern-arc/plans/5-codex-fast-mode-research.md +34 -0
  100. package/RAF/46-lantern-arc/plans/6-optimize-llm-prompts.md +48 -0
  101. package/RAF/47-signal-trim/decisions.md +13 -0
  102. package/RAF/47-signal-trim/input.md +2 -0
  103. package/RAF/47-signal-trim/plans/1-remove-cache-from-status.md +73 -0
  104. package/README.md +50 -63
  105. package/dist/commands/config.d.ts.map +1 -1
  106. package/dist/commands/config.js +47 -49
  107. package/dist/commands/config.js.map +1 -1
  108. package/dist/commands/do.d.ts +2 -0
  109. package/dist/commands/do.d.ts.map +1 -1
  110. package/dist/commands/do.js +91 -230
  111. package/dist/commands/do.js.map +1 -1
  112. package/dist/commands/plan.d.ts.map +1 -1
  113. package/dist/commands/plan.js +54 -259
  114. package/dist/commands/plan.js.map +1 -1
  115. package/dist/commands/preset.d.ts +3 -0
  116. package/dist/commands/preset.d.ts.map +1 -0
  117. package/dist/commands/preset.js +158 -0
  118. package/dist/commands/preset.js.map +1 -0
  119. package/dist/core/claude-runner.d.ts +2 -0
  120. package/dist/core/claude-runner.d.ts.map +1 -1
  121. package/dist/core/claude-runner.js +36 -12
  122. package/dist/core/claude-runner.js.map +1 -1
  123. package/dist/core/codex-runner.d.ts +1 -0
  124. package/dist/core/codex-runner.d.ts.map +1 -1
  125. package/dist/core/codex-runner.js +26 -7
  126. package/dist/core/codex-runner.js.map +1 -1
  127. package/dist/core/failure-analyzer.js +2 -1
  128. package/dist/core/failure-analyzer.js.map +1 -1
  129. package/dist/core/git.d.ts +2 -2
  130. package/dist/core/git.d.ts.map +1 -1
  131. package/dist/core/git.js +53 -3
  132. package/dist/core/git.js.map +1 -1
  133. package/dist/core/project-manager.d.ts.map +1 -1
  134. package/dist/core/project-manager.js +2 -2
  135. package/dist/core/project-manager.js.map +1 -1
  136. package/dist/core/pull-request.js +5 -5
  137. package/dist/core/pull-request.js.map +1 -1
  138. package/dist/core/runner-factory.d.ts +4 -4
  139. package/dist/core/runner-factory.d.ts.map +1 -1
  140. package/dist/core/runner-factory.js +8 -8
  141. package/dist/core/runner-factory.js.map +1 -1
  142. package/dist/core/runner-interface.d.ts +1 -1
  143. package/dist/core/runner-types.d.ts +17 -4
  144. package/dist/core/runner-types.d.ts.map +1 -1
  145. package/dist/core/state-derivation.js +3 -3
  146. package/dist/core/state-derivation.js.map +1 -1
  147. package/dist/parsers/codex-stream-renderer.d.ts +28 -4
  148. package/dist/parsers/codex-stream-renderer.d.ts.map +1 -1
  149. package/dist/parsers/codex-stream-renderer.js +110 -0
  150. package/dist/parsers/codex-stream-renderer.js.map +1 -1
  151. package/dist/prompts/amend.d.ts +0 -1
  152. package/dist/prompts/amend.d.ts.map +1 -1
  153. package/dist/prompts/amend.js +31 -104
  154. package/dist/prompts/amend.js.map +1 -1
  155. package/dist/prompts/execution.d.ts.map +1 -1
  156. package/dist/prompts/execution.js +17 -34
  157. package/dist/prompts/execution.js.map +1 -1
  158. package/dist/prompts/planning.d.ts.map +1 -1
  159. package/dist/prompts/planning.js +23 -123
  160. package/dist/prompts/planning.js.map +1 -1
  161. package/dist/types/config.d.ts +33 -32
  162. package/dist/types/config.d.ts.map +1 -1
  163. package/dist/types/config.js +14 -28
  164. package/dist/types/config.js.map +1 -1
  165. package/dist/utils/config.d.ts +36 -16
  166. package/dist/utils/config.d.ts.map +1 -1
  167. package/dist/utils/config.js +209 -104
  168. package/dist/utils/config.js.map +1 -1
  169. package/dist/utils/name-generator.d.ts.map +1 -1
  170. package/dist/utils/name-generator.js +25 -12
  171. package/dist/utils/name-generator.js.map +1 -1
  172. package/dist/utils/paths.d.ts +5 -0
  173. package/dist/utils/paths.d.ts.map +1 -1
  174. package/dist/utils/paths.js +9 -0
  175. package/dist/utils/paths.js.map +1 -1
  176. package/dist/utils/terminal-symbols.d.ts +15 -2
  177. package/dist/utils/terminal-symbols.d.ts.map +1 -1
  178. package/dist/utils/terminal-symbols.js +36 -4
  179. package/dist/utils/terminal-symbols.js.map +1 -1
  180. package/dist/utils/token-tracker.d.ts +6 -1
  181. package/dist/utils/token-tracker.d.ts.map +1 -1
  182. package/dist/utils/token-tracker.js +84 -51
  183. package/dist/utils/token-tracker.js.map +1 -1
  184. package/dist/utils/validation.d.ts +1 -2
  185. package/dist/utils/validation.d.ts.map +1 -1
  186. package/dist/utils/validation.js +4 -25
  187. package/dist/utils/validation.js.map +1 -1
  188. package/package.json +7 -2
  189. package/src/commands/config.ts +60 -63
  190. package/src/commands/do.ts +96 -262
  191. package/src/commands/plan.ts +55 -279
  192. package/src/commands/preset.ts +186 -0
  193. package/src/core/claude-runner.ts +45 -5
  194. package/src/core/codex-runner.ts +32 -7
  195. package/src/core/failure-analyzer.ts +2 -1
  196. package/src/core/git.ts +57 -3
  197. package/src/core/project-manager.ts +2 -1
  198. package/src/core/pull-request.ts +5 -5
  199. package/src/core/runner-factory.ts +9 -9
  200. package/src/core/runner-interface.ts +1 -1
  201. package/src/core/runner-types.ts +17 -4
  202. package/src/core/state-derivation.ts +3 -3
  203. package/src/parsers/codex-stream-renderer.ts +149 -4
  204. package/src/prompts/amend.ts +30 -105
  205. package/src/prompts/config-docs.md +206 -62
  206. package/src/prompts/execution.ts +17 -34
  207. package/src/prompts/planning.ts +23 -124
  208. package/src/types/config.ts +47 -59
  209. package/src/utils/config.ts +248 -115
  210. package/src/utils/name-generator.ts +29 -13
  211. package/src/utils/paths.ts +10 -0
  212. package/src/utils/terminal-symbols.ts +46 -6
  213. package/src/utils/token-tracker.ts +96 -57
  214. package/src/utils/validation.ts +5 -30
  215. package/tests/unit/amend-prompt.test.ts +3 -2
  216. package/tests/unit/claude-runner-interactive.test.ts +21 -3
  217. package/tests/unit/claude-runner.test.ts +39 -0
  218. package/tests/unit/codex-runner.test.ts +163 -0
  219. package/tests/unit/codex-stream-renderer.test.ts +127 -0
  220. package/tests/unit/command-output.test.ts +57 -0
  221. package/tests/unit/commit-planning-artifacts-worktree.test.ts +24 -7
  222. package/tests/unit/commit-planning-artifacts.test.ts +26 -4
  223. package/tests/unit/config-command.test.ts +215 -303
  224. package/tests/unit/config.test.ts +319 -235
  225. package/tests/unit/dependency-integration.test.ts +27 -1
  226. package/tests/unit/do-model-display.test.ts +35 -0
  227. package/tests/unit/execution-prompt.test.ts +49 -19
  228. package/tests/unit/name-generator.test.ts +82 -12
  229. package/tests/unit/plan-command-auto-flag.test.ts +7 -10
  230. package/tests/unit/plan-command.test.ts +14 -17
  231. package/tests/unit/planning-prompt.test.ts +9 -8
  232. package/tests/unit/terminal-symbols.test.ts +94 -3
  233. package/tests/unit/token-tracker.test.ts +180 -1
  234. package/tests/unit/validation.test.ts +9 -41
  235. package/tests/unit/worktree-flag-override.test.ts +0 -186
@@ -15,16 +15,8 @@ export interface PlanningPromptResult {
15
15
  * - userMessage: Reference to input.md file (via positional argument, triggers the LLM to start)
16
16
  */
17
17
  export function getPlanningPrompt(params: PlanningPromptParams): PlanningPromptResult {
18
- const { projectPath, worktreeMode } = params;
19
- const worktreeFlag = worktreeMode ? ' --worktree' : '';
20
-
21
- const systemPrompt = `You are a project planning assistant for RAF (Ralph's Automation Framework). Your task is to analyze the user's project description and create detailed task plans.
22
-
23
- ## Your Goals
24
-
25
- 1. **Analyze the input** and identify distinct, actionable tasks
26
- 2. **Interview the user** about EACH task to gather specific requirements
27
- 3. **Create plan files** for each task with clear instructions
18
+ const { projectPath } = params;
19
+ const systemPrompt = `You are a project planning assistant for RAF (Ralph's Automation Framework). Analyze the user's project description, interview them, and create detailed task plans.
28
20
 
29
21
  ## Project Location
30
22
 
@@ -34,53 +26,25 @@ Project folder: ${projectPath}
34
26
 
35
27
  ### Step 1: Identify and Order Tasks
36
28
 
37
- Based on the project description, identify distinct tasks. Each task should:
38
- - Be independently completable
39
- - Have a clear outcome
40
- - Take roughly 10-30 minutes of work
29
+ Identify distinct tasks from the project description. Each task should be independently completable, have a clear outcome, and take roughly 10-30 minutes.
41
30
 
42
- **CRITICAL: Order tasks by logical execution order.** Lower-numbered tasks should be completed before higher-numbered ones. Consider:
43
- - Setup/foundation tasks come first (e.g., defining schemas, creating interfaces)
44
- - Core implementation tasks come next
45
- - Integration and extension tasks come later
46
- - Testing and validation tasks typically come last
31
+ **Order tasks by logical execution order:** setup/foundation core implementation integration/extension testing/validation.
47
32
 
48
33
  ### Step 2: Interview the User
49
34
 
50
- For EACH task you identify, you MUST use the AskUserQuestion tool to gather:
51
- - Specific requirements and constraints
52
- - Technology preferences
53
- - Any existing code or patterns to follow
54
- - Edge cases to handle
55
-
56
- DO NOT skip the interview step. The quality of your plans depends on understanding the user's exact needs.
35
+ For EACH task, use the AskUserQuestion tool to gather specific requirements, technology preferences, existing patterns to follow, and edge cases. Do not skip this step.
57
36
 
58
- ### Step 2.5: Record Decisions
59
-
60
- After EACH interview question is answered, record the Q&A pair in the decisions file:
61
- - ${projectPath}/decisions.md
62
-
63
- Use this format:
37
+ After EACH answer, append the Q&A pair to \`${projectPath}/decisions.md\`:
64
38
  \`\`\`markdown
65
- # Project Decisions
66
-
67
- ## [Question asked]
68
- [User's answer]
69
-
70
39
  ## [Question asked]
71
40
  [User's answer]
72
41
  \`\`\`
73
42
 
74
- This file serves as documentation of design choices made during planning. Append each new Q&A pair as you conduct the interview.
75
-
76
43
  ### Step 3: Create Plan Files
77
44
 
78
- After interviewing the user about all tasks, create plan files in the plans folder:
79
- - ${projectPath}/plans/1-task-name.md
80
- - ${projectPath}/plans/2-task-name.md
81
- - etc.
45
+ Create plan files in \`${projectPath}/plans/\` numbered in execution order (e.g., \`1-task-name.md\`, \`2-task-name.md\`). Use kebab-case names.
82
46
 
83
- Each plan file MUST have Obsidian-style frontmatter at the top, before the \`# Task:\` heading. The frontmatter uses standard YAML format with opening and closing \`---\` delimiters:
47
+ Each plan file MUST have this structure:
84
48
 
85
49
  \`\`\`markdown
86
50
  ---
@@ -89,116 +53,51 @@ effort: medium
89
53
  # Task: [Task Name]
90
54
 
91
55
  ## Objective
92
- [Clear, one-sentence description of what this task accomplishes]
56
+ [Clear, one-sentence description]
93
57
 
94
58
  ## Context
95
59
  [Why this task is needed, how it fits into the larger project]
96
60
 
97
61
  ## Dependencies
98
- [Optional section - omit if task has no dependencies]
99
- [Comma-separated list of task IDs this task depends on, e.g., "1, 2"]
100
- [If a dependency fails, this task will be automatically blocked]
62
+ [Optional omit if none. Comma-separated task IDs, e.g., "1, 2"]
101
63
 
102
64
  ## Requirements
103
- [Specific requirements gathered from the user interview]
104
65
  - Requirement 1
105
66
  - Requirement 2
106
- - ...
107
67
 
108
68
  ## Implementation Steps
109
69
  1. [Step 1]
110
70
  2. [Step 2]
111
- 3. [Step 3]
112
- ...
113
71
 
114
72
  ## Acceptance Criteria
115
73
  - [ ] Criterion 1
116
74
  - [ ] Criterion 2
117
- - [ ] All tests pass
118
75
 
119
76
  ## Notes
120
- [Any additional context, warnings, or considerations]
121
- \`\`\`
122
-
123
- ### Frontmatter Requirements
124
-
125
- The \`effort\` field is REQUIRED in every plan file. It indicates task complexity and determines which model will execute the task:
126
- - \`effort: low\` — Trivial/mechanical changes, simple one-file edits, config changes
127
- - \`effort: medium\` — Well-scoped feature work, bug fixes with clear plans, multi-file changes following existing patterns
128
- - \`effort: high\` — Architectural changes, complex logic, tasks requiring deep codebase understanding
129
-
130
- Optionally, you can add an explicit \`model\` field to override the effort-based model selection:
131
- \`\`\`markdown
132
- ---
133
- effort: medium
134
- model: opus
135
- ---
136
- # Task: ...
77
+ [Additional context, warnings, or considerations]
137
78
  \`\`\`
138
79
 
139
- This is rarely needed — prefer using the \`effort\` label so the user's config controls the actual model used.
80
+ **Frontmatter fields:**
81
+ - \`effort\` (REQUIRED): \`low\` (trivial/mechanical), \`medium\` (well-scoped feature work), \`high\` (architectural/complex)
82
+ - \`model\` (optional): Override effort-based model selection. Rarely needed — prefer \`effort\` so the user's config controls the model.
140
83
 
141
- ### Step 4: Infer Task Dependencies
84
+ **Dependencies:** Infer automatically from task relationships (don't ask the user). Only reference lower-numbered tasks. Only direct dependencies, not transitive ones. Omit section if no prerequisites.
142
85
 
143
- For each task, analyze which other tasks must complete successfully before it can begin. Add a \`## Dependencies\` section to plan files that have prerequisites.
86
+ ### Step 4: Confirm Completion
144
87
 
145
- **How to identify dependencies:**
146
- - If task B uses output/artifacts from task A → B depends on A
147
- - If task B modifies code created by task A → B depends on A
148
- - If task B tests functionality from task A → B depends on A
149
- - If task B extends or builds upon task A → B depends on A
150
-
151
- **Dependency format examples:**
152
- \`\`\`markdown
153
- ## Dependencies
154
- 1
155
- \`\`\`
156
- or for multiple dependencies:
157
- \`\`\`markdown
158
- ## Dependencies
159
- 1, 2
160
- \`\`\`
161
-
162
- **Rules for dependencies:**
163
- - Only reference lower-numbered tasks (tasks are ordered by execution order)
164
- - Omit the Dependencies section entirely if a task has no prerequisites
165
- - Keep dependency lists minimal - only direct dependencies, not transitive ones
166
- - Never create circular dependencies (impossible if you only reference lower-numbered tasks)
167
-
168
- ### Step 5: Confirm Completion
169
-
170
- After creating all plan files:
171
- 1. Provide a summary of the tasks you've created, including the effort level for each task. Example:
172
- - Task 1: setup-database (effort: low)
173
- - Task 2: implement-auth (effort: medium)
174
- - Task 3: refactor-api (effort: high)
175
- 2. Display this exit message to the user:
88
+ Provide a summary with effort levels (e.g., "Task 1: setup-database (effort: low)"), then display:
176
89
 
177
90
  \`\`\`
178
91
  Planning complete! To exit this session and run your tasks:
179
92
  1. Press Ctrl-C twice to exit
180
- 2. Then run: raf do <project>${worktreeFlag}
93
+ 2. Then run: raf do <project>
181
94
  \`\`\`
182
95
 
183
- ## Important Rules
184
-
185
- 1. ALWAYS interview the user before creating plans
186
- 2. Create plans in numbered order (1, 2, 3, etc.) reflecting logical execution order
187
- 3. Use descriptive, kebab-case names for plan files
188
- 4. Each plan should be self-contained with all context needed
189
- 5. Infer dependencies automatically - analyze task relationships, don't ask the user about dependencies
190
- 6. Only add Dependencies section when a task genuinely requires another to complete first
191
- 7. Dependencies must only reference lower-numbered tasks to prevent circular dependencies
192
- 8. Be specific - vague plans lead to poor execution
193
- 9. ALWAYS include the \`effort\` frontmatter field in every plan file — assess each task's complexity
194
-
195
- ## Plan Output Style
196
-
197
- Plans can include whatever level of detail you deem helpful for the executing agent. Use your judgment:
198
- - Include implementation details when they clarify the approach
199
- - Code snippets are acceptable when they help illustrate a specific pattern
200
- - File paths are helpful when referencing existing project files, patterns, or directories
201
- - Focus on clarity — the goal is for the executing agent to understand what needs to be done`;
96
+ ## Rules
97
+
98
+ - Each plan must be self-contained with all context needed for execution
99
+ - Be specific vague plans lead to poor execution
100
+ - Include implementation details, code snippets, and file paths when they clarify the approach`;
202
101
 
203
102
  const userMessage = `Here is my project description:
204
103
 
@@ -1,13 +1,13 @@
1
- /** CLI harness provider */
2
- export type HarnessProvider = 'claude' | 'codex';
1
+ /** CLI harness name */
2
+ export type HarnessName = 'claude' | 'codex';
3
3
 
4
4
  /** Short alias for a Claude model family */
5
5
  export type ClaudeModelAlias = 'sonnet' | 'haiku' | 'opus';
6
6
 
7
7
  /** Short alias for a Codex model family */
8
- export type CodexModelAlias = 'spark' | 'codex' | 'gpt54';
8
+ export type CodexModelAlias = 'codex' | 'gpt54';
9
9
 
10
- /** Provider-agnostic model alias (union of all provider aliases) */
10
+ /** Harness-agnostic model alias (union of all harness aliases) */
11
11
  export type ModelAlias = ClaudeModelAlias | CodexModelAlias;
12
12
 
13
13
  /**
@@ -17,7 +17,7 @@ export type ModelAlias = ClaudeModelAlias | CodexModelAlias;
17
17
  */
18
18
  export type ClaudeModelName = ClaudeModelAlias | (string & { __brand?: 'FullModelId' });
19
19
 
20
- /** Provider-agnostic model name — accepts any alias, full ID, or harness-prefixed format */
20
+ /** Harness-agnostic model name — accepts any alias, full ID, or harness-prefixed format */
21
21
  export type ModelName = string & { __brand?: 'ModelName' };
22
22
 
23
23
  /** Task complexity label for per-task effort frontmatter. Maps to models via effortMapping. */
@@ -26,23 +26,38 @@ export type TaskEffortLevel = 'low' | 'medium' | 'high';
26
26
  export type ModelScenario = 'plan' | 'execute' | 'nameGeneration' | 'failureAnalysis' | 'prGeneration' | 'config';
27
27
  export type CommitFormatType = 'task' | 'plan' | 'amend';
28
28
 
29
+ /**
30
+ * A harness-aware model configuration entry.
31
+ * Stores model, harness, and optional reasoning effort together.
32
+ */
33
+ export interface ModelEntry {
34
+ /** Model name: short alias (opus, sonnet, gpt-5.4) or full ID */
35
+ model: string;
36
+ /** Which CLI harness to use for this entry */
37
+ harness: HarnessName;
38
+ /** Optional reasoning effort hint. Codex accepts: "none", "minimal", "low", "medium", "high", "xhigh" */
39
+ reasoningEffort?: string;
40
+ /** Enable fast mode for faster output (Claude only). Default: false/omitted. */
41
+ fast?: boolean;
42
+ }
43
+
29
44
  export interface ModelsConfig {
30
- plan: ClaudeModelName;
31
- execute: ClaudeModelName;
32
- nameGeneration: ClaudeModelName;
33
- failureAnalysis: ClaudeModelName;
34
- prGeneration: ClaudeModelName;
35
- config: ClaudeModelName;
45
+ plan: ModelEntry;
46
+ execute: ModelEntry;
47
+ nameGeneration: ModelEntry;
48
+ failureAnalysis: ModelEntry;
49
+ prGeneration: ModelEntry;
50
+ config: ModelEntry;
36
51
  }
37
52
 
38
53
  /**
39
- * Maps task complexity labels to model names.
54
+ * Maps task complexity labels to harness-aware model entries.
40
55
  * Used to resolve per-task effort frontmatter to a model.
41
56
  */
42
57
  export interface EffortMappingConfig {
43
- low: ClaudeModelName;
44
- medium: ClaudeModelName;
45
- high: ClaudeModelName;
58
+ low: ModelEntry;
59
+ medium: ModelEntry;
60
+ high: ModelEntry;
46
61
  }
47
62
 
48
63
  export interface CommitFormatConfig {
@@ -59,15 +74,9 @@ export interface DisplayConfig {
59
74
  }
60
75
 
61
76
  export interface RafConfig {
62
- /** CLI harness provider. Default: 'claude' */
63
- provider: HarnessProvider;
64
77
  models: ModelsConfig;
65
- /** Maps task complexity labels (low/medium/high) to models. Used for per-task effort frontmatter. */
78
+ /** Maps task complexity labels (low/medium/high) to model entries. Used for per-task effort frontmatter. */
66
79
  effortMapping: EffortMappingConfig;
67
- /** Codex model assignments per scenario */
68
- codexModels: ModelsConfig;
69
- /** Maps task complexity labels to Codex models */
70
- codexEffortMapping: EffortMappingConfig;
71
80
  timeout: number;
72
81
  maxRetries: number;
73
82
  autoCommit: boolean;
@@ -79,32 +88,18 @@ export interface RafConfig {
79
88
  }
80
89
 
81
90
  export const DEFAULT_CONFIG: RafConfig = {
82
- provider: 'claude',
83
91
  models: {
84
- plan: 'opus',
85
- execute: 'opus',
86
- nameGeneration: 'sonnet',
87
- failureAnalysis: 'haiku',
88
- prGeneration: 'sonnet',
89
- config: 'sonnet',
92
+ plan: { model: 'opus', harness: 'claude' },
93
+ execute: { model: 'opus', harness: 'claude' },
94
+ nameGeneration: { model: 'sonnet', harness: 'claude' },
95
+ failureAnalysis: { model: 'haiku', harness: 'claude' },
96
+ prGeneration: { model: 'sonnet', harness: 'claude' },
97
+ config: { model: 'sonnet', harness: 'claude' },
90
98
  },
91
99
  effortMapping: {
92
- low: 'sonnet',
93
- medium: 'opus',
94
- high: 'opus',
95
- },
96
- codexModels: {
97
- plan: 'gpt-5.3-codex',
98
- execute: 'gpt-5.4',
99
- nameGeneration: 'gpt-5.3-codex-spark',
100
- failureAnalysis: 'gpt-5.3-codex-spark',
101
- prGeneration: 'gpt-5.3-codex',
102
- config: 'gpt-5.3-codex',
103
- },
104
- codexEffortMapping: {
105
- low: 'gpt-5.3-codex-spark',
106
- medium: 'gpt-5.3-codex',
107
- high: 'gpt-5.4',
100
+ low: { model: 'sonnet', harness: 'claude' },
101
+ medium: { model: 'opus', harness: 'claude' },
102
+ high: { model: 'opus', harness: 'claude' },
108
103
  },
109
104
  timeout: 60,
110
105
  maxRetries: 3,
@@ -112,9 +107,9 @@ export const DEFAULT_CONFIG: RafConfig = {
112
107
  worktree: false,
113
108
  syncMainBranch: true,
114
109
  commitFormat: {
115
- task: '{prefix}[{projectId}:{taskId}] {description}',
116
- plan: '{prefix}[{projectId}] Plan: {projectName}',
117
- amend: '{prefix}[{projectId}] Amend: {projectName}',
110
+ task: '{prefix}[{projectName}:{taskId}] {description}',
111
+ plan: '{prefix}[{projectName}] Plan: {description}',
112
+ amend: '{prefix}[{projectName}] Amend: {description}',
118
113
  prefix: 'RAF',
119
114
  },
120
115
  display: {
@@ -131,9 +126,9 @@ export type UserConfig = DeepPartial<RafConfig>;
131
126
 
132
127
  export const VALID_MODEL_ALIASES: readonly ClaudeModelAlias[] = ['sonnet', 'haiku', 'opus'];
133
128
 
134
- export const VALID_CODEX_MODEL_ALIASES: readonly CodexModelAlias[] = ['spark', 'codex', 'gpt54'];
129
+ export const VALID_CODEX_MODEL_ALIASES: readonly CodexModelAlias[] = ['codex', 'gpt54'];
135
130
 
136
- export const VALID_HARNESS_PROVIDERS: readonly HarnessProvider[] = ['claude', 'codex'];
131
+ export const VALID_HARNESSES: readonly HarnessName[] = ['claude', 'codex'];
137
132
 
138
133
  /**
139
134
  * Regex for full Claude model IDs (e.g., `claude-sonnet-4-5-20250929`, `claude-opus-4-5-20251101`).
@@ -157,9 +152,6 @@ export const DEFAULT_RAF_CONFIG = {
157
152
 
158
153
  export interface PlanCommandOptions {
159
154
  projectName?: string;
160
- model?: ClaudeModelName;
161
- sonnet?: boolean;
162
- provider?: HarnessProvider;
163
155
  }
164
156
 
165
157
  export interface DoCommandOptions {
@@ -167,10 +159,6 @@ export interface DoCommandOptions {
167
159
  verbose?: boolean;
168
160
  debug?: boolean;
169
161
  force?: boolean;
170
- model?: ClaudeModelName;
171
- sonnet?: boolean;
172
- worktree?: boolean;
173
- provider?: HarnessProvider;
174
162
  }
175
163
 
176
164
  export interface StatusCommandOptions {
@@ -184,7 +172,7 @@ export interface ModelTokenUsage {
184
172
  cacheReadInputTokens: number;
185
173
  cacheCreationInputTokens: number;
186
174
  /** Cost in USD for this model's usage (provided by Claude CLI). */
187
- costUsd: number;
175
+ costUsd?: number | null;
188
176
  }
189
177
 
190
178
  /** Token usage data extracted from Claude CLI stream-json result event. */
@@ -197,5 +185,5 @@ export interface UsageData {
197
185
  /** Per-model breakdown (e.g., { "claude-opus-4-6": { ... } }). */
198
186
  modelUsage: Record<string, ModelTokenUsage>;
199
187
  /** Total cost in USD for this usage (provided by Claude CLI). */
200
- totalCostUsd: number;
188
+ totalCostUsd: number | null;
201
189
  }