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.
- package/.claude/settings.local.json +3 -1
- package/CLAUDE.md +0 -1
- package/RAF/38-dual-wielder/decisions.md +9 -0
- package/RAF/38-dual-wielder/input.md +6 -1
- package/RAF/38-dual-wielder/outcomes/8-e2e-test-codex-provider.md +139 -0
- package/RAF/38-dual-wielder/plans/8-e2e-test-codex-provider.md +95 -0
- package/RAF/39-pathless-rover/decisions.md +16 -0
- package/RAF/39-pathless-rover/input.md +2 -0
- package/RAF/39-pathless-rover/outcomes/1-fix-codex-stream-renderer.md +21 -0
- package/RAF/39-pathless-rover/outcomes/2-wire-provider-flag.md +28 -0
- package/RAF/39-pathless-rover/outcomes/3-remove-worktree-flag-do.md +41 -0
- package/RAF/39-pathless-rover/outcomes/4-remove-worktree-flag-plan-amend.md +30 -0
- package/RAF/39-pathless-rover/outcomes/5-update-prompts-and-docs.md +26 -0
- package/RAF/39-pathless-rover/plans/1-fix-codex-stream-renderer.md +43 -0
- package/RAF/39-pathless-rover/plans/2-wire-provider-flag.md +48 -0
- package/RAF/39-pathless-rover/plans/3-remove-worktree-flag-do.md +41 -0
- package/RAF/39-pathless-rover/plans/4-remove-worktree-flag-plan-amend.md +43 -0
- package/RAF/39-pathless-rover/plans/5-update-prompts-and-docs.md +31 -0
- package/RAF/40-numeric-order-fix/decisions.md +7 -0
- package/RAF/40-numeric-order-fix/input.md +19 -0
- package/RAF/40-numeric-order-fix/outcomes/1-fix-numeric-sort-order.md +18 -0
- package/RAF/40-numeric-order-fix/outcomes/2-add-npm-keywords.md +10 -0
- package/RAF/40-numeric-order-fix/plans/1-fix-numeric-sort-order.md +48 -0
- package/RAF/40-numeric-order-fix/plans/2-add-npm-keywords.md +23 -0
- package/RAF/41-echo-chamber/decisions.md +13 -0
- package/RAF/41-echo-chamber/input.md +4 -0
- package/RAF/41-echo-chamber/outcomes/1-update-codex-model-defaults.md +24 -0
- package/RAF/41-echo-chamber/outcomes/2-e2e-test-codex-provider.md +74 -0
- package/RAF/41-echo-chamber/plans/1-update-codex-model-defaults.md +28 -0
- package/RAF/41-echo-chamber/plans/2-e2e-test-codex-provider.md +103 -0
- package/RAF/42-patch-parade/decisions.md +29 -0
- package/RAF/42-patch-parade/input.md +9 -0
- package/RAF/42-patch-parade/outcomes/1-fix-codex-model-resolution.md +36 -0
- package/RAF/42-patch-parade/outcomes/2-fix-provider-aware-name-generation.md +31 -0
- package/RAF/42-patch-parade/outcomes/3-fix-codex-error-event-rendering.md +32 -0
- package/RAF/42-patch-parade/outcomes/4-update-cli-help-docs.md +28 -0
- package/RAF/42-patch-parade/outcomes/5-update-default-codex-models-to-gpt-5-4.md +33 -0
- package/RAF/42-patch-parade/outcomes/6-unify-model-config-schema.md +89 -0
- package/RAF/42-patch-parade/plans/1-fix-codex-model-resolution.md +35 -0
- package/RAF/42-patch-parade/plans/2-fix-provider-aware-name-generation.md +38 -0
- package/RAF/42-patch-parade/plans/3-fix-codex-error-event-rendering.md +32 -0
- package/RAF/42-patch-parade/plans/4-update-cli-help-docs.md +31 -0
- package/RAF/42-patch-parade/plans/5-update-default-codex-models-to-gpt-5-4.md +35 -0
- package/RAF/42-patch-parade/plans/6-unify-model-config-schema.md +46 -0
- package/RAF/43-swiss-army/decisions.md +34 -0
- package/RAF/43-swiss-army/input.md +7 -0
- package/RAF/43-swiss-army/outcomes/1-fix-model-validation.md +21 -0
- package/RAF/43-swiss-army/outcomes/2-update-commit-format.md +31 -0
- package/RAF/43-swiss-army/outcomes/3-wire-reasoning-effort.md +28 -0
- package/RAF/43-swiss-army/outcomes/4-remove-provider-flag.md +27 -0
- package/RAF/43-swiss-army/outcomes/5-config-wizard-validation.md +23 -0
- package/RAF/43-swiss-army/outcomes/6-add-fast-mode.md +32 -0
- package/RAF/43-swiss-army/outcomes/7-config-preset.md +31 -0
- package/RAF/43-swiss-army/plans/1-fix-model-validation.md +38 -0
- package/RAF/43-swiss-army/plans/2-update-commit-format.md +46 -0
- package/RAF/43-swiss-army/plans/3-wire-reasoning-effort.md +39 -0
- package/RAF/43-swiss-army/plans/4-remove-provider-flag.md +43 -0
- package/RAF/43-swiss-army/plans/5-config-wizard-validation.md +42 -0
- package/RAF/43-swiss-army/plans/6-add-fast-mode.md +46 -0
- package/RAF/43-swiss-army/plans/7-config-preset.md +51 -0
- package/RAF/44-config-api-change/decisions.md +22 -0
- package/RAF/44-config-api-change/input.md +5 -0
- package/RAF/44-config-api-change/outcomes/1-restructure-config-subcommands.md +19 -0
- package/RAF/44-config-api-change/outcomes/2-move-preset-under-config.md +17 -0
- package/RAF/44-config-api-change/outcomes/3-update-existing-tests-for-config-api.md +14 -0
- package/RAF/44-config-api-change/outcomes/4-update-config-command-docs.md +11 -0
- package/RAF/44-config-api-change/outcomes/5-fix-codex-name-generation.md +18 -0
- package/RAF/44-config-api-change/plans/1-restructure-config-subcommands.md +37 -0
- package/RAF/44-config-api-change/plans/2-move-preset-under-config.md +38 -0
- package/RAF/44-config-api-change/plans/3-update-existing-tests-for-config-api.md +38 -0
- package/RAF/44-config-api-change/plans/4-update-config-command-docs.md +36 -0
- package/RAF/44-config-api-change/plans/5-fix-codex-name-generation.md +49 -0
- package/RAF/45-signal-cairn/decisions.md +7 -0
- package/RAF/45-signal-cairn/input.md +2 -0
- package/RAF/45-signal-cairn/outcomes/1-rename-provider-to-harness.md +19 -0
- package/RAF/45-signal-cairn/outcomes/2-normalize-model-display-names.md +18 -0
- package/RAF/45-signal-cairn/plans/1-rename-provider-to-harness.md +40 -0
- package/RAF/45-signal-cairn/plans/2-normalize-model-display-names.md +41 -0
- package/RAF/45-signal-lantern/decisions.md +10 -0
- package/RAF/45-signal-lantern/input.md +2 -0
- package/RAF/45-signal-lantern/outcomes/1-add-effort-and-fast-to-do-model-display.md +15 -0
- package/RAF/45-signal-lantern/outcomes/2-capture-codex-post-run-token-usage.md +15 -0
- package/RAF/45-signal-lantern/outcomes/3-show-codex-token-summaries-without-fake-cost.md +14 -0
- package/RAF/45-signal-lantern/plans/1-add-effort-and-fast-to-do-model-display.md +38 -0
- package/RAF/45-signal-lantern/plans/2-capture-codex-post-run-token-usage.md +37 -0
- package/RAF/45-signal-lantern/plans/3-show-codex-token-summaries-without-fake-cost.md +40 -0
- package/RAF/46-lantern-arc/decisions.md +19 -0
- package/RAF/46-lantern-arc/input.md +6 -0
- package/RAF/46-lantern-arc/outcomes/1-remove-spark-alias.md +16 -0
- package/RAF/46-lantern-arc/outcomes/2-clean-up-worktree-plan-command.md +30 -0
- package/RAF/46-lantern-arc/outcomes/3-fix-token-usage-accumulation.md +32 -0
- package/RAF/46-lantern-arc/outcomes/4-display-effort-in-compact-mode.md +22 -0
- package/RAF/46-lantern-arc/outcomes/5-codex-fast-mode-research.md +38 -0
- package/RAF/46-lantern-arc/outcomes/6-optimize-llm-prompts.md +39 -0
- package/RAF/46-lantern-arc/plans/1-remove-spark-alias.md +38 -0
- package/RAF/46-lantern-arc/plans/2-clean-up-worktree-plan-command.md +33 -0
- package/RAF/46-lantern-arc/plans/3-fix-token-usage-accumulation.md +33 -0
- package/RAF/46-lantern-arc/plans/4-display-effort-in-compact-mode.md +28 -0
- package/RAF/46-lantern-arc/plans/5-codex-fast-mode-research.md +34 -0
- package/RAF/46-lantern-arc/plans/6-optimize-llm-prompts.md +48 -0
- package/RAF/47-signal-trim/decisions.md +13 -0
- package/RAF/47-signal-trim/input.md +2 -0
- package/RAF/47-signal-trim/plans/1-remove-cache-from-status.md +73 -0
- package/README.md +50 -63
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +47 -49
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/do.d.ts +2 -0
- package/dist/commands/do.d.ts.map +1 -1
- package/dist/commands/do.js +91 -230
- package/dist/commands/do.js.map +1 -1
- package/dist/commands/plan.d.ts.map +1 -1
- package/dist/commands/plan.js +54 -259
- package/dist/commands/plan.js.map +1 -1
- package/dist/commands/preset.d.ts +3 -0
- package/dist/commands/preset.d.ts.map +1 -0
- package/dist/commands/preset.js +158 -0
- package/dist/commands/preset.js.map +1 -0
- package/dist/core/claude-runner.d.ts +2 -0
- package/dist/core/claude-runner.d.ts.map +1 -1
- package/dist/core/claude-runner.js +36 -12
- package/dist/core/claude-runner.js.map +1 -1
- package/dist/core/codex-runner.d.ts +1 -0
- package/dist/core/codex-runner.d.ts.map +1 -1
- package/dist/core/codex-runner.js +26 -7
- package/dist/core/codex-runner.js.map +1 -1
- package/dist/core/failure-analyzer.js +2 -1
- package/dist/core/failure-analyzer.js.map +1 -1
- package/dist/core/git.d.ts +2 -2
- package/dist/core/git.d.ts.map +1 -1
- package/dist/core/git.js +53 -3
- package/dist/core/git.js.map +1 -1
- package/dist/core/project-manager.d.ts.map +1 -1
- package/dist/core/project-manager.js +2 -2
- package/dist/core/project-manager.js.map +1 -1
- package/dist/core/pull-request.js +5 -5
- package/dist/core/pull-request.js.map +1 -1
- package/dist/core/runner-factory.d.ts +4 -4
- package/dist/core/runner-factory.d.ts.map +1 -1
- package/dist/core/runner-factory.js +8 -8
- package/dist/core/runner-factory.js.map +1 -1
- package/dist/core/runner-interface.d.ts +1 -1
- package/dist/core/runner-types.d.ts +17 -4
- package/dist/core/runner-types.d.ts.map +1 -1
- package/dist/core/state-derivation.js +3 -3
- package/dist/core/state-derivation.js.map +1 -1
- package/dist/parsers/codex-stream-renderer.d.ts +28 -4
- package/dist/parsers/codex-stream-renderer.d.ts.map +1 -1
- package/dist/parsers/codex-stream-renderer.js +110 -0
- package/dist/parsers/codex-stream-renderer.js.map +1 -1
- package/dist/prompts/amend.d.ts +0 -1
- package/dist/prompts/amend.d.ts.map +1 -1
- package/dist/prompts/amend.js +31 -104
- package/dist/prompts/amend.js.map +1 -1
- package/dist/prompts/execution.d.ts.map +1 -1
- package/dist/prompts/execution.js +17 -34
- package/dist/prompts/execution.js.map +1 -1
- package/dist/prompts/planning.d.ts.map +1 -1
- package/dist/prompts/planning.js +23 -123
- package/dist/prompts/planning.js.map +1 -1
- package/dist/types/config.d.ts +33 -32
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/config.js +14 -28
- package/dist/types/config.js.map +1 -1
- package/dist/utils/config.d.ts +36 -16
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +209 -104
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/name-generator.d.ts.map +1 -1
- package/dist/utils/name-generator.js +25 -12
- package/dist/utils/name-generator.js.map +1 -1
- package/dist/utils/paths.d.ts +5 -0
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +9 -0
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/terminal-symbols.d.ts +15 -2
- package/dist/utils/terminal-symbols.d.ts.map +1 -1
- package/dist/utils/terminal-symbols.js +36 -4
- package/dist/utils/terminal-symbols.js.map +1 -1
- package/dist/utils/token-tracker.d.ts +6 -1
- package/dist/utils/token-tracker.d.ts.map +1 -1
- package/dist/utils/token-tracker.js +84 -51
- package/dist/utils/token-tracker.js.map +1 -1
- package/dist/utils/validation.d.ts +1 -2
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +4 -25
- package/dist/utils/validation.js.map +1 -1
- package/package.json +7 -2
- package/src/commands/config.ts +60 -63
- package/src/commands/do.ts +96 -262
- package/src/commands/plan.ts +55 -279
- package/src/commands/preset.ts +186 -0
- package/src/core/claude-runner.ts +45 -5
- package/src/core/codex-runner.ts +32 -7
- package/src/core/failure-analyzer.ts +2 -1
- package/src/core/git.ts +57 -3
- package/src/core/project-manager.ts +2 -1
- package/src/core/pull-request.ts +5 -5
- package/src/core/runner-factory.ts +9 -9
- package/src/core/runner-interface.ts +1 -1
- package/src/core/runner-types.ts +17 -4
- package/src/core/state-derivation.ts +3 -3
- package/src/parsers/codex-stream-renderer.ts +149 -4
- package/src/prompts/amend.ts +30 -105
- package/src/prompts/config-docs.md +206 -62
- package/src/prompts/execution.ts +17 -34
- package/src/prompts/planning.ts +23 -124
- package/src/types/config.ts +47 -59
- package/src/utils/config.ts +248 -115
- package/src/utils/name-generator.ts +29 -13
- package/src/utils/paths.ts +10 -0
- package/src/utils/terminal-symbols.ts +46 -6
- package/src/utils/token-tracker.ts +96 -57
- package/src/utils/validation.ts +5 -30
- package/tests/unit/amend-prompt.test.ts +3 -2
- package/tests/unit/claude-runner-interactive.test.ts +21 -3
- package/tests/unit/claude-runner.test.ts +39 -0
- package/tests/unit/codex-runner.test.ts +163 -0
- package/tests/unit/codex-stream-renderer.test.ts +127 -0
- package/tests/unit/command-output.test.ts +57 -0
- package/tests/unit/commit-planning-artifacts-worktree.test.ts +24 -7
- package/tests/unit/commit-planning-artifacts.test.ts +26 -4
- package/tests/unit/config-command.test.ts +215 -303
- package/tests/unit/config.test.ts +319 -235
- package/tests/unit/dependency-integration.test.ts +27 -1
- package/tests/unit/do-model-display.test.ts +35 -0
- package/tests/unit/execution-prompt.test.ts +49 -19
- package/tests/unit/name-generator.test.ts +82 -12
- package/tests/unit/plan-command-auto-flag.test.ts +7 -10
- package/tests/unit/plan-command.test.ts +14 -17
- package/tests/unit/planning-prompt.test.ts +9 -8
- package/tests/unit/terminal-symbols.test.ts +94 -3
- package/tests/unit/token-tracker.test.ts +180 -1
- package/tests/unit/validation.test.ts +9 -41
- package/tests/unit/worktree-flag-override.test.ts +0 -186
package/dist/prompts/amend.js
CHANGED
|
@@ -5,8 +5,7 @@ import { encodeTaskId } from '../utils/paths.js';
|
|
|
5
5
|
* - userMessage: Reference to input.md and new task description (via positional argument, triggers the LLM to start)
|
|
6
6
|
*/
|
|
7
7
|
export function getAmendPrompt(params) {
|
|
8
|
-
const { projectPath, existingTasks, nextTaskNumber, newTaskDescription,
|
|
9
|
-
const worktreeFlag = worktreeMode ? ' --worktree' : '';
|
|
8
|
+
const { projectPath, existingTasks, nextTaskNumber, newTaskDescription, } = params;
|
|
10
9
|
const existingTasksSummary = existingTasks
|
|
11
10
|
.map((task) => {
|
|
12
11
|
const status = task.status === 'completed'
|
|
@@ -29,15 +28,14 @@ export function getAmendPrompt(params) {
|
|
|
29
28
|
const modifiableTasksList = modifiableTasks.length > 0
|
|
30
29
|
? modifiableTasks.map((t) => `- Task ${t.id}: ${t.taskName}`).join('\n')
|
|
31
30
|
: '(none)';
|
|
32
|
-
const systemPrompt = `You are a project planning assistant for RAF (Ralph's Automation Framework).
|
|
31
|
+
const systemPrompt = `You are a project planning assistant for RAF (Ralph's Automation Framework). Add new tasks or modify pending tasks in an existing project.
|
|
33
32
|
|
|
34
|
-
##
|
|
33
|
+
## Amendment Mode
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
- You can create NEW tasks starting from number ${encodeTaskId(nextTaskNumber)}
|
|
35
|
+
- [PROTECTED] tasks (completed): NEVER modify — their outcomes depend on the original plan
|
|
36
|
+
- [MODIFIABLE] tasks (pending/failed): MAY modify if the user requests changes
|
|
37
|
+
- Do NOT renumber existing tasks
|
|
38
|
+
- New tasks start from number ${encodeTaskId(nextTaskNumber)}
|
|
41
39
|
|
|
42
40
|
## Project Location
|
|
43
41
|
|
|
@@ -45,54 +43,30 @@ Project folder: ${projectPath}
|
|
|
45
43
|
|
|
46
44
|
## Existing Tasks
|
|
47
45
|
|
|
48
|
-
The following tasks already exist in this project:
|
|
49
|
-
|
|
50
46
|
${existingTasksSummary}
|
|
51
47
|
|
|
52
|
-
### Protected
|
|
48
|
+
### Protected (COMPLETED)
|
|
53
49
|
${protectedTasksList}
|
|
54
50
|
|
|
55
|
-
### Modifiable
|
|
51
|
+
### Modifiable (PENDING/FAILED)
|
|
56
52
|
${modifiableTasksList}
|
|
57
53
|
|
|
58
54
|
## Instructions
|
|
59
55
|
|
|
60
56
|
### Step 1: Read Context
|
|
61
57
|
|
|
62
|
-
|
|
63
|
-
- ${projectPath}/input.md
|
|
64
|
-
|
|
65
|
-
And review existing decisions from:
|
|
66
|
-
- ${projectPath}/decisions.md (if it exists)
|
|
58
|
+
Read the original project description (\`${projectPath}/input.md\`) and existing decisions (\`${projectPath}/decisions.md\`, if it exists).
|
|
67
59
|
|
|
68
60
|
### Step 2: Analyze New Requirements
|
|
69
61
|
|
|
70
|
-
|
|
71
|
-
- How the new tasks relate to existing ones
|
|
72
|
-
- Dependencies on completed tasks (check the ## Dependencies section in existing plan files)
|
|
73
|
-
- Whether new tasks should reference existing task outcomes
|
|
74
|
-
|
|
75
|
-
**Identifying Follow-up Tasks**: When a new task is a follow-up, fix, or iteration of a previously completed task, you MUST reference the previous task's outcome in the new plan's Context section. This gives the executing agent full context about what was done before.
|
|
76
|
-
|
|
77
|
-
Use this format in the Context section:
|
|
62
|
+
Consider how new tasks relate to existing ones and their dependencies. For follow-up/fix tasks, reference the previous task's outcome in the Context section:
|
|
78
63
|
\`This is a follow-up to task NN. See outcome: {projectPath}/outcomes/NN-task-name.md\`
|
|
79
64
|
|
|
80
|
-
The outcome file paths for completed tasks are listed above in the Existing Tasks section.
|
|
81
|
-
|
|
82
65
|
### Step 3: Interview the User
|
|
83
66
|
|
|
84
|
-
For EACH new task
|
|
85
|
-
- Specific requirements and constraints
|
|
86
|
-
- Technology preferences
|
|
87
|
-
- Any existing code or patterns to follow
|
|
88
|
-
- Edge cases to handle
|
|
89
|
-
|
|
90
|
-
### Step 3.5: Record Decisions
|
|
67
|
+
For EACH new task, use AskUserQuestion to gather specific requirements, technology preferences, existing patterns, and edge cases.
|
|
91
68
|
|
|
92
|
-
After EACH
|
|
93
|
-
- ${projectPath}/decisions.md
|
|
94
|
-
|
|
95
|
-
Use this format:
|
|
69
|
+
After EACH answer, append the Q&A to \`${projectPath}/decisions.md\`:
|
|
96
70
|
\`\`\`markdown
|
|
97
71
|
## [Question asked]
|
|
98
72
|
[User's answer]
|
|
@@ -100,12 +74,9 @@ Use this format:
|
|
|
100
74
|
|
|
101
75
|
### Step 4: Create New Plan Files
|
|
102
76
|
|
|
103
|
-
|
|
104
|
-
- ${projectPath}/plans/${encodeTaskId(nextTaskNumber)}-task-name.md
|
|
105
|
-
- ${projectPath}/plans/${encodeTaskId(nextTaskNumber + 1)}-task-name.md
|
|
106
|
-
- etc.
|
|
77
|
+
Create plan files starting from \`${projectPath}/plans/${encodeTaskId(nextTaskNumber)}-task-name.md\`. Use kebab-case names.
|
|
107
78
|
|
|
108
|
-
Each plan file MUST have
|
|
79
|
+
Each plan file MUST have this structure:
|
|
109
80
|
|
|
110
81
|
\`\`\`markdown
|
|
111
82
|
---
|
|
@@ -114,95 +85,51 @@ effort: medium
|
|
|
114
85
|
# Task: [Task Name]
|
|
115
86
|
|
|
116
87
|
## Objective
|
|
117
|
-
[Clear, one-sentence description
|
|
88
|
+
[Clear, one-sentence description]
|
|
118
89
|
|
|
119
90
|
## Context
|
|
120
|
-
[Why this task is needed,
|
|
121
|
-
[
|
|
122
|
-
[For follow-up/fix tasks: "This is a follow-up to task NN. See outcome: {projectPath}/outcomes/NN-task-name.md"]
|
|
91
|
+
[Why this task is needed, relation to existing tasks]
|
|
92
|
+
[For follow-ups: "This is a follow-up to task NN. See outcome: {projectPath}/outcomes/NN-task-name.md"]
|
|
123
93
|
|
|
124
94
|
## Dependencies
|
|
125
|
-
[Optional
|
|
126
|
-
[Comma-separated list of task IDs this task depends on, e.g., "1, 2"]
|
|
127
|
-
[If a dependency fails, this task will be automatically blocked]
|
|
95
|
+
[Optional — omit if none. Comma-separated task IDs, e.g., "1, 2"]
|
|
128
96
|
|
|
129
97
|
## Requirements
|
|
130
|
-
[Specific requirements gathered from the user interview]
|
|
131
98
|
- Requirement 1
|
|
132
99
|
- Requirement 2
|
|
133
|
-
- ...
|
|
134
100
|
|
|
135
101
|
## Implementation Steps
|
|
136
102
|
1. [Step 1]
|
|
137
103
|
2. [Step 2]
|
|
138
|
-
3. [Step 3]
|
|
139
|
-
...
|
|
140
104
|
|
|
141
105
|
## Acceptance Criteria
|
|
142
106
|
- [ ] Criterion 1
|
|
143
107
|
- [ ] Criterion 2
|
|
144
|
-
- [ ] All tests pass
|
|
145
108
|
|
|
146
109
|
## Notes
|
|
147
|
-
[
|
|
148
|
-
[Reference to existing task outcomes if relevant]
|
|
149
|
-
\`\`\`
|
|
150
|
-
|
|
151
|
-
### Frontmatter Requirements
|
|
152
|
-
|
|
153
|
-
The \`effort\` field is REQUIRED in every plan file. It indicates task complexity and determines which model will execute the task:
|
|
154
|
-
- \`effort: low\` — Trivial/mechanical changes, simple one-file edits, config changes
|
|
155
|
-
- \`effort: medium\` — Well-scoped feature work, bug fixes with clear plans, multi-file changes following existing patterns
|
|
156
|
-
- \`effort: high\` — Architectural changes, complex logic, tasks requiring deep codebase understanding
|
|
157
|
-
|
|
158
|
-
Optionally, you can add an explicit \`model\` field to override the effort-based model selection:
|
|
159
|
-
\`\`\`markdown
|
|
160
|
-
---
|
|
161
|
-
effort: medium
|
|
162
|
-
model: opus
|
|
163
|
-
---
|
|
164
|
-
# Task: ...
|
|
110
|
+
[Additional context, warnings, references to existing task outcomes]
|
|
165
111
|
\`\`\`
|
|
166
112
|
|
|
167
|
-
|
|
113
|
+
**Frontmatter fields:**
|
|
114
|
+
- \`effort\` (REQUIRED): \`low\` (trivial/mechanical), \`medium\` (well-scoped feature work), \`high\` (architectural/complex)
|
|
115
|
+
- \`model\` (optional): Override effort-based model selection. Rarely needed.
|
|
168
116
|
|
|
169
117
|
### Step 5: Confirm Completion
|
|
170
118
|
|
|
171
|
-
|
|
172
|
-
1. Provide a summary of:
|
|
173
|
-
- The new tasks you've created, including the effort level for each task. Example format:
|
|
174
|
-
- Task 2: add-caching (effort: medium)
|
|
175
|
-
- Task 3: update-docs (effort: low)
|
|
176
|
-
- How they relate to existing tasks
|
|
177
|
-
- Total task count in the project
|
|
178
|
-
2. Display this exit message to the user:
|
|
119
|
+
Summarize new tasks with effort levels, their relation to existing tasks, and total task count. Then display:
|
|
179
120
|
|
|
180
121
|
\`\`\`
|
|
181
122
|
Planning complete! To exit this session and run your tasks:
|
|
182
123
|
1. Press Ctrl-C twice to exit
|
|
183
|
-
2. Then run: raf do <project
|
|
124
|
+
2. Then run: raf do <project>
|
|
184
125
|
\`\`\`
|
|
185
126
|
|
|
186
|
-
##
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
5. Use descriptive, kebab-case names for plan files
|
|
193
|
-
6. Each plan should be self-contained with all context needed
|
|
194
|
-
7. Specify task dependencies using the ## Dependencies section with task IDs only (e.g., "1, 2")
|
|
195
|
-
8. Tasks without dependencies should omit the Dependencies section entirely
|
|
196
|
-
9. Be specific - vague plans lead to poor execution
|
|
197
|
-
10. ALWAYS include the \`effort\` frontmatter field in every plan file — assess each task's complexity
|
|
198
|
-
|
|
199
|
-
## Plan Output Style
|
|
200
|
-
|
|
201
|
-
Plans can include whatever level of detail you deem helpful for the executing agent. Use your judgment:
|
|
202
|
-
- Include implementation details when they clarify the approach
|
|
203
|
-
- Code snippets are acceptable when they help illustrate a specific pattern
|
|
204
|
-
- File paths are helpful when referencing existing project files, patterns, or directories
|
|
205
|
-
- Focus on clarity — the goal is for the executing agent to understand what needs to be done`;
|
|
127
|
+
## Rules
|
|
128
|
+
|
|
129
|
+
- Always interview the user before creating or modifying plans
|
|
130
|
+
- Each plan must be self-contained with all context needed
|
|
131
|
+
- Be specific — vague plans lead to poor execution
|
|
132
|
+
- Include implementation details, code snippets, and file paths when they clarify the approach`;
|
|
206
133
|
const userMessage = `I want to add the following new tasks to this project:
|
|
207
134
|
|
|
208
135
|
${newTaskDescription}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amend.js","sourceRoot":"","sources":["../../src/prompts/amend.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"amend.js","sourceRoot":"","sources":["../../src/prompts/amend.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAcjD;;;;GAIG;AACH,MA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AAE,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACvE,CAAC,CAAC,QAAQ,CAAC;IACf,MAAM,mBAAmB,GACvB,eAAe,CAAC,MAAM,GAAG,CAAC;QACxB,CAAC,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACxE,CAAC,CAAC,QAAQ,CAAC;IAEf,MAAM,YAAY,GAAG;;;;;;;gCAOS,YAAY,CAAC,cAAc,CAAC;;;;kBAI1C,WAAW;;;;EAI3B,oBAAoB;;;EAGpB,kBAAkB;;;EAGlB,mBAAmB;;;;;;2CAMsB,WAAW,0CAA0C,WAAW;;;;;;;;;;;yCAWlE,WAAW;;;;;;;;oCAQhB,WAAW,UAAU,YAAY,CAAC,cAAc,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+FAuDU,CAAC;IAE9F,MAAM,WAAW,GAAG;;EAEpB,kBAAkB;;wEAEoD,CAAC;IAEvE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/prompts/execution.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../../src/prompts/execution.ts"],"names":[],"mappings":"AASA;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA2BxD;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,qDAAqD;IACrD,kBAAkB,CAAC,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAgKxE"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getCommitFormat, getCommitPrefix, renderCommitMessage } from '../utils/config.js';
|
|
2
|
+
import { extractProjectName } from '../utils/paths.js';
|
|
2
3
|
/**
|
|
3
4
|
* Maximum characters for a dependency outcome summary.
|
|
4
5
|
* Outcomes larger than this will be truncated to avoid context bloat.
|
|
@@ -49,9 +50,11 @@ ${previousOutcomes.map((o) => `### Task ${o.taskId}\n${o.content}`).join('\n\n')
|
|
|
49
50
|
// Build example commit message from config template
|
|
50
51
|
const commitTemplate = getCommitFormat('task');
|
|
51
52
|
const commitPrefix = getCommitPrefix();
|
|
53
|
+
const projectName = extractProjectName(projectPath) ?? projectNumber;
|
|
52
54
|
const exampleCommit = renderCommitMessage(commitTemplate, {
|
|
53
55
|
prefix: commitPrefix,
|
|
54
|
-
projectId:
|
|
56
|
+
projectId: projectName, // backwards compat: {projectId} resolves to projectName
|
|
57
|
+
projectName,
|
|
55
58
|
taskId: paddedTaskNumber,
|
|
56
59
|
description: '<description>',
|
|
57
60
|
});
|
|
@@ -121,20 +124,19 @@ ${depOutcomesFormatted}
|
|
|
121
124
|
2. Execute the task according to the plan
|
|
122
125
|
3. Verify all acceptance criteria are met
|
|
123
126
|
4. Signal completion with the appropriate marker
|
|
124
|
-
|
|
125
|
-
## Instructions
|
|
126
127
|
${retryContextSection}
|
|
128
|
+
## Instructions
|
|
129
|
+
|
|
127
130
|
### Step 1: Read the Plan
|
|
128
131
|
|
|
129
|
-
|
|
132
|
+
Read the plan file to understand exactly what needs to be done.
|
|
130
133
|
|
|
131
134
|
### Step 2: Execute the Task
|
|
132
135
|
|
|
133
|
-
Follow the implementation steps in the plan
|
|
134
|
-
- Write clean, maintainable code
|
|
135
|
-
- Follow existing code patterns in the project
|
|
136
|
-
- Add appropriate error handling
|
|
136
|
+
Follow the implementation steps in the plan:
|
|
137
|
+
- Write clean, maintainable code following existing patterns
|
|
137
138
|
- Follow any CLAUDE.md instructions
|
|
139
|
+
- If you encounter blockers, try to resolve them before giving up
|
|
138
140
|
${dependencyContextSection}${outcomesSection}
|
|
139
141
|
### Step 3: Verify Completion
|
|
140
142
|
|
|
@@ -145,48 +147,29 @@ Before marking the task complete:
|
|
|
145
147
|
${commitInstructions}
|
|
146
148
|
### Step 4: Write Outcome File
|
|
147
149
|
|
|
148
|
-
**CRITICAL**: You MUST write an outcome file to document what was accomplished.
|
|
149
|
-
|
|
150
150
|
**Outcome file path**: \`${outcomeFilePath}\`
|
|
151
151
|
|
|
152
|
-
The outcome file
|
|
152
|
+
The outcome file must contain:
|
|
153
153
|
1. A summary of what was done
|
|
154
154
|
2. Key changes made (files modified, features added, etc.)
|
|
155
155
|
3. Any important notes or follow-up items
|
|
156
|
-
4. The completion marker as the LAST line
|
|
156
|
+
4. The completion marker as the LAST line (exactly one marker per file)
|
|
157
157
|
|
|
158
|
-
**For
|
|
159
|
-
**For documentation/report tasks**: The outcome IS the deliverable - include the full content
|
|
158
|
+
**For documentation/report tasks**: The outcome IS the deliverable — include the full content.
|
|
160
159
|
|
|
161
|
-
|
|
160
|
+
The outcome file MUST end with one of these markers:
|
|
162
161
|
|
|
163
|
-
|
|
162
|
+
On success:
|
|
164
163
|
\`\`\`
|
|
165
164
|
<promise>COMPLETE</promise>
|
|
166
165
|
\`\`\`
|
|
167
166
|
|
|
168
|
-
|
|
167
|
+
On failure (do NOT commit — just write the outcome and stop):
|
|
169
168
|
\`\`\`
|
|
170
169
|
<promise>FAILED</promise>
|
|
171
170
|
Reason: [explain why the task failed]
|
|
172
171
|
\`\`\`
|
|
173
172
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
1. ALWAYS read the plan file first
|
|
177
|
-
2. Follow the plan precisely
|
|
178
|
-
3. Do not skip any acceptance criteria
|
|
179
|
-
4. If you encounter blockers, try to resolve them
|
|
180
|
-
5. The outcome file MUST contain EXACTLY ONE completion marker
|
|
181
|
-
6. The completion marker MUST be the LAST line in the outcome file
|
|
182
|
-
7. On SUCCESS: Commit code changes AND outcome file together BEFORE you finish
|
|
183
|
-
8. On FAILURE: Do NOT commit - just write the outcome file with FAILED marker
|
|
184
|
-
|
|
185
|
-
## Error Handling
|
|
186
|
-
|
|
187
|
-
If you encounter errors:
|
|
188
|
-
- Try to fix them yourself first
|
|
189
|
-
- If an error prevents completion, write the outcome file with FAILED status and a clear reason
|
|
190
|
-
- Do not mark COMPLETE if there are failing tests or unmet criteria`;
|
|
173
|
+
Do not mark COMPLETE if there are failing tests or unmet criteria.`;
|
|
191
174
|
}
|
|
192
175
|
//# sourceMappingURL=execution.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/prompts/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"execution.js","sourceRoot":"","sources":["../../src/prompts/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,eAAe,EA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AoB,GAAG,oBAAoB,
|
|
1
|
+
{"version":3,"file":"planning.d.ts","sourceRoot":"","sources":["../../src/prompts/planning.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,oBAAoB,GAAG,oBAAoB,CA4FpF"}
|
package/dist/prompts/planning.js
CHANGED
|
@@ -4,15 +4,8 @@
|
|
|
4
4
|
* - userMessage: Reference to input.md file (via positional argument, triggers the LLM to start)
|
|
5
5
|
*/
|
|
6
6
|
export function getPlanningPrompt(params) {
|
|
7
|
-
const { projectPath
|
|
8
|
-
const
|
|
9
|
-
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.
|
|
10
|
-
|
|
11
|
-
## Your Goals
|
|
12
|
-
|
|
13
|
-
1. **Analyze the input** and identify distinct, actionable tasks
|
|
14
|
-
2. **Interview the user** about EACH task to gather specific requirements
|
|
15
|
-
3. **Create plan files** for each task with clear instructions
|
|
7
|
+
const { projectPath } = params;
|
|
8
|
+
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.
|
|
16
9
|
|
|
17
10
|
## Project Location
|
|
18
11
|
|
|
@@ -22,53 +15,25 @@ Project folder: ${projectPath}
|
|
|
22
15
|
|
|
23
16
|
### Step 1: Identify and Order Tasks
|
|
24
17
|
|
|
25
|
-
|
|
26
|
-
- Be independently completable
|
|
27
|
-
- Have a clear outcome
|
|
28
|
-
- Take roughly 10-30 minutes of work
|
|
18
|
+
Identify distinct tasks from the project description. Each task should be independently completable, have a clear outcome, and take roughly 10-30 minutes.
|
|
29
19
|
|
|
30
|
-
**
|
|
31
|
-
- Setup/foundation tasks come first (e.g., defining schemas, creating interfaces)
|
|
32
|
-
- Core implementation tasks come next
|
|
33
|
-
- Integration and extension tasks come later
|
|
34
|
-
- Testing and validation tasks typically come last
|
|
20
|
+
**Order tasks by logical execution order:** setup/foundation → core implementation → integration/extension → testing/validation.
|
|
35
21
|
|
|
36
22
|
### Step 2: Interview the User
|
|
37
23
|
|
|
38
|
-
For EACH task
|
|
39
|
-
- Specific requirements and constraints
|
|
40
|
-
- Technology preferences
|
|
41
|
-
- Any existing code or patterns to follow
|
|
42
|
-
- Edge cases to handle
|
|
43
|
-
|
|
44
|
-
DO NOT skip the interview step. The quality of your plans depends on understanding the user's exact needs.
|
|
45
|
-
|
|
46
|
-
### Step 2.5: Record Decisions
|
|
24
|
+
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.
|
|
47
25
|
|
|
48
|
-
After EACH
|
|
49
|
-
- ${projectPath}/decisions.md
|
|
50
|
-
|
|
51
|
-
Use this format:
|
|
26
|
+
After EACH answer, append the Q&A pair to \`${projectPath}/decisions.md\`:
|
|
52
27
|
\`\`\`markdown
|
|
53
|
-
# Project Decisions
|
|
54
|
-
|
|
55
|
-
## [Question asked]
|
|
56
|
-
[User's answer]
|
|
57
|
-
|
|
58
28
|
## [Question asked]
|
|
59
29
|
[User's answer]
|
|
60
30
|
\`\`\`
|
|
61
31
|
|
|
62
|
-
This file serves as documentation of design choices made during planning. Append each new Q&A pair as you conduct the interview.
|
|
63
|
-
|
|
64
32
|
### Step 3: Create Plan Files
|
|
65
33
|
|
|
66
|
-
|
|
67
|
-
- ${projectPath}/plans/1-task-name.md
|
|
68
|
-
- ${projectPath}/plans/2-task-name.md
|
|
69
|
-
- etc.
|
|
34
|
+
Create plan files in \`${projectPath}/plans/\` numbered in execution order (e.g., \`1-task-name.md\`, \`2-task-name.md\`). Use kebab-case names.
|
|
70
35
|
|
|
71
|
-
Each plan file MUST have
|
|
36
|
+
Each plan file MUST have this structure:
|
|
72
37
|
|
|
73
38
|
\`\`\`markdown
|
|
74
39
|
---
|
|
@@ -77,116 +42,51 @@ effort: medium
|
|
|
77
42
|
# Task: [Task Name]
|
|
78
43
|
|
|
79
44
|
## Objective
|
|
80
|
-
[Clear, one-sentence description
|
|
45
|
+
[Clear, one-sentence description]
|
|
81
46
|
|
|
82
47
|
## Context
|
|
83
48
|
[Why this task is needed, how it fits into the larger project]
|
|
84
49
|
|
|
85
50
|
## Dependencies
|
|
86
|
-
[Optional
|
|
87
|
-
[Comma-separated list of task IDs this task depends on, e.g., "1, 2"]
|
|
88
|
-
[If a dependency fails, this task will be automatically blocked]
|
|
51
|
+
[Optional — omit if none. Comma-separated task IDs, e.g., "1, 2"]
|
|
89
52
|
|
|
90
53
|
## Requirements
|
|
91
|
-
[Specific requirements gathered from the user interview]
|
|
92
54
|
- Requirement 1
|
|
93
55
|
- Requirement 2
|
|
94
|
-
- ...
|
|
95
56
|
|
|
96
57
|
## Implementation Steps
|
|
97
58
|
1. [Step 1]
|
|
98
59
|
2. [Step 2]
|
|
99
|
-
3. [Step 3]
|
|
100
|
-
...
|
|
101
60
|
|
|
102
61
|
## Acceptance Criteria
|
|
103
62
|
- [ ] Criterion 1
|
|
104
63
|
- [ ] Criterion 2
|
|
105
|
-
- [ ] All tests pass
|
|
106
64
|
|
|
107
65
|
## Notes
|
|
108
|
-
[
|
|
66
|
+
[Additional context, warnings, or considerations]
|
|
109
67
|
\`\`\`
|
|
110
68
|
|
|
111
|
-
|
|
69
|
+
**Frontmatter fields:**
|
|
70
|
+
- \`effort\` (REQUIRED): \`low\` (trivial/mechanical), \`medium\` (well-scoped feature work), \`high\` (architectural/complex)
|
|
71
|
+
- \`model\` (optional): Override effort-based model selection. Rarely needed — prefer \`effort\` so the user's config controls the model.
|
|
112
72
|
|
|
113
|
-
|
|
114
|
-
- \`effort: low\` — Trivial/mechanical changes, simple one-file edits, config changes
|
|
115
|
-
- \`effort: medium\` — Well-scoped feature work, bug fixes with clear plans, multi-file changes following existing patterns
|
|
116
|
-
- \`effort: high\` — Architectural changes, complex logic, tasks requiring deep codebase understanding
|
|
73
|
+
**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.
|
|
117
74
|
|
|
118
|
-
|
|
119
|
-
\`\`\`markdown
|
|
120
|
-
---
|
|
121
|
-
effort: medium
|
|
122
|
-
model: opus
|
|
123
|
-
---
|
|
124
|
-
# Task: ...
|
|
125
|
-
\`\`\`
|
|
75
|
+
### Step 4: Confirm Completion
|
|
126
76
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
### Step 4: Infer Task Dependencies
|
|
130
|
-
|
|
131
|
-
For each task, analyze which other tasks must complete successfully before it can begin. Add a \`## Dependencies\` section to plan files that have prerequisites.
|
|
132
|
-
|
|
133
|
-
**How to identify dependencies:**
|
|
134
|
-
- If task B uses output/artifacts from task A → B depends on A
|
|
135
|
-
- If task B modifies code created by task A → B depends on A
|
|
136
|
-
- If task B tests functionality from task A → B depends on A
|
|
137
|
-
- If task B extends or builds upon task A → B depends on A
|
|
138
|
-
|
|
139
|
-
**Dependency format examples:**
|
|
140
|
-
\`\`\`markdown
|
|
141
|
-
## Dependencies
|
|
142
|
-
1
|
|
143
|
-
\`\`\`
|
|
144
|
-
or for multiple dependencies:
|
|
145
|
-
\`\`\`markdown
|
|
146
|
-
## Dependencies
|
|
147
|
-
1, 2
|
|
148
|
-
\`\`\`
|
|
149
|
-
|
|
150
|
-
**Rules for dependencies:**
|
|
151
|
-
- Only reference lower-numbered tasks (tasks are ordered by execution order)
|
|
152
|
-
- Omit the Dependencies section entirely if a task has no prerequisites
|
|
153
|
-
- Keep dependency lists minimal - only direct dependencies, not transitive ones
|
|
154
|
-
- Never create circular dependencies (impossible if you only reference lower-numbered tasks)
|
|
155
|
-
|
|
156
|
-
### Step 5: Confirm Completion
|
|
157
|
-
|
|
158
|
-
After creating all plan files:
|
|
159
|
-
1. Provide a summary of the tasks you've created, including the effort level for each task. Example:
|
|
160
|
-
- Task 1: setup-database (effort: low)
|
|
161
|
-
- Task 2: implement-auth (effort: medium)
|
|
162
|
-
- Task 3: refactor-api (effort: high)
|
|
163
|
-
2. Display this exit message to the user:
|
|
77
|
+
Provide a summary with effort levels (e.g., "Task 1: setup-database (effort: low)"), then display:
|
|
164
78
|
|
|
165
79
|
\`\`\`
|
|
166
80
|
Planning complete! To exit this session and run your tasks:
|
|
167
81
|
1. Press Ctrl-C twice to exit
|
|
168
|
-
2. Then run: raf do <project
|
|
82
|
+
2. Then run: raf do <project>
|
|
169
83
|
\`\`\`
|
|
170
84
|
|
|
171
|
-
##
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
4. Each plan should be self-contained with all context needed
|
|
177
|
-
5. Infer dependencies automatically - analyze task relationships, don't ask the user about dependencies
|
|
178
|
-
6. Only add Dependencies section when a task genuinely requires another to complete first
|
|
179
|
-
7. Dependencies must only reference lower-numbered tasks to prevent circular dependencies
|
|
180
|
-
8. Be specific - vague plans lead to poor execution
|
|
181
|
-
9. ALWAYS include the \`effort\` frontmatter field in every plan file — assess each task's complexity
|
|
182
|
-
|
|
183
|
-
## Plan Output Style
|
|
184
|
-
|
|
185
|
-
Plans can include whatever level of detail you deem helpful for the executing agent. Use your judgment:
|
|
186
|
-
- Include implementation details when they clarify the approach
|
|
187
|
-
- Code snippets are acceptable when they help illustrate a specific pattern
|
|
188
|
-
- File paths are helpful when referencing existing project files, patterns, or directories
|
|
189
|
-
- Focus on clarity — the goal is for the executing agent to understand what needs to be done`;
|
|
85
|
+
## Rules
|
|
86
|
+
|
|
87
|
+
- Each plan must be self-contained with all context needed for execution
|
|
88
|
+
- Be specific — vague plans lead to poor execution
|
|
89
|
+
- Include implementation details, code snippets, and file paths when they clarify the approach`;
|
|
190
90
|
const userMessage = `Here is my project description:
|
|
191
91
|
|
|
192
92
|
${params.inputContent}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planning.js","sourceRoot":"","sources":["../../src/prompts/planning.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAA4B;IAC5D,MAAM,EAAE,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"planning.js","sourceRoot":"","sources":["../../src/prompts/planning.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAA4B;IAC5D,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IAC/B,MAAM,YAAY,GAAG;;;;kBAIL,WAAW;;;;;;;;;;;;;;8CAciB,WAAW;;;;;;;;yBAQhC,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+FAuD2D,CAAC;IAE9F,MAAM,WAAW,GAAG;;EAEpB,MAAM,CAAC,YAAY;;sDAEiC,CAAC;IAErD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AACvC,CAAC"}
|