@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.
Files changed (60) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/README.md +90 -72
  3. package/commands/cursorflow-clean.md +24 -135
  4. package/commands/cursorflow-doctor.md +66 -38
  5. package/commands/cursorflow-init.md +33 -50
  6. package/commands/cursorflow-models.md +51 -0
  7. package/commands/cursorflow-monitor.md +52 -72
  8. package/commands/cursorflow-prepare.md +426 -147
  9. package/commands/cursorflow-resume.md +51 -159
  10. package/commands/cursorflow-review.md +38 -202
  11. package/commands/cursorflow-run.md +197 -84
  12. package/commands/cursorflow-signal.md +27 -72
  13. package/dist/cli/clean.js +23 -0
  14. package/dist/cli/clean.js.map +1 -1
  15. package/dist/cli/doctor.js +14 -1
  16. package/dist/cli/doctor.js.map +1 -1
  17. package/dist/cli/index.js +14 -3
  18. package/dist/cli/index.js.map +1 -1
  19. package/dist/cli/init.js +5 -4
  20. package/dist/cli/init.js.map +1 -1
  21. package/dist/cli/models.d.ts +7 -0
  22. package/dist/cli/models.js +104 -0
  23. package/dist/cli/models.js.map +1 -0
  24. package/dist/cli/monitor.js +17 -0
  25. package/dist/cli/monitor.js.map +1 -1
  26. package/dist/cli/prepare.d.ts +7 -0
  27. package/dist/cli/prepare.js +748 -0
  28. package/dist/cli/prepare.js.map +1 -0
  29. package/dist/cli/resume.js +56 -0
  30. package/dist/cli/resume.js.map +1 -1
  31. package/dist/cli/run.js +30 -1
  32. package/dist/cli/run.js.map +1 -1
  33. package/dist/cli/signal.js +18 -0
  34. package/dist/cli/signal.js.map +1 -1
  35. package/dist/utils/cursor-agent.d.ts +4 -0
  36. package/dist/utils/cursor-agent.js +58 -10
  37. package/dist/utils/cursor-agent.js.map +1 -1
  38. package/dist/utils/doctor.d.ts +10 -0
  39. package/dist/utils/doctor.js +581 -1
  40. package/dist/utils/doctor.js.map +1 -1
  41. package/dist/utils/types.d.ts +2 -0
  42. package/examples/README.md +114 -59
  43. package/examples/demo-project/README.md +61 -79
  44. package/examples/demo-project/_cursorflow/tasks/demo-test/01-create-utils.json +17 -6
  45. package/examples/demo-project/_cursorflow/tasks/demo-test/02-add-tests.json +17 -6
  46. package/examples/demo-project/_cursorflow/tasks/demo-test/README.md +66 -25
  47. package/package.json +1 -1
  48. package/src/cli/clean.ts +27 -0
  49. package/src/cli/doctor.ts +18 -2
  50. package/src/cli/index.ts +15 -3
  51. package/src/cli/init.ts +6 -4
  52. package/src/cli/models.ts +83 -0
  53. package/src/cli/monitor.ts +20 -0
  54. package/src/cli/prepare.ts +844 -0
  55. package/src/cli/resume.ts +66 -0
  56. package/src/cli/run.ts +36 -2
  57. package/src/cli/signal.ts +22 -0
  58. package/src/utils/cursor-agent.ts +62 -10
  59. package/src/utils/doctor.ts +633 -5
  60. package/src/utils/types.ts +2 -0
package/CHANGELOG.md CHANGED
@@ -5,6 +5,30 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.1.12] - 2025-12-21
9
+
10
+ ### Added
11
+ - **Preset Templates**: Three built-in task templates for common patterns:
12
+ - `--preset complex`: plan → implement → test (saves plan to `_cursorflow/PLAN_lane-{N}.md`)
13
+ - `--preset simple`: implement → test
14
+ - `--preset merge`: merge → test (auto-applied for dependent lanes)
15
+ - **Plan Document Integration**: Complex preset saves implementation plans to dedicated files, which are referenced by subsequent tasks
16
+ - **Single Task Mode**: Create simple tasks with just `--prompt` without specifying a preset
17
+ - **Branch Validation in Doctor**:
18
+ - Detects branch prefix collisions between lanes
19
+ - Warns about existing branches that may conflict
20
+ - Suggests consistent naming conventions
21
+ - **Pre-resume Validation**: `cursorflow resume` now runs doctor checks before resuming (use `--skip-doctor` to bypass)
22
+ - **Models Command**: `cursorflow models` to list available AI models
23
+ - **Incremental Lane/Task Addition**:
24
+ - `--add-lane` to add new lanes to existing task directories
25
+ - `--add-task` to append tasks to existing lane files
26
+
27
+ ### Changed
28
+ - All documentation updated to English
29
+ - Improved task generation with better prompts and acceptance criteria
30
+ - Enhanced error messages for branch and dependency issues
31
+
8
32
  ## [0.1.9] - 2025-12-21
9
33
 
10
34
  ### Added
package/README.md CHANGED
@@ -13,10 +13,10 @@
13
13
 
14
14
  - ⚡ **Parallel Execution**: Run multiple AI agents concurrently using isolated Git worktrees.
15
15
  - 🔗 **Task Dependencies (DAG)**: Define complex workflows where tasks wait for and merge their dependencies automatically.
16
+ - 📋 **Preset Templates**: Built-in templates for common patterns (complex, simple, merge).
16
17
  - 📊 **Interactive Dashboard**: A powerful terminal-based monitor to track all lanes, progress, and dependencies in real-time.
17
18
  - 📺 **Live Terminal Streaming**: Watch the AI agent's output as it happens with scrollable history.
18
- - 🙋 **Human Intervention**: Send direct messages to running agents to guide them or fix issues on the fly (requires `enableIntervention: true`).
19
- - 🛡️ **PID Control**: Track and manage agent processes directly from the dashboard.
19
+ - 🙋 **Human Intervention**: Send direct messages to running agents to guide them or fix issues on the fly.
20
20
  - 🔍 **Automatic Review**: AI-powered code review with iterative feedback loops.
21
21
  - 🔀 **Smart Merging**: Automatically merge completed feature branches into subsequent dependent lanes.
22
22
  - 🔒 **Security-First**: Automated security scanning and dependency policy enforcement.
@@ -26,27 +26,61 @@
26
26
  ### 1. Install
27
27
 
28
28
  ```bash
29
- # npm (recommended)
30
29
  npm install -g @litmers/cursorflow-orchestrator
31
30
  ```
32
31
 
33
- ### 2. Initialize
32
+ ### 2. Initialize & Prepare Tasks
34
33
 
35
34
  ```bash
36
35
  cd your-project
37
- cursorflow init --example
36
+ cursorflow init
37
+
38
+ # Simple task (single implement task)
39
+ cursorflow prepare FixBug --prompt "Fix the login validation bug in auth.ts"
40
+
41
+ # Complex feature (plan → implement → test)
42
+ cursorflow prepare AuthSystem --preset complex --prompt "Build user authentication with JWT"
43
+
44
+ # Multiple parallel lanes
45
+ cursorflow prepare FullStack --lanes 3 --sequential --preset complex \
46
+ --prompt "Build your layer of the full-stack feature"
38
47
  ```
39
48
 
40
- ### 3. Run & Monitor
49
+ ### 3. Validate & Run
41
50
 
42
51
  ```bash
52
+ # Check for issues before running
53
+ cursorflow doctor --tasks-dir _cursorflow/tasks/2412211530_AuthSystem
54
+
43
55
  # Start orchestration
44
- cursorflow run _cursorflow/tasks/example/
56
+ cursorflow run _cursorflow/tasks/2412211530_AuthSystem
45
57
 
46
- # Open the interactive dashboard (highly recommended!)
58
+ # Open the interactive dashboard
47
59
  cursorflow monitor latest
48
60
  ```
49
61
 
62
+ ## 📋 Preset Templates
63
+
64
+ CursorFlow provides built-in task templates:
65
+
66
+ | Preset | Tasks | Use Case |
67
+ |--------|-------|----------|
68
+ | `--preset complex` | plan → implement → test | Complex features (saves plan to `_cursorflow/PLAN_lane-{N}.md`) |
69
+ | `--preset simple` | implement → test | Simple changes, bug fixes |
70
+ | `--preset merge` | merge → test | Integration lanes (auto-applied with `--depends-on`) |
71
+ | *(none)* | implement | Quick single task |
72
+
73
+ ```bash
74
+ # Complex: Creates plan document that subsequent tasks reference
75
+ cursorflow prepare Feature --preset complex --prompt "Build user dashboard"
76
+
77
+ # Simple: Just implement and test
78
+ cursorflow prepare BugFix --preset simple --prompt "Fix null pointer in auth.ts"
79
+
80
+ # Single task: Just the prompt
81
+ cursorflow prepare QuickFix --prompt "Update README.md"
82
+ ```
83
+
50
84
  ## 🎮 Dashboard Controls
51
85
 
52
86
  Within the `cursorflow monitor` dashboard:
@@ -66,19 +100,18 @@ Within the `cursorflow monitor` dashboard:
66
100
  ```json
67
101
  {
68
102
  "baseBranch": "main",
69
- "branchPrefix": "cursorflow/feature-",
70
- "model": "sonnet-4.5",
103
+ "branchPrefix": "feature/lane-1-",
71
104
  "timeout": 300000,
72
105
  "enableIntervention": false,
73
- "dependsOn": ["other-lane"],
74
- "dependencyPolicy": {
75
- "allowDependencyChange": false,
76
- "lockfileReadOnly": true
77
- },
106
+ "dependsOn": ["01-lane-1"],
107
+ "enableReview": true,
108
+ "reviewModel": "sonnet-4.5-thinking",
78
109
  "tasks": [
79
110
  {
80
- "name": "implement-feature",
81
- "prompt": "Implement the user authentication..."
111
+ "name": "implement",
112
+ "model": "sonnet-4.5",
113
+ "prompt": "Implement the user authentication...",
114
+ "acceptanceCriteria": ["Code complete", "Tests pass"]
82
115
  }
83
116
  ]
84
117
  }
@@ -88,75 +121,60 @@ Within the `cursorflow monitor` dashboard:
88
121
 
89
122
  | Option | Type | Default | Description |
90
123
  |--------|------|---------|-------------|
91
- | `timeout` | number | 300000 | Task timeout in milliseconds (5 min default) |
124
+ | `timeout` | number | 300000 | Task timeout in milliseconds (5 min) |
92
125
  | `enableIntervention` | boolean | false | Enable stdin piping for intervention |
93
126
  | `model` | string | "sonnet-4.5" | AI model to use |
94
127
  | `dependsOn` | string[] | [] | Lane dependencies |
95
-
96
- ### Timeout Configuration
97
-
98
- Set custom timeouts based on task complexity:
99
-
100
- ```json
101
- {
102
- "timeout": 60000,
103
- "tasks": [{ "name": "simple-task", "prompt": "..." }]
104
- }
105
- ```
106
-
107
- - **Simple tasks**: `60000` (1 minute)
108
- - **Medium tasks**: `300000` (5 minutes) - default
109
- - **Complex tasks**: `600000` (10 minutes)
110
-
111
- ### Task Validation
112
-
113
- CursorFlow automatically validates your task configuration before execution:
114
-
115
- - ✅ Required `name` and `prompt` fields
116
- - ✅ Valid task name format (letters, numbers, `-`, `_` only)
117
- - ✅ Proper timeout values
118
- - ✅ Helpful error messages with fix suggestions
119
-
120
- ### Progress Monitoring (Heartbeat)
121
-
122
- During execution, CursorFlow logs progress every 30 seconds:
123
-
124
- ```
125
- ⏱ Heartbeat: 30s elapsed, 1234 bytes received
126
- ⏱ Heartbeat: 60s elapsed, 5678 bytes received
127
- ```
128
+ | `enableReview` | boolean | true | Enable AI code review |
128
129
 
129
130
  ## 🔗 Task Dependencies
130
131
 
131
- You can define dependencies between lanes in your task JSON files. Dependent lanes will wait for their parents to complete and then automatically merge the parent's work before starting.
132
+ Define dependencies between lanes. Dependent lanes wait for parents and auto-merge:
132
133
 
133
- ```json
134
- {
135
- "name": "api-implementation",
136
- "dependsOn": ["database-schema", "common-utils"],
137
- "tasks": [ ... ]
138
- }
134
+ ```bash
135
+ # Create 3 sequential lanes (1 → 2 → 3)
136
+ cursorflow prepare Pipeline --lanes 3 --sequential --preset complex
137
+
138
+ # Add a merge lane that depends on multiple lanes
139
+ cursorflow prepare --add-lane _cursorflow/tasks/2412211530_Pipeline \
140
+ --depends-on "01-lane-1,02-lane-2"
139
141
  ```
140
142
 
141
- ## 🧪 Advanced Testing
143
+ ## 🩺 Pre-flight Checks
142
144
 
143
- A complete test suite for dependency orchestration is included.
145
+ Doctor validates your configuration before running:
144
146
 
145
147
  ```bash
146
- # Run a complex dependency test (6 interdependent lanes)
147
- cursorflow run test-projects/advanced-orchestration/_cursorflow/tasks/full-stack/
148
-
149
- # Monitor the flow
150
- cursorflow monitor latest
148
+ cursorflow doctor --tasks-dir _cursorflow/tasks/my-feature
149
+
150
+ # Checks performed:
151
+ # Git repository and remote
152
+ # Branch prefix collisions
153
+ # ✓ Task structure validation
154
+ # ✓ Circular dependency detection (DAG)
155
+ # ✓ Existing branch conflicts
151
156
  ```
152
157
 
153
- ## 📚 Documentation
154
-
155
- - [📖 User Guide](docs/GUIDE.md) - Detailed usage instructions
156
- - [📋 API Reference](docs/API.md) - CLI and config API
157
- - [🎨 Command Guide](docs/COMMANDS.md) - Cursor command usage
158
- - [🏗️ Architecture](docs/ARCHITECTURE.md) - System structure
159
- - [🔧 Troubleshooting](docs/TROUBLESHOOTING.md) - Issue resolution
158
+ ## 📚 Commands Reference
159
+
160
+ | Command | Description |
161
+ |---------|-------------|
162
+ | `cursorflow init` | Initialize CursorFlow in project |
163
+ | `cursorflow prepare` | Generate task files (with presets) |
164
+ | `cursorflow doctor` | Validate environment and tasks |
165
+ | `cursorflow run` | Execute task orchestration |
166
+ | `cursorflow monitor` | Interactive dashboard |
167
+ | `cursorflow resume` | Resume interrupted lane |
168
+ | `cursorflow clean` | Clean branches/worktrees |
169
+ | `cursorflow signal` | Send message to running agent |
170
+ | `cursorflow models` | List available AI models |
171
+
172
+ ## 📖 Documentation
173
+
174
+ - [📋 Prepare Command](commands/cursorflow-prepare.md) - Task generation with presets
175
+ - [🏃 Run Command](commands/cursorflow-run.md) - Execution options
176
+ - [🩺 Doctor Command](commands/cursorflow-doctor.md) - Validation details
177
+ - [📊 Monitor Command](commands/cursorflow-monitor.md) - Dashboard usage
160
178
  - [📦 Examples](examples/) - Practical examples
161
179
 
162
180
  ## 🚀 Deployment & Updates
@@ -1,162 +1,51 @@
1
1
  # CursorFlow Clean
2
2
 
3
3
  ## Overview
4
- Clean up branches, worktrees, and logs. Remove stale files or remnants from failed runs.
4
+ Clean up temporary resources created by CursorFlow, including Git worktrees, feature branches, and log files.
5
5
 
6
- ## Steps
6
+ ## Usage
7
7
 
8
- 1. **Choose what to clean**
9
-
10
- | Type | Description |
11
- |------|------|
12
- | `branches` | Clean Git branches |
13
- | `worktrees` | Clean Git worktrees |
14
- | `logs` | Clean log files |
15
- | `all` | Clean everything |
16
-
17
- 2. **Clean branches**
18
- ```bash
19
- cursorflow clean branches --pattern "feature/my-*"
20
- ```
21
-
22
- 3. **Clean worktrees**
23
- ```bash
24
- cursorflow clean worktrees --all
25
- ```
8
+ ```bash
9
+ cursorflow clean <type> [options]
10
+ ```
26
11
 
27
- 4. **Clean logs**
28
- ```bash
29
- cursorflow clean logs --older-than 30
30
- ```
12
+ ## Clean Types
31
13
 
32
- 5. **Verify with a dry run**
33
- ```bash
34
- cursorflow clean all --dry-run
35
- ```
14
+ | Type | Description |
15
+ |------|------|
16
+ | `branches` | Remove local feature branches created by CursorFlow |
17
+ | `worktrees` | Remove temporary Git worktrees |
18
+ | `logs` | Clear all run and terminal logs |
19
+ | `all` | Clean everything (branches, worktrees, and logs) |
36
20
 
37
21
  ## Options
38
22
 
39
23
  | Option | Description |
40
24
  |------|------|
41
- | `--pattern <pattern>` | Pattern match (e.g., "feature/*") |
42
- | `--older-than <days>` | Items older than N days (for logs) |
43
- | `--dry-run` | Show items to delete without removing |
44
- | `--force` | Delete without confirmation |
45
- | `--local-only` | Local only (branches) |
46
- | `--remote-only` | Remote only (branches) |
25
+ | `--dry-run` | Show what would be removed without actually deleting anything |
26
+ | `--force` | Force removal (ignore uncommitted changes in worktrees) |
27
+ | `--help`, `-h` | Show help |
47
28
 
48
29
  ## Examples
49
30
 
50
- ### Branch cleanup
51
-
52
- #### Delete by pattern
53
- ```bash
54
- cursorflow clean branches --pattern "feature/dashboard-*"
55
- ```
56
-
57
- #### All CursorFlow branches
58
- ```bash
59
- cursorflow clean branches --pattern "feature/*" --dry-run
60
- ```
61
-
62
- #### Local branches only
63
- ```bash
64
- cursorflow clean branches --pattern "feature/*" --local-only
65
- ```
66
-
67
- ### Worktree cleanup
68
-
69
- #### All worktrees
70
- ```bash
71
- cursorflow clean worktrees --all
72
- ```
73
-
74
- #### Specific pattern
75
- ```bash
76
- cursorflow clean worktrees --pattern "*-dashboard-*"
77
- ```
78
-
79
- ### Log cleanup
80
-
81
- #### Logs older than 30 days
31
+ ### Review before deleting
82
32
  ```bash
83
- cursorflow clean logs --older-than 30
33
+ cursorflow clean all --dry-run
84
34
  ```
85
35
 
86
- #### All logs
36
+ ### Clean only worktrees
87
37
  ```bash
88
- cursorflow clean logs --all --force
38
+ cursorflow clean worktrees
89
39
  ```
90
40
 
91
- ### Full cleanup
92
-
93
- #### Review then delete
41
+ ### Force clean everything
94
42
  ```bash
95
- cursorflow clean all --dry-run
96
43
  cursorflow clean all --force
97
44
  ```
98
45
 
99
- ## Sample output
100
-
101
- ```
102
- 🧹 Cleaning CursorFlow Resources
103
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
104
-
105
- Branches to delete:
106
- - feature/dashboard-pipeline-abc123 (local)
107
- - feature/dashboard-pipeline-abc123 (remote)
108
- - feature/client-pipeline-def456 (local)
109
-
110
- Worktrees to remove:
111
- - .cursorflow/logs/worktrees/01-dashboard-pipeline-abc123
112
- - .cursorflow/logs/worktrees/02-client-pipeline-def456
113
-
114
- Logs to delete:
115
- - _cursorflow/logs/runs/01-dashboard-2025-12-10T10-00-00 (9 days old)
116
-
117
- Total: 5 branches, 2 worktrees, 1 log directory
118
-
119
- Proceed? [y/N]
120
- ```
121
-
122
46
  ## Notes
123
47
 
124
- 1. **Back up**: Save important branches before deleting.
125
- 2. **Confirm**: Start with `--dry-run` to review changes.
126
- 3. **Remote caution**: Be careful when deleting remote branches.
127
- 4. **Irreversible**: Deleted items are hard to recover.
128
-
129
- ## Checklist
130
- - [ ] Have you reviewed items to clean?
131
- - [ ] Do you need backups?
132
- - [ ] Did you run a dry run first?
133
- - [ ] Are other teammates using these branches?
134
- - [ ] Do you also need to delete from the remote?
135
-
136
- ## Troubleshooting
137
-
138
- ### Branch deletion failed
139
- ```bash
140
- # Force delete
141
- git branch -D <branch-name>
142
- git push origin --delete <branch-name>
143
- ```
144
-
145
- ### Worktree removal failed
146
- ```bash
147
- # Force remove
148
- git worktree remove --force <worktree-path>
149
- ```
150
-
151
- ### Log directory permission issues
152
- ```bash
153
- # Check permissions
154
- ls -la _cursorflow/logs/
155
- # Fix permissions
156
- chmod -R u+w _cursorflow/logs/
157
- ```
158
-
159
- ## Next steps
160
- 1. Clean logs regularly (e.g., monthly).
161
- 2. Add an automated cleanup script to CI/CD.
162
- 3. Add log directories to `.gitignore`.
48
+ 1. **Safety**: It is highly recommended to run with `--dry-run` first to see exactly what will be deleted.
49
+ 2. **Worktrees**: The command identifies CursorFlow worktrees by their location (usually in `_cursorflow/worktrees/`) or their prefix.
50
+ 3. **Branches**: Only branches starting with the configured `branchPrefix` (default: `cursorflow/`) are targeted.
51
+ 4. **Irreversible**: Once logs are deleted, they cannot be recovered.
@@ -1,52 +1,80 @@
1
- # /cursorflow-doctor
1
+ # CursorFlow Doctor
2
2
 
3
- ## Goal
4
- Verify that the current environment is properly configured for CursorFlow.
3
+ ## Overview
4
+ Verify that your environment and task configurations are properly set up for CursorFlow.
5
5
 
6
6
  ## Usage
7
- 1. Type `/cursorflow-doctor` in the chat.
8
- 2. The agent will check:
9
- - Git repository status
10
- - 'origin' remote availability
11
- - Git worktree support
12
- - Cursor Agent installation and authentication
13
- - Task directory and lane file validity (if a path is provided)
14
-
15
- ## Context
16
- Use this command whenever:
17
- - You are setting up a new project with CursorFlow.
18
- - A `cursorflow run` fails with environment-related errors.
19
- - You want to verify your Cursor authentication status.
20
- - You want to validate task configuration before running.
7
+
8
+ ```bash
9
+ cursorflow doctor [options]
10
+ ```
11
+
12
+ ## Checks Performed
13
+ - **Environment**: Git repository status, remote availability, and worktree support.
14
+ - **Cursor IDE**: Verifies `cursor-agent` is installed and authenticated.
15
+ - **Tasks**: (Optional) Validates task JSON files for schema errors or missing fields.
16
+
17
+ ## Options
18
+
19
+ | Option | Description |
20
+ |------|------|
21
+ | `--tasks-dir <path>` | Validate lane files in a specific directory |
22
+ | `--executor <type>` | Check environment for `cursor-agent` \| `cloud` |
23
+ | `--test-agent` | Run an interactive agent test (to approve permissions) |
24
+ | `--no-cursor` | Skip Cursor Agent installation and auth checks |
25
+ | `--json` | Output the report in machine-readable JSON format |
21
26
 
22
27
  ## Task Validation
23
28
 
24
- When a task directory is provided, CursorFlow validates:
29
+ When `--tasks-dir` is provided, the doctor performs comprehensive validation:
25
30
 
26
- ### Required Fields
27
- - ✅ `tasks` array exists and is not empty
28
- - Each task has a `name` field
29
- - Each task has a `prompt` field
31
+ ### Structure Validation
32
+ - **tasks array**: Must exist and be non-empty
33
+ - **task.name**: Required, must be alphanumeric with `-` and `_` only, unique within lane
34
+ - **task.prompt**: Required, should be descriptive (warns if < 10 chars)
35
+ - **task.model**: Optional, must be string if provided
36
+ - **task.acceptanceCriteria**: Optional, must be non-empty array if provided
30
37
 
31
- ### Task Name Format
32
- - Only letters, numbers, `-`, `_` allowed
33
- - Spaces not allowed
34
- - Special characters not allowed
38
+ ### Dependency Validation (DAG)
39
+ - **Unknown dependencies**: Reports if `dependsOn` references non-existent lanes
40
+ - **Circular dependencies**: Detects cycles (e.g., A→B→A) that would cause deadlock
41
+ - Reports the exact cycle path for easy debugging
35
42
 
36
- ### Configuration Values
37
- - `timeout` is a positive number (if provided)
38
- - `enableIntervention` is a boolean (if provided)
43
+ ### Branch Validation
44
+ - **Prefix collision**: Warns if multiple lanes use the same `branchPrefix`
45
+ - **Existing branch conflicts**: Detects if existing branches match a lane's prefix
46
+ - **Duplicate lane names**: Ensures each lane file has a unique name
47
+ - **Naming suggestions**: Recommends using lane numbers in branch prefixes for consistency
39
48
 
40
- ## Common Validation Errors
49
+ Example errors:
50
+ ```
51
+ ❌ Branch prefix collision
52
+ Multiple lanes use the same branchPrefix "feature/lane-1-": 01-lane-1, 02-lane-2
53
+ Fix: Update the branchPrefix in each lane JSON file to be unique
41
54
 
42
- | Error | Solution |
43
- |-------|----------|
44
- | `Task N missing required "name" field` | Add `"name": "task-name"` to each task object |
45
- | `Task name contains invalid characters` | Use only letters, numbers, `-`, `_` |
46
- | `"timeout" must be a positive number` | Provide timeout in milliseconds (e.g., `60000`) |
55
+ ⚠️ Existing branches may conflict with 01-lane-1
56
+ Found 2 existing branch(es) matching prefix "feature/lane-1-": feature/lane-1-abc, feature/lane-1-xyz
57
+ Fix: Delete conflicting branches or change the branchPrefix
58
+ ```
47
59
 
48
60
  ## Example
49
- "Check if my environment is ready for CursorFlow."
50
- "Run cursorflow doctor on the _cursorflow/tasks/my-feature/ directory."
51
- "Validate my task configuration in _cursorflow/tasks/api-lane/."
52
61
 
62
+ ```bash
63
+ # Basic environment check
64
+ cursorflow doctor
65
+
66
+ # Test agent permissions
67
+ cursorflow doctor --test-agent
68
+
69
+ # Validate a specific task set
70
+ cursorflow doctor --tasks-dir _cursorflow/tasks/my-feature/
71
+ ```
72
+
73
+ ## Common Issues & Fixes
74
+
75
+ | Issue | Potential Fix |
76
+ |-------|---------------|
77
+ | `Cursor Agent not found` | Ensure Cursor IDE is installed and `cursor` command is in PATH. |
78
+ | `Not authenticated` | Open Cursor IDE and log in to your account. |
79
+ | `Worktree not supported` | Upgrade your Git version (requires Git >= 2.5). |
80
+ | `Circular dependency` | Check the `dependsOn` fields in your task JSON files. |
@@ -1,67 +1,50 @@
1
1
  # CursorFlow Init
2
2
 
3
3
  ## Overview
4
- Initialize CursorFlow in your project. Create the config file and directory structure, and optionally install Cursor commands and example tasks.
4
+ Initialize CursorFlow in your project. This command creates the default configuration file, sets up the required directory structure, and prepares the environment for parallel AI orchestration.
5
5
 
6
- ## Steps
6
+ ## Usage
7
7
 
8
- 1. **Run initialization**
9
- ```bash
10
- cursorflow init
11
- ```
8
+ ```bash
9
+ cursorflow init [options]
10
+ ```
12
11
 
13
- 2. **Choose options**
14
- - `--example`: create example tasks
15
- - `--config-only`: create only the config file
16
- - `--no-commands`: skip installing Cursor commands
17
- - `--force`: overwrite existing files
12
+ ## Options
18
13
 
19
- 3. **Verify created files**
20
- - `cursorflow.config.js` created
21
- - `_cursorflow/tasks/` directory created
22
- - `_cursorflow/logs/` directory created
23
- - `.cursor/commands/cursorflow/` commands installed (optional)
14
+ | Option | Description |
15
+ |------|------|
16
+ | `--example` | Create an example task to help you get started |
17
+ | `--config-only` | Only create the `cursorflow.config.js` file |
18
+ | `--no-commands` | Skip installing Cursor IDE custom commands |
19
+ | `--no-gitignore` | Skip adding `_cursorflow/` to your `.gitignore` |
20
+ | `--force` | Overwrite existing configuration or directories |
24
21
 
25
- 4. **Review the config file**
26
- ```javascript
27
- // cursorflow.config.js
28
- module.exports = {
29
- tasksDir: '_cursorflow/tasks',
30
- logsDir: '_cursorflow/logs',
31
- baseBranch: 'main',
32
- // ... other settings
33
- };
34
- ```
22
+ ## What's Created?
35
23
 
36
- ## Examples
24
+ 1. **`cursorflow.config.js`**: Central configuration for the project.
25
+ 2. **`_cursorflow/tasks/`**: Directory where you define your task JSON files.
26
+ 3. **`_cursorflow/logs/`**: Directory for run logs and terminal outputs.
27
+ 4. **`.cursor/commands/cursorflow/`**: (Optional) Integrated Cursor IDE commands.
28
+ 5. **`.gitignore` update**: Adds `_cursorflow/` to prevent committing logs.
37
29
 
38
- ### Basic initialization
39
- ```bash
40
- cursorflow init
41
- ```
30
+ ## Example
42
31
 
43
- ### Include example tasks
44
32
  ```bash
33
+ # Standard initialization with an example task
45
34
  cursorflow init --example
46
- ```
47
35
 
48
- ### Generate only the config
49
- ```bash
50
- cursorflow init --config-only
51
- ```
52
-
53
- ### Overwrite existing files
54
- ```bash
55
- cursorflow init --force
36
+ # Minimal initialization
37
+ cursorflow init --no-commands --no-gitignore
56
38
  ```
57
39
 
58
- ## Checklist
59
- - [ ] Was the config file created at the project root?
60
- - [ ] Were the required directories created?
61
- - [ ] Were Cursor commands installed?
62
- - [ ] Is the configuration adjusted for the project?
40
+ ## Next Steps
63
41
 
64
- ## Next steps
65
- 1. Update `cursorflow.config.js` for your project.
66
- 2. In Cursor IDE, type `/` to confirm the commands are available.
67
- 3. Start generating tasks with `cursorflow prepare MyFeature`.
42
+ 1. **Configure**: Review `cursorflow.config.js` and adjust settings like `baseBranch` or `maxConcurrentLanes`.
43
+ 2. **Explore**: If you used `--example`, run it with:
44
+ ```bash
45
+ cursorflow run _cursorflow/tasks/example/
46
+ ```
47
+ 3. **Create**: Start your own feature tasks with:
48
+ ```bash
49
+ cursorflow prepare MyFeature
50
+ ```