Git worktree-based parallel AI agent orchestration system for Cursor
npm install @litmers/cursorflow-orchestrator> Parallel AI agent orchestration system built on Git worktrees






- โก Parallel Execution: Run multiple AI agents concurrently using isolated Git worktrees.
- ๐ Task Dependencies (DAG): Define complex workflows where tasks wait for and merge their dependencies automatically.
- ๐ Flow Architecture: Intuitive new + add commands to define Flows, Lanes, and Tasks.
- ๐ Interactive Dashboard: A powerful terminal-based monitor to track all lanes, progress, and dependencies in real-time.
- ๐บ Live Terminal Streaming: Watch the AI agent's output as it happens with scrollable history.
- ๐ Human Intervention: Send direct messages to running agents to guide them or fix issues on the fly.
- ๐ Smart Merging: Automatically merge completed feature branches into subsequent dependent lanes.
- ๐ Security-First: Automated security scanning and dependency policy enforcement.
``bash`
npm install -g @litmers/cursorflow-orchestrator
`bash
cd your-project
cursorflow init
$3
`bash
Add tasks to backend lane (uses default model)
cursorflow add ShopFeature backend \
--task "name=implement|prompt=์ํ ๊ฒ์ API ๊ตฌํ"Add tasks to frontend lane (waits for backend)
cursorflow add ShopFeature frontend \
--task "name=ui|prompt=๊ฒ์ UI ๊ตฌํ" \
--after "backend:implement"
`$3
`bash
Start orchestration
cursorflow run ShopFeatureMonitor progress in real-time
cursorflow monitor latest
`๐ Flow ์ปค๋งจ๋ - ์๋๋ฆฌ์ค๋ก ๋ฐฐ์ฐ๊ธฐ
์๋๋ฆฌ์ค: "์ผํ๋ชฐ" ํ๋ก์ ํธ์์ ๋ฐฑ์๋ API์ ํ๋ก ํธ์๋๋ฅผ ๋์์ ๊ฐ๋ฐ
---
$3
`bash
cursorflow new SearchFeature --lanes "api,web,mobile"
`๊ฒฐ๊ณผ:
`
_cursorflow/flows/001_SearchFeature/
โโโ flow.meta.json # Flow ๋ฉํ๋ฐ์ดํฐ
โโโ api.json # API ๋ ์ธ (๋น ์ํ)
โโโ web.json # Web ๋ ์ธ (๋น ์ํ)
โโโ mobile.json # Mobile ๋ ์ธ (๋น ์ํ)
`---
$3
`bash
API ๋ ์ธ: ์์กด์ฑ ์์, ๋ฐ๋ก ์์
cursorflow add SearchFeature api \
--task "name=plan|prompt=API ์ค๊ณ" \
--task "name=implement|prompt=๊ฒ์ API ๊ตฌํ" \
--task "name=test|prompt=API ํ
์คํธ ์์ฑ"Web ๋ ์ธ: API์ implement ์๋ฃ ํ ์์
cursorflow add SearchFeature web \
--task "name=ui|prompt=๊ฒ์ UI ๊ตฌํ" \
--after "api:implement"Mobile ๋ ์ธ: API ํ
์คํธ๊น์ง ๋ชจ๋ ๋๋์ผ ์์
cursorflow add SearchFeature mobile \
--task "name=app|prompt=๋ชจ๋ฐ์ผ ๊ฒ์ ํ๋ฉด ๊ตฌํ" \
--after "api:test"
`---
$3
`bash
cursorflow run SearchFeature
`์คํ ํ๋ฆ:
`
api: [plan] โ [implement] โ [test]
โ โ
web: โโโ [ui] โโโโโค
โ
mobile: โโโ [app]
`---
$3
`
"name=<์ด๋ฆ>|prompt=<ํ๋กฌํํธ>" # ๊ธฐ๋ณธ ๋ชจ๋ธ ์ฌ์ฉ
"name=<์ด๋ฆ>|model=<๋ชจ๋ธ>|prompt=<ํ๋กฌํํธ>" # ๋ชจ๋ธ ์ง์
`| ํ๋ | ํ์ | ์ค๋ช
|
|------|------|------|
|
name | โ
| ํ์คํฌ ์ด๋ฆ (์๋ฌธ, ์ซ์, -, _) |
| prompt | โ
| ํ์คํฌ ํ๋กฌํํธ |
| model | โ | AI ๋ชจ๋ธ (์๋ต ์ ๊ธฐ๋ณธ ๋ชจ๋ธ ์ฌ์ฉ) |๊ธฐ๋ณธ ๋ชจ๋ธ ์ค์ :
cursorflow config defaultModel ---
$3
`
--after "lane:task" # ํน์ ํ์คํฌ ์๋ฃ ํ ์์
--after "lane" # ํด๋น ๋ ์ธ์ ๋ง์ง๋ง ํ์คํฌ ์๋ฃ ํ
--after "a:t1, b:t2" # ์ฌ๋ฌ ํ์คํฌ ๋ชจ๋ ์๋ฃ ํ (์ฝค๋ง ๊ตฌ๋ถ)
`---
$3
| ์ปค๋งจ๋ | ์ค๋ช
| ์์ |
|--------|------|------|
|
new | Flow์ Lane ์์ฑ | cursorflow new Feature --lanes "api,web" |
| add | Lane์ Task ์ถ๊ฐ | cursorflow add Feature api --task "..." |
| run | Flow ์คํ | cursorflow run Feature |
| complete | Flow ํตํฉ ๋ฐ ๋ง๋ฌด๋ฆฌ | cursorflow complete Feature |๐ฎ Dashboard Controls
Within the
cursorflow monitor dashboard:
- โ/โ: Navigate between lanes or scroll through logs.
- โ / Enter: Enter detailed lane view.
- โ / Esc: Go back.
- F: Toggle Dependency Flow view.
- T: Open Live Terminal Streaming.
- I: Intervene (send a message to the agent).
- K: Kill the current agent process.
- Q: Quit monitor.โ๏ธ Configuration
$3
`json
{
"branchPrefix": "feature/lane-1-",
"timeout": 600000,
"enableIntervention": true,
"tasks": [
{
"name": "setup",
"model": "sonnet-4.5",
"prompt": "Set up the project structure..."
},
{
"name": "implement",
"model": "sonnet-4.5",
"prompt": "Implement the user authentication...",
"acceptanceCriteria": ["Code complete", "Tests pass"],
"dependsOn": ["other-lane:setup"]
}
]
}
`$3
| Option | Type | Default | Description |
|--------|------|---------|-------------|
|
timeout | number | 600000 | Task timeout in milliseconds (10 min) |
| enableIntervention | boolean | true | Enable stdin piping for intervention |
| model | string | "sonnet-4.5" | AI model to use |๐ ํ์คํฌ ์์กด์ฑ (dependsOn)
์ธ์ ์ฌ์ฉ? ํ๋ก ํธ์๋๊ฐ ๋ฐฑ์๋ API ์์ฑ ํ์ ์์ํด์ผ ํ ๋
$3
JSON ํ์ผ์์
dependsOn ํ๋ ์ถ๊ฐ:`json
{
"tasks": [
{ "name": "setup", "prompt": "์ด๊ธฐ ์ค์ ..." },
{
"name": "integrate",
"prompt": "API ์ฐ๋...",
"dependsOn": ["backend:implement"] // โ ์ด ํ์คํฌ ์๋ฃ ํ ์์
}
]
}
`ํ์:
"๋ ์ธํ์ผ๋ช
:ํ์คํฌ๋ช
" (ํ์ฅ์ .json ์ ์ธ)$3
`
1-backend: [setup] โ [implement] โ [test]
โ ์๋ฃ!
2-frontend: [setup] โโโโโโดโ ๋๊ธฐ โ [integrate] โ [test]
`- ๋ฐฑ์๋์ ํ๋ก ํธ์๋ ๋์ ์์
- ํ๋ก ํธ์
integrate๋ ๋ฐฑ์๋ implement ์๋ฃ๊น์ง ๋๊ธฐ
- ์๋ฃ๋๋ฉด ๋ฐฑ์๋ ๋ธ๋์น ์๋ ๋จธ์ง ํ ์์$3
`bash
cursorflow doctor --tasks-dir _cursorflow/tasks/MyFeature
โ Cyclic dependency: a:task1 โ b:task2 โ a:task1
`๐ฉบ Pre-flight Checks
Doctor validates your configuration before running:
`bash
cursorflow doctor --tasks-dir _cursorflow/tasks/my-featureChecks performed:
โ Git repository and remote
โ Branch prefix collisions
โ Task structure validation
โ Circular dependency detection (DAG)
โ Existing branch conflicts
`๐ Commands Reference
$3
| Command | Description |
|---------|-------------|
| cursorflow new | Create Flow with Lanes |
| cursorflow add | Add Tasks to Lane |
| cursorflow config | View/set configuration |
| cursorflow tasks | Browse flows and legacy tasks |$3
| Command | Description |
|---------|-------------|
| cursorflow run | Run orchestration (DAG-based) |
| cursorflow monitor | Interactive lane dashboard |
| cursorflow resume | Resume lane(s) - use --all for batch resume |
| cursorflow stop | Stop running workflows |$3
| Command | Description |
|---------|-------------|
| cursorflow doctor | Check environment and preflight |
| cursorflow logs | View, export, and follow logs |
| cursorflow models | List available AI models |$3
| Command | Description |
|---------|-------------|
| cursorflow init | Initialize CursorFlow in project |
| cursorflow setup | Install Cursor IDE commands |
| cursorflow clean | Clean branches/worktrees/logs/tasks |
| cursorflow signal | Directly intervene in a running lane |$3
| Command | Description |
|---------|-------------|
| cursorflow prepare | (deprecated) Use 'new' + 'add' instead |๐ Enhanced Logging
CursorFlow provides comprehensive logging with automatic cleanup and export options.
$3
Logs use the format
[{n}-{t}-{lanename}]:
- {n}: Lane number (1-indexed)
- {t}: Task number (1-indexed)
- {lanename}: First 10 characters of lane nameExample:
[1-2-backend] = Lane 1, Task 2, lane "backend"$3
- ANSI Stripping: Clean logs without terminal escape codes
- Timestamps: Automatic timestamps on each line (ISO, relative, or short format)
- Log Rotation: Automatic rotation when files exceed size limits
- Multiple Formats:
- terminal.log - Clean, readable logs
- terminal-raw.log - Raw logs with ANSI codes
- terminal.jsonl - Structured JSON for programmatic access$3
`bash
View logs summary for latest run
cursorflow logsView specific lane logs
cursorflow logs --lane api-setupView ALL lanes merged (unified timeline)
cursorflow logs --allFollow all lanes in real-time
cursorflow logs --all --followFollow logs in real-time
cursorflow logs --lane api-setup --followExport to different formats
cursorflow logs --lane api-setup --format json --output logs.json
cursorflow logs --all --format html --output all-logs.htmlFilter logs
cursorflow logs --all --filter "error|failed"
cursorflow logs --all --level stderr
cursorflow logs --lane api-setup --level error --tail 50
`$3
When running multiple lanes, use
--all to see a unified timeline:`
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Merged Logs - run-123 (45 entries from 3 lanes)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ Lanes: โ api-setup โ frontend โ database
[10:15:30] [api-setup ] [STDOUT] Starting API setup...
[10:15:31] [frontend ] [STDOUT] Setting up React...
[10:15:32] [database ] [STDOUT] Creating schema...
[10:15:33] [api-setup ] [STDOUT] Endpoints created
[10:15:34] [frontend ] [STDERR] Warning: Deprecated API
...
`$3
Add to
cursorflow.config.js:`javascript
module.exports = {
// ... other config ...
enhancedLogging: {
enabled: true, // Enable enhanced logging
stripAnsi: true, // Strip ANSI codes for clean logs
addTimestamps: true, // Add timestamps to each line
maxFileSize: 52428800, // 50MB max before rotation
maxFiles: 5, // Keep 5 rotated files
keepRawLogs: true, // Keep raw logs separately
writeJsonLog: true, // Generate JSON logs
timestampFormat: 'iso', // 'iso' | 'relative' | 'short'
},
};
`๐ Documentation
$3
- ๐๏ธ Architecture - Core principles, isolation, and recovery mechanisms (includes Workflow & States)
- ๐ Module Guide - Architecture and module structure
- ๐ค cursor-agent Guide - CLI usage and output parsing
- ๐งช Test Architecture - Test layers and strategies
- ๐ช Hook System Guide - Custom hooks and flow control$3
- ๐ Prepare Command - Task generation with presets
- ๐ Run Command - Execution options
- ๐ฉบ Doctor Command - Validation details
- ๐ Monitor Command - Dashboard usage
- ๐ Event Triggers & Webhooks - Event system and webhooks
- ๐ฆ Examples - Practical examples๐ Deployment & Updates
$3
To release a new version to NPM:
1. Run the release script: ./scripts/release.sh [patch|minor|major]
2. The script handles versioning, changelog, and triggers GitHub Actions.$3
Update and refresh commands:
`bash
npm install -g @litmers/cursorflow-orchestrator
cursorflow-setup --force
``MIT ยฉ Eugene Jin
---
Made with โค๏ธ for Cursor IDE users