@litmers/cursorflow-orchestrator 0.1.0 → 0.1.1
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/README.md +375 -310
- package/commands/cursorflow-clean.md +162 -162
- package/commands/cursorflow-init.md +67 -67
- package/commands/cursorflow-monitor.md +131 -131
- package/commands/cursorflow-prepare.md +134 -134
- package/commands/cursorflow-resume.md +181 -181
- package/commands/cursorflow-review.md +220 -220
- package/commands/cursorflow-run.md +129 -129
- package/package.json +13 -4
- package/scripts/ai-security-check.js +224 -0
- package/scripts/release.sh +109 -0
- package/scripts/setup-security.sh +105 -0
- package/src/cli/init.js +69 -4
- package/src/cli/monitor.js +196 -9
- package/src/core/runner.js +187 -9
- package/src/utils/config.js +2 -2
- package/src/utils/cursor-agent.js +96 -0
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
# CursorFlow Monitor
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
## Steps
|
|
7
|
-
|
|
8
|
-
1.
|
|
9
|
-
```bash
|
|
10
|
-
cursorflow monitor --watch
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
2.
|
|
14
|
-
```bash
|
|
15
|
-
cursorflow monitor _cursorflow/logs/runs/my-run/
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
3.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- pending:
|
|
22
|
-
- running:
|
|
23
|
-
- completed:
|
|
24
|
-
- failed:
|
|
25
|
-
- blocked_dependency:
|
|
26
|
-
|
|
27
|
-
4.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- `state.json`:
|
|
31
|
-
- `conversation.jsonl`:
|
|
32
|
-
- `git-operations.jsonl`: Git
|
|
33
|
-
- `events.jsonl`:
|
|
34
|
-
|
|
35
|
-
##
|
|
36
|
-
|
|
37
|
-
|
|
|
38
|
-
|------|------|
|
|
39
|
-
| `--watch` |
|
|
40
|
-
| `--interval <sec>` |
|
|
41
|
-
| `--json` | JSON
|
|
42
|
-
|
|
43
|
-
##
|
|
44
|
-
|
|
45
|
-
###
|
|
46
|
-
```bash
|
|
47
|
-
cursorflow monitor
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
###
|
|
51
|
-
```bash
|
|
52
|
-
cursorflow monitor --watch --interval 5
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### JSON
|
|
56
|
-
```bash
|
|
57
|
-
cursorflow monitor --json | jq
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
##
|
|
61
|
-
|
|
62
|
-
```
|
|
63
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
64
|
-
📡 Lane
|
|
65
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
66
|
-
|
|
67
|
-
Run: 01-dashboard-2025-12-19T18-30-00
|
|
68
|
-
|
|
69
|
-
- 01-dashboard: running (2/3)
|
|
70
|
-
- 02-client: completed (3/3)
|
|
71
|
-
- 03-projects: blocked_dependency (1/2)
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
##
|
|
75
|
-
|
|
76
|
-
###
|
|
77
|
-
```bash
|
|
78
|
-
cat _cursorflow/logs/runs/01-dashboard-xxx/conversation.jsonl | jq
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
### Git
|
|
82
|
-
```bash
|
|
83
|
-
cat _cursorflow/logs/runs/01-dashboard-xxx/git-operations.jsonl | jq
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
###
|
|
87
|
-
```bash
|
|
88
|
-
cat _cursorflow/logs/runs/01-dashboard-xxx/events.jsonl | jq
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
##
|
|
92
|
-
|
|
93
|
-
###
|
|
94
|
-
```bash
|
|
95
|
-
#
|
|
96
|
-
for state in _cursorflow/logs/runs/*/lanes/*/state.json; do
|
|
97
|
-
echo "$(dirname $state):"
|
|
98
|
-
jq '.status, .currentTaskIndex, .totalTasks' $state
|
|
99
|
-
done
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
###
|
|
103
|
-
```bash
|
|
104
|
-
# status
|
|
105
|
-
find _cursorflow/logs/runs -name "state.json" -exec sh -c \
|
|
106
|
-
'jq -r "select(.status==\"failed\") | .label" {}' \;
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Checklist
|
|
110
|
-
- [ ]
|
|
111
|
-
- [ ]
|
|
112
|
-
- [ ]
|
|
113
|
-
- [ ]
|
|
114
|
-
- [ ]
|
|
115
|
-
|
|
116
|
-
##
|
|
117
|
-
|
|
118
|
-
###
|
|
119
|
-
1. `state.json
|
|
120
|
-
2. `conversation.jsonl
|
|
121
|
-
3.
|
|
122
|
-
|
|
123
|
-
###
|
|
124
|
-
1.
|
|
125
|
-
2.
|
|
126
|
-
3.
|
|
127
|
-
|
|
128
|
-
## Next
|
|
129
|
-
1.
|
|
130
|
-
2.
|
|
131
|
-
3.
|
|
1
|
+
# CursorFlow Monitor
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Monitor lane execution status. Track progress in real time and inspect logs.
|
|
5
|
+
|
|
6
|
+
## Steps
|
|
7
|
+
|
|
8
|
+
1. **Monitor in real time**
|
|
9
|
+
```bash
|
|
10
|
+
cursorflow monitor --watch
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
2. **Monitor a specific run**
|
|
14
|
+
```bash
|
|
15
|
+
cursorflow monitor _cursorflow/logs/runs/my-run/
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
3. **Check status**
|
|
19
|
+
|
|
20
|
+
Lane status values:
|
|
21
|
+
- pending: waiting
|
|
22
|
+
- running: in progress
|
|
23
|
+
- completed: finished
|
|
24
|
+
- failed: failed
|
|
25
|
+
- blocked_dependency: waiting on dependencies
|
|
26
|
+
|
|
27
|
+
4. **Inspect logs**
|
|
28
|
+
|
|
29
|
+
Per-lane log files:
|
|
30
|
+
- `state.json`: current status
|
|
31
|
+
- `conversation.jsonl`: agent conversation
|
|
32
|
+
- `git-operations.jsonl`: Git activity
|
|
33
|
+
- `events.jsonl`: event log
|
|
34
|
+
|
|
35
|
+
## Options
|
|
36
|
+
|
|
37
|
+
| Option | Description |
|
|
38
|
+
|------|------|
|
|
39
|
+
| `--watch` | Refresh in real time (every 2 seconds) |
|
|
40
|
+
| `--interval <sec>` | Refresh interval in seconds |
|
|
41
|
+
| `--json` | Output in JSON format |
|
|
42
|
+
|
|
43
|
+
## Examples
|
|
44
|
+
|
|
45
|
+
### Monitor the latest run
|
|
46
|
+
```bash
|
|
47
|
+
cursorflow monitor
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Real-time monitoring (5-second interval)
|
|
51
|
+
```bash
|
|
52
|
+
cursorflow monitor --watch --interval 5
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### JSON output
|
|
56
|
+
```bash
|
|
57
|
+
cursorflow monitor --json | jq
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Sample output
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
64
|
+
📡 Lane Status Monitoring
|
|
65
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
66
|
+
|
|
67
|
+
Run: 01-dashboard-2025-12-19T18-30-00
|
|
68
|
+
|
|
69
|
+
- 01-dashboard: running (2/3)
|
|
70
|
+
- 02-client: completed (3/3)
|
|
71
|
+
- 03-projects: blocked_dependency (1/2)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Viewing logs
|
|
75
|
+
|
|
76
|
+
### Conversation history
|
|
77
|
+
```bash
|
|
78
|
+
cat _cursorflow/logs/runs/01-dashboard-xxx/conversation.jsonl | jq
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Git activity log
|
|
82
|
+
```bash
|
|
83
|
+
cat _cursorflow/logs/runs/01-dashboard-xxx/git-operations.jsonl | jq
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Event log
|
|
87
|
+
```bash
|
|
88
|
+
cat _cursorflow/logs/runs/01-dashboard-xxx/events.jsonl | jq
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Status analysis
|
|
92
|
+
|
|
93
|
+
### Progress per lane
|
|
94
|
+
```bash
|
|
95
|
+
# Inspect state.json for all lanes
|
|
96
|
+
for state in _cursorflow/logs/runs/*/lanes/*/state.json; do
|
|
97
|
+
echo "$(dirname $state):"
|
|
98
|
+
jq '.status, .currentTaskIndex, .totalTasks' $state
|
|
99
|
+
done
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Find failed lanes
|
|
103
|
+
```bash
|
|
104
|
+
# Lanes where status is failed
|
|
105
|
+
find _cursorflow/logs/runs -name "state.json" -exec sh -c \
|
|
106
|
+
'jq -r "select(.status==\"failed\") | .label" {}' \;
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Checklist
|
|
110
|
+
- [ ] Are lane states healthy?
|
|
111
|
+
- [ ] Did any errors occur?
|
|
112
|
+
- [ ] Have the logs been reviewed?
|
|
113
|
+
- [ ] Are any lanes blocked?
|
|
114
|
+
- [ ] Are there dependency issues?
|
|
115
|
+
|
|
116
|
+
## Troubleshooting
|
|
117
|
+
|
|
118
|
+
### Lane is stuck
|
|
119
|
+
1. Check status in `state.json`.
|
|
120
|
+
2. Inspect the last conversation in `conversation.jsonl`.
|
|
121
|
+
3. Resume if needed with `cursorflow resume <lane>`.
|
|
122
|
+
|
|
123
|
+
### Logs are missing
|
|
124
|
+
1. Confirm the run actually started.
|
|
125
|
+
2. Check log directory permissions.
|
|
126
|
+
3. Verify the `logsDir` path in the config file.
|
|
127
|
+
|
|
128
|
+
## Next steps
|
|
129
|
+
1. If you find issues, resume with `cursorflow resume`.
|
|
130
|
+
2. Review PRs for completed lanes.
|
|
131
|
+
3. Analyze logs to identify improvements.
|
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
# CursorFlow Prepare
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
##
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
## Steps
|
|
11
|
-
|
|
12
|
-
1. **
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
📋
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
1. Feature
|
|
20
|
-
2.
|
|
21
|
-
3.
|
|
22
|
-
- Lane 1: [
|
|
23
|
-
- Lane 2: [
|
|
24
|
-
- ...
|
|
25
|
-
4.
|
|
26
|
-
5.
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
2.
|
|
30
|
-
```bash
|
|
31
|
-
#
|
|
32
|
-
TIMESTAMP=$(date +%y%m%d%H%M)
|
|
33
|
-
FEATURE_NAME="
|
|
34
|
-
TASK_DIR="_cursorflow/tasks/${TIMESTAMP}_${FEATURE_NAME}"
|
|
35
|
-
|
|
36
|
-
mkdir -p "$TASK_DIR"
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
3.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
```json
|
|
43
|
-
{
|
|
44
|
-
"repository": "https://github.com/org/repo",
|
|
45
|
-
"baseBranch": "main",
|
|
46
|
-
"branchPrefix": "<feature>/<lane>-",
|
|
47
|
-
"executor": "cursor-agent",
|
|
48
|
-
"autoCreatePr": false,
|
|
49
|
-
"allowDependencyChange": false,
|
|
50
|
-
"lockfileReadOnly": true,
|
|
51
|
-
"pollInterval": 60,
|
|
52
|
-
|
|
53
|
-
"laneNumber": 1,
|
|
54
|
-
"devPort": 3001,
|
|
55
|
-
|
|
56
|
-
"enableReview": true,
|
|
57
|
-
"reviewModel": "sonnet-4.5-thinking",
|
|
58
|
-
"maxReviewIterations": 3,
|
|
59
|
-
|
|
60
|
-
"tasks": [
|
|
61
|
-
{
|
|
62
|
-
"name": "plan",
|
|
63
|
-
"model": "opus-4.5-thinking",
|
|
64
|
-
"acceptanceCriteria": [
|
|
65
|
-
"
|
|
66
|
-
],
|
|
67
|
-
"prompt": "..."
|
|
68
|
-
}
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
4.
|
|
74
|
-
|
|
75
|
-
|
|
|
76
|
-
|------|------|------|
|
|
77
|
-
| `sonnet-4.5` |
|
|
78
|
-
| `sonnet-4.5-thinking` |
|
|
79
|
-
| `opus-4.5` |
|
|
80
|
-
| `opus-4.5-thinking` |
|
|
81
|
-
| `gpt-5.2` |
|
|
82
|
-
| `gpt-5.2-high` |
|
|
83
|
-
|
|
84
|
-
5.
|
|
85
|
-
```
|
|
86
|
-
✅
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
- 01-<lane1>.json
|
|
92
|
-
- 02-<lane2>.json
|
|
93
|
-
- ...
|
|
94
|
-
- README.md
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
cursorflow run _cursorflow/tasks/<timestamp>_<feature>/
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
##
|
|
101
|
-
|
|
102
|
-
###
|
|
103
|
-
```bash
|
|
104
|
-
cursorflow prepare MyFeature --lanes 1
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
###
|
|
108
|
-
```bash
|
|
109
|
-
cursorflow prepare AdminDashboard --lanes 5
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
###
|
|
113
|
-
```bash
|
|
114
|
-
cursorflow prepare MyFeature --template ./my-template.json
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
## Checklist
|
|
118
|
-
- [ ]
|
|
119
|
-
- [ ]
|
|
120
|
-
- [ ]
|
|
121
|
-
- [ ]
|
|
122
|
-
- [ ]
|
|
123
|
-
- [ ]
|
|
124
|
-
|
|
125
|
-
##
|
|
126
|
-
1.
|
|
127
|
-
2.
|
|
128
|
-
3.
|
|
129
|
-
4. **devPort**:
|
|
130
|
-
|
|
131
|
-
## Next
|
|
132
|
-
1.
|
|
133
|
-
2.
|
|
134
|
-
3. `cursorflow run
|
|
1
|
+
# CursorFlow Prepare
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Prepare task files for a new feature by gathering requirements and generating lane-specific JSON files.
|
|
5
|
+
|
|
6
|
+
## Required references
|
|
7
|
+
- Package docs: `node_modules/@litmers/cursorflow-orchestrator/docs/GUIDE.md`
|
|
8
|
+
- Model list: run `cursorflow models --list` in the terminal
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
1. **Collect feature information**
|
|
13
|
+
|
|
14
|
+
Confirm the following details with the requester:
|
|
15
|
+
```
|
|
16
|
+
📋 Task Preparation Info
|
|
17
|
+
=======================
|
|
18
|
+
|
|
19
|
+
1. Feature name: [e.g., SchemaUpdate, AdminDashboard]
|
|
20
|
+
2. Number of lanes: [e.g., 3]
|
|
21
|
+
3. Work per lane:
|
|
22
|
+
- Lane 1: [description]
|
|
23
|
+
- Lane 2: [description]
|
|
24
|
+
- ...
|
|
25
|
+
4. Need dependency changes? [Y/N]
|
|
26
|
+
5. Existing task to reference (optional): [path or N]
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
2. **Create the task folder**
|
|
30
|
+
```bash
|
|
31
|
+
# Timestamp-based folder name (YYMMDDHHMM - 10 digits)
|
|
32
|
+
TIMESTAMP=$(date +%y%m%d%H%M)
|
|
33
|
+
FEATURE_NAME="<user input>"
|
|
34
|
+
TASK_DIR="_cursorflow/tasks/${TIMESTAMP}_${FEATURE_NAME}"
|
|
35
|
+
|
|
36
|
+
mkdir -p "$TASK_DIR"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
3. **Task JSON template**
|
|
40
|
+
|
|
41
|
+
Create one JSON file per lane using this structure:
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"repository": "https://github.com/org/repo",
|
|
45
|
+
"baseBranch": "main",
|
|
46
|
+
"branchPrefix": "<feature>/<lane>-",
|
|
47
|
+
"executor": "cursor-agent",
|
|
48
|
+
"autoCreatePr": false,
|
|
49
|
+
"allowDependencyChange": false,
|
|
50
|
+
"lockfileReadOnly": true,
|
|
51
|
+
"pollInterval": 60,
|
|
52
|
+
|
|
53
|
+
"laneNumber": 1,
|
|
54
|
+
"devPort": 3001,
|
|
55
|
+
|
|
56
|
+
"enableReview": true,
|
|
57
|
+
"reviewModel": "sonnet-4.5-thinking",
|
|
58
|
+
"maxReviewIterations": 3,
|
|
59
|
+
|
|
60
|
+
"tasks": [
|
|
61
|
+
{
|
|
62
|
+
"name": "plan",
|
|
63
|
+
"model": "opus-4.5-thinking",
|
|
64
|
+
"acceptanceCriteria": [
|
|
65
|
+
"Plan document created"
|
|
66
|
+
],
|
|
67
|
+
"prompt": "..."
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
4. **Model selection guide**
|
|
74
|
+
|
|
75
|
+
| Model | Purpose | Notes |
|
|
76
|
+
|------|------|------|
|
|
77
|
+
| `sonnet-4.5` | General implementation, fast work | Most versatile |
|
|
78
|
+
| `sonnet-4.5-thinking` | Code review, deeper reasoning | Thinking model |
|
|
79
|
+
| `opus-4.5` | Complex tasks, high quality | Advanced |
|
|
80
|
+
| `opus-4.5-thinking` | Architecture design | Premium |
|
|
81
|
+
| `gpt-5.2` | General tasks | OpenAI |
|
|
82
|
+
| `gpt-5.2-high` | Advanced reasoning | High performance |
|
|
83
|
+
|
|
84
|
+
5. **Verify the output**
|
|
85
|
+
```
|
|
86
|
+
✅ Task preparation complete
|
|
87
|
+
===========================
|
|
88
|
+
|
|
89
|
+
Folder: _cursorflow/tasks/<timestamp>_<feature>/
|
|
90
|
+
Files created:
|
|
91
|
+
- 01-<lane1>.json
|
|
92
|
+
- 02-<lane2>.json
|
|
93
|
+
- ...
|
|
94
|
+
- README.md
|
|
95
|
+
|
|
96
|
+
Run with:
|
|
97
|
+
cursorflow run _cursorflow/tasks/<timestamp>_<feature>/
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Examples
|
|
101
|
+
|
|
102
|
+
### Single-lane task
|
|
103
|
+
```bash
|
|
104
|
+
cursorflow prepare MyFeature --lanes 1
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Multi-lane task
|
|
108
|
+
```bash
|
|
109
|
+
cursorflow prepare AdminDashboard --lanes 5
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Using a custom template
|
|
113
|
+
```bash
|
|
114
|
+
cursorflow prepare MyFeature --template ./my-template.json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Checklist
|
|
118
|
+
- [ ] Is the feature name clear?
|
|
119
|
+
- [ ] Is the work for each lane defined?
|
|
120
|
+
- [ ] Is the model selection appropriate?
|
|
121
|
+
- [ ] Have dependency changes been confirmed?
|
|
122
|
+
- [ ] Are the acceptance criteria clear?
|
|
123
|
+
- [ ] Have the generated files been reviewed?
|
|
124
|
+
|
|
125
|
+
## Notes
|
|
126
|
+
1. **Model names**: Use only valid models (check with the `models` command).
|
|
127
|
+
2. **Paths**: Always create tasks under `_cursorflow/tasks/`.
|
|
128
|
+
3. **Branch prefix**: Make it unique to avoid collisions.
|
|
129
|
+
4. **devPort**: Use unique ports per lane (3001, 3002, ...).
|
|
130
|
+
|
|
131
|
+
## Next steps
|
|
132
|
+
1. Tailor the generated JSON files to the project.
|
|
133
|
+
2. Write detailed prompts.
|
|
134
|
+
3. Run the tasks with `cursorflow run`.
|