@litmers/cursorflow-orchestrator 0.1.31 → 0.1.36

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 (150) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +182 -59
  3. package/commands/cursorflow-add.md +159 -0
  4. package/commands/cursorflow-doctor.md +45 -23
  5. package/commands/cursorflow-monitor.md +23 -2
  6. package/commands/cursorflow-new.md +87 -0
  7. package/commands/cursorflow-run.md +60 -111
  8. package/dist/cli/add.d.ts +7 -0
  9. package/dist/cli/add.js +377 -0
  10. package/dist/cli/add.js.map +1 -0
  11. package/dist/cli/clean.js +1 -0
  12. package/dist/cli/clean.js.map +1 -1
  13. package/dist/cli/config.d.ts +7 -0
  14. package/dist/cli/config.js +181 -0
  15. package/dist/cli/config.js.map +1 -0
  16. package/dist/cli/doctor.js +47 -4
  17. package/dist/cli/doctor.js.map +1 -1
  18. package/dist/cli/index.js +34 -30
  19. package/dist/cli/index.js.map +1 -1
  20. package/dist/cli/logs.js +17 -34
  21. package/dist/cli/logs.js.map +1 -1
  22. package/dist/cli/monitor.js +62 -65
  23. package/dist/cli/monitor.js.map +1 -1
  24. package/dist/cli/new.d.ts +7 -0
  25. package/dist/cli/new.js +232 -0
  26. package/dist/cli/new.js.map +1 -0
  27. package/dist/cli/prepare.js +95 -193
  28. package/dist/cli/prepare.js.map +1 -1
  29. package/dist/cli/resume.js +57 -68
  30. package/dist/cli/resume.js.map +1 -1
  31. package/dist/cli/run.js +60 -30
  32. package/dist/cli/run.js.map +1 -1
  33. package/dist/cli/stop.js +6 -0
  34. package/dist/cli/stop.js.map +1 -1
  35. package/dist/cli/tasks.d.ts +5 -3
  36. package/dist/cli/tasks.js +181 -29
  37. package/dist/cli/tasks.js.map +1 -1
  38. package/dist/core/failure-policy.d.ts +9 -0
  39. package/dist/core/failure-policy.js +9 -0
  40. package/dist/core/failure-policy.js.map +1 -1
  41. package/dist/core/orchestrator.d.ts +20 -6
  42. package/dist/core/orchestrator.js +215 -334
  43. package/dist/core/orchestrator.js.map +1 -1
  44. package/dist/core/runner/agent.d.ts +27 -0
  45. package/dist/core/runner/agent.js +294 -0
  46. package/dist/core/runner/agent.js.map +1 -0
  47. package/dist/core/runner/index.d.ts +5 -0
  48. package/dist/core/runner/index.js +22 -0
  49. package/dist/core/runner/index.js.map +1 -0
  50. package/dist/core/runner/pipeline.d.ts +9 -0
  51. package/dist/core/runner/pipeline.js +539 -0
  52. package/dist/core/runner/pipeline.js.map +1 -0
  53. package/dist/core/runner/prompt.d.ts +25 -0
  54. package/dist/core/runner/prompt.js +175 -0
  55. package/dist/core/runner/prompt.js.map +1 -0
  56. package/dist/core/runner/task.d.ts +26 -0
  57. package/dist/core/runner/task.js +283 -0
  58. package/dist/core/runner/task.js.map +1 -0
  59. package/dist/core/runner/utils.d.ts +37 -0
  60. package/dist/core/runner/utils.js +161 -0
  61. package/dist/core/runner/utils.js.map +1 -0
  62. package/dist/core/runner.d.ts +2 -96
  63. package/dist/core/runner.js +11 -1136
  64. package/dist/core/runner.js.map +1 -1
  65. package/dist/core/stall-detection.d.ts +326 -0
  66. package/dist/core/stall-detection.js +781 -0
  67. package/dist/core/stall-detection.js.map +1 -0
  68. package/dist/services/logging/console.js +2 -1
  69. package/dist/services/logging/console.js.map +1 -1
  70. package/dist/types/config.d.ts +6 -6
  71. package/dist/types/flow.d.ts +84 -0
  72. package/dist/types/flow.js +10 -0
  73. package/dist/types/flow.js.map +1 -0
  74. package/dist/types/index.d.ts +1 -0
  75. package/dist/types/index.js +3 -3
  76. package/dist/types/index.js.map +1 -1
  77. package/dist/types/lane.d.ts +0 -2
  78. package/dist/types/logging.d.ts +5 -1
  79. package/dist/types/task.d.ts +7 -11
  80. package/dist/utils/config.d.ts +5 -1
  81. package/dist/utils/config.js +15 -16
  82. package/dist/utils/config.js.map +1 -1
  83. package/dist/utils/dependency.d.ts +36 -1
  84. package/dist/utils/dependency.js +256 -1
  85. package/dist/utils/dependency.js.map +1 -1
  86. package/dist/utils/doctor.js +40 -8
  87. package/dist/utils/doctor.js.map +1 -1
  88. package/dist/utils/enhanced-logger.d.ts +45 -82
  89. package/dist/utils/enhanced-logger.js +239 -844
  90. package/dist/utils/enhanced-logger.js.map +1 -1
  91. package/dist/utils/flow.d.ts +9 -0
  92. package/dist/utils/flow.js +73 -0
  93. package/dist/utils/flow.js.map +1 -0
  94. package/dist/utils/git.d.ts +29 -0
  95. package/dist/utils/git.js +115 -5
  96. package/dist/utils/git.js.map +1 -1
  97. package/dist/utils/state.js +0 -2
  98. package/dist/utils/state.js.map +1 -1
  99. package/dist/utils/task-service.d.ts +2 -2
  100. package/dist/utils/task-service.js +40 -31
  101. package/dist/utils/task-service.js.map +1 -1
  102. package/package.json +4 -3
  103. package/src/cli/add.ts +397 -0
  104. package/src/cli/clean.ts +1 -0
  105. package/src/cli/config.ts +177 -0
  106. package/src/cli/doctor.ts +48 -4
  107. package/src/cli/index.ts +36 -32
  108. package/src/cli/logs.ts +20 -33
  109. package/src/cli/monitor.ts +70 -75
  110. package/src/cli/new.ts +235 -0
  111. package/src/cli/prepare.ts +98 -205
  112. package/src/cli/resume.ts +61 -76
  113. package/src/cli/run.ts +333 -306
  114. package/src/cli/stop.ts +8 -0
  115. package/src/cli/tasks.ts +200 -21
  116. package/src/core/failure-policy.ts +9 -0
  117. package/src/core/orchestrator.ts +279 -379
  118. package/src/core/runner/agent.ts +314 -0
  119. package/src/core/runner/index.ts +6 -0
  120. package/src/core/runner/pipeline.ts +567 -0
  121. package/src/core/runner/prompt.ts +174 -0
  122. package/src/core/runner/task.ts +320 -0
  123. package/src/core/runner/utils.ts +142 -0
  124. package/src/core/runner.ts +8 -1347
  125. package/src/core/stall-detection.ts +936 -0
  126. package/src/services/logging/console.ts +2 -1
  127. package/src/types/config.ts +6 -6
  128. package/src/types/flow.ts +91 -0
  129. package/src/types/index.ts +15 -3
  130. package/src/types/lane.ts +0 -2
  131. package/src/types/logging.ts +5 -1
  132. package/src/types/task.ts +7 -11
  133. package/src/utils/config.ts +16 -17
  134. package/src/utils/dependency.ts +311 -2
  135. package/src/utils/doctor.ts +36 -8
  136. package/src/utils/enhanced-logger.ts +264 -927
  137. package/src/utils/flow.ts +42 -0
  138. package/src/utils/git.ts +145 -5
  139. package/src/utils/state.ts +0 -2
  140. package/src/utils/task-service.ts +48 -40
  141. package/commands/cursorflow-review.md +0 -56
  142. package/commands/cursorflow-runs.md +0 -59
  143. package/dist/cli/runs.d.ts +0 -5
  144. package/dist/cli/runs.js +0 -214
  145. package/dist/cli/runs.js.map +0 -1
  146. package/dist/core/reviewer.d.ts +0 -66
  147. package/dist/core/reviewer.js +0 -265
  148. package/dist/core/reviewer.js.map +0 -1
  149. package/src/cli/runs.ts +0 -212
  150. package/src/core/reviewer.ts +0 -285
package/CHANGELOG.md CHANGED
@@ -5,6 +5,33 @@ 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.36] - 2025-12-26
9
+
10
+ ### Fixed
11
+ - **CLI**: Fixed indentation and validation logic in `tasks` command.
12
+ - **Tests**: Improved `stop.test.ts` stability by mocking `process.chdir`.
13
+ - **E2E**: Removed redundant `lane-a.json` from `test-tasks-e2e`.
14
+
15
+ ### Changed
16
+ - **Release**: Improved release process with annotated tags.
17
+
18
+ ## [0.1.35] - 2025-12-26
19
+
20
+ ### Changed
21
+ - **Log Format**: Updated log format to `L{n}-T{t}-{lanename}` with single-digit numbers and 10-char max lane name for cleaner output.
22
+ - **Flow Support**: All commands now support flow names in addition to directory paths.
23
+ - `run`, `resume`, `doctor` can now use flow names like `cursorflow run MyFlow`
24
+ - `tasks` command now browses flows from `_cursorflow/flows/` directory
25
+
26
+ ### Fixed
27
+ - **Build Errors**: Fixed missing `getLogsDir` import in `logs.ts` and `monitor.ts`.
28
+ - **Flow Recognition**: Fixed `flow.meta.json` being incorrectly treated as a lane file in orchestrator.
29
+ - **Doctor CLI**: Fixed positional argument parsing for flow names.
30
+
31
+ ### Added
32
+ - `getFlowsDir()` function in config.ts for consistent flow directory resolution.
33
+ - `findFlowDir()` utility for resolving flow names to paths.
34
+
8
35
  ## [0.1.30] - 2025-12-25
9
36
 
10
37
  ### Added
package/README.md CHANGED
@@ -13,11 +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
+ - 🌊 **Flow Architecture**: Intuitive `new` + `add` commands to define Flows, Lanes, and Tasks.
17
17
  - 📊 **Interactive Dashboard**: A powerful terminal-based monitor to track all lanes, progress, and dependencies in real-time.
18
18
  - 📺 **Live Terminal Streaming**: Watch the AI agent's output as it happens with scrollable history.
19
19
  - 🙋 **Human Intervention**: Send direct messages to running agents to guide them or fix issues on the fly.
20
- - 🔍 **Automatic Review**: AI-powered code review with iterative feedback loops.
21
20
  - 🔀 **Smart Merging**: Automatically merge completed feature branches into subsequent dependent lanes.
22
21
  - 🔒 **Security-First**: Automated security scanning and dependency policy enforcement.
23
22
 
@@ -29,74 +28,135 @@
29
28
  npm install -g @litmers/cursorflow-orchestrator
30
29
  ```
31
30
 
32
- ### 2. Initialize & Prepare Tasks
31
+ ### 2. Create a Flow
33
32
 
34
33
  ```bash
35
34
  cd your-project
36
35
  cursorflow init
37
36
 
38
- # Simple task (single implement task)
39
- cursorflow prepare FixBug --prompt "Fix the login validation bug in auth.ts"
37
+ # Create a Flow with two Lanes: backend and frontend
38
+ cursorflow new ShopFeature --lanes "backend,frontend"
39
+ ```
40
40
 
41
- # Complex feature (plan implement → test)
42
- cursorflow prepare AuthSystem --preset complex --prompt "Build user authentication with JWT"
41
+ ### 3. Add Tasks to Lanes
43
42
 
44
- # Multiple parallel lanes
45
- cursorflow prepare FullStack --lanes 3 --sequential --preset complex \
46
- --prompt "Build your layer of the full-stack feature"
43
+ ```bash
44
+ # Add tasks to backend lane (uses default model)
45
+ cursorflow add ShopFeature backend \
46
+ --task "name=implement|prompt=상품 검색 API 구현"
47
+
48
+ # Add tasks to frontend lane (waits for backend)
49
+ cursorflow add ShopFeature frontend \
50
+ --task "name=ui|prompt=검색 UI 구현" \
51
+ --after "backend:implement"
47
52
  ```
48
53
 
49
- ### 3. Validate & Run
54
+ ### 4. Run
50
55
 
51
56
  ```bash
52
- # Check for issues before running
53
- cursorflow doctor --tasks-dir _cursorflow/tasks/2412211530_AuthSystem
54
-
55
57
  # Start orchestration
56
- cursorflow run _cursorflow/tasks/2412211530_AuthSystem
58
+ cursorflow run ShopFeature
57
59
 
58
- # Open the interactive dashboard
60
+ # Monitor progress in real-time
59
61
  cursorflow monitor latest
60
62
  ```
61
63
 
62
- ## 📋 Preset Templates
64
+ ## 📋 Flow 커맨드 - 시나리오로 배우기
63
65
 
64
- CursorFlow provides built-in task templates:
66
+ **시나리오**: "쇼핑몰" 프로젝트에서 백엔드 API와 프론트엔드를 동시에 개발
65
67
 
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
- ### Using External Templates
68
+ ---
74
69
 
75
- You can use templates from a local file, a remote URL, or a built-in name:
70
+ ### Step 1: Flow와 Lane 생성 (`new`)
76
71
 
77
72
  ```bash
78
- # Using a built-in template name
79
- cursorflow prepare Feature --template basic
73
+ cursorflow new SearchFeature --lanes "api,web,mobile"
74
+ ```
75
+
76
+ **결과:**
77
+ ```
78
+ _cursorflow/flows/001_SearchFeature/
79
+ ├── flow.meta.json # Flow 메타데이터
80
+ ├── 01-api.json # API 레인 (빈 상태)
81
+ ├── 02-web.json # Web 레인 (빈 상태)
82
+ └── 03-mobile.json # Mobile 레인 (빈 상태)
83
+ ```
84
+
85
+ ---
80
86
 
81
- # Using a local template file
82
- cursorflow prepare Custom --template ./my-template.json
87
+ ### Step 2: Lane에 Task 추가 (`add`)
83
88
 
84
- # Using a remote template URL
85
- cursorflow prepare Remote --template https://raw.githubusercontent.com/user/repo/main/template.json
89
+ ```bash
90
+ # API 레인: 의존성 없음, 바로 시작
91
+ cursorflow add SearchFeature api \
92
+ --task "name=plan|prompt=API 설계" \
93
+ --task "name=implement|prompt=검색 API 구현" \
94
+ --task "name=test|prompt=API 테스트 작성"
95
+
96
+ # Web 레인: API의 implement 완료 후 시작
97
+ cursorflow add SearchFeature web \
98
+ --task "name=ui|prompt=검색 UI 구현" \
99
+ --after "api:implement"
100
+
101
+ # Mobile 레인: API 테스트까지 모두 끝나야 시작
102
+ cursorflow add SearchFeature mobile \
103
+ --task "name=app|prompt=모바일 검색 화면 구현" \
104
+ --after "api:test"
86
105
  ```
87
106
 
88
- Templates support `{{featureName}}`, `{{laneNumber}}`, and `{{devPort}}` placeholders.
107
+ ---
108
+
109
+ ### Step 3: 실행
89
110
 
90
111
  ```bash
91
- # Complex: Creates plan document that subsequent tasks reference
92
- cursorflow prepare Feature --preset complex --prompt "Build user dashboard"
112
+ cursorflow run SearchFeature
113
+ ```
114
+
115
+ **실행 흐름:**
116
+ ```
117
+ api: [plan] → [implement] → [test]
118
+ │ │
119
+ web: └─→ [ui] ────┤
120
+
121
+ mobile: └─→ [app]
122
+ ```
123
+
124
+ ---
93
125
 
94
- # Simple: Just implement and test
95
- cursorflow prepare BugFix --preset simple --prompt "Fix null pointer in auth.ts"
126
+ ### --task 형식
96
127
 
97
- # Single task: Just the prompt
98
- cursorflow prepare QuickFix --prompt "Update README.md"
99
128
  ```
129
+ "name=<이름>|prompt=<프롬프트>" # 기본 모델 사용
130
+ "name=<이름>|model=<모델>|prompt=<프롬프트>" # 모델 지정
131
+ ```
132
+
133
+ | 필드 | 필수 | 설명 |
134
+ |------|------|------|
135
+ | `name` | ✅ | 태스크 이름 (영문, 숫자, -, _) |
136
+ | `prompt` | ✅ | 태스크 프롬프트 |
137
+ | `model` | ❌ | AI 모델 (생략 시 기본 모델 사용) |
138
+
139
+ 기본 모델 설정: `cursorflow config defaultModel <model-name>`
140
+
141
+ ---
142
+
143
+ ### --after 형식 (의존성)
144
+
145
+ ```
146
+ --after "lane:task" # 특정 태스크 완료 후 시작
147
+ --after "lane" # 해당 레인의 마지막 태스크 완료 후
148
+ --after "a:t1, b:t2" # 여러 태스크 모두 완료 후 (콤마 구분)
149
+ ```
150
+
151
+ ---
152
+
153
+ ### 커맨드 요약
154
+
155
+ | 커맨드 | 설명 | 예시 |
156
+ |--------|------|------|
157
+ | `new` | Flow와 Lane 생성 | `cursorflow new Feature --lanes "api,web"` |
158
+ | `add` | Lane에 Task 추가 | `cursorflow add Feature api --task "..."` |
159
+ | `run` | Flow 실행 | `cursorflow run Feature` |
100
160
 
101
161
  ## 🎮 Dashboard Controls
102
162
 
@@ -116,19 +176,23 @@ Within the `cursorflow monitor` dashboard:
116
176
 
117
177
  ```json
118
178
  {
119
- "baseBranch": "main",
120
179
  "branchPrefix": "feature/lane-1-",
121
180
  "timeout": 600000,
122
181
  "enableIntervention": false,
123
- "dependsOn": ["01-lane-1"],
124
182
  "enableReview": true,
125
183
  "reviewModel": "sonnet-4.5-thinking",
126
184
  "tasks": [
185
+ {
186
+ "name": "setup",
187
+ "model": "sonnet-4.5",
188
+ "prompt": "Set up the project structure..."
189
+ },
127
190
  {
128
191
  "name": "implement",
129
192
  "model": "sonnet-4.5",
130
193
  "prompt": "Implement the user authentication...",
131
- "acceptanceCriteria": ["Code complete", "Tests pass"]
194
+ "acceptanceCriteria": ["Code complete", "Tests pass"],
195
+ "dependsOn": ["other-lane:setup"]
132
196
  }
133
197
  ]
134
198
  }
@@ -141,20 +205,48 @@ Within the `cursorflow monitor` dashboard:
141
205
  | `timeout` | number | 600000 | Task timeout in milliseconds (10 min) |
142
206
  | `enableIntervention` | boolean | false | Enable stdin piping for intervention |
143
207
  | `model` | string | "sonnet-4.5" | AI model to use |
144
- | `dependsOn` | string[] | [] | Lane dependencies |
145
208
  | `enableReview` | boolean | true | Enable AI code review |
146
209
 
147
- ## 🔗 Task Dependencies
210
+ ## 🔗 태스크 의존성 (dependsOn)
148
211
 
149
- Define dependencies between lanes. Dependent lanes wait for parents and auto-merge:
212
+ **언제 사용?** 프론트엔드가 백엔드 API 완성 후에 시작해야
150
213
 
151
- ```bash
152
- # Create 3 sequential lanes (1 → 2 → 3)
153
- cursorflow prepare Pipeline --lanes 3 --sequential --preset complex
214
+ ### 사용법
215
+
216
+ JSON 파일에서 `dependsOn` 필드 추가:
217
+
218
+ ```json
219
+ {
220
+ "tasks": [
221
+ { "name": "setup", "prompt": "초기 설정..." },
222
+ {
223
+ "name": "integrate",
224
+ "prompt": "API 연동...",
225
+ "dependsOn": ["01-backend:implement"] // ← 이 태스크 완료 후 시작
226
+ }
227
+ ]
228
+ }
229
+ ```
230
+
231
+ 형식: `"레인파일명:태스크명"` (확장자 `.json` 제외)
232
+
233
+ ### 실행 흐름 예시
234
+
235
+ ```
236
+ 01-backend: [setup] → [implement] → [test]
237
+ ↓ 완료!
238
+ 02-frontend: [setup] ─────┴─ 대기 → [integrate] → [test]
239
+ ```
240
+
241
+ - 백엔드와 프론트엔드 **동시 시작**
242
+ - 프론트의 `integrate`는 백엔드 `implement` 완료까지 대기
243
+ - 완료되면 백엔드 브랜치 **자동 머지** 후 시작
244
+
245
+ ### 순환 의존성 검사
154
246
 
155
- # Add a merge lane that depends on multiple lanes
156
- cursorflow prepare --add-lane _cursorflow/tasks/2412211530_Pipeline \
157
- --depends-on "01-lane-1,02-lane-2"
247
+ ```bash
248
+ cursorflow doctor --tasks-dir _cursorflow/tasks/MyFeature
249
+ # ❌ Cyclic dependency: 01-a:task1 → 02-b:task2 → 01-a:task1
158
250
  ```
159
251
 
160
252
  ## 🩺 Pre-flight Checks
@@ -174,23 +266,54 @@ cursorflow doctor --tasks-dir _cursorflow/tasks/my-feature
174
266
 
175
267
  ## 📚 Commands Reference
176
268
 
269
+ ### Flow Commands (New)
270
+ | Command | Description |
271
+ |---------|-------------|
272
+ | `cursorflow new` | Create Flow with Lanes |
273
+ | `cursorflow add` | Add Tasks to Lane |
274
+ | `cursorflow config` | View/set configuration |
275
+ | `cursorflow tasks` | Browse flows and legacy tasks |
276
+
277
+ ### Execution
177
278
  | Command | Description |
178
279
  |---------|-------------|
179
- | `cursorflow init` | Initialize CursorFlow in project |
180
- | `cursorflow setup` | Install Cursor IDE commands |
181
- | `cursorflow prepare` | Prepare task directory and JSON files |
182
280
  | `cursorflow run` | Run orchestration (DAG-based) |
183
281
  | `cursorflow monitor` | Interactive lane dashboard |
184
- | `cursorflow clean` | Clean branches/worktrees/logs/tasks |
185
282
  | `cursorflow resume` | Resume lane(s) - use --all for batch resume |
283
+ | `cursorflow stop` | Stop running workflows |
284
+
285
+ ### Inspection
286
+ | Command | Description |
287
+ |---------|-------------|
186
288
  | `cursorflow doctor` | Check environment and preflight |
187
- | `cursorflow signal` | Directly intervene in a running lane |
188
- | `cursorflow models` | List available AI models |
189
289
  | `cursorflow logs` | View, export, and follow logs |
290
+ | `cursorflow models` | List available AI models |
291
+
292
+ ### Utility
293
+ | Command | Description |
294
+ |---------|-------------|
295
+ | `cursorflow init` | Initialize CursorFlow in project |
296
+ | `cursorflow setup` | Install Cursor IDE commands |
297
+ | `cursorflow clean` | Clean branches/worktrees/logs/tasks |
298
+ | `cursorflow signal` | Directly intervene in a running lane |
299
+
300
+ ### Legacy
301
+ | Command | Description |
302
+ |---------|-------------|
303
+ | `cursorflow prepare` | (deprecated) Use 'new' + 'add' instead |
190
304
 
191
305
  ## 📝 Enhanced Logging
192
306
 
193
- CursorFlow provides comprehensive logging with automatic cleanup and export options:
307
+ CursorFlow provides comprehensive logging with automatic cleanup and export options.
308
+
309
+ ### Log Format
310
+
311
+ Logs use the format `[L{n}-T{t}-{lanename}]`:
312
+ - `L{n}`: Lane number (1-indexed, single digit)
313
+ - `T{t}`: Task number (1-indexed, single digit)
314
+ - `{lanename}`: First 10 characters of lane name
315
+
316
+ Example: `[L1-T2-backend]` = Lane 1, Task 2, lane "backend"
194
317
 
195
318
  ### Features
196
319
  - **ANSI Stripping**: Clean logs without terminal escape codes
@@ -0,0 +1,159 @@
1
+ # cursorflow add
2
+
3
+ Lane에 Task를 추가합니다.
4
+
5
+ ## 사용법
6
+
7
+ ```bash
8
+ cursorflow add <FlowName> <LaneName> --task "name=...|model=...|prompt=..." [--after ...]
9
+ ```
10
+
11
+ ## 설명
12
+
13
+ 지정된 Flow의 Lane에 Task를 추가합니다.
14
+ `--task` 옵션은 여러 번 사용하여 여러 태스크를 순차적으로 추가할 수 있습니다.
15
+
16
+ ## --task 형식
17
+
18
+ ```
19
+ "name=<이름>|model=<모델>|prompt=<프롬프트>"
20
+ ```
21
+
22
+ ### 필수 필드
23
+
24
+ | 필드 | 설명 | 예시 |
25
+ |------|------|------|
26
+ | `name` | 태스크 이름 (영문, 숫자, -, _) | `name=implement` |
27
+ | `prompt` | 태스크 프롬프트/지시사항 | `prompt=API 구현` |
28
+
29
+ ### 선택 필드
30
+
31
+ | 필드 | 설명 | 예시 |
32
+ |------|------|------|
33
+ | `model` | AI 모델 (생략 시 기본 모델 사용) | `model=<your-model>` |
34
+
35
+ 기본 모델 설정: `cursorflow config defaultModel <model-name>`
36
+
37
+ ## --after 형식 (의존성 설정)
38
+
39
+ 첫 번째 태스크가 시작되기 전에 완료되어야 할 태스크를 지정합니다.
40
+
41
+ | 형식 | 설명 |
42
+ |------|------|
43
+ | `"lane"` | 해당 레인의 **마지막 태스크** 완료 후 시작 |
44
+ | `"lane:task"` | 특정 태스크 완료 후 시작 |
45
+ | `"a:t1, b:t2"` | **여러 태스크가 모두 완료**된 후 시작 |
46
+
47
+ ## 예시
48
+
49
+ ### 기본 사용: 단일 태스크 추가 (기본 모델 사용)
50
+
51
+ ```bash
52
+ cursorflow add SearchFeature api \
53
+ --task "name=implement|prompt=검색 API 구현"
54
+ ```
55
+
56
+ ### 여러 태스크 추가
57
+
58
+ ```bash
59
+ cursorflow add SearchFeature api \
60
+ --task "name=plan|prompt=API 설계" \
61
+ --task "name=implement|prompt=검색 API 구현" \
62
+ --task "name=test|prompt=테스트 코드 작성"
63
+ ```
64
+
65
+ ### 의존성 설정: 특정 태스크 완료 후 시작
66
+
67
+ ```bash
68
+ # api 레인의 implement 태스크 완료 후 시작
69
+ cursorflow add SearchFeature web \
70
+ --task "name=ui|prompt=검색 UI 구현" \
71
+ --after "api:implement"
72
+ ```
73
+
74
+ ### 의존성 설정: 레인 전체 완료 후 시작
75
+
76
+ ```bash
77
+ # api 레인의 마지막 태스크 완료 후 시작
78
+ cursorflow add SearchFeature web \
79
+ --task "name=ui|prompt=검색 UI 구현" \
80
+ --after "api"
81
+ ```
82
+
83
+ ### 다중 의존성: 여러 태스크 완료 후 시작
84
+
85
+ ```bash
86
+ # web과 mobile 모두 완료된 후 시작
87
+ cursorflow add SearchFeature e2e \
88
+ --task "name=verify|prompt=E2E 테스트" \
89
+ --after "web:ui, mobile:app"
90
+ ```
91
+
92
+ ## 출력 예시
93
+
94
+ ```
95
+ ✅ 3개 태스크 추가 완료
96
+
97
+ 📄 01-api.json
98
+
99
+ ├── plan (<default-model>)
100
+ ├── implement (<default-model>)
101
+ └── test (<default-model>)
102
+
103
+ 전체 태스크 목록:
104
+ 1. plan (new)
105
+ 2. implement (new)
106
+ 3. test (new)
107
+
108
+ 다음 단계:
109
+ cursorflow run SearchFeature # Flow 실행
110
+ cursorflow doctor SearchFeature # 설정 검증
111
+ ```
112
+
113
+ ## 생성되는 Lane 파일 구조
114
+
115
+ ```json
116
+ {
117
+ "laneName": "api",
118
+ "tasks": [
119
+ {
120
+ "name": "plan",
121
+ "model": "<your-model>",
122
+ "prompt": "API 설계"
123
+ },
124
+ {
125
+ "name": "implement",
126
+ "model": "<your-model>",
127
+ "prompt": "검색 API 구현"
128
+ },
129
+ {
130
+ "name": "test",
131
+ "model": "<your-model>",
132
+ "prompt": "테스트 코드 작성"
133
+ }
134
+ ]
135
+ }
136
+ ```
137
+
138
+ ### 의존성이 있는 경우
139
+
140
+ ```json
141
+ {
142
+ "laneName": "web",
143
+ "tasks": [
144
+ {
145
+ "name": "ui",
146
+ "model": "<your-model>",
147
+ "prompt": "검색 UI 구현",
148
+ "dependsOn": ["01-api:implement"]
149
+ }
150
+ ]
151
+ }
152
+ ```
153
+
154
+ ## 관련 명령어
155
+
156
+ - [cursorflow new](cursorflow-new.md) - Flow와 Lane 생성
157
+ - [cursorflow run](cursorflow-run.md) - Flow 실행
158
+ - [cursorflow doctor](cursorflow-doctor.md) - 설정 검증
159
+
@@ -1,42 +1,43 @@
1
1
  # CursorFlow Doctor
2
2
 
3
3
  ## Overview
4
- Verify that your environment and task configurations are properly set up for CursorFlow.
4
+ Verify that your environment and flow configurations are properly set up for CursorFlow.
5
5
 
6
6
  ## Usage
7
7
 
8
8
  ```bash
9
- cursorflow doctor [options]
9
+ cursorflow doctor [flow-name] [options]
10
10
  ```
11
11
 
12
12
  ## Checks Performed
13
13
  - **Environment**: Git repository status, remote availability, and worktree support.
14
14
  - **Cursor IDE**: Verifies `cursor-agent` is installed and authenticated.
15
- - **Tasks**: (Optional) Validates task JSON files for schema errors or missing fields.
15
+ - **Flow/Tasks**: (Optional) Validates flow JSON files for schema errors or missing fields.
16
16
 
17
17
  ## Options
18
18
 
19
19
  | Option | Description |
20
20
  |------|------|
21
- | `--tasks-dir <path>` | Validate lane files in a specific directory |
21
+ | `[flow-name]` | Flow name to validate (e.g., `SearchFeature`) |
22
+ | `--tasks-dir <path>` | Validate flow/tasks in a specific directory (legacy) |
22
23
  | `--executor <type>` | Check environment for `cursor-agent` \| `cloud` |
23
24
  | `--test-agent` | Run an interactive agent test (to approve permissions) |
24
25
  | `--no-cursor` | Skip Cursor Agent installation and auth checks |
25
26
  | `--json` | Output the report in machine-readable JSON format |
26
27
 
27
- ## Task Validation
28
+ ## Flow Validation
28
29
 
29
- When `--tasks-dir` is provided, the doctor performs comprehensive validation:
30
+ When a flow name or `--tasks-dir` is provided, the doctor performs comprehensive validation:
30
31
 
31
32
  ### Structure Validation
32
33
  - **tasks array**: Must exist and be non-empty
33
34
  - **task.name**: Required, must be alphanumeric with `-` and `_` only, unique within lane
34
35
  - **task.prompt**: Required, should be descriptive (warns if < 10 chars)
35
36
  - **task.model**: Optional, must be string if provided
36
- - **task.acceptanceCriteria**: Optional, must be non-empty array if provided
37
+ - **task.dependsOn**: Optional, task-level dependencies
37
38
 
38
39
  ### Dependency Validation (DAG)
39
- - **Unknown dependencies**: Reports if `dependsOn` references non-existent lanes
40
+ - **Unknown dependencies**: Reports if `dependsOn` references non-existent lanes/tasks
40
41
  - **Circular dependencies**: Detects cycles (e.g., A→B→A) that would cause deadlock
41
42
  - Reports the exact cycle path for easy debugging
42
43
 
@@ -44,30 +45,44 @@ When `--tasks-dir` is provided, the doctor performs comprehensive validation:
44
45
  - **Prefix collision**: Warns if multiple lanes use the same `branchPrefix`
45
46
  - **Existing branch conflicts**: Detects if existing branches match a lane's prefix
46
47
  - **Duplicate lane names**: Ensures each lane file has a unique name
47
- - **Naming suggestions**: Recommends using lane numbers in branch prefixes for consistency
48
48
 
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
54
-
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
- ```
59
-
60
- ## Example
49
+ ## Examples
61
50
 
62
51
  ```bash
63
52
  # Basic environment check
64
53
  cursorflow doctor
65
54
 
55
+ # Validate a specific flow by name
56
+ cursorflow doctor SearchFeature
57
+
66
58
  # Test agent permissions
67
59
  cursorflow doctor --test-agent
68
60
 
69
- # Validate a specific task set
70
- cursorflow doctor --tasks-dir _cursorflow/tasks/my-feature/
61
+ # Validate a specific flow directory
62
+ cursorflow doctor --tasks-dir _cursorflow/flows/001_SearchFeature
63
+
64
+ # Skip cursor checks (faster)
65
+ cursorflow doctor SearchFeature --no-cursor
66
+
67
+ # Output as JSON
68
+ cursorflow doctor SearchFeature --json
69
+ ```
70
+
71
+ ## Example Output
72
+
73
+ ```
74
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
75
+ 🩺 CursorFlow Doctor
76
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
77
+
78
+ cwd: /home/user/project
79
+ repo: /home/user/project
80
+ tasks: /home/user/project/_cursorflow/flows/001_SearchFeature
81
+
82
+ ✅ All checks passed
83
+
84
+ 💡 Tip: If this is your first run, we recommend running:
85
+ cursorflow doctor --test-agent
71
86
  ```
72
87
 
73
88
  ## Common Issues & Fixes
@@ -78,3 +93,10 @@ cursorflow doctor --tasks-dir _cursorflow/tasks/my-feature/
78
93
  | `Not authenticated` | Open Cursor IDE and log in to your account. |
79
94
  | `Worktree not supported` | Upgrade your Git version (requires Git >= 2.5). |
80
95
  | `Circular dependency` | Check the `dependsOn` fields in your task JSON files. |
96
+ | `Flow not found` | Verify flow name or create with `cursorflow new`. |
97
+
98
+ ## Related Commands
99
+
100
+ - [cursorflow new](cursorflow-new.md) - Create Flow and Lanes
101
+ - [cursorflow add](cursorflow-add.md) - Add Tasks to Lanes
102
+ - [cursorflow run](cursorflow-run.md) - Run Flow
@@ -7,20 +7,41 @@ The `cursorflow monitor` command provides a powerful, interactive terminal-based
7
7
 
8
8
  ```bash
9
9
  # Monitor the most recent run
10
- cursorflow monitor latest
10
+ cursorflow monitor
11
+
12
+ # List all runs (Multiple Flows Dashboard)
13
+ cursorflow monitor --list
11
14
 
12
15
  # Monitor a specific run directory
13
- cursorflow monitor _cursorflow/logs/runs/run-2025-12-21T10-00-00
16
+ cursorflow monitor run-2025-12-21T10-00-00
14
17
  ```
15
18
 
19
+ ## Options
20
+
21
+ | Option | Description |
22
+ |--------|-------------|
23
+ | `[run-dir]` | Run directory or ID to monitor (default: latest) |
24
+ | `--list`, `-l` | Show all runs dashboard (interactive list) |
25
+ | `--interval <n>` | Refresh interval in seconds (default: 2) |
26
+ | `--help`, `-h` | Show help |
27
+
16
28
  ## Dashboard Controls
17
29
 
18
30
  ### List View (Main)
19
31
  - **Navigation**: Use `↑` and `↓` to move between lanes.
20
32
  - **Details**: Press `→` or `Enter` to enter the **Lane Detail View**.
21
33
  - **Flow View**: Press `F` to see the task dependency graph (DAG).
34
+ - **All Runs**: Press `M` to switch to the **All Flows Dashboard**.
35
+ - **Unified Logs**: Press `U` to see a merged log stream of all lanes.
22
36
  - **Quit**: Press `Q` to exit.
23
37
 
38
+ ### All Flows Dashboard
39
+ - **Navigation**: Use `↑` and `↓` to select a flow.
40
+ - **Switch**: Press `→` or `Enter` to switch the monitor to the selected flow.
41
+ - **Delete**: Press `D` to delete a completed flow's logs (requires confirmation).
42
+ - **Refresh**: Press `R` to refresh the list of flows.
43
+ - **Back**: Press `M` or `Esc` to return to the List View.
44
+
24
45
  ### Lane Detail View
25
46
  - **History Browsing**: Use `↑` and `↓` to scroll through conversation history.
26
47
  - **Message Detail**: Press `→` or `Enter` on a message to see its full content.