@litmers/cursorflow-orchestrator 0.1.9 → 0.1.12
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/CHANGELOG.md +24 -0
- package/README.md +90 -72
- package/commands/cursorflow-clean.md +24 -135
- package/commands/cursorflow-doctor.md +66 -38
- package/commands/cursorflow-init.md +33 -50
- package/commands/cursorflow-models.md +51 -0
- package/commands/cursorflow-monitor.md +52 -72
- package/commands/cursorflow-prepare.md +426 -147
- package/commands/cursorflow-resume.md +51 -159
- package/commands/cursorflow-review.md +38 -202
- package/commands/cursorflow-run.md +197 -84
- package/commands/cursorflow-signal.md +27 -72
- package/dist/cli/clean.js +23 -0
- package/dist/cli/clean.js.map +1 -1
- package/dist/cli/doctor.js +14 -1
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/index.js +14 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/init.js +5 -4
- package/dist/cli/init.js.map +1 -1
- package/dist/cli/models.d.ts +7 -0
- package/dist/cli/models.js +104 -0
- package/dist/cli/models.js.map +1 -0
- package/dist/cli/monitor.js +17 -0
- package/dist/cli/monitor.js.map +1 -1
- package/dist/cli/prepare.d.ts +7 -0
- package/dist/cli/prepare.js +748 -0
- package/dist/cli/prepare.js.map +1 -0
- package/dist/cli/resume.js +56 -0
- package/dist/cli/resume.js.map +1 -1
- package/dist/cli/run.js +30 -1
- package/dist/cli/run.js.map +1 -1
- package/dist/cli/signal.js +18 -0
- package/dist/cli/signal.js.map +1 -1
- package/dist/utils/cursor-agent.d.ts +4 -0
- package/dist/utils/cursor-agent.js +58 -10
- package/dist/utils/cursor-agent.js.map +1 -1
- package/dist/utils/doctor.d.ts +10 -0
- package/dist/utils/doctor.js +581 -1
- package/dist/utils/doctor.js.map +1 -1
- package/dist/utils/types.d.ts +2 -0
- package/examples/README.md +114 -59
- package/examples/demo-project/README.md +61 -79
- package/examples/demo-project/_cursorflow/tasks/demo-test/01-create-utils.json +17 -6
- package/examples/demo-project/_cursorflow/tasks/demo-test/02-add-tests.json +17 -6
- package/examples/demo-project/_cursorflow/tasks/demo-test/README.md +66 -25
- package/package.json +1 -1
- package/src/cli/clean.ts +27 -0
- package/src/cli/doctor.ts +18 -2
- package/src/cli/index.ts +15 -3
- package/src/cli/init.ts +6 -4
- package/src/cli/models.ts +83 -0
- package/src/cli/monitor.ts +20 -0
- package/src/cli/prepare.ts +844 -0
- package/src/cli/resume.ts +66 -0
- package/src/cli/run.ts +36 -2
- package/src/cli/signal.ts +22 -0
- package/src/utils/cursor-agent.ts +62 -10
- package/src/utils/doctor.ts +633 -5
- package/src/utils/types.ts +2 -0
|
@@ -1,157 +1,436 @@
|
|
|
1
1
|
# CursorFlow Prepare
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"prompt": "..."
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
**Key Configuration Options:**
|
|
80
|
-
|
|
81
|
-
| Option | Type | Default | Description |
|
|
82
|
-
|--------|------|---------|-------------|
|
|
83
|
-
| `timeout` | number | 300000 | Task timeout in milliseconds |
|
|
84
|
-
| `enableIntervention` | boolean | false | Enable stdin piping for intervention |
|
|
85
|
-
| `dependsOn` | string[] | [] | Lane dependencies |
|
|
86
|
-
|
|
87
|
-
**Timeout Guidelines:**
|
|
88
|
-
- Simple tasks: `60000` (1 min)
|
|
89
|
-
- Medium tasks: `300000` (5 min) - default
|
|
90
|
-
- Complex tasks: `600000` (10 min)
|
|
91
|
-
|
|
92
|
-
4. **Model selection guide**
|
|
93
|
-
|
|
94
|
-
| Model | Purpose | Notes |
|
|
95
|
-
|------|------|------|
|
|
96
|
-
| `sonnet-4.5` | General implementation, fast work | Most versatile |
|
|
97
|
-
| `sonnet-4.5-thinking` | Code review, deeper reasoning | Thinking model |
|
|
98
|
-
| `opus-4.5` | Complex tasks, high quality | Advanced |
|
|
99
|
-
| `opus-4.5-thinking` | Architecture design | Premium |
|
|
100
|
-
| `gpt-5.2` | General tasks | OpenAI |
|
|
101
|
-
| `gpt-5.2-high` | Advanced reasoning | High performance |
|
|
102
|
-
|
|
103
|
-
5. **Verify the output**
|
|
104
|
-
```
|
|
105
|
-
✅ Task preparation complete
|
|
106
|
-
===========================
|
|
107
|
-
|
|
108
|
-
Folder: _cursorflow/tasks/<timestamp>_<feature>/
|
|
109
|
-
Files created:
|
|
110
|
-
- 01-<lane1>.json
|
|
111
|
-
- 02-<lane2>.json
|
|
112
|
-
- ...
|
|
113
|
-
- README.md
|
|
114
|
-
|
|
115
|
-
Run with:
|
|
116
|
-
cursorflow run _cursorflow/tasks/<timestamp>_<feature>/
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
## Examples
|
|
120
|
-
|
|
121
|
-
### Single-lane task
|
|
122
|
-
```bash
|
|
123
|
-
cursorflow prepare MyFeature --lanes 1
|
|
124
|
-
```
|
|
3
|
+
## Core Philosophy: Think Like an Engineering Manager
|
|
4
|
+
|
|
5
|
+
Before writing any command, adopt the mindset of an engineering manager assigning work to developers:
|
|
6
|
+
|
|
7
|
+
### 1. Each Lane is a Developer
|
|
8
|
+
- **One developer = One area of responsibility**
|
|
9
|
+
- Just as you wouldn't assign a frontend developer to work on database migrations while simultaneously building UI components, don't mix unrelated concerns in a single lane
|
|
10
|
+
- A lane maintains context across its tasks—switching domains mid-lane loses that continuity
|
|
11
|
+
|
|
12
|
+
### 2. Separation of Concerns
|
|
13
|
+
- **Different domains → Different lanes**: Backend API and Frontend UI should be separate lanes
|
|
14
|
+
- **Same domain, sequential work → Multiple tasks in one lane**: Planning, implementing, and testing the same feature stays in one lane
|
|
15
|
+
- **Shared dependencies → Use `dependsOn`**: If the UI needs the API to exist first, make the UI lane depend on the API lane
|
|
16
|
+
|
|
17
|
+
### 3. Clear Boundaries, Clear Prompts
|
|
18
|
+
- Each task prompt should be specific enough that a developer could execute it without asking questions
|
|
19
|
+
- If your prompt says "implement the feature," that's too vague—specify WHAT, WHERE, and HOW
|
|
20
|
+
- Include verification steps: "Double-check that all edge cases are handled"
|
|
21
|
+
|
|
22
|
+
### 4. Fail-Safe Design
|
|
23
|
+
- **Expect incomplete work**: AI agents sometimes miss edge cases. Add a "verify" task at the end
|
|
24
|
+
- **Post-merge validation**: When a lane depends on another, include instructions to "merge, resolve conflicts, then verify integration"
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Terminal-First Workflow
|
|
29
|
+
|
|
30
|
+
CursorFlow follows a **terminal-first** approach. Everything is defined via CLI commands.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
|
|
34
|
+
│ 1. Create Lanes │ ──▶ │ 2. Add Tasks │ ──▶ │ 3. Validate │ ──▶ │ 4. Run │
|
|
35
|
+
│ (prepare) │ │ (prepare) │ │ (doctor) │ │ (run) │
|
|
36
|
+
└─────────────────┘ └─────────────────┘ └─────────────────┘ └─────────────────┘
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Step-by-Step Workflow
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# Step 1: Create lanes with preset templates
|
|
43
|
+
# Complex feature: plan → implement → test
|
|
44
|
+
cursorflow prepare AuthSystem --preset complex --prompt "Build authentication system"
|
|
45
|
+
|
|
46
|
+
# Or simple fix: implement → test
|
|
47
|
+
cursorflow prepare BugFix --preset simple --prompt "Fix login bug"
|
|
48
|
+
|
|
49
|
+
# Or multi-lane with auto-merge for dependent lanes
|
|
50
|
+
cursorflow prepare FullStack --lanes 3 --sequential --preset complex \
|
|
51
|
+
--prompt "Build your layer"
|
|
52
|
+
|
|
53
|
+
# Step 2: Add more lanes if needed (merge preset auto-applied)
|
|
54
|
+
cursorflow prepare --add-lane _cursorflow/tasks/2412211530_AuthSystem \
|
|
55
|
+
--depends-on "01-lane-1,02-lane-2" # Uses merge preset automatically
|
|
56
|
+
|
|
57
|
+
# Step 3: Add tasks to existing lanes
|
|
58
|
+
cursorflow prepare --add-task _cursorflow/tasks/2412211530_AuthSystem/01-lane-1.json \
|
|
59
|
+
--task "verify|sonnet-4.5|Double-check all requirements|All criteria met"
|
|
60
|
+
|
|
61
|
+
# Step 4: Validate configuration
|
|
62
|
+
cursorflow doctor --tasks-dir _cursorflow/tasks/2412211530_AuthSystem
|
|
63
|
+
|
|
64
|
+
# Step 5: Run
|
|
65
|
+
cursorflow run _cursorflow/tasks/2412211530_AuthSystem
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Command Reference
|
|
71
|
+
|
|
72
|
+
### Usage
|
|
125
73
|
|
|
126
|
-
### Multi-lane task
|
|
127
74
|
```bash
|
|
128
|
-
|
|
75
|
+
# Create new feature
|
|
76
|
+
cursorflow prepare <feature-name> [options]
|
|
77
|
+
|
|
78
|
+
# Add lane to existing task directory
|
|
79
|
+
cursorflow prepare --add-lane <task-dir> [options]
|
|
80
|
+
|
|
81
|
+
# Add task to existing lane
|
|
82
|
+
cursorflow prepare --add-task <lane-file> --task <spec>
|
|
129
83
|
```
|
|
130
84
|
|
|
131
|
-
###
|
|
85
|
+
### Options
|
|
86
|
+
|
|
87
|
+
| Option | Description |
|
|
88
|
+
|--------|-------------|
|
|
89
|
+
| **Core** ||
|
|
90
|
+
| `<feature-name>` | Feature name (for new task directories) |
|
|
91
|
+
| `--lanes <num>` | Number of lanes to create (default: 1) |
|
|
92
|
+
| `--preset <type>` | Use preset template: `complex` \| `simple` \| `merge` |
|
|
93
|
+
| **Task Definition** ||
|
|
94
|
+
| `--prompt <text>` | Task prompt (context for preset or single task) |
|
|
95
|
+
| `--criteria <list>` | Comma-separated acceptance criteria |
|
|
96
|
+
| `--model <model>` | Model to use (default: `sonnet-4.5`) |
|
|
97
|
+
| `--task <spec>` | Full task spec: `"name\|model\|prompt\|criteria"` (repeatable) |
|
|
98
|
+
| **Dependencies** ||
|
|
99
|
+
| `--sequential` | Chain lanes: 1 → 2 → 3 (auto-merge between lanes) |
|
|
100
|
+
| `--deps <spec>` | Custom dependency graph: `"2:1;3:1,2"` |
|
|
101
|
+
| `--depends-on <lanes>` | Dependencies for `--add-lane`: `"01-lane-1,02-lane-2"` |
|
|
102
|
+
| **Incremental** ||
|
|
103
|
+
| `--add-lane <dir>` | Add a new lane to existing task directory |
|
|
104
|
+
| `--add-task <file>` | Append task(s) to existing lane JSON file |
|
|
105
|
+
| **Advanced** ||
|
|
106
|
+
| `--template <path>` | Custom JSON template |
|
|
107
|
+
| `--force` | Overwrite existing files |
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Preset Templates
|
|
112
|
+
|
|
113
|
+
CursorFlow provides 3 preset templates for common patterns:
|
|
114
|
+
|
|
115
|
+
### `--preset complex` (plan → implement → test)
|
|
116
|
+
|
|
117
|
+
For complex features that need planning:
|
|
118
|
+
|
|
132
119
|
```bash
|
|
133
|
-
cursorflow prepare
|
|
120
|
+
cursorflow prepare FeatureName --preset complex --prompt "Implement user authentication"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Generated tasks:
|
|
124
|
+
1. **plan** (sonnet-4.5-thinking): Analyze requirements, **save plan to `_cursorflow/PLAN_lane-{N}.md`**
|
|
125
|
+
2. **implement** (sonnet-4.5): **Read plan from `_cursorflow/PLAN_lane-{N}.md`**, build feature
|
|
126
|
+
3. **test** (sonnet-4.5): **Refer to plan document** for test requirements
|
|
127
|
+
|
|
128
|
+
**Plan Document Path**: Each lane saves its plan to `_cursorflow/PLAN_lane-{N}.md` where `{N}` is the lane number. The implement and test tasks explicitly reference this document.
|
|
129
|
+
|
|
130
|
+
### `--preset simple` (implement → test)
|
|
131
|
+
|
|
132
|
+
For simple changes or bug fixes:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
cursorflow prepare BugFix --preset simple --prompt "Fix login validation bug"
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Generated tasks:
|
|
139
|
+
1. **implement** (sonnet-4.5): Make the required changes
|
|
140
|
+
2. **test** (sonnet-4.5): Write/update tests
|
|
141
|
+
|
|
142
|
+
### No Preset (Single Task)
|
|
143
|
+
|
|
144
|
+
For quick, simple changes you can omit the preset entirely:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
cursorflow prepare QuickFix --prompt "Fix typo in README.md"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Generated: Single `implement` task with your prompt directly.
|
|
151
|
+
|
|
152
|
+
### `--preset merge` (merge → test)
|
|
153
|
+
|
|
154
|
+
For integration lanes with dependencies. **Auto-applied when `--depends-on` is set**:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
cursorflow prepare --add-lane _cursorflow/tasks/2412211530_Feature \
|
|
158
|
+
--preset merge --depends-on "01-lane-1,02-lane-2"
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Generated tasks:
|
|
162
|
+
1. **merge** (sonnet-4.5): Resolve conflicts, verify integration
|
|
163
|
+
2. **test** (sonnet-4.5): Run integration tests
|
|
164
|
+
|
|
165
|
+
### Auto-Detection
|
|
166
|
+
|
|
167
|
+
When a lane has dependencies (`--depends-on` or via `--sequential`), the `merge` preset is automatically applied unless you explicitly specify another preset.
|
|
168
|
+
|
|
169
|
+
### Task Spec Format (`--task`)
|
|
170
|
+
|
|
171
|
+
```
|
|
172
|
+
"name|model|prompt|criteria1,criteria2"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
- **name**: Task identifier (alphanumeric, `-`, `_`)
|
|
176
|
+
- **model**: AI model (`sonnet-4.5`, `sonnet-4.5-thinking`, etc.)
|
|
177
|
+
- **prompt**: Instructions for the AI
|
|
178
|
+
- **criteria**: Comma-separated acceptance criteria (optional)
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Quick Examples
|
|
183
|
+
|
|
184
|
+
### 1. Simple Single-Lane Feature
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
cursorflow prepare FixBug --prompt "Fix null pointer in auth.ts line 42"
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 2. Single Lane with Multiple Tasks
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
cursorflow prepare AddAPI \
|
|
194
|
+
--task "plan|sonnet-4.5-thinking|Create REST API design|Design documented" \
|
|
195
|
+
--task "implement|sonnet-4.5|Build the API endpoints|All endpoints work" \
|
|
196
|
+
--task "verify|sonnet-4.5|Test all edge cases|All tests pass"
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### 3. Multiple Parallel Lanes
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
cursorflow prepare Dashboard --lanes 2 \
|
|
203
|
+
--prompt "Implement dashboard for your layer"
|
|
204
|
+
|
|
205
|
+
# Lane 1: Frontend developer
|
|
206
|
+
# Lane 2: Backend developer
|
|
207
|
+
# Both work in parallel
|
|
134
208
|
```
|
|
135
209
|
|
|
210
|
+
### 4. Sequential Lanes with Dependencies
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
cursorflow prepare AuthSystem --lanes 3 --sequential \
|
|
214
|
+
--prompt "Implement your authentication layer"
|
|
215
|
+
|
|
216
|
+
# Lane 1: DB Schema (starts immediately)
|
|
217
|
+
# Lane 2: Backend API (waits for Lane 1, auto-merges)
|
|
218
|
+
# Lane 3: Frontend (waits for Lane 2, auto-merges)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### 5. Adding Lanes Incrementally
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# Create initial feature
|
|
225
|
+
cursorflow prepare PaymentFlow --lanes 2 --sequential \
|
|
226
|
+
--prompt "Implement payment processing"
|
|
227
|
+
|
|
228
|
+
# Later: Add integration test lane that depends on both
|
|
229
|
+
cursorflow prepare --add-lane _cursorflow/tasks/2412211530_PaymentFlow \
|
|
230
|
+
--prompt "Run integration tests for payment flow" \
|
|
231
|
+
--criteria "All payment flows tested,Error handling verified" \
|
|
232
|
+
--depends-on "01-lane-1,02-lane-2"
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### 6. Adding Tasks to Existing Lane
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
# Add verification task to lane 1
|
|
239
|
+
cursorflow prepare --add-task _cursorflow/tasks/2412211530_PaymentFlow/01-lane-1.json \
|
|
240
|
+
--task "verify|sonnet-4.5|Double-check payment validation|All validations work"
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## Understanding `dependsOn`
|
|
246
|
+
|
|
247
|
+
`dependsOn` is not just ordering—it triggers **automatic branch merging**.
|
|
248
|
+
|
|
249
|
+
### How It Works
|
|
250
|
+
|
|
251
|
+
1. Lane 1 completes and creates branch `feature/lane-1-abc123`
|
|
252
|
+
2. Lane 2 starts, `runner.ts` **merges Lane 1's branch** into Lane 2's worktree
|
|
253
|
+
3. Lane 2 now has all of Lane 1's code changes and can build upon them
|
|
254
|
+
|
|
255
|
+
### Dependency Patterns
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
# Sequential: 1 → 2 → 3
|
|
259
|
+
cursorflow prepare Feature --lanes 3 --sequential
|
|
260
|
+
|
|
261
|
+
# Diamond: 1 → 2, 1 → 3, 2+3 → 4
|
|
262
|
+
cursorflow prepare Feature --lanes 4 --deps "2:1;3:1;4:2,3"
|
|
263
|
+
|
|
264
|
+
# Parallel then merge: 1, 2 (parallel) → 3
|
|
265
|
+
cursorflow prepare Feature --lanes 3 --deps "3:1,2"
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
### Example: 3-Lane Authentication System
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
cursorflow prepare AuthSystem --lanes 3 --deps "2:1;3:1,2" \
|
|
272
|
+
--prompt "Implement your assigned component"
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
| Lane | Role | dependsOn | When It Starts |
|
|
276
|
+
|------|------|-----------|----------------|
|
|
277
|
+
| 01-lane-1 | DB Schema | (none) | Immediately |
|
|
278
|
+
| 02-lane-2 | Backend API | 01-lane-1 | After DB done, merges DB branch |
|
|
279
|
+
| 03-lane-3 | Integration Tests | 01-lane-1, 02-lane-2 | After both, merges both branches |
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Task Design Patterns
|
|
284
|
+
|
|
285
|
+
### Standard Patterns
|
|
286
|
+
|
|
287
|
+
**Complex Feature (recommended):**
|
|
288
|
+
```bash
|
|
289
|
+
cursorflow prepare ComplexFeature \
|
|
290
|
+
--task "plan|sonnet-4.5-thinking|Analyze requirements and create plan|Plan documented" \
|
|
291
|
+
--task "implement|sonnet-4.5|Implement according to plan|Code complete" \
|
|
292
|
+
--task "verify|sonnet-4.5|Double-check all requirements are met|All tests pass"
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
**Simple Change:**
|
|
296
|
+
```bash
|
|
297
|
+
cursorflow prepare SimpleFix \
|
|
298
|
+
--task "implement|sonnet-4.5|Fix the bug and add test|Bug fixed,Test added" \
|
|
299
|
+
--task "verify|sonnet-4.5|Verify fix works in all cases|All cases handled"
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
**Merge Lane (for dependent lanes):**
|
|
303
|
+
```bash
|
|
304
|
+
# Create as 4th lane depending on 2 and 3
|
|
305
|
+
cursorflow prepare --add-lane _cursorflow/tasks/2412211530_Feature \
|
|
306
|
+
--depends-on "02-lane-2,03-lane-3" \
|
|
307
|
+
--task "merge|sonnet-4.5|Merge branches and resolve conflicts|Clean merge" \
|
|
308
|
+
--task "integrate|sonnet-4.5|Verify integration|Tests pass"
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### Best Practices
|
|
312
|
+
|
|
313
|
+
1. **Be Specific**
|
|
314
|
+
- ❌ "Implement the feature"
|
|
315
|
+
- ✅ "Create `src/api/users.ts` with GET/POST/PUT/DELETE endpoints for User model"
|
|
316
|
+
|
|
317
|
+
2. **Include Verification**
|
|
318
|
+
- Always add a final "verify" task
|
|
319
|
+
- AI agents often miss edge cases on first pass
|
|
320
|
+
|
|
321
|
+
3. **Scope Post-Merge Tasks**
|
|
322
|
+
- When `dependsOn` is set, include: "After merging, resolve any conflicts and verify integration"
|
|
323
|
+
|
|
324
|
+
4. **Use Thinking Models for Planning**
|
|
325
|
+
- Use `sonnet-4.5-thinking` for `plan` tasks (deeper reasoning)
|
|
326
|
+
- Use `sonnet-4.5` for `implement` tasks (faster execution)
|
|
327
|
+
|
|
328
|
+
---
|
|
329
|
+
|
|
330
|
+
## When to Use Multiple Lanes
|
|
331
|
+
|
|
332
|
+
### Good Use Cases for Separate Lanes
|
|
333
|
+
|
|
334
|
+
| Scenario | Lanes | Why |
|
|
335
|
+
|----------|-------|-----|
|
|
336
|
+
| Frontend + Backend | 2 | Different file sets, can run in parallel |
|
|
337
|
+
| Database + API + UI | 3 | Sequential dependency, clean separation |
|
|
338
|
+
| Multiple microservices | N | Completely isolated codebases |
|
|
339
|
+
| Refactor + New Feature | 2 | Refactor first, feature depends on it |
|
|
340
|
+
|
|
341
|
+
### Keep in Single Lane
|
|
342
|
+
|
|
343
|
+
| Scenario | Why |
|
|
344
|
+
|----------|-----|
|
|
345
|
+
| Sequential tasks on same files | Context continuity |
|
|
346
|
+
| Plan → Implement → Test same feature | Single developer mindset |
|
|
347
|
+
| Tightly coupled changes | Avoid merge complexity |
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## Validation with Doctor
|
|
352
|
+
|
|
353
|
+
Before running, always validate your configuration:
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
cursorflow doctor --tasks-dir _cursorflow/tasks/2412211530_FeatureName
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
The doctor command checks:
|
|
360
|
+
- Required fields (`tasks`, `name`, `prompt`)
|
|
361
|
+
- Valid task name format
|
|
362
|
+
- Correct dependency graph (no circular dependencies)
|
|
363
|
+
- Configuration value types
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## Generated File Structure
|
|
368
|
+
|
|
369
|
+
```
|
|
370
|
+
_cursorflow/tasks/2412211530_FeatureName/
|
|
371
|
+
├── 01-lane-1.json # Lane 1 configuration
|
|
372
|
+
├── 02-lane-2.json # Lane 2 configuration
|
|
373
|
+
├── 03-lane-3.json # Lane 3 configuration (if added)
|
|
374
|
+
└── README.md # Auto-generated instructions
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### JSON Schema
|
|
378
|
+
|
|
379
|
+
```json
|
|
380
|
+
{
|
|
381
|
+
"baseBranch": "main",
|
|
382
|
+
"branchPrefix": "featurename/lane-1-",
|
|
383
|
+
"timeout": 300000,
|
|
384
|
+
"enableIntervention": false,
|
|
385
|
+
"dependencyPolicy": {
|
|
386
|
+
"allowDependencyChange": false,
|
|
387
|
+
"lockfileReadOnly": true
|
|
388
|
+
},
|
|
389
|
+
"enableReview": true,
|
|
390
|
+
"reviewModel": "sonnet-4.5-thinking",
|
|
391
|
+
"maxReviewIterations": 3,
|
|
392
|
+
"laneNumber": 1,
|
|
393
|
+
"devPort": 3001,
|
|
394
|
+
"dependsOn": ["01-lane-1"],
|
|
395
|
+
"tasks": [
|
|
396
|
+
{
|
|
397
|
+
"name": "implement",
|
|
398
|
+
"model": "sonnet-4.5",
|
|
399
|
+
"prompt": "Your task instructions here",
|
|
400
|
+
"acceptanceCriteria": ["Criterion 1", "Criterion 2"]
|
|
401
|
+
}
|
|
402
|
+
]
|
|
403
|
+
}
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
### Key Fields
|
|
407
|
+
|
|
408
|
+
| Field | Required | Description |
|
|
409
|
+
|-------|----------|-------------|
|
|
410
|
+
| `tasks` | Yes | Array of task objects |
|
|
411
|
+
| `tasks[].name` | Yes | Task identifier |
|
|
412
|
+
| `tasks[].prompt` | Yes | Instructions for AI agent |
|
|
413
|
+
| `tasks[].model` | No | Model override |
|
|
414
|
+
| `tasks[].acceptanceCriteria` | No | Criteria for AI review |
|
|
415
|
+
| `dependsOn` | No | Array of lane names to wait for |
|
|
416
|
+
| `baseBranch` | Yes | Branch to create worktree from |
|
|
417
|
+
| `branchPrefix` | Yes | Prefix for the feature branch |
|
|
418
|
+
|
|
419
|
+
---
|
|
420
|
+
|
|
136
421
|
## Checklist
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
- [ ]
|
|
140
|
-
- [ ]
|
|
141
|
-
- [ ]
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
- [ ]
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
6. **Timeout**: Set based on task complexity. See timeout guidelines above.
|
|
153
|
-
|
|
154
|
-
## Next steps
|
|
155
|
-
1. Tailor the generated JSON files to the project.
|
|
156
|
-
2. Write detailed prompts.
|
|
157
|
-
3. Run the tasks with `cursorflow run`.
|
|
422
|
+
|
|
423
|
+
### Before Creating Tasks
|
|
424
|
+
- [ ] Requirements are clearly understood
|
|
425
|
+
- [ ] Work is divided by domain (one lane = one area of responsibility)
|
|
426
|
+
- [ ] Dependencies between lanes are identified
|
|
427
|
+
|
|
428
|
+
### After Creating Tasks
|
|
429
|
+
- [ ] Each task has a specific, actionable prompt
|
|
430
|
+
- [ ] Acceptance criteria are measurable
|
|
431
|
+
- [ ] Dependent lanes include merge/integration instructions
|
|
432
|
+
- [ ] Final task includes verification step
|
|
433
|
+
|
|
434
|
+
### Before Running
|
|
435
|
+
- [ ] `cursorflow doctor --tasks-dir <dir>` passes with no errors
|
|
436
|
+
- [ ] JSON files reviewed for any issues
|