ralphflow 0.4.0 → 0.5.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 +79 -87
- package/dist/chunk-DOC64TD6.js +535 -0
- package/dist/ralphflow.js +666 -269
- package/dist/server-EX5MWYW4.js +1021 -0
- package/package.json +6 -3
- package/src/dashboard/ui/app.js +203 -0
- package/src/dashboard/ui/archives.js +167 -0
- package/src/dashboard/ui/index.html +6 -804
- package/src/dashboard/ui/loop-detail.js +880 -0
- package/src/dashboard/ui/notifications.js +151 -0
- package/src/dashboard/ui/prompt-builder.js +327 -0
- package/src/dashboard/ui/sidebar.js +97 -0
- package/src/dashboard/ui/state.js +54 -0
- package/src/dashboard/ui/styles.css +2119 -0
- package/src/dashboard/ui/templates.js +1855 -0
- package/src/dashboard/ui/utils.js +115 -0
- package/src/templates/code-implementation/loops/00-story-loop/prompt.md +34 -6
- package/src/templates/code-implementation/loops/01-tasks-loop/prompt.md +23 -0
- package/src/templates/code-implementation/loops/02-delivery-loop/prompt.md +21 -0
- package/src/templates/code-implementation/ralphflow.yaml +3 -0
- package/src/templates/research/loops/00-discovery-loop/prompt.md +22 -0
- package/src/templates/research/loops/01-research-loop/prompt.md +22 -0
- package/src/templates/research/loops/02-story-loop/prompt.md +22 -0
- package/src/templates/research/loops/03-document-loop/prompt.md +22 -0
- package/src/templates/research/ralphflow.yaml +4 -0
- package/dist/chunk-GVOJO5IN.js +0 -274
- package/dist/server-O6J52DZT.js +0 -323
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@ Multi-agent AI workflow orchestration for [Claude Code](https://docs.anthropic.c
|
|
|
8
8
|
|
|
9
9
|
Define pipelines as loops, coordinate parallel agents via file-based trackers, and ship structured work — from single-agent interactive sessions to multi-agent autonomous execution.
|
|
10
10
|
|
|
11
|
+
**[Documentation](https://rahulthakur319.github.io/ralph-flow/)** | **[npm](https://www.npmjs.com/package/ralphflow)** | **[GitHub](https://github.com/rahulthakur319/ralph-flow)**
|
|
12
|
+
|
|
11
13
|
## Quick Start
|
|
12
14
|
|
|
13
15
|
```bash
|
|
@@ -15,23 +17,26 @@ Define pipelines as loops, coordinate parallel agents via file-based trackers, a
|
|
|
15
17
|
npx ralphflow
|
|
16
18
|
```
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
This starts the web dashboard at `http://localhost:4242` and opens it in your browser. From the dashboard you can create apps, run loops, edit prompts, monitor agents, and browse archives — all in one place.
|
|
19
21
|
|
|
20
|
-
###
|
|
22
|
+
### CLI Commands
|
|
21
23
|
|
|
22
24
|
```bash
|
|
23
|
-
#
|
|
25
|
+
# Initialize a new flow
|
|
24
26
|
npx ralphflow init --template code-implementation --name my-app
|
|
27
|
+
|
|
28
|
+
# Run loops
|
|
25
29
|
npx ralphflow run story
|
|
26
30
|
npx ralphflow run tasks
|
|
27
31
|
npx ralphflow run tasks --multi-agent # Multi-agent — one terminal per agent
|
|
28
32
|
npx ralphflow run delivery
|
|
29
|
-
npx ralphflow status
|
|
30
33
|
|
|
31
|
-
#
|
|
32
|
-
npx ralphflow
|
|
33
|
-
npx ralphflow
|
|
34
|
-
|
|
34
|
+
# Run with live dashboard alongside
|
|
35
|
+
npx ralphflow run tasks --ui
|
|
36
|
+
npx ralphflow e2e --ui
|
|
37
|
+
|
|
38
|
+
# Check status
|
|
39
|
+
npx ralphflow status
|
|
35
40
|
```
|
|
36
41
|
|
|
37
42
|
## How It Works
|
|
@@ -59,9 +64,33 @@ Story Loop Tasks Loop Delivery Loop
|
|
|
59
64
|
agent-1 agent-2 agent-3
|
|
60
65
|
```
|
|
61
66
|
|
|
67
|
+
## Web Dashboard
|
|
68
|
+
|
|
69
|
+
The dashboard (`http://localhost:4242`) is the primary interface for managing workflows.
|
|
70
|
+
|
|
71
|
+
**Features:**
|
|
72
|
+
- **Live pipeline view** — color-coded loop status (complete/running/pending)
|
|
73
|
+
- **Per-loop detail** — stage, active item, progress bar, agent table
|
|
74
|
+
- **Prompt editor** — edit prompt files with Cmd+S save and dirty indicator
|
|
75
|
+
- **Tracker viewer** — auto-updates as agents write via WebSocket
|
|
76
|
+
- **Model selector** — per-loop model configuration (claude-sonnet-4-6, claude-opus-4-6, etc.)
|
|
77
|
+
- **Attention notifications** — real-time alerts when Claude needs input, with desktop notifications and audio chime
|
|
78
|
+
- **App archiving** — snapshot and reset flows to start fresh
|
|
79
|
+
- **Archive browser** — browse past snapshots with timeline view and file viewer
|
|
80
|
+
- **Template creator** — build custom templates with a visual config builder and live YAML preview
|
|
81
|
+
- **Create app** — initialize new flows from built-in or custom templates
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx ralphflow dashboard # Default port 4242
|
|
85
|
+
npx ralphflow dashboard -p 3000 # Custom port
|
|
86
|
+
npx ralphflow ui # Alias
|
|
87
|
+
```
|
|
88
|
+
|
|
62
89
|
## Commands
|
|
63
90
|
|
|
64
|
-
|
|
91
|
+
### `npx ralphflow` (no args)
|
|
92
|
+
|
|
93
|
+
Starts the dashboard and opens it in your browser. This is the recommended way to use RalphFlow.
|
|
65
94
|
|
|
66
95
|
### `npx ralphflow init`
|
|
67
96
|
|
|
@@ -73,55 +102,30 @@ npx ralphflow init --template code-implementation --name api # Non-interactive
|
|
|
73
102
|
npx ralphflow init --template research --name kashi # Research pipeline
|
|
74
103
|
```
|
|
75
104
|
|
|
76
|
-
Requires `CLAUDE.md` to exist in your project root. If it doesn't, you'll be prompted to create one first.
|
|
77
|
-
|
|
78
105
|
**Options:**
|
|
79
|
-
- `-t, --template <name>` — Template to use (`code-implementation`, `research
|
|
106
|
+
- `-t, --template <name>` — Template to use (`code-implementation`, `research`, or any custom template)
|
|
80
107
|
- `-n, --name <name>` — Custom name for the flow
|
|
81
108
|
|
|
82
109
|
### `npx ralphflow run <loop>`
|
|
83
110
|
|
|
84
|
-
Runs a loop. Handles the iteration cycle — spawning Claude, detecting completion signals, and restarting
|
|
111
|
+
Runs a loop. Handles the iteration cycle — spawning Claude, detecting completion signals, and restarting.
|
|
85
112
|
|
|
86
113
|
```bash
|
|
87
114
|
npx ralphflow run story # Run story loop (interactive Claude session)
|
|
88
115
|
npx ralphflow run tasks # Run tasks loop (single agent)
|
|
89
|
-
npx ralphflow run tasks --multi-agent # Run as a multi-agent instance
|
|
90
|
-
npx ralphflow run
|
|
91
|
-
npx ralphflow run
|
|
92
|
-
npx ralphflow run tasks --max-iterations 5 # Limit iterations
|
|
116
|
+
npx ralphflow run tasks --multi-agent # Run as a multi-agent instance
|
|
117
|
+
npx ralphflow run tasks --ui # Run with live dashboard alongside
|
|
118
|
+
npx ralphflow run tasks -m claude-opus-4-6 # Use a specific model
|
|
93
119
|
```
|
|
94
120
|
|
|
95
|
-
Each
|
|
96
|
-
|
|
97
|
-
**Multi-agent mode:** Instead of spawning N agents from one process, each terminal is one agent. Open multiple terminals, run `--multi-agent` in each, and they auto-assign sequential agent IDs (`agent-1`, `agent-2`, ...) via PID-based lock files. Stale agents are automatically cleaned up.
|
|
121
|
+
**Multi-agent mode:** Each terminal is one agent. Open multiple terminals, run `--multi-agent` in each, and they auto-assign sequential agent IDs (`agent-1`, `agent-2`, ...) via PID-based lock files.
|
|
98
122
|
|
|
99
123
|
**Options:**
|
|
100
|
-
- `--multi-agent` — Run as a multi-agent instance
|
|
124
|
+
- `--multi-agent` — Run as a multi-agent instance
|
|
101
125
|
- `--ui` — Start the web dashboard alongside execution
|
|
102
|
-
- `-m, --model <model>` — Claude model to use
|
|
126
|
+
- `-m, --model <model>` — Claude model to use (overrides per-loop config)
|
|
103
127
|
- `-n, --max-iterations <n>` — Maximum iterations (default: 30)
|
|
104
|
-
- `-f, --flow <name>` — Which flow to run
|
|
105
|
-
|
|
106
|
-
### `npx ralphflow dashboard`
|
|
107
|
-
|
|
108
|
-
Starts a real-time web dashboard at `http://localhost:4242`. Shows all apps, loop pipelines, tracker status, and lets you edit prompt files — all updated live via WebSocket as agents work.
|
|
109
|
-
|
|
110
|
-
```bash
|
|
111
|
-
npx ralphflow dashboard # Default port 4242
|
|
112
|
-
npx ralphflow dashboard -p 3000 # Custom port
|
|
113
|
-
npx ralphflow ui # Alias
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
**Features:**
|
|
117
|
-
- Live pipeline view with color-coded status (complete/running/pending)
|
|
118
|
-
- Per-loop detail: stage, active item, progress bar, agent table
|
|
119
|
-
- Prompt editor with Cmd+S save and dirty indicator
|
|
120
|
-
- Live tracker viewer (auto-updates as agents write)
|
|
121
|
-
- WebSocket auto-reconnect with exponential backoff
|
|
122
|
-
|
|
123
|
-
**Options:**
|
|
124
|
-
- `-p, --port <port>` — Port number (default: 4242)
|
|
128
|
+
- `-f, --flow <name>` — Which flow to run
|
|
125
129
|
|
|
126
130
|
### `npx ralphflow e2e`
|
|
127
131
|
|
|
@@ -130,23 +134,17 @@ Runs all loops end-to-end with SQLite orchestration. Skips loops already complet
|
|
|
130
134
|
```bash
|
|
131
135
|
npx ralphflow e2e # Run all loops
|
|
132
136
|
npx ralphflow e2e --ui # With live dashboard
|
|
133
|
-
npx ralphflow e2e --flow my-app # Specific flow
|
|
134
137
|
```
|
|
135
138
|
|
|
136
139
|
**Options:**
|
|
137
|
-
- `--ui` — Start the web dashboard alongside
|
|
140
|
+
- `--ui` — Start the web dashboard alongside
|
|
138
141
|
- `-m, --model <model>` — Claude model to use
|
|
139
142
|
- `-n, --max-iterations <n>` — Maximum iterations per loop (default: 30)
|
|
140
|
-
- `-f, --flow <name>` — Which flow to run
|
|
143
|
+
- `-f, --flow <name>` — Which flow to run
|
|
141
144
|
|
|
142
145
|
### `npx ralphflow status`
|
|
143
146
|
|
|
144
|
-
Shows the current state of all loops
|
|
145
|
-
|
|
146
|
-
```bash
|
|
147
|
-
npx ralphflow status # All flows
|
|
148
|
-
npx ralphflow status --flow my-app # Specific flow
|
|
149
|
-
```
|
|
147
|
+
Shows the current state of all loops.
|
|
150
148
|
|
|
151
149
|
```
|
|
152
150
|
RalphFlow — my-app
|
|
@@ -157,32 +155,40 @@ npx ralphflow status --flow my-app # Specific flow
|
|
|
157
155
|
Delivery Loop idle none 0/0
|
|
158
156
|
```
|
|
159
157
|
|
|
160
|
-
|
|
161
|
-
- `-f, --flow <name>` — Show status for a specific flow
|
|
162
|
-
|
|
163
|
-
## Multiple Flows
|
|
164
|
-
|
|
165
|
-
You can run multiple flows in the same project — useful for separate workstreams:
|
|
158
|
+
## Per-Loop Model Configuration
|
|
166
159
|
|
|
167
|
-
|
|
168
|
-
npx ralphflow init --template code-implementation --name frontend
|
|
169
|
-
npx ralphflow init --template code-implementation --name backend
|
|
170
|
-
npx ralphflow init --template research --name market-research
|
|
160
|
+
Each loop in `ralphflow.yaml` supports an optional `model` field:
|
|
171
161
|
|
|
172
|
-
|
|
162
|
+
```yaml
|
|
163
|
+
loops:
|
|
164
|
+
story-loop:
|
|
165
|
+
model: claude-sonnet-4-6
|
|
166
|
+
tasks-loop:
|
|
167
|
+
model: claude-opus-4-6
|
|
173
168
|
```
|
|
174
169
|
|
|
175
|
-
|
|
170
|
+
**Resolution order:** CLI `--model` flag → per-loop `model` from config → Claude default. The dashboard includes a model selector dropdown to configure this per loop.
|
|
176
171
|
|
|
177
172
|
## Templates
|
|
178
173
|
|
|
179
|
-
###
|
|
174
|
+
### Built-in
|
|
175
|
+
|
|
176
|
+
- **`code-implementation`** — Story → Tasks → Delivery pipeline for code projects
|
|
177
|
+
- **`research`** — Discovery → Research → Story → Document pipeline for research projects
|
|
180
178
|
|
|
181
|
-
|
|
179
|
+
### Custom Templates
|
|
182
180
|
|
|
183
|
-
|
|
181
|
+
Create custom templates via the dashboard's Template Creator or the API. Custom templates are stored in `.ralph-flow/.templates/` and appear alongside built-in templates when creating new apps.
|
|
182
|
+
|
|
183
|
+
## Multiple Flows
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
Run multiple flows in the same project for separate workstreams:
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
npx ralphflow init --template code-implementation --name frontend
|
|
189
|
+
npx ralphflow init --template code-implementation --name backend
|
|
190
|
+
npx ralphflow init --template research --name market-research
|
|
191
|
+
```
|
|
186
192
|
|
|
187
193
|
## Project Structure
|
|
188
194
|
|
|
@@ -197,19 +203,14 @@ your-project/
|
|
|
197
203
|
├── 00-story-loop/
|
|
198
204
|
│ ├── prompt.md # Agent instructions
|
|
199
205
|
│ ├── tracker.md # State tracking
|
|
200
|
-
│
|
|
201
|
-
│ └── loop.md # Manual run instructions
|
|
206
|
+
│ └── stories.md # Story definitions
|
|
202
207
|
├── 01-tasks-loop/
|
|
203
208
|
│ ├── prompt.md
|
|
204
209
|
│ ├── tracker.md
|
|
205
|
-
│
|
|
206
|
-
│ ├── loop.md
|
|
207
|
-
│ ├── phases/ # Phase documentation
|
|
208
|
-
│ └── testing/ # Test documentation
|
|
210
|
+
│ └── tasks.md
|
|
209
211
|
└── 02-delivery-loop/
|
|
210
212
|
├── prompt.md
|
|
211
|
-
|
|
212
|
-
└── loop.md
|
|
213
|
+
└── tracker.md
|
|
213
214
|
```
|
|
214
215
|
|
|
215
216
|
## CLAUDE.md
|
|
@@ -217,11 +218,10 @@ your-project/
|
|
|
217
218
|
`CLAUDE.md` is a first-class citizen of the workflow:
|
|
218
219
|
|
|
219
220
|
- **Story loop** reads it for project context
|
|
220
|
-
- **Tasks loop** reads it for architecture, stack, conventions, commands
|
|
221
|
-
- **Tasks loop updates it** after each task (keeping changes under 150 words net)
|
|
221
|
+
- **Tasks loop** reads it for architecture, stack, conventions, and commands — and updates it after each task
|
|
222
222
|
- **Delivery loop** reads it for project context and patterns
|
|
223
223
|
|
|
224
|
-
RalphFlow requires `CLAUDE.md` to exist before initializing a flow.
|
|
224
|
+
RalphFlow requires `CLAUDE.md` to exist before initializing a flow.
|
|
225
225
|
|
|
226
226
|
## Install
|
|
227
227
|
|
|
@@ -231,14 +231,6 @@ No install required — use `npx ralphflow` directly. Or install globally:
|
|
|
231
231
|
npm install -g ralphflow
|
|
232
232
|
```
|
|
233
233
|
|
|
234
|
-
Then use without the `npx` prefix:
|
|
235
|
-
|
|
236
|
-
```bash
|
|
237
|
-
ralphflow init --template code-implementation --name my-app
|
|
238
|
-
ralphflow run story
|
|
239
|
-
ralphflow status
|
|
240
|
-
```
|
|
241
|
-
|
|
242
234
|
## Requirements
|
|
243
235
|
|
|
244
236
|
- Node.js >= 18
|