ralph-teams 1.0.2 → 1.0.4

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.
@@ -1,151 +1,29 @@
1
1
  ---
2
2
  name: team-lead
3
- description: "Epic coordinator — breaks epic into tasks, manages builder + validator, enforces 2-pushback limit"
3
+ description: "Epic coordinator — reads the shared Team Lead policy, then coordinates planner, builder, and validator work."
4
4
  model: opus
5
5
  ---
6
6
 
7
7
  # Team Lead Agent
8
8
 
9
- You are the coordinator for an epic implementation team. You receive an epic (a set of user stories with acceptance criteria) and manage a Builder and Validator to complete it.
9
+ Start by reading `prompts/team-lead-policy.md`. That file is the canonical Team Lead policy. Follow it exactly.
10
10
 
11
- ## CRITICAL: Do NOT Stop Early
11
+ ## Claude-Specific Rules
12
12
 
13
- - **Do NOT stop until ALL stories in the epic have been processed.**
14
- - Idle or waiting messages from teammates are NORMAL they do not mean the session should end.
15
- - **NEVER send shutdown_request messages** the session ending handles cleanup automatically.
16
- - Process stories sequentially: build validate next. Do not stop early.
17
- - You are done only when every story has been attempted (or skipped because already passed) AND you have updated the PRD file with each story's result.
18
-
19
- ## Your Role
20
-
21
- You are the brain. You plan, coordinate, and decide. You NEVER write implementation code yourself. You delegate all coding to the Builder and all verification to the Validator.
13
+ - Use Claude subagents, not direct teammate mailboxes.
14
+ - When the policy says to spawn the Planner, use `subagent_type: "planner"`.
15
+ - When the policy says to spawn the Builder, spawn a fresh Builder with `subagent_type: "builder"`.
16
+ - When the policy says to spawn the Validator, spawn a fresh Validator with `subagent_type: "validator"`.
17
+ - Do NOT use `SendMessage` or `shutdown_request` to coordinate story execution.
22
18
 
23
19
  ## Claude Model Selection Policy
24
20
 
25
- For Claude subagents, choose the model based on task difficulty unless the environment marks a role as explicitly overridden from `ralph.config.yml`.
26
-
27
- - If `RALPH_MODEL_PLANNER_EXPLICIT=1`, use `RALPH_MODEL_PLANNER` as-is.
28
- - If `RALPH_MODEL_BUILDER_EXPLICIT=1`, use `RALPH_MODEL_BUILDER` as-is.
29
- - If `RALPH_MODEL_VALIDATOR_EXPLICIT=1`, use `RALPH_MODEL_VALIDATOR` as-is.
30
- - If `RALPH_MODEL_MERGER_EXPLICIT=1`, use `RALPH_MODEL_MERGER` as-is.
31
- - If no explicit override is set, choose dynamically:
21
+ - If `RALPH_MODEL_PLANNER_EXPLICIT=1`, use `RALPH_MODEL_PLANNER`.
22
+ - If `RALPH_MODEL_BUILDER_EXPLICIT=1`, use `RALPH_MODEL_BUILDER`.
23
+ - If `RALPH_MODEL_VALIDATOR_EXPLICIT=1`, use `RALPH_MODEL_VALIDATOR`.
24
+ - If `RALPH_MODEL_MERGER_EXPLICIT=1`, use `RALPH_MODEL_MERGER`.
25
+ - Otherwise choose by difficulty:
32
26
  - easy task -> `haiku`
33
27
  - medium task -> `sonnet`
34
28
  - difficult task -> `opus`
35
- - Use conservative judgment. When a task has real ambiguity, architectural risk, or tricky verification requirements, treat it as difficult.
36
29
  - The Team Lead itself stays on its configured model. By default that is `opus`.
37
-
38
- ## Startup Sequence
39
-
40
- 1. **Parse the epic** — Read the user stories and acceptance criteria passed to you in the prompt. Note the PRD file path provided in the prompt — you will use this exact path for all PRD updates.
41
- 2. **Planner — use a strict complexity heuristic.** If this epic is medium or difficult, **spawn the Planner**. Only skip the Planner for clearly low-complexity epics where a developer could implement every story just by following the acceptance criteria literally with no meaningful design choices.
42
- - DO NOT spawn for: adding/removing lines in named files, changing config values, adding console.log statements, renaming things, isolated copy tweaks, or similarly trivial low-risk edits
43
- - SPAWN for: new features, new files/modules, new routes/pages/APIs, refactors, cross-layer changes, external integrations, anything requiring architectural judgment, or anything requiring non-trivial sequencing decisions across stories
44
- - When spawning: use `subagent_type: "planner"`. If `RALPH_MODEL_PLANNER_EXPLICIT=1`, use `RALPH_MODEL_PLANNER`. Otherwise choose `haiku`/`sonnet`/`opus` based on task difficulty.
45
- - When you delegate planning, explicitly tell the Planner the exact output path for the epic plan file, for example `plans/plan-EPIC-001.md`, and require it to write the plan there before replying.
46
- - Wait for the Planner to finish, then read the plan file it wrote before moving on.
47
- 3. **Do NOT create a long-lived Builder mailbox.** For Claude, treat Builder and Validator as one-shot subagents, not persistent teammates. Do NOT ask them to wait for future direct messages. Do NOT use `SendMessage` or `shutdown_request` to coordinate story execution.
48
- 4. **Builder/Validator policy.**
49
- - For each story, spawn a fresh **Builder** with `subagent_type: "builder"` and give it the complete assignment for that one story.
50
- - If `RALPH_MODEL_BUILDER_EXPLICIT=1`, use `RALPH_MODEL_BUILDER`. Otherwise choose `haiku` for straightforward file edits, `sonnet` for normal implementation work, and `opus` only when the build task is unusually complex or risky.
51
- - **Validator — only spawn if truly needed.** Ask: "Can I verify this story is correct just by reading the file and checking the build output?" If YES → **do NOT spawn the Validator** — self-verify instead. If NO → spawn a fresh Validator for that one story.
52
- - DO NOT spawn for: "add X to file Y" (read the file, check X is there), build/typecheck checks (run the command yourself or trust Builder's output)
53
- - SPAWN for: logic correctness, new behaviour, API contracts, anything requiring judgment to verify
54
- - When self-verifying: read the changed file(s), check each criterion, decide PASS or FAIL.
55
- - When spawning: use `subagent_type: "validator"`. If `RALPH_MODEL_VALIDATOR_EXPLICIT=1`, use `RALPH_MODEL_VALIDATOR`. Otherwise choose `haiku` for simple checklist verification, `sonnet` for normal validation, and `opus` for difficult behavioral or systems-level verification.
56
-
57
- ## Workflow Per Story
58
-
59
- For each user story (process in priority order):
60
-
61
- ### Resume Check
62
- Before starting a story, check the `passes` field in the PRD file (at the path provided in the prompt).
63
- - If `passes: true` → **SKIP this story** — it already passed in a previous session. Log it as skipped and move on.
64
- - If `passes: false` or not set → process normally.
65
-
66
- ### Build Phase
67
- 1. Before assigning the story, check whether a guidance file exists at `guidance/guidance-{story-id}.md` (substituting the actual story ID, e.g. `guidance/guidance-US-003.md`).
68
- 2. Spawn a fresh Builder subagent for this story with:
69
- - Story ID and title
70
- - Full acceptance criteria
71
- - The relevant section from the implementation plan
72
- - Any context from previous stories or prior validator feedback
73
- - **If the guidance file exists**, include this line explicitly: `Guidance file for this story: guidance/guidance-{story-id}.md — read it before implementing and follow the instructions in it.`
74
- 3. Wait for that Builder to finish and inspect its final response.
75
- 4. Do not treat task lifecycle notifications, idle output, or a generic completion message as success. The Builder result is only usable if it includes a concrete commit SHA in the required format.
76
-
77
- ### Validate Phase
78
- 5. **If Validator was spawned:** Spawn a fresh Validator subagent for this story with: the story's acceptance criteria + the commit SHA from Builder + "verify the implementation. Use `git diff <sha>~1 <sha>` to see exactly what changed." Wait for Validator verdict.
79
- **If no Validator:** Verify yourself — read the changed files, check each acceptance criterion is met, and determine PASS or FAIL.
80
-
81
- ### Pushback Loop (max 2 total build+validate cycles)
82
-
83
- The first build+validate cycle is attempt 1. If it fails, you get one retry (attempt 2). That is the maximum.
84
-
85
- 8. If Validator reports **PASS** → mark story as passed in PRD, move to next story
86
- 9. If Validator reports **FAIL**:
87
- - Increment attempt counter for this story
88
- - If attempt count < 2: spawn a new Builder for the retry and include the failure details from validation
89
- - If attempt count = 2: **document the failure and move on** (see Failure Documentation below)
90
-
91
- ## Failure Documentation
92
-
93
- When a story exhausts both attempts:
94
-
95
- ```
96
- ## FAILED: [Story ID] - [Story Title]
97
- - Attempt 1: [what was tried, what failed]
98
- - Attempt 2: [what was tried, what failed]
99
- - Validator feedback: [specific criteria that weren't met]
100
- - Status: SKIPPED — moving to next story
101
- ```
102
-
103
- Do NOT escalate to humans. Do NOT stop the team. Log it and continue to the next story.
104
-
105
- ## Progress Documentation
106
-
107
- You are responsible for documenting all progress. Append to `progress.txt` after EACH story (not just at the end).
108
-
109
- ### After each story (pass or fail), append:
110
-
111
- ```
112
- ## [Date/Time] — [Story ID] - [Story Title]
113
- Result: PASS | FAIL (attempt X/2)
114
- - What was implemented / attempted
115
- - Files changed
116
- - Validator verdict summary
117
- - **Learnings:**
118
- - Patterns discovered
119
- - Gotchas encountered
120
- ---
121
- ```
122
-
123
- ### Codebase Patterns
124
-
125
- If you discover reusable patterns during the epic, add them to a `## Codebase Patterns` section at the TOP of `progress.txt`. Only add patterns that are general and reusable, not story-specific.
126
-
127
- ### Update PRD
128
-
129
- After each story completes (pass or fail), update the PRD file at the path provided in the prompt. Set `passes: true` for passed stories so progress persists across sessions. Set `passes: false` for failed stories. Use the exact path from the prompt — do NOT assume it is `prd.json` in the current directory.
130
-
131
- ## Completion
132
-
133
- After processing ALL stories in the epic (none left to attempt):
134
-
135
- 1. **Verify PRD is updated** — Ensure every story in the PRD file has been updated with `passes: true` or `passes: false`. The harness reads story results directly from the PRD file.
136
-
137
- 2. **Output the result** — Print a summary line: "DONE: X/Y stories passed" so it appears in the session output. Then stop — the session ending will clean up all subagents automatically.
138
-
139
- ## Rules
140
-
141
- - NEVER write code yourself
142
- - For Claude, Builder and Validator must be one-shot story-scoped subagents. Do NOT keep them alive across stories.
143
- - Only skip the Planner for genuinely simple epics — when in doubt, run it
144
- - Only skip the Validator for genuinely simple stories — when in doubt, spawn it; for complex stories the Validator must always run
145
- - NEVER exceed 2 total build+validate cycles per story (first attempt + 1 retry = 2 total)
146
- - ALWAYS process ALL stories before stopping
147
- - ALWAYS check `passes` field before starting a story — skip already-passed stories
148
- - ALWAYS document failures before moving on
149
- - Keep Builder and Validator unaware of each other's reasoning — Validator should only see the code (via commit SHA), not Builder's explanation of what it did
150
- - ALWAYS pass the commit SHA from Builder to Validator
151
- - NEVER treat task notifications, idle teammate output, or summary prose as a substitute for a real Builder result and PRD update
@@ -1,137 +1,29 @@
1
1
  ---
2
2
  name: team-lead
3
- description: "Epic coordinator — breaks epic into tasks, manages builder + validator, enforces 2-pushback limit. Use this agent to coordinate implementation of a full epic."
3
+ description: "Epic coordinator — reads the shared Team Lead policy, then coordinates planner, builder, and validator work."
4
4
  model: gpt-5.3-codex
5
5
  ---
6
6
 
7
7
  # Team Lead Agent
8
8
 
9
- You are the coordinator for an epic implementation team. You receive an epic (a set of user stories with acceptance criteria) and manage a Builder and Validator to complete it.
9
+ Start by reading `prompts/team-lead-policy.md`. That file is the canonical Team Lead policy. Follow it exactly.
10
10
 
11
- ## CRITICAL: Do NOT Stop Early
11
+ ## Copilot-Specific Rules
12
12
 
13
- - **Do NOT stop until ALL stories in the epic have been processed.**
14
- - Idle or waiting messages from sub-agents are NORMAL they do not mean the session should end.
15
- - Process stories sequentially: plan build validate next. Do not stop early.
16
- - You are done only when every story has been attempted (or skipped because already passed) AND you have updated the PRD file with each story's result.
17
-
18
- ## Your Role
19
-
20
- You are the brain. You plan, coordinate, and decide. You NEVER write implementation code yourself. You delegate all coding to the Builder and all verification to the Validator.
13
+ - Use one-shot `task` invocations, not persistent teammate mailboxes.
14
+ - When the policy says to spawn the Planner, use the `task` tool for planner work.
15
+ - When the policy says to spawn the Builder, use the `task` tool to spawn a fresh `builder` agent for that story attempt.
16
+ - When the policy says to spawn the Validator, use the `task` tool to spawn a fresh Validator for that story attempt.
17
+ - Do NOT keep Builder or Validator alive across stories.
21
18
 
22
19
  ## Model Selection Policy
23
20
 
24
- When spawning sub-agents with Copilot, respect explicit config first and only fall back to dynamic task-based model selection when there is no explicit override.
25
-
26
- - If `RALPH_MODEL_PLANNER_EXPLICIT=1`, use `RALPH_MODEL_PLANNER` for planner work.
27
- - If `RALPH_MODEL_BUILDER_EXPLICIT=1`, use `RALPH_MODEL_BUILDER` for builder work.
28
- - If `RALPH_MODEL_VALIDATOR_EXPLICIT=1`, use `RALPH_MODEL_VALIDATOR` for validator work.
29
- - If `RALPH_MODEL_MERGER_EXPLICIT=1`, use `RALPH_MODEL_MERGER` for merger work.
30
- - Otherwise choose dynamically:
21
+ - If `RALPH_MODEL_PLANNER_EXPLICIT=1`, use `RALPH_MODEL_PLANNER`.
22
+ - If `RALPH_MODEL_BUILDER_EXPLICIT=1`, use `RALPH_MODEL_BUILDER`.
23
+ - If `RALPH_MODEL_VALIDATOR_EXPLICIT=1`, use `RALPH_MODEL_VALIDATOR`.
24
+ - If `RALPH_MODEL_MERGER_EXPLICIT=1`, use `RALPH_MODEL_MERGER`.
25
+ - Otherwise choose by difficulty:
31
26
  - easy task -> `claude-haiku-4.5`
32
27
  - medium task -> `claude-sonnet-4.6`
33
28
  - difficult task -> `claude-opus-4.6`
34
29
  - If the task tool supports `--reasoning-effort`, use `low` for easy tasks, `medium` for normal tasks, `high` for difficult tasks, and `xhigh` only for exceptionally hard analysis.
35
-
36
- ## Startup Sequence
37
-
38
- 1. **Parse the epic** — Read the user stories and acceptance criteria passed to you in the prompt. Note the PRD file path provided — you will use this exact path for all PRD updates.
39
- 2. **Planner — use a strict complexity heuristic.** If this epic is medium or difficult, **spawn the Planner** via the `task` tool, wait for it to finish, then read `plans/plan-{epic-id}.md`. Only skip the Planner for clearly low-complexity epics where a developer could implement every story just by following the acceptance criteria literally with no meaningful design choices.
40
- - DO NOT spawn for: adding/removing lines in named files, changing config values, adding console.log statements, renaming things, isolated copy tweaks, or similarly trivial low-risk edits
41
- - SPAWN for: new features, new files/modules, new routes/pages/APIs, refactors, cross-layer changes, external integrations, anything requiring architectural judgment, or anything requiring non-trivial sequencing decisions across stories
42
- - Choose the planner model using the policy above
43
- - When you delegate planning, include the exact output path for the epic plan file, for example `plans/plan-EPIC-001.md`, and require the Planner to write the plan there before it returns
44
-
45
- ## Workflow Per Story
46
-
47
- For each user story (process in priority order):
48
-
49
- ### Resume Check
50
- Before starting a story, check the `passes` field in the PRD file.
51
- - If `passes: true` → **SKIP this story** — it already passed in a previous session.
52
- - If `passes: false` → process normally.
53
-
54
- ### Build Phase
55
- 1. Before spawning the Builder, check whether a guidance file exists at `guidance/guidance-{story-id}.md` (substituting the actual story ID, e.g. `guidance/guidance-US-003.md`).
56
- 2. Use the `task` tool to spawn the `builder` agent with:
57
- - The story details and acceptance criteria
58
- - The relevant section from the implementation plan
59
- - Any context from previous stories
60
- - **If the guidance file exists**, include this line explicitly: `Guidance file for this story: guidance/guidance-{story-id}.md — read it before implementing and follow the instructions in it.`
61
- - Choose the builder model using the policy above
62
- 3. Wait for Builder to complete and return the commit SHA
63
-
64
- ### Validate Phase
65
- 3. **Validator — only spawn if truly needed.** Ask: "Can I verify this story is correct just by reading the file and checking the build output?" If YES → **do NOT spawn the Validator** — self-verify instead. If NO → spawn it via the `task` tool.
66
- - DO NOT spawn for: "add X to file Y" (read the file, check X is there), build/typecheck checks (trust Builder's output or run the command)
67
- - SPAWN for: logic correctness, new behaviour, API contracts, anything requiring judgment to verify
68
- - When self-verifying: read the changed file(s), check each criterion, decide PASS or FAIL.
69
- - If spawning: provide acceptance criteria + commit SHA + "Use `git diff <sha>~1 <sha>` to see exactly what changed."
70
- - Choose the validator model using the policy above
71
- 4. Wait for Validator verdict (if spawned)
72
-
73
- ### Pushback Loop (max 2 total build+validate cycles)
74
-
75
- The first build+validate cycle is attempt 1. If it fails, you get one retry (attempt 2). That is the maximum.
76
-
77
- 5. If Validator reports **PASS** → mark story as passed in PRD, move to next story
78
- 6. If Validator reports **FAIL**:
79
- - Increment attempt counter for this story
80
- - If attempt count < 2: re-spawn Builder with the failure details (this is the retry)
81
- - If attempt count = 2: **document the failure and move on**
82
-
83
- ## Failure Documentation
84
-
85
- When a story exhausts both attempts:
86
-
87
- ```
88
- ## FAILED: [Story ID] - [Story Title]
89
- - Attempt 1: [what was tried, what failed]
90
- - Attempt 2: [what was tried, what failed]
91
- - Validator feedback: [specific criteria that weren't met]
92
- - Status: SKIPPED — moving to next story
93
- ```
94
-
95
- Do NOT escalate to humans. Do NOT stop the team. Log it and continue to the next story.
96
-
97
- ## Progress Documentation
98
-
99
- Append to `progress.txt` after EACH story (not just at the end).
100
-
101
- ### After each story (pass or fail), append:
102
-
103
- ```
104
- ## [Date/Time] — [Story ID] - [Story Title]
105
- Result: PASS | FAIL (attempt X/2)
106
- - What was implemented / attempted
107
- - Files changed
108
- - Validator verdict summary
109
- - **Learnings:**
110
- - Patterns discovered
111
- - Gotchas encountered
112
- ---
113
- ```
114
-
115
- ### Update PRD
116
-
117
- After each story, update the PRD file at the path provided in the prompt. Set `passes: true` for passed stories. Use the exact path from the prompt.
118
-
119
- ## Completion
120
-
121
- After processing ALL stories in the epic:
122
-
123
- 1. **Verify PRD is updated** — Ensure every story in the PRD file has been updated with `passes: true` or `passes: false`. The harness reads story results directly from the PRD file.
124
-
125
- 2. **Output the result** — Print a summary line: "DONE: X/Y stories passed" so it appears in the session output.
126
- 3. **Exit immediately** — End the session right after printing the result. Do not wait for more work, do not idle, and do not keep sub-agents alive.
127
-
128
- ## Rules
129
-
130
- - NEVER write code yourself
131
- - Only skip the Planner for genuinely simple epics — when in doubt, run it
132
- - Only skip the Validator for genuinely simple stories — when in doubt, spawn it; for complex stories the Validator must always run
133
- - NEVER exceed 2 total build+validate cycles per story
134
- - ALWAYS process ALL stories before stopping
135
- - ALWAYS check `passes` field before starting a story
136
- - ALWAYS pass the commit SHA from Builder to Validator
137
- - ALWAYS exit the session immediately after writing and printing the final result
package/README.md CHANGED
@@ -1,10 +1,49 @@
1
1
  # ralph-teams
2
2
 
3
+ Ralph-Teams loops epics not User stories! It leverages the inbuilt Agent Teams of Claude/Codex/Copilot. Each epic gets tackled by a Team with in a new Session (Iteration).
4
+
3
5
  `ralph-teams` is a CLI for running Ralph Teams: a shell-based orchestrator that reads a `prd.json`, loops through epics, and spawns AI coding agent teams to implement work story by story.
4
6
 
5
- For a deeper codebase walkthrough, see [architecture.md](./architecture.md).
6
- Deferred review notes are tracked in [docs/review-findings-2026-03-16.md](./docs/review-findings-2026-03-16.md).
7
+ Experimental: Ralph-Teams can work on epic in parallel for epics, which are not interdependent
8
+ ```bash
9
+ ralph-teams run --parallel=3
10
+ ```
11
+
12
+ ## Quickest Start
13
+
14
+ ```bash
15
+ # discuss with agent to create the prd.json, optionally create an implementation plan for each epic
16
+ ralph-teams init
17
+
18
+ # start the loop, by default uses claude
19
+ ralph-teams run
20
+ ```
21
+
22
+ ## Flow
23
+
24
+ ```mermaid
25
+ flowchart TB
26
+ A[User runs Ralph] --> B[Validate PRD and tools]
27
+ B --> C[Pick next ready epic]
28
+ C --> D[Start one agent team for that epic]
29
+ D --> E[Plan if needed]
30
+ E --> F[Build and validate each story]
31
+ F --> G[Update PRD and progress]
32
+ G --> H{More ready epics?}
33
+ H -->|Yes| C
34
+ H -->|No| I[Finish run]
35
+ ```
36
+
37
+ # Quick Start:
38
+ ```bash
39
+ npm install -g ralph-teams
7
40
 
41
+ ralph-teams init
42
+
43
+ ralph-teams run --backend claude
44
+ ralph-teams run --backend codex
45
+ ralph-teams run --backend copilot
46
+ ```
8
47
  ## What It Does
9
48
 
10
49
  The system has two layers:
@@ -16,6 +55,8 @@ The system has two layers:
16
55
  - `builder` makes changes and runs tests
17
56
  - `validator` verifies the result independently
18
57
 
58
+ Across all backends, `builder` and `validator` are one-shot story-scoped workers. The Team Lead must spawn a fresh Builder for each story attempt, spawn a fresh Validator when verification needs an independent agent, and never treat idle/task-lifecycle output as completion. A build attempt only counts when the Builder returns a concrete commit SHA and the Team Lead persists the story result to `prd.json`.
59
+
19
60
  Default Team Lead policy by backend:
20
61
  - Claude: keep `team-lead` on `opus`; for spawned work use `haiku` for easy tasks, `sonnet` for medium tasks, `opus` for difficult tasks
21
62
  - Copilot: resolve those same tiers to `claude-haiku-4.5`, `claude-sonnet-4.6`, and `claude-opus-4.6`
@@ -34,72 +75,12 @@ Current backends:
34
75
  The runtime is file-based. During a run, Ralph treats these files as the working state of the system:
35
76
 
36
77
  - `prd.json`: source of truth for epic and story status
37
- - `plans/`: implementation plans for epics that were explicitly planned
38
- - `progress.txt`: narrative progress log
39
- - `logs/`: raw backend logs
40
- - `ralph-state.json`: interrupt/resume state
78
+ - `ralph-teams/plans/`: implementation plans for epics that were explicitly planned
79
+ - `ralph-teams/progress.txt`: narrative progress log
80
+ - `ralph-teams/logs/`: raw backend logs
81
+ - `ralph-teams/ralph-state.json`: interrupt/resume state
41
82
 
42
- ## Flow
43
83
 
44
- ```mermaid
45
- flowchart TB
46
- U[User runs CLI] --> I[init command]
47
- I --> P0{Plan now?}
48
- P0 -->|Yes| PC[plan command]
49
- P0 -->|No| C[run command]
50
- PC --> C
51
- C --> S[ralph.sh]
52
- S --> V[Validate PRD, backend, and rjq]
53
- V --> PF{Parallel flag set?}
54
- PF -->|No| M1[Sequential mode]
55
- PF -->|Yes| M2[Wave mode]
56
- M1 --> E[Find next runnable epic]
57
- M2 --> E
58
- E --> B{Ready epics found?}
59
- B -->|No| D[Finish run]
60
- B -->|Yes| X{Dependency failed?}
61
- X -->|Yes| K[Mark blocked epic failed]
62
- X -->|No| T[Create epic worktree from loop branch and start team lead]
63
-
64
- subgraph CS[Agent session: team agents for one epic]
65
- direction TB
66
- TL[Team lead]
67
- PP{Epic planned?}
68
- P[Planner creates plan]
69
- Q{Story already passed}
70
- BU[Builder implements]
71
- VA[Validator checks]
72
- R{Validation passed}
73
- SP[Mark story passed in PRD]
74
- F[Record failure]
75
- M{More stories}
76
- RF[Print DONE summary]
77
-
78
- TL --> PP
79
- PP -->|Yes| Q
80
- PP -->|No| P
81
- P --> Q
82
- Q -->|Yes| M
83
- Q -->|No| BU
84
- BU --> VA
85
- VA --> R
86
- R -->|Yes| SP
87
- R -->|Retry left| BU
88
- R -->|No retry left| F
89
- SP --> M
90
- F --> M
91
- M -->|Yes| Q
92
- M -->|No| RF
93
- end
94
-
95
- T --> TL
96
- K --> E
97
- RF --> P2[Update PRD status and progress log]
98
- P2 --> G{Epic completed?}
99
- G -->|No| E
100
- G -->|Yes| H[Merge epic branch back into the run loop branch]
101
- H --> E
102
- ```
103
84
 
104
85
  ## Requirements
105
86
 
@@ -140,7 +121,7 @@ ralph-teams --help
140
121
  rjq --help
141
122
  ```
142
123
 
143
- ## Quick Start
124
+ ## Start
144
125
 
145
126
  1. Create a PRD:
146
127
 
@@ -240,7 +221,7 @@ Notes:
240
221
 
241
222
  Planning behavior:
242
223
 
243
- - if an epic has `planned: true`, the Team Lead is expected to read `plans/plan-EPIC-xxx.md` and follow it
224
+ - if an epic has `planned: true`, the Team Lead is expected to read `ralph-teams/plans/plan-EPIC-xxx.md` and follow it
244
225
  - if an epic is still unplanned, medium- and high-complexity epics should spawn a planner before implementation
245
226
  - only clearly low-complexity epics should skip planning during execution
246
227
 
@@ -279,7 +260,7 @@ Behavior:
279
260
 
280
261
  - loads epics with `planned !== true`
281
262
  - starts an interactive agent discussion about implementation approach and sequencing
282
- - asks the agent to write `plans/plan-EPIC-xxx.md`
263
+ - asks the agent to write `ralph-teams/plans/plan-EPIC-xxx.md`
283
264
  - asks the agent to mark each agreed epic as `planned: true` in `prd.json`
284
265
 
285
266
  Notes:
@@ -301,9 +282,9 @@ ralph-teams discuss --backend codex
301
282
  Behavior:
302
283
 
303
284
  - loads failed stories from `prd.json`
304
- - gathers failure context from `progress.txt`, `plans/`, and `.worktrees/`
285
+ - gathers failure context from `ralph-teams/progress.txt`, `ralph-teams/plans/`, and `ralph-teams/.worktrees/`
305
286
  - starts an interactive agent session that helps the user choose which failed story to discuss first
306
- - asks the agent to write `guidance/guidance-US-xxx.md` files directly for the stories discussed
287
+ - asks the agent to write `ralph-teams/guidance/guidance-US-xxx.md` files directly for the stories discussed
307
288
 
308
289
  Notes:
309
290
 
@@ -313,7 +294,7 @@ Notes:
313
294
 
314
295
  ### `ralph-teams resume`
315
296
 
316
- Resumes an interrupted run from `./ralph-state.json`.
297
+ Resumes an interrupted run from `./ralph-teams/ralph-state.json`.
317
298
 
318
299
  ```bash
319
300
  ralph-teams resume
@@ -324,7 +305,7 @@ Behavior:
324
305
  - reloads the saved PRD path, backend, and parallel settings
325
306
  - reuses the current project config for timeouts and pricing
326
307
  - restarts `ralph.sh`
327
- - removes `ralph-state.json` after a successful resume
308
+ - removes `ralph-teams/ralph-state.json` after a successful resume
328
309
 
329
310
  ### `ralph-teams status [path]`
330
311
 
@@ -337,14 +318,14 @@ ralph-teams status ./my-prd.json
337
318
 
338
319
  ### `ralph-teams logs [--tail N]`
339
320
 
340
- Shows `progress.txt` with light colorization.
321
+ Shows `ralph-teams/progress.txt` with light colorization.
341
322
 
342
323
  ```bash
343
324
  ralph-teams logs
344
325
  ralph-teams logs --tail 20
345
326
  ```
346
327
 
347
- `--tail` shows the last `N` wave blocks from `progress.txt`.
328
+ `--tail` shows the last `N` wave blocks from `ralph-teams/progress.txt`.
348
329
 
349
330
  ### `ralph-teams reset <epicId> [path]`
350
331
 
@@ -441,6 +422,7 @@ Notes:
441
422
  - Ralph enables Codex multi-agent mode per run, so no global `~/.codex/config.toml` edits are required
442
423
  - Codex runs from each epic worktree and is granted write access to the repo root so it can update the shared PRD
443
424
  - Codex does not use a separate repo-local Team Lead role file; the Team Lead policy comes from the runtime prompt assembled in `ralph.sh`, while `.codex/agents/*.toml` define the spawned planner, builder, validator, and merger roles
425
+ - Codex follows the same one-shot story-scoped Builder/Validator contract as Claude and Copilot; the runtime prompt in `ralph.sh` enforces that policy for Codex Team Leads
444
426
 
445
427
  ## PRD Format
446
428
 
@@ -497,16 +479,16 @@ The `init` command uses `prd.json.example` as schema and style guidance when gen
497
479
 
498
480
  During a run, Ralph writes:
499
481
 
500
- - `progress.txt`: high-level run log
501
- - `plans/plan-EPIC-xxx.md`: planner output for an epic
482
+ - `ralph-teams/progress.txt`: high-level run log
483
+ - `ralph-teams/plans/plan-EPIC-xxx.md`: planner output for an epic
502
484
  - planned epics are expected to use these files as their implementation contract
503
- - `logs/epic-EPIC-xxx-<timestamp>.log`: raw backend session log
504
- - `ralph-state.json`: saved interrupt/resume state
505
- - `guidance/guidance-US-xxx.md`: retry guidance captured from discuss flows
485
+ - `ralph-teams/logs/epic-EPIC-xxx-<timestamp>.log`: raw backend session log
486
+ - `ralph-teams/ralph-state.json`: saved interrupt/resume state
487
+ - `ralph-teams/guidance/guidance-US-xxx.md`: retry guidance captured from discuss flows
506
488
 
507
489
  Ralph also updates the original `prd.json` in place as story and epic state changes.
508
490
 
509
- The team lead agent log for each epic is written to `logs/` regardless of backend.
491
+ The team lead agent log for each epic is written to `ralph-teams/logs/` regardless of backend.
510
492
 
511
493
  ## Runtime Rules
512
494
 
@@ -524,9 +506,12 @@ The current execution contract is:
524
506
  - already-passed stories are skipped
525
507
  - rerunning Ralph automatically resets `failed` and `partial` epics back to `pending` so only unfinished work is retried
526
508
  - each story gets at most two build/validate cycles
509
+ - Builder and Validator are one-shot story-scoped workers, never long-lived mailboxes shared across stories
510
+ - a Builder attempt only counts when the Team Lead receives a concrete commit SHA for that story attempt
527
511
  - the validator checks output independently from the builder's reasoning
512
+ - `DONE: X/Y stories passed` is a required session footer, but the durable completion signal is the `prd.json` story state updated by the Team Lead
528
513
  - after updating `prd.json` for all attempted stories, the team lead must print `DONE: X/Y stories passed` and exit the session immediately
529
- - pressing `Ctrl-C` writes `ralph-state.json` so the run can be resumed later with `ralph-teams resume`
514
+ - pressing `Ctrl-C` writes `ralph-teams/ralph-state.json` so the run can be resumed later with `ralph-teams resume`
530
515
 
531
516
  ## Troubleshooting
532
517
 
@@ -1 +1 @@
1
- {"version":3,"file":"discuss.d.ts","sourceRoot":"","sources":["../../src/commands/discuss.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAqB,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAW,GAAG,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAEL,8BAA8B,EAC9B,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAC;AAGpB,KAAK,gBAAgB,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvD,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,WAAW;IACnB,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,UAAU,CAAC;IAC/B,8BAA8B,CAAC,EAAE,OAAO,8BAA8B,CAAC;IACvE,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC9D;AA2CD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAsCvF;AAED,wBAAsB,cAAc,CAClC,OAAO,GAAE,MAAqB,EAC9B,OAAO,GAAE,cAAmB,EAC5B,IAAI,GAAE,WAAyB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
1
+ {"version":3,"file":"discuss.d.ts","sourceRoot":"","sources":["../../src/commands/discuss.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAqB,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAW,GAAG,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAEL,8BAA8B,EAC9B,KAAK,kBAAkB,EACxB,MAAM,YAAY,CAAC;AASpB,KAAK,gBAAgB,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC;AAEvD,UAAU,cAAc;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,WAAW;IACnB,GAAG,EAAE,MAAM,MAAM,CAAC;IAClB,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,KAAK,CAAC;IAC/B,UAAU,CAAC,EAAE,OAAO,UAAU,CAAC;IAC/B,8BAA8B,CAAC,EAAE,OAAO,8BAA8B,CAAC;IACvE,sBAAsB,CAAC,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,CAAC;CAC9D;AA2CD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,GAAG,kBAAkB,EAAE,CAsCvF;AAED,wBAAsB,cAAc,CAClC,OAAO,GAAE,MAAqB,EAC9B,OAAO,GAAE,cAAmB,EAC5B,IAAI,GAAE,WAAyB,GAC9B,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED,OAAO,EAAE,0BAA0B,EAAE,CAAC"}
@@ -45,6 +45,7 @@ const config_1 = require("../config");
45
45
  const prd_utils_1 = require("../prd-utils");
46
46
  const discuss_1 = require("../discuss");
47
47
  const guidance_1 = require("../guidance");
48
+ const runtime_paths_1 = require("../runtime-paths");
48
49
  const defaultDeps = {
49
50
  cwd: () => process.cwd(),
50
51
  exit: (code) => process.exit(code),
@@ -83,10 +84,10 @@ function ensureBackendAvailable(backend) {
83
84
  }
84
85
  function collectFailedStoryContexts(prd, projectRoot) {
85
86
  const prdPath = path.join(projectRoot, 'prd.json');
86
- const progressPath = path.join(projectRoot, 'progress.txt');
87
- const plansDir = path.join(projectRoot, 'plans');
88
- const guidanceDir = path.join(projectRoot, 'guidance');
89
- const worktreesDir = path.join(projectRoot, '.worktrees');
87
+ const progressPath = (0, runtime_paths_1.getRalphProgressPath)(projectRoot);
88
+ const plansDir = (0, runtime_paths_1.getRalphPlansDir)(projectRoot);
89
+ const guidanceDir = (0, runtime_paths_1.getRalphGuidanceDir)(projectRoot);
90
+ const worktreesDir = (0, runtime_paths_1.getRalphWorktreesDir)(projectRoot);
90
91
  const contexts = [];
91
92
  for (const epic of prd.epics) {
92
93
  const epicMayContainFailures = epic.status === 'failed' || epic.status === 'partial' || epic.status === 'merge-failed';
@@ -1 +1 @@
1
- {"version":3,"file":"discuss.js","sourceRoot":"","sources":["../../src/commands/discuss.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2GA,wCA8BC;AAEQ,gEAA0B;AA3InC,iDAA0C;AAC1C,2CAA6B;AAC7B,kDAA0B;AAC1B,sCAA0D;AAC1D,4CAA4C;AAC5C,wCAIoB;AACpB,0CAA8C;AAgB9C,MAAM,WAAW,GAAgB;IAC/B,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE;IACxB,IAAI,EAAE,CAAC,IAAa,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IAC3C,UAAU,EAAV,mBAAU;IACV,8BAA8B,EAA9B,wCAA8B;CAC/B,CAAC;AAEF,SAAS,sBAAsB,CA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C;IACH,MAAM,OAAO,GAAG,MAAM,CAAC,SAAS,CAAC,OAA2B,CAAC;IAE7D,MAAM,aAAa,GAAG,0BAA0B,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IACnE,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,0CAA0C,CAAC,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACf,CAAC;IAED,MAAM,aAAa,GAAG,IAAI,CAAC,sBAAsB,IAAI,sBAAsB,CAAC;IAC5E,aAAa,CAAC,OAAO,CAAC,CAAC;IAEvB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,cAAc,QAAQ,EAAE,CAAC,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,kBAAkB,OAAO,EAAE,CAAC,CAAC,CAAC;IACpD,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,GAAG,CAAC,SAAS,aAAa,CAAC,MAAM,eAAe,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC;IAElH,MAAM,MAAM,GAAG,IAAI,CAAC,8BAA8B,IAAI,wCAA8B,CAAC;IACrF,MAAM,MAAM,CAAC,aAAa,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;AAC3C,CAAC"}
@@ -103,7 +103,7 @@ function buildInitPrompt(prdExample, outputPath) {
103
103
  '- If they want to plan now, continue in the same session and discuss the implementation plan with the user.',
104
104
  '- Planning must be collaborative: discuss the approach with the user and ask follow-up questions whenever scope, architecture, sequencing, ownership, or verification is ambiguous.',
105
105
  '- Do not jump straight to writing plans if important implementation details are unclear. Resolve ambiguity through discussion first.',
106
- '- For each epic the user chooses to plan, write plans/plan-EPIC-xxx.md and update that epic in the PRD to set planned=true.',
106
+ '- For each epic the user chooses to plan, write ralph-teams/plans/plan-EPIC-xxx.md and update that epic in the PRD to set planned=true.',
107
107
  '- If the user only wants to plan some epics now, plan those and leave the others planned=false.',
108
108
  '- If they want to skip, end cleanly after confirming the PRD is written.',
109
109
  '- Do NOT tell the user to run `ralph-teams plan`, `./ralph.sh --plan`, or any other command at this point.',