@sulhadin/orchestrator 1.6.1 → 1.7.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/README.md +72 -159
- package/package.json +1 -1
- package/template/.orchestra/README.md +87 -112
- package/template/.orchestra/agents/worker.md +186 -82
- package/template/.orchestra/roles/architect.md +9 -8
- package/template/.orchestra/roles/backend-engineer.md +8 -7
- package/template/.orchestra/roles/code-reviewer.md +2 -2
- package/template/.orchestra/roles/frontend-engineer.md +10 -9
- package/template/.orchestra/roles/owner.md +7 -7
- package/template/.orchestra/roles/product-manager.md +28 -145
- package/template/CLAUDE.md +33 -19
package/README.md
CHANGED
|
@@ -1,207 +1,120 @@
|
|
|
1
1
|
# Orchestra
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
AI team orchestration for [Claude Code](https://docs.anthropic.com/en/docs/claude-code). Two terminals — PM plans, worker builds.
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
Building a feature with Claude Code typically looks like this:
|
|
5
|
+
## Install
|
|
8
6
|
|
|
7
|
+
```bash
|
|
8
|
+
npx @sulhadin/orchestrator
|
|
9
9
|
```
|
|
10
|
-
You: "Build user authentication"
|
|
11
|
-
You: *opens terminal* "#architect — design the system"
|
|
12
|
-
You: *reads RFC, approves*
|
|
13
|
-
You: *opens terminal* "#backend — implement the API"
|
|
14
|
-
You: *opens terminal* "#reviewer — review the code"
|
|
15
|
-
You: *opens terminal* "#pm — close the feature"
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
You become the orchestrator. You carry context between sessions, sequence work in the right order, and manage the pipeline manually. This is tedious and error-prone.
|
|
19
10
|
|
|
20
|
-
|
|
11
|
+
Skip permission prompts:
|
|
21
12
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
You: "#pm"
|
|
26
|
-
You: "I want user authentication with JWT"
|
|
27
|
-
PM: creates milestone, grooms phases, dispatches worker agent
|
|
28
|
-
#architect writes RFC → you approve
|
|
29
|
-
#backend implements phase by phase → each phase = one commit
|
|
30
|
-
#frontend builds the UI → each phase = one commit
|
|
31
|
-
#reviewer reviews unpushed commits
|
|
32
|
-
you approve → PM pushes to origin
|
|
33
|
-
milestone closed.
|
|
13
|
+
```bash
|
|
14
|
+
npx @sulhadin/orchestrator --dangerously-skip-permissions
|
|
34
15
|
```
|
|
35
16
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
## How It Works
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
You ←→ PM (always-on orchestrator)
|
|
42
|
-
│
|
|
43
|
-
├── Creates milestone with groomed phases
|
|
44
|
-
├── Spawns one worker agent (all roles loaded)
|
|
45
|
-
│
|
|
46
|
-
├── SendMessage("#architect: write RFC") → awaits
|
|
47
|
-
├── SendMessage("#backend: phase-1") → awaits → commit
|
|
48
|
-
├── SendMessage("#backend: phase-2") → awaits → commit
|
|
49
|
-
├── SendMessage("#frontend: phase-3") → awaits → commit
|
|
50
|
-
├── SendMessage("#reviewer: review") → awaits
|
|
51
|
-
│
|
|
52
|
-
├── You approve → PM pushes to origin
|
|
53
|
-
└── Milestone closed
|
|
54
|
-
```
|
|
17
|
+
## Two Terminals
|
|
55
18
|
|
|
56
|
-
###
|
|
19
|
+
### Terminal 1: `#pm` — Planning
|
|
57
20
|
|
|
58
|
-
|
|
21
|
+
PM is your strategic partner. Discuss ideas, challenge scope, create milestones. PM never writes code — only plans.
|
|
59
22
|
|
|
60
23
|
```
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
├── milestone.md Status, acceptance criteria
|
|
64
|
-
├── grooming.md Discussion notes, decisions
|
|
65
|
-
├── rfc.md Architect writes (how)
|
|
66
|
-
├── architecture.md Architect writes (system design)
|
|
67
|
-
├── design.md Frontend engineer writes (UI/UX)
|
|
68
|
-
├── adrs/ Architecture Decision Records
|
|
69
|
-
└── phases/
|
|
70
|
-
├── phase-1.md backend: DB schema → commit
|
|
71
|
-
├── phase-2.md backend: API endpoints → commit
|
|
72
|
-
└── phase-3.md frontend: login UI → commit
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
**Single Worker Session** — PM creates one agent with all roles loaded. No warmup on role switches. Architect decisions are in context when backend implements. Backend code is in context when reviewer reviews.
|
|
76
|
-
|
|
77
|
-
**Await-Based** — PM dispatches via `SendMessage`, blocks until the worker returns. No polling, no signal files. Results flow directly through the return value.
|
|
78
|
-
|
|
79
|
-
**Git-Native Review** — Reviewer doesn't need task files. Reviews unpushed commits on the current branch via `git diff origin/branch...HEAD`.
|
|
80
|
-
|
|
81
|
-
### Roles
|
|
24
|
+
You: #pm
|
|
25
|
+
PM: "No active milestones. Ready for instructions."
|
|
82
26
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
| **Product Manager** | Orchestrates everything. Creates milestones, dispatches worker, drives pipeline. |
|
|
86
|
-
| **Architect** | Designs technical solutions. Writes RFCs, ADRs. |
|
|
87
|
-
| **Backend Engineer** | Implements backend code + tests. One commit per phase. |
|
|
88
|
-
| **Frontend Engineer** | Designs + implements UI. One commit per phase. |
|
|
89
|
-
| **Code Reviewer** | Reviews unpushed commits. Returns approved or changes-requested. |
|
|
90
|
-
| **Owner** | Maintains Orchestra system files (roles, rules, structure). |
|
|
27
|
+
You: "I want user authentication with JWT"
|
|
28
|
+
PM: *discusses, challenges, refines scope*
|
|
91
29
|
|
|
92
|
-
|
|
30
|
+
You: "Create the milestone"
|
|
31
|
+
PM: *creates prd.md, grooming.md, milestone.md, phases/*
|
|
32
|
+
"🎯 M1-user-auth ready. Run #start in another terminal."
|
|
93
33
|
|
|
34
|
+
You: "Let's also plan a dashboard"
|
|
35
|
+
PM: *plans M2 while worker executes M1*
|
|
94
36
|
```
|
|
95
|
-
PM creates milestone
|
|
96
|
-
→ Architect writes RFC
|
|
97
|
-
→ [You approve RFC]
|
|
98
|
-
→ Backend phases (sequential, each → commit)
|
|
99
|
-
→ Frontend phases (sequential, each → commit)
|
|
100
|
-
→ Reviewer reviews unpushed commits
|
|
101
|
-
→ Fix cycle if needed (one round, no re-review)
|
|
102
|
-
→ [You approve push]
|
|
103
|
-
→ PM pushes to origin, closes milestone
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Approval Gates
|
|
107
37
|
|
|
108
|
-
|
|
38
|
+
PM is always available. Plan ahead while work runs in the other terminal.
|
|
109
39
|
|
|
110
|
-
|
|
111
|
-
2. **Push to origin** — after reviewer approves
|
|
40
|
+
### Terminal 2: `#start` — Execution
|
|
112
41
|
|
|
113
|
-
|
|
42
|
+
Worker picks up milestones and executes them autonomously. Loops to the next when done.
|
|
114
43
|
|
|
115
|
-
## Install
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
npx @sulhadin/orchestrator
|
|
119
44
|
```
|
|
45
|
+
You: #start
|
|
120
46
|
|
|
121
|
-
|
|
47
|
+
📋 Starting M1-user-auth
|
|
122
48
|
|
|
123
|
-
|
|
124
|
-
|
|
49
|
+
🏗️ #architect ▶ RFC + grooming validation...
|
|
50
|
+
🏗️ #architect ✅ RFC ready
|
|
51
|
+
🚦 Approve RFC? → yes
|
|
125
52
|
|
|
126
|
-
|
|
53
|
+
⚙️ #backend ▶ phase-1: DB schema + migrations...
|
|
54
|
+
⚙️ #backend ✅ phase-1 done (feat(db): add auth tables)
|
|
127
55
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
├── .orchestra/
|
|
131
|
-
│ ├── README.md Orchestration rules
|
|
132
|
-
│ ├── agents/worker.md Worker agent prompt
|
|
133
|
-
│ ├── roles/ 6 role definitions
|
|
134
|
-
│ ├── milestones/ Feature work (empty)
|
|
135
|
-
|
|
136
|
-
└── CLAUDE.md Orchestra instructions for Claude
|
|
137
|
-
```
|
|
56
|
+
⚙️ #backend ▶ phase-2: API endpoints + tests...
|
|
57
|
+
⚙️ #backend ✅ phase-2 done (feat(auth): add login endpoint)
|
|
138
58
|
|
|
139
|
-
|
|
59
|
+
🎨 #frontend ▶ phase-3: Login UI...
|
|
60
|
+
🎨 #frontend ✅ phase-3 done (feat(auth): add login page)
|
|
140
61
|
|
|
141
|
-
|
|
62
|
+
🔍 #reviewer ▶ reviewing unpushed commits...
|
|
63
|
+
🔍 #reviewer ✅ approved
|
|
142
64
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
PM: "No active milestones. Ready for instructions."
|
|
65
|
+
🚦 Push to origin? → yes
|
|
66
|
+
✅ M1-user-auth done.
|
|
146
67
|
|
|
147
|
-
|
|
148
|
-
PM: *discusses scope, challenges assumptions, proposes approach*
|
|
149
|
-
|
|
150
|
-
You: "Let's build it"
|
|
151
|
-
PM: *creates milestone, grooms phases, dispatches worker*
|
|
152
|
-
*reports progress after each phase*
|
|
153
|
-
*asks for approval at gates*
|
|
154
|
-
*pushes and closes milestone*
|
|
68
|
+
📋 Starting M2-dashboard...
|
|
155
69
|
```
|
|
156
70
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
| Command | Description |
|
|
160
|
-
|---------|------------|
|
|
161
|
-
| `#pm` | Activate Product Manager |
|
|
162
|
-
| `#backend` | Activate Backend Engineer (manual mode) |
|
|
163
|
-
| `#frontend` | Activate Frontend Engineer (manual mode) |
|
|
164
|
-
| `#reviewer` | Activate Code Reviewer (manual mode) |
|
|
165
|
-
| `#architect` | Activate Architect (manual mode) |
|
|
166
|
-
| `#owner` | Activate Owner (system maintenance) |
|
|
167
|
-
| `status` | Pipeline status report (PM only) |
|
|
168
|
-
| `orc help` | Show all commands |
|
|
71
|
+
Close the terminal, reopen, type `#start` — it resumes from where it left off.
|
|
169
72
|
|
|
170
|
-
|
|
73
|
+
## Milestones
|
|
171
74
|
|
|
172
|
-
|
|
75
|
+
Everything for a feature lives in one directory:
|
|
173
76
|
|
|
174
77
|
```
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
78
|
+
.orchestra/milestones/M1-user-auth/
|
|
79
|
+
├── prd.md What + why (PM writes)
|
|
80
|
+
├── milestone.md Status, acceptance criteria
|
|
81
|
+
├── grooming.md Discussion notes, scope decisions
|
|
82
|
+
├── rfc.md Technical design (architect writes)
|
|
83
|
+
├── context.md Running log (worker maintains for resume)
|
|
84
|
+
└── phases/
|
|
85
|
+
├── phase-1.md backend: DB schema → commit
|
|
86
|
+
├── phase-2.md backend: API endpoints → commit
|
|
87
|
+
└── phase-3.md frontend: login UI → commit
|
|
178
88
|
```
|
|
179
89
|
|
|
180
|
-
|
|
90
|
+
## Approval Gates
|
|
181
91
|
|
|
182
|
-
|
|
92
|
+
Worker asks you at two points:
|
|
183
93
|
|
|
184
|
-
|
|
94
|
+
1. **RFC ready** — approve before implementation starts
|
|
95
|
+
2. **Push to origin** — approve before code is pushed
|
|
185
96
|
|
|
186
|
-
|
|
187
|
-
- **Code without tests is not done** — backend and frontend engineers write tests as part of implementation
|
|
188
|
-
- **Conventional commits** — one commit per phase (`feat`, `fix`, `refactor`, etc.)
|
|
189
|
-
- **No `any` types, no unused code, no workarounds** — zero-tolerance rules
|
|
190
|
-
- **Design before code** — frontend engineer writes design specs before implementing
|
|
191
|
-
- **Grooming before implementation** — detailed phase planning before any code is written
|
|
192
|
-
- **Current library versions** — always verify with docs, never rely on memory
|
|
97
|
+
PM asks you before creating a milestone. Everything else is automatic.
|
|
193
98
|
|
|
194
|
-
##
|
|
99
|
+
## Commands
|
|
195
100
|
|
|
196
|
-
|
|
101
|
+
| Command | Where | What it does |
|
|
102
|
+
|---------|-------|-------------|
|
|
103
|
+
| `#pm` | Terminal 1 | Plan features, create milestones |
|
|
104
|
+
| `#start` | Terminal 2 | Execute milestones, asks at approval gates |
|
|
105
|
+
| `#start --auto` | Terminal 2 | Fully autonomous — no questions asked |
|
|
106
|
+
| `#status` | Terminal 1 | Milestone status report |
|
|
107
|
+
| `#help` | Any | Show all commands |
|
|
197
108
|
|
|
198
|
-
|
|
199
|
-
- File ownership (what it can/cannot write)
|
|
200
|
-
- Workflow steps
|
|
201
|
-
- Engineering principles
|
|
202
|
-
- Review checklists (for code-reviewer)
|
|
109
|
+
Manual mode (any terminal):
|
|
203
110
|
|
|
204
|
-
|
|
111
|
+
| Command | Role |
|
|
112
|
+
|---------|------|
|
|
113
|
+
| `#backend` | Backend Engineer |
|
|
114
|
+
| `#frontend` | Frontend Engineer |
|
|
115
|
+
| `#reviewer` | Code Reviewer |
|
|
116
|
+
| `#architect` | Architect |
|
|
117
|
+
| `#owner` | System maintenance |
|
|
205
118
|
|
|
206
119
|
## License
|
|
207
120
|
|
package/package.json
CHANGED
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
# Orchestra — AI Team Orchestration
|
|
2
2
|
|
|
3
3
|
A milestone-based orchestration system for coordinating AI agent sessions
|
|
4
|
-
working on the same codebase.
|
|
5
|
-
dispatching work to a single worker agent that switches between roles.
|
|
4
|
+
working on the same codebase. Two terminals: PM plans, worker executes.
|
|
6
5
|
|
|
7
6
|
## How It Works
|
|
8
7
|
|
|
9
8
|
```
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
→ PM pushes to origin after approval
|
|
23
|
-
→ PM closes milestone
|
|
9
|
+
Terminal 1 (PM): Terminal 2 (Worker):
|
|
10
|
+
#pm #start
|
|
11
|
+
│ │
|
|
12
|
+
├─ Discuss features with user ├─ Scan milestones
|
|
13
|
+
├─ Create milestones ├─ 🏗️ #architect → RFC
|
|
14
|
+
├─ Groom phases ├─ 🚦 User approves RFC
|
|
15
|
+
├─ Always available ├─ ⚙️ #backend → phase by phase
|
|
16
|
+
│ ├─ 🎨 #frontend → phase by phase
|
|
17
|
+
│ (can plan M2 while M1 runs) ├─ 🔍 #reviewer → review commits
|
|
18
|
+
│ ├─ 🚦 User approves push
|
|
19
|
+
│ ├─ git push → milestone done
|
|
20
|
+
│ └─ Loop → next milestone
|
|
24
21
|
```
|
|
25
22
|
|
|
26
23
|
## Directory Structure
|
|
@@ -42,35 +39,42 @@ You (User)
|
|
|
42
39
|
│ ├── milestone.md # Summary, acceptance criteria, status
|
|
43
40
|
│ ├── grooming.md # Discussion, scope, decisions
|
|
44
41
|
│ ├── rfc.md # Technical design (architect fills)
|
|
42
|
+
│ ├── architecture.md # System design (architect fills, if needed)
|
|
43
|
+
│ ├── design.md # UI/UX design (frontend fills, if needed)
|
|
44
|
+
│ ├── context.md # Running log (worker maintains for resume)
|
|
45
|
+
│ ├── adrs/ # Architecture Decision Records (if needed)
|
|
45
46
|
│ └── phases/ # Sequential units of work
|
|
46
47
|
│ ├── phase-1.md # role + objective + scope + result
|
|
47
48
|
│ ├── phase-2.md
|
|
48
49
|
│ └── ...
|
|
49
50
|
```
|
|
50
51
|
|
|
51
|
-
## Two
|
|
52
|
+
## Two Terminals
|
|
52
53
|
|
|
53
|
-
###
|
|
54
|
+
### Terminal 1: `#pm` (Planning)
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
PM is always available for discussion. Creates milestones, never writes code.
|
|
57
|
+
You can plan new milestones while the worker is executing another one.
|
|
56
58
|
|
|
57
|
-
|
|
58
|
-
2. PM creates worker agent session (via `Agent` tool — all roles loaded once)
|
|
59
|
-
3. PM dispatches phases via `SendMessage` → awaits result → dispatches next
|
|
60
|
-
4. Worker switches roles as PM instructs (`#architect`, `#backend`, `#frontend`, `#reviewer`)
|
|
61
|
-
5. Each phase → one commit. Milestone done → push to origin.
|
|
59
|
+
### Terminal 2: `#start` (Execution)
|
|
62
60
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
User switches roles directly — same as before:
|
|
61
|
+
Worker reads milestones, executes phases autonomously. Switches roles per phase.
|
|
62
|
+
Loops to the next milestone when done. Maintains `context.md` for resume capability.
|
|
66
63
|
|
|
67
64
|
```
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
#start
|
|
66
|
+
→ finds M1-user-auth (status: in-progress) → resumes
|
|
67
|
+
→ finds M2-dashboard (status: planning) → starts after M1
|
|
68
|
+
→ no more milestones → "All done. Waiting for new work."
|
|
70
69
|
```
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
### Manual Mode
|
|
72
|
+
|
|
73
|
+
You can still use roles directly in any terminal:
|
|
74
|
+
```
|
|
75
|
+
#backend → checks milestones for pending backend phases
|
|
76
|
+
#reviewer → checks for unpushed commits to review
|
|
77
|
+
```
|
|
74
78
|
|
|
75
79
|
---
|
|
76
80
|
|
|
@@ -243,38 +247,31 @@ Each role has exclusive write access to specific directories:
|
|
|
243
247
|
| product-manager | `.orchestra/milestones/*` (prd.md, milestone.md, grooming.md, phases) | Everything |
|
|
244
248
|
| architect | `.orchestra/milestones/*/rfc.md`, `.orchestra/milestones/*/architecture.md`, `.orchestra/milestones/*/adrs/*`, project configs (initial setup) | Everything |
|
|
245
249
|
| backend-engineer | `src/`, `tests/`, `src/**/__tests__/*`, `migrations/`, `package.json`, `tsconfig.json` | `.orchestra/milestones/*/phases/*` |
|
|
246
|
-
| code-reviewer | Review findings only
|
|
250
|
+
| code-reviewer | Review findings only — never modifies source code | `src/`, `tests/`, `frontend/` |
|
|
247
251
|
| frontend-engineer | `frontend/`, `frontend/**/__tests__/*`, `frontend/**/e2e/*`, `.orchestra/milestones/*/design.md` | `.orchestra/milestones/*/phases/*` |
|
|
248
252
|
|
|
249
253
|
---
|
|
250
254
|
|
|
251
|
-
## Worker
|
|
252
|
-
|
|
253
|
-
### PM → Worker (via SendMessage)
|
|
254
|
-
|
|
255
|
-
PM dispatches tasks by specifying the role and the work:
|
|
255
|
+
## PM ↔ Worker Communication
|
|
256
256
|
|
|
257
|
-
|
|
258
|
-
"#backend: Implement phase-1 of M1-user-auth.
|
|
259
|
-
Read: .orchestra/milestones/M1-user-auth/phases/phase-1.md"
|
|
260
|
-
```
|
|
257
|
+
PM and worker run in **separate terminals**. They communicate through milestone files:
|
|
261
258
|
|
|
262
|
-
|
|
259
|
+
- **PM writes:** prd.md, grooming.md, milestone.md, phase files
|
|
260
|
+
- **Worker reads:** milestone files → executes phases → updates results + context.md
|
|
261
|
+
- **No direct messaging** between PM and worker — file system is the interface
|
|
263
262
|
|
|
264
|
-
|
|
263
|
+
### Context Persistence
|
|
265
264
|
|
|
266
|
-
|
|
267
|
-
-
|
|
268
|
-
-
|
|
269
|
-
-
|
|
270
|
-
- **NEEDS** — worker needs work outside current role's scope, PM dispatches appropriate role
|
|
271
|
-
- **Error** — worker failed, PM reports to user
|
|
265
|
+
Worker maintains `context.md` in each milestone directory. This allows:
|
|
266
|
+
- Resume after terminal close/reopen
|
|
267
|
+
- Track decisions made during implementation
|
|
268
|
+
- Record what was committed in each phase
|
|
272
269
|
|
|
273
|
-
###
|
|
270
|
+
### Approval Gates (Worker Terminal)
|
|
274
271
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
272
|
+
Worker asks the user directly (not PM) at these points:
|
|
273
|
+
1. **RFC ready** — "🚦 Approve RFC to start implementation?"
|
|
274
|
+
2. **Push to origin** — "🚦 All done. Push to origin?"
|
|
278
275
|
|
|
279
276
|
---
|
|
280
277
|
|
|
@@ -285,85 +282,63 @@ persistence if PM session dies.
|
|
|
285
282
|
```mermaid
|
|
286
283
|
sequenceDiagram
|
|
287
284
|
actor U as User
|
|
288
|
-
participant PM as
|
|
289
|
-
participant W as Worker
|
|
285
|
+
participant PM as Terminal 1: PM
|
|
286
|
+
participant W as Terminal 2: Worker
|
|
290
287
|
|
|
291
|
-
U->>PM:
|
|
292
|
-
PM->>PM:
|
|
293
|
-
PM->>W: Agent(worker.md) — create session
|
|
288
|
+
U->>PM: "I want user auth"
|
|
289
|
+
PM->>PM: Discuss, plan, create milestone
|
|
294
290
|
|
|
295
|
-
|
|
296
|
-
W
|
|
297
|
-
|
|
298
|
-
|
|
291
|
+
U->>W: #start
|
|
292
|
+
W->>W: Read milestone files
|
|
293
|
+
|
|
294
|
+
W->>W: 🏗️ #architect → write RFC
|
|
295
|
+
W->>U: 🚦 Approve RFC?
|
|
296
|
+
U->>W: Yes
|
|
299
297
|
|
|
300
298
|
loop Each backend phase
|
|
301
|
-
|
|
302
|
-
W-->>PM: Phase result + commit
|
|
303
|
-
PM->>U: Progress: phase-N done
|
|
299
|
+
W->>W: ⚙️ #backend → phase-N → commit
|
|
304
300
|
end
|
|
305
301
|
|
|
306
302
|
loop Each frontend phase
|
|
307
|
-
|
|
308
|
-
W-->>PM: Phase result + commit
|
|
309
|
-
PM->>U: Progress: phase-N done
|
|
303
|
+
W->>W: 🎨 #frontend → phase-N → commit
|
|
310
304
|
end
|
|
311
305
|
|
|
312
|
-
|
|
313
|
-
W-->>PM: Review verdict
|
|
306
|
+
W->>W: 🔍 #reviewer → review commits
|
|
314
307
|
|
|
315
308
|
alt Changes requested
|
|
316
|
-
|
|
317
|
-
W-->>PM: Fix result + commit
|
|
309
|
+
W->>W: Fix → commit
|
|
318
310
|
end
|
|
319
311
|
|
|
320
|
-
|
|
321
|
-
U->>
|
|
322
|
-
|
|
312
|
+
W->>U: 🚦 Push to origin?
|
|
313
|
+
U->>W: Yes
|
|
314
|
+
W->>W: git push → milestone done
|
|
315
|
+
|
|
316
|
+
W->>W: Next milestone? → loop or done
|
|
317
|
+
|
|
318
|
+
Note over PM: PM is free the entire time<br/>Can plan M2 while M1 executes
|
|
323
319
|
```
|
|
324
320
|
|
|
325
|
-
### 2.
|
|
321
|
+
### 2. Worker Execution Loop
|
|
326
322
|
|
|
327
323
|
```mermaid
|
|
328
324
|
sequenceDiagram
|
|
329
|
-
participant
|
|
330
|
-
participant W as Worker Agent
|
|
331
|
-
|
|
332
|
-
PM->>W: "#backend: implement phase-1"
|
|
333
|
-
Note over W: Read phase file<br/>Activate backend role<br/>Implement + test<br/>Commit
|
|
334
|
-
W-->>PM: Result: done, committed abc123
|
|
335
|
-
|
|
336
|
-
PM->>W: "#backend: implement phase-2"
|
|
337
|
-
Note over W: Same session<br/>Full context preserved<br/>Implement + test<br/>Commit
|
|
338
|
-
W-->>PM: Result: done, committed def456
|
|
325
|
+
participant W as Worker
|
|
339
326
|
|
|
340
|
-
|
|
341
|
-
Note over W:
|
|
342
|
-
W-->>PM: Result: done, committed ghi789
|
|
343
|
-
```
|
|
327
|
+
W->>W: Scan milestones/
|
|
328
|
+
Note over W: M1: in-progress<br/>M2: planning<br/>M3: done
|
|
344
329
|
|
|
345
|
-
|
|
330
|
+
W->>W: Resume M1 (read context.md)
|
|
331
|
+
W->>W: ⚙️ phase-2 (resuming)
|
|
332
|
+
W->>W: ⚙️ phase-3
|
|
333
|
+
W->>W: 🔍 review → approved
|
|
334
|
+
W->>W: Push → M1 done
|
|
346
335
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
336
|
+
W->>W: Start M2
|
|
337
|
+
W->>W: 🏗️ architect → RFC
|
|
338
|
+
W->>W: ⚙️ phase-1
|
|
339
|
+
W->>W: 🔍 review → approved
|
|
340
|
+
W->>W: Push → M2 done
|
|
352
341
|
|
|
353
|
-
|
|
354
|
-
Note over W:
|
|
355
|
-
|
|
356
|
-
alt Approved
|
|
357
|
-
W-->>PM: verdict: approved
|
|
358
|
-
PM->>U: Review passed. Push?
|
|
359
|
-
U->>PM: Yes
|
|
360
|
-
PM->>PM: git push + close milestone
|
|
361
|
-
else Changes Requested
|
|
362
|
-
W-->>PM: verdict: changes-requested + issues
|
|
363
|
-
PM->>W: "#backend: fix issues in phase-2"
|
|
364
|
-
W-->>PM: Fixed + committed
|
|
365
|
-
PM->>U: Fixes applied. Push?
|
|
366
|
-
U->>PM: Yes
|
|
367
|
-
PM->>PM: git push + close milestone
|
|
368
|
-
end
|
|
342
|
+
W->>W: No more milestones
|
|
343
|
+
Note over W: "All done. Waiting for new work."
|
|
369
344
|
```
|