ralphflow 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rahul Thakur
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,205 @@
1
+ # RalphFlow
2
+
3
+ Multi-agent AI workflow orchestration for [Claude Code](https://docs.anthropic.com/en/docs/claude-code).
4
+
5
+ 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.
6
+
7
+ ## Quick Start
8
+
9
+ ```bash
10
+ # 1. Make sure you have a CLAUDE.md in your project
11
+ # (or let Claude create one: claude "Initialize CLAUDE.md for this project")
12
+
13
+ # 2. Initialize a flow
14
+ npx ralphflow init --template code-implementation --name my-app
15
+
16
+ # 3. Run the story loop — describe what you want to build
17
+ npx ralphflow run story
18
+
19
+ # 4. Run the tasks loop — agents implement your stories
20
+ npx ralphflow run tasks
21
+
22
+ # 5. Run with multiple agents for parallel execution
23
+ npx ralphflow run tasks --agents 3
24
+
25
+ # 6. Deliver — review, get feedback, resolve
26
+ npx ralphflow run delivery
27
+
28
+ # 7. Check progress anytime
29
+ npx ralphflow status
30
+ ```
31
+
32
+ ## How It Works
33
+
34
+ RalphFlow organizes work into **loops** — repeating cycles where Claude agents read a prompt, check a tracker, do work, update the tracker, and exit. The framework handles iteration, signal detection, and multi-agent coordination.
35
+
36
+ The default `code-implementation` template ships with three loops:
37
+
38
+ | Loop | Purpose | Mode |
39
+ |------|---------|------|
40
+ | **Story Loop** | Break features into stories and tasks | Interactive — Claude asks you questions |
41
+ | **Tasks Loop** | Implement tasks, commit code, update CLAUDE.md | Single or multi-agent (autonomous) |
42
+ | **Delivery Loop** | Review completed work, gather feedback | Interactive — Claude presents deliverables |
43
+
44
+ ### Pipeline Flow
45
+
46
+ ```
47
+ Story Loop Tasks Loop Delivery Loop
48
+ ┌──────────┐ ┌──────────────┐ ┌──────────────┐
49
+ │ Describe │──────▶│ Implement │───────▶│ Review │
50
+ │ features │ │ tasks │ │ & feedback │
51
+ └──────────┘ └──────────────┘ └──────────────┘
52
+ ▲ ▲ ▲
53
+ │ │ │
54
+ agent-1 agent-2 agent-3
55
+ ```
56
+
57
+ ## Commands
58
+
59
+ All commands are run via `npx ralphflow` — no global install needed.
60
+
61
+ ### `npx ralphflow init`
62
+
63
+ Scaffolds a new flow in `.ralph-flow/<name>/`.
64
+
65
+ ```bash
66
+ npx ralphflow init # Interactive — pick template and name
67
+ npx ralphflow init --template code-implementation --name api # Non-interactive
68
+ npx ralphflow init --template research --name kashi # Research pipeline
69
+ ```
70
+
71
+ Requires `CLAUDE.md` to exist in your project root. If it doesn't, you'll be prompted to create one first.
72
+
73
+ **Options:**
74
+ - `-t, --template <name>` — Template to use (`code-implementation`, `research`)
75
+ - `-n, --name <name>` — Custom name for the flow
76
+
77
+ ### `npx ralphflow run <loop>`
78
+
79
+ Runs a loop. Handles the iteration cycle — spawning Claude, detecting completion signals, and restarting on `kill -INT $PPID`.
80
+
81
+ ```bash
82
+ npx ralphflow run story # Run story loop
83
+ npx ralphflow run tasks # Run tasks loop (single agent)
84
+ npx ralphflow run tasks --agents 3 # Run with 3 parallel agents
85
+ npx ralphflow run delivery # Run delivery loop
86
+ npx ralphflow run story --flow my-app # Specify which flow (when multiple exist)
87
+ npx ralphflow run tasks --max-iterations 5 # Limit iterations
88
+ ```
89
+
90
+ **Options:**
91
+ - `-a, --agents <n>` — Number of parallel agents (default: 1)
92
+ - `-m, --model <model>` — Claude model to use
93
+ - `-n, --max-iterations <n>` — Maximum iterations (default: 30)
94
+ - `-f, --flow <name>` — Which flow to run (auto-detected if only one exists)
95
+
96
+ ### `npx ralphflow status`
97
+
98
+ Shows the current state of all loops across all flows.
99
+
100
+ ```bash
101
+ npx ralphflow status # All flows
102
+ npx ralphflow status --flow my-app # Specific flow
103
+ ```
104
+
105
+ ```
106
+ RalphFlow — my-app
107
+
108
+ Loop Stage Active Progress
109
+ Story Loop analyze none 0/0
110
+ Tasks Loop — none 3/6
111
+ agent-1 understand-execute TASK-4 2026-03-08T10:00
112
+ agent-2 verify-document TASK-5 2026-03-08T10:01
113
+ Delivery Loop idle none 0/0
114
+ ```
115
+
116
+ **Options:**
117
+ - `-f, --flow <name>` — Show status for a specific flow
118
+
119
+ ## Multiple Flows
120
+
121
+ You can run multiple flows in the same project — useful for separate workstreams:
122
+
123
+ ```bash
124
+ npx ralphflow init --template code-implementation --name frontend
125
+ npx ralphflow init --template code-implementation --name backend
126
+ npx ralphflow init --template research --name market-research
127
+
128
+ npx ralphflow status # Shows all three
129
+ ```
130
+
131
+ When multiple flows exist, use `--flow <name>` with `run` and `status`.
132
+
133
+ ## Templates
134
+
135
+ ### `code-implementation`
136
+
137
+ Story → Tasks → Delivery pipeline for code projects. Battle-tested across 28 stories and 84 tasks.
138
+
139
+ ### `research`
140
+
141
+ Multi-loop research pipeline with discovery, research, story, evolution, issue, datapoints, and merge loops. Tested across 467 places and 94 roads in a Kashi/Varanasi research project.
142
+
143
+ ## Project Structure
144
+
145
+ After `npx ralphflow init --template code-implementation --name my-app`:
146
+
147
+ ```
148
+ your-project/
149
+ ├── CLAUDE.md # Project context (read + updated by agents)
150
+ └── .ralph-flow/
151
+ └── my-app/
152
+ ├── ralphflow.yaml # Pipeline config
153
+ ├── 00-story-loop/
154
+ │ ├── prompt.md # Agent instructions
155
+ │ ├── tracker.md # State tracking
156
+ │ ├── stories.md # Story definitions
157
+ │ └── loop.md # Manual run instructions
158
+ ├── 01-tasks-loop/
159
+ │ ├── prompt.md
160
+ │ ├── tracker.md
161
+ │ ├── tasks.md
162
+ │ ├── loop.md
163
+ │ ├── phases/ # Phase documentation
164
+ │ └── testing/ # Test documentation
165
+ └── 02-delivery-loop/
166
+ ├── prompt.md
167
+ ├── tracker.md
168
+ └── loop.md
169
+ ```
170
+
171
+ ## CLAUDE.md
172
+
173
+ `CLAUDE.md` is a first-class citizen of the workflow:
174
+
175
+ - **Story loop** reads it for project context
176
+ - **Tasks loop** reads it for architecture, stack, conventions, commands, and URLs
177
+ - **Tasks loop updates it** after each task (keeping changes under 150 words net)
178
+ - **Delivery loop** reads it for project context and patterns
179
+
180
+ RalphFlow requires `CLAUDE.md` to exist before initializing a flow. Create one with your project description, tech stack, dev commands, and conventions — or let Claude generate it for you.
181
+
182
+ ## Install
183
+
184
+ No install required — use `npx ralphflow` directly. Or install globally:
185
+
186
+ ```bash
187
+ npm install -g ralphflow
188
+ ```
189
+
190
+ Then use without the `npx` prefix:
191
+
192
+ ```bash
193
+ ralphflow init --template code-implementation --name my-app
194
+ ralphflow run story
195
+ ralphflow status
196
+ ```
197
+
198
+ ## Requirements
199
+
200
+ - Node.js >= 18
201
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) installed and authenticated
202
+
203
+ ## License
204
+
205
+ [MIT](LICENSE)