@sulhadin/orchestrator 3.0.0-beta.12 → 3.0.0-beta.13
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 +4 -3
- package/package.json +1 -1
- package/template/.claude/agents/conductor.md +174 -19
- package/template/.claude/agents/reviewer.md +1 -1
- package/template/.claude/commands/orchestra/start.md +6 -2
- package/template/.claude/commands/orchestra/status.md +2 -2
- package/template/.orchestra/README.md +73 -27
- package/template/.orchestra/config.yml +5 -0
- package/template/.orchestra/knowledge.md +1 -1
- package/template/CLAUDE.md +18 -2
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Terminal 1 (PM): Terminal 2 (Conductor):
|
|
|
28
28
|
│ ├─ Delegate to frontend → UI
|
|
29
29
|
│ (plan M2 while M1 runs) ├─ Call reviewer → code review
|
|
30
30
|
│ ├─ Push → milestone done
|
|
31
|
-
│ └─
|
|
31
|
+
│ └─ Stop (inline) or next milestone (agent)
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
## Quick Example
|
|
@@ -49,8 +49,7 @@ PM challenges scope, creates M1-user-auth with 3 phases
|
|
|
49
49
|
⚙️ backend → phase-2: API endpoints → committed
|
|
50
50
|
🎨 frontend → phase-3: Login UI → committed
|
|
51
51
|
🔍 reviewer → approved
|
|
52
|
-
|
|
53
|
-
✅ M1-user-auth done. Checking for next milestone...
|
|
52
|
+
✅ M1-user-auth done. Pushed to origin.
|
|
54
53
|
```
|
|
55
54
|
|
|
56
55
|
## Commands
|
|
@@ -117,6 +116,8 @@ PM challenges scope, creates M1-user-auth with 3 phases
|
|
|
117
116
|
|
|
118
117
|
**Role boundaries** — Enforced via `.claude/rules/`. PM cannot write code. Engineers cannot modify system files. Orchestrator cannot write features. Boundaries checked by file path, not by words.
|
|
119
118
|
|
|
119
|
+
**Milestone isolation** — `inline` mode stops after each milestone (user compacts manually). `agent` mode spawns each milestone in its own sub-agent — context freed automatically, enabling 20+ milestones in a single `--auto` session.
|
|
120
|
+
|
|
120
121
|
**Stuck detection** — Detects repeated failures, circular fixes, over-engineering. Tries different approach once, then escalates. Auto mode skips to next phase.
|
|
121
122
|
|
|
122
123
|
## Upgrading
|
package/package.json
CHANGED
|
@@ -18,8 +18,10 @@ by delegating each phase to a sub-agent. You NEVER implement code yourself.
|
|
|
18
18
|
|
|
19
19
|
When started:
|
|
20
20
|
|
|
21
|
-
1. If `--auto`: print `Warning: Auto mode —
|
|
21
|
+
1. If `--auto`: print `Warning: Auto mode — RFC gate skipped, fully autonomous.` and proceed.
|
|
22
22
|
2. Read `.orchestra/config.yml` for pipeline settings and thresholds.
|
|
23
|
+
- Read `pipeline.milestone_isolation` (default: `inline`).
|
|
24
|
+
- If `--auto` and `milestone_isolation: inline`: warn once: "Inline mode with --auto: conductor stops after each milestone. Consider `milestone_isolation: agent` for batch runs."
|
|
23
25
|
3. Read `.orchestra/README.md` for orchestration rules.
|
|
24
26
|
4. Read `.orchestra/knowledge.md` Active Knowledge section (skip Archive).
|
|
25
27
|
5. Scan milestones:
|
|
@@ -136,10 +138,11 @@ that affect this phase. Omit for first phase.}
|
|
|
136
138
|
### 4. Process Sub-Agent Result (Conductor does this)
|
|
137
139
|
|
|
138
140
|
- If **done** (verification passed):
|
|
139
|
-
1. Conductor commits
|
|
140
|
-
2.
|
|
141
|
+
1. Conductor commits
|
|
142
|
+
2. Update context.md: set phase `done`, add commit hash + files_changed, append decisions from notes
|
|
143
|
+
3. Store sub-agent ID for potential review fix cycle
|
|
141
144
|
- If **failed** (verification failed after max retries):
|
|
142
|
-
1.
|
|
145
|
+
1. Update context.md: set phase `failed`, add error summary + last-error + retry count
|
|
143
146
|
2. Decide: retry with new sub-agent or escalate to user
|
|
144
147
|
|
|
145
148
|
**Note:** Conductor owns commit only. Sub-agents own implementation + verification.
|
|
@@ -188,6 +191,8 @@ Read gate behavior from config.yml:
|
|
|
188
191
|
|
|
189
192
|
## Milestone Completion
|
|
190
193
|
|
|
194
|
+
### Inline Mode (default)
|
|
195
|
+
|
|
191
196
|
After push:
|
|
192
197
|
1. Update milestone.md `status: done`, remove `Locked-By`.
|
|
193
198
|
2. Append 5-line retrospective to knowledge.md:
|
|
@@ -199,35 +204,185 @@ After push:
|
|
|
199
204
|
- Review findings: {N blocking, N non-blocking} — {top issue}
|
|
200
205
|
- Missing skill: {name or "none"}
|
|
201
206
|
```
|
|
207
|
+
3. Proceed to "Next Milestone — Mode-Dependent Behavior" → Inline Mode.
|
|
208
|
+
|
|
209
|
+
### Agent Mode
|
|
210
|
+
|
|
211
|
+
Milestone agent handles push and returns structured result (see Milestone Agent Delegation).
|
|
212
|
+
Conductor processes the return:
|
|
213
|
+
1. Update milestone.md `status: done`, remove `Locked-By`.
|
|
214
|
+
2. Append retro from milestone agent's return to knowledge.md.
|
|
215
|
+
3. Proceed to "Next Milestone — Mode-Dependent Behavior" → Agent Mode.
|
|
216
|
+
|
|
217
|
+
## Next Milestone — Mode-Dependent Behavior
|
|
218
|
+
|
|
219
|
+
Behavior after milestone completion depends on `pipeline.milestone_isolation`:
|
|
220
|
+
|
|
221
|
+
### Inline Mode (default)
|
|
222
|
+
|
|
223
|
+
After push and retro:
|
|
224
|
+
1. Clear context.md: remove `## Status`, `## Phases`, `## Decisions`, `## Metrics` sections, keep only `## Codebase Map`
|
|
225
|
+
2. **STOP.** Print: "Milestone {id} complete and pushed. Run `/compact` then `/orchestra start` for next milestone."
|
|
226
|
+
3. Do NOT loop to next milestone — user manages context manually.
|
|
227
|
+
|
|
228
|
+
**Why stop?** Conductor accumulates ~5-8k tokens per milestone from phase
|
|
229
|
+
results, review cycles, and commit logs. In inline mode, the user controls
|
|
230
|
+
when to compact and restart, keeping quality high across milestones.
|
|
231
|
+
|
|
232
|
+
### Agent Mode
|
|
233
|
+
|
|
234
|
+
After milestone agent returns (retro already written in Milestone Completion above):
|
|
235
|
+
1. Re-read knowledge.md Active section (may have new retros)
|
|
236
|
+
2. Re-scan `.orchestra/milestones/` using Glob (PM may have created new ones)
|
|
237
|
+
3. If pending → spawn next milestone agent
|
|
238
|
+
4. If none → "All milestones complete. Waiting for new work from PM."
|
|
239
|
+
|
|
240
|
+
Context stays lean because all phase-level context lived in the (now ended)
|
|
241
|
+
milestone agent. Conductor only accumulates ~1-2k tokens per milestone
|
|
242
|
+
(prompt + structured result).
|
|
243
|
+
|
|
244
|
+
## Milestone Agent Delegation (Agent Mode Only)
|
|
245
|
+
|
|
246
|
+
This section applies ONLY when config `pipeline.milestone_isolation: agent`.
|
|
247
|
+
|
|
248
|
+
In agent mode, the conductor becomes a two-tier dispatcher:
|
|
249
|
+
- Conductor spawns one milestone agent per milestone
|
|
250
|
+
- Milestone agent spawns phase sub-agents (same as current phase delegation)
|
|
251
|
+
- When milestone agent completes, its context is freed entirely
|
|
252
|
+
|
|
253
|
+
### Milestone Agent Prompt Template
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
You are a Milestone Agent executing milestone {milestone_id}: {title}.
|
|
257
|
+
Rules from `.claude/rules/*.orchestra.md` are automatically loaded.
|
|
258
|
+
|
|
259
|
+
**Config:**
|
|
260
|
+
{config_yml_content}
|
|
261
|
+
|
|
262
|
+
**Orchestration Rules:**
|
|
263
|
+
{readme_content}
|
|
264
|
+
|
|
265
|
+
**Active Knowledge:**
|
|
266
|
+
{knowledge_active_section}
|
|
267
|
+
|
|
268
|
+
**Milestone:**
|
|
269
|
+
{milestone.md content}
|
|
270
|
+
|
|
271
|
+
**Grooming:**
|
|
272
|
+
{grooming.md content}
|
|
202
273
|
|
|
203
|
-
|
|
274
|
+
**Context (if resuming):**
|
|
275
|
+
{context.md content}
|
|
276
|
+
Sections: `## Status` (milestone state), `## Phases` (per-phase status — skip `done` phases),
|
|
277
|
+
`## Decisions` (cross-phase context), `## Metrics` (duration + retries per phase).
|
|
204
278
|
|
|
205
|
-
|
|
279
|
+
**Phase files:**
|
|
280
|
+
{all phase file contents, in order}
|
|
206
281
|
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
3. Drop cached role/skills content — next milestone may use different roles
|
|
210
|
-
4. Re-read essentials: config.yml (if not cached), knowledge.md Active section
|
|
211
|
-
5. Re-scan `.orchestra/milestones/` using Glob (PM may have created new ones)
|
|
212
|
-
6. If pending → start next milestone
|
|
213
|
-
7. If none → "All milestones complete. Waiting for new work from PM."
|
|
282
|
+
**Role files (unique, one per role used in phases):**
|
|
283
|
+
{role file contents — deduplicated}
|
|
214
284
|
|
|
215
|
-
**
|
|
216
|
-
|
|
217
|
-
|
|
285
|
+
**Skills (unique, one per skill used in phases):**
|
|
286
|
+
{skill file contents — deduplicated}
|
|
287
|
+
|
|
288
|
+
## Your Task
|
|
289
|
+
Execute this milestone using the Phase Execution protocol:
|
|
290
|
+
1. For each phase: pre-flight → compose prompt → delegate to phase sub-agent → process result
|
|
291
|
+
2. Conductor (you) commits after each successful phase, updates context.md
|
|
292
|
+
3. After all phases: trigger review (unless config says skip)
|
|
293
|
+
4. After review passes: push to origin
|
|
294
|
+
5. On phase failure after max retries: set phase to `failed`, log in context.md
|
|
295
|
+
- If stuck: set milestone status to `failed`, return immediately
|
|
296
|
+
6. You own exactly ONE milestone — do NOT loop to other milestones
|
|
297
|
+
|
|
298
|
+
## Return Format
|
|
299
|
+
- status: done | failed
|
|
300
|
+
- phases_completed: [list of phase names]
|
|
301
|
+
- phases_failed: [list with error summaries]
|
|
302
|
+
- review_verdict: approved | approved-with-comments | changes-requested | skipped
|
|
303
|
+
- pushed: true | false
|
|
304
|
+
- retro: |
|
|
305
|
+
## Retro: {id} — {title} ({date})
|
|
306
|
+
- Longest phase: {name} (~{duration}) — {why}
|
|
307
|
+
- Verification retries: {count} — {which phases}
|
|
308
|
+
- Stuck: {yes/no} — {root cause if yes}
|
|
309
|
+
- Review findings: {N blocking, N non-blocking} — {top issue}
|
|
310
|
+
- Missing skill: {name or "none"}
|
|
311
|
+
- notes: {anything conductor should know for subsequent milestones}
|
|
312
|
+
|
|
313
|
+
IMPORTANT: Return retro text in your result. Do NOT write to knowledge.md — conductor handles this.
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
### Processing Milestone Agent Result
|
|
317
|
+
|
|
318
|
+
Conductor processes the return:
|
|
319
|
+
|
|
320
|
+
- **status: done + pushed: true** → Write retro to knowledge.md, update milestone.md status to `done`, remove `Locked-By`, proceed to next milestone.
|
|
321
|
+
- **status: failed** → Log failure to context.md, write partial retro to knowledge.md.
|
|
322
|
+
- `--auto` mode: move to next milestone.
|
|
323
|
+
- Normal mode: stop and report to user with options: (a) retry with fresh agent, (b) skip, (c) stop.
|
|
324
|
+
- **status: done + pushed: false** → Log error, escalate to user.
|
|
325
|
+
|
|
326
|
+
### Milestone Agent Configuration
|
|
327
|
+
|
|
328
|
+
- Use default (general-purpose) subagent_type — milestone identity is in the prompt
|
|
329
|
+
- Do NOT use `isolation: "worktree"` — milestones run sequentially, not in parallel
|
|
330
|
+
- Milestone agent inherits all conductor capabilities: git, Agent tool, file access
|
|
331
|
+
- On resume (milestone was `in-progress`): include context.md in prompt — milestone agent reads phase statuses and continues from last completed phase
|
|
218
332
|
|
|
219
333
|
## Context Persistence
|
|
220
334
|
|
|
221
|
-
|
|
222
|
-
|
|
335
|
+
context.md uses a fixed structure. Conductor updates it at phase start, completion, and on errors.
|
|
336
|
+
|
|
337
|
+
### context.md Format
|
|
338
|
+
|
|
339
|
+
```markdown
|
|
340
|
+
## Status
|
|
341
|
+
milestone: {milestone-id}
|
|
342
|
+
started: {YYYY-MM-DD}
|
|
343
|
+
pipeline: {quick | standard | full}
|
|
344
|
+
|
|
345
|
+
## Phases
|
|
346
|
+
- phase-1: {done | in-progress | failed | pending} | commit: {hash} | files: {changed files}
|
|
347
|
+
- phase-2: {status} | error: {error summary, retry count} | last-error: {specific error}
|
|
348
|
+
- phase-3: pending
|
|
349
|
+
...
|
|
350
|
+
|
|
351
|
+
## Codebase Map
|
|
352
|
+
{path — one-line description, generated by scout sub-agent}
|
|
353
|
+
|
|
354
|
+
## Decisions
|
|
355
|
+
- phase-1: {key decision or trade-off made during implementation}
|
|
356
|
+
- phase-2: {why a specific approach was chosen}
|
|
357
|
+
|
|
358
|
+
## Metrics
|
|
359
|
+
- phase-1: duration: ~{N}min | verification_retries: {N}
|
|
360
|
+
- phase-2: duration: ~{N}min | verification_retries: {N}
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### Update Rules
|
|
364
|
+
|
|
365
|
+
- **Phase start:** Set phase status to `in-progress`
|
|
366
|
+
- **Phase done:** Set status to `done`, add commit hash and files_changed from sub-agent result
|
|
367
|
+
- **Phase failed:** Set status to `failed`, add error summary and last-error
|
|
368
|
+
- **Decisions:** Append key decisions from sub-agent's `notes` field — only non-obvious choices that affect later phases
|
|
369
|
+
- **Metrics:** Record approximate phase duration and verification_retries from sub-agent result
|
|
370
|
+
- **Milestone complete (inline mode):** Clear all sections except `## Codebase Map`
|
|
371
|
+
|
|
372
|
+
### On Resume
|
|
373
|
+
|
|
374
|
+
Read context.md → skip phases marked `done` → resume from first non-done phase.
|
|
375
|
+
`## Decisions` from completed phases are included in "previous phase summary" for the next sub-agent — this preserves cross-phase context even after session restart.
|
|
223
376
|
|
|
224
377
|
## Hotfix Pipeline
|
|
225
378
|
|
|
379
|
+
Hotfix always runs inline regardless of `milestone_isolation` setting — single-phase fast path, sub-agent isolation adds no value.
|
|
380
|
+
|
|
226
381
|
When user types `/orchestra hotfix {description}`:
|
|
227
382
|
1. Auto-create hotfix milestone + single phase
|
|
228
383
|
2. Launch implementation sub-agent (model: standard) — implements, verifies, reports
|
|
229
384
|
3. If done → conductor commits → push immediately (no RFC, no review, no gates)
|
|
230
|
-
|
|
385
|
+
4. Append one-liner to knowledge.md
|
|
231
386
|
6. Return to normal execution if active
|
|
232
387
|
|
|
233
388
|
## What Conductor Does NOT Do
|
|
@@ -10,7 +10,7 @@ Review code independently. No implementation context by design — only the code
|
|
|
10
10
|
|
|
11
11
|
## Process
|
|
12
12
|
|
|
13
|
-
1. Read
|
|
13
|
+
1. Read milestone.md for objectives, phase files for acceptance criteria, context.md for codebase map and decisions
|
|
14
14
|
2. Read RFC if exists
|
|
15
15
|
3. `git log origin/{branch}..HEAD` + `git diff origin/{branch}...HEAD`
|
|
16
16
|
4. Detect mode from diff: backend / frontend / both → apply relevant checklist
|
|
@@ -7,7 +7,11 @@ The conductor will:
|
|
|
7
7
|
2. Execute phases sequentially (or parallel if configured)
|
|
8
8
|
3. Activate roles, load skills, implement code
|
|
9
9
|
4. Trigger code review via reviewer agent
|
|
10
|
-
5. Push after
|
|
11
|
-
6.
|
|
10
|
+
5. Push automatically after review passes
|
|
11
|
+
6. Behavior after milestone: stop (inline mode) or continue to next (agent mode)
|
|
12
|
+
|
|
13
|
+
Config `pipeline.milestone_isolation` controls post-milestone behavior:
|
|
14
|
+
- `inline` (default): stops after each milestone. User compacts and restarts.
|
|
15
|
+
- `agent`: spawns each milestone in sub-agent. Loops automatically. Best with `--auto`.
|
|
12
16
|
|
|
13
17
|
Pass `--auto` flag for fully autonomous mode (warns once, then skips all gates).
|
|
@@ -5,7 +5,7 @@ Show full milestone status report. PM role only.
|
|
|
5
5
|
3. For active milestones, read context.md for progress details.
|
|
6
6
|
4. Report:
|
|
7
7
|
- All milestones with status, current phase, next action
|
|
8
|
-
- Phase details for active milestone (role, status,
|
|
8
|
+
- Phase details for active milestone (role, status, metrics)
|
|
9
9
|
- Git status (branch, unpushed commits)
|
|
10
|
-
-
|
|
10
|
+
- Metrics summary from context.md `## Metrics` section (duration + retries per phase)
|
|
11
11
|
- Actions needed (specific next steps)
|
|
@@ -15,9 +15,8 @@ Terminal 1 (PM): Terminal 2 (Conductor):
|
|
|
15
15
|
├─ Always available ├─ ⚙️ delegate to backend → phase by phase
|
|
16
16
|
│ ├─ 🎨 delegate to frontend → phase by phase
|
|
17
17
|
│ (can plan M2 while M1 runs) ├─ 🔍 reviewer → review commits
|
|
18
|
-
│ ├─ 🚦 User approves push
|
|
19
18
|
│ ├─ git push → milestone done
|
|
20
|
-
│ └─
|
|
19
|
+
│ └─ Stop (inline) or next milestone (agent)
|
|
21
20
|
```
|
|
22
21
|
|
|
23
22
|
## Directory Structure
|
|
@@ -57,7 +56,8 @@ You can plan new milestones while the conductor is executing another one.
|
|
|
57
56
|
### Terminal 2: `/orchestra start` (Execution)
|
|
58
57
|
|
|
59
58
|
Conductor reads milestones, delegates each phase to a sub-agent with the right role.
|
|
60
|
-
Sub-agents implement + verify; conductor commits.
|
|
59
|
+
Sub-agents implement + verify; conductor commits. After milestone completion, behavior
|
|
60
|
+
depends on `milestone_isolation` config: stops (inline) or continues to next (agent).
|
|
61
61
|
Maintains `context.md` for resume capability.
|
|
62
62
|
|
|
63
63
|
```
|
|
@@ -82,7 +82,6 @@ PM discusses feature with user
|
|
|
82
82
|
→ Conductor executes frontend phases (sequential, each → commit)
|
|
83
83
|
→ Conductor calls reviewer agent (reviews unpushed commits)
|
|
84
84
|
→ FIX cycle if changes-requested (re-review if fix >= 30 lines)
|
|
85
|
-
→ [USER APPROVAL GATE: Push to origin]
|
|
86
85
|
→ Conductor pushes, PM verifies acceptance criteria, closes milestone
|
|
87
86
|
→ Conductor appends 5-line retrospective to knowledge.md
|
|
88
87
|
|
|
@@ -110,6 +109,31 @@ PM sets `Complexity` on milestone (pipeline) and `complexity` on each phase (mod
|
|
|
110
109
|
|
|
111
110
|
Defaults: config.yml `pipeline.default_pipeline` and `pipeline.default_complexity`.
|
|
112
111
|
|
|
112
|
+
### Milestone Isolation
|
|
113
|
+
|
|
114
|
+
Config `pipeline.milestone_isolation` controls how the conductor handles multiple milestones:
|
|
115
|
+
|
|
116
|
+
| Mode | Behavior | Best for |
|
|
117
|
+
|------|----------|----------|
|
|
118
|
+
| `inline` (default) | Conductor runs milestone directly, **stops** after completion. User runs `/compact` then `/orchestra start` for next milestone. | Manual sessions, PC-based work |
|
|
119
|
+
| `agent` | Conductor spawns a sub-agent per milestone. Context freed automatically after each. Loops to next milestone. | `--auto` overnight batch runs |
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
Inline mode: Agent mode:
|
|
123
|
+
/orchestra start /orchestra start --auto
|
|
124
|
+
→ M1 executes → done → STOP → Spawn Agent(M1) → done → freed
|
|
125
|
+
user: /compact → Spawn Agent(M2) → done → freed
|
|
126
|
+
/orchestra start → Spawn Agent(M3) → done → freed
|
|
127
|
+
→ M2 executes → done → STOP → All done
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
In agent mode, the delegation is two-tier:
|
|
131
|
+
```
|
|
132
|
+
Conductor (lean dispatcher)
|
|
133
|
+
└── Milestone Agent (fresh context)
|
|
134
|
+
└── Phase Agent (unchanged)
|
|
135
|
+
```
|
|
136
|
+
|
|
113
137
|
### Milestone Statuses
|
|
114
138
|
|
|
115
139
|
| Status | Meaning |
|
|
@@ -153,7 +177,8 @@ Conductor NEVER commits unless verification passes.
|
|
|
153
177
|
|
|
154
178
|
- Each phase completion → **one conventional commit** on the current branch
|
|
155
179
|
- No branch creation or switching — work happens on whatever branch is checked out
|
|
156
|
-
- Milestone completion → **push to origin** (after
|
|
180
|
+
- Milestone completion → **push to origin** (automatic after review passes)
|
|
181
|
+
- Commits stay local until milestone fully completes — no partial push on failure
|
|
157
182
|
- Reviewer reviews unpushed commits: `git log origin/{branch}..HEAD`
|
|
158
183
|
- Clean git history: each commit maps to a phase
|
|
159
184
|
|
|
@@ -187,16 +212,14 @@ Rules:
|
|
|
187
212
|
|
|
188
213
|
The user must approve before these transitions:
|
|
189
214
|
- **Milestone creation** — PM discusses and plans, but must get user approval before creating the milestone directory and files
|
|
190
|
-
- **RFC → Implementation** — user reviews architect's RFC
|
|
191
|
-
- **Push to origin** — user approves the final changeset
|
|
215
|
+
- **RFC → Implementation** — user reviews architect's RFC (if `rfc_approval` is not `skip`)
|
|
192
216
|
|
|
193
|
-
All other transitions are automatic.
|
|
217
|
+
Push is automatic after review passes. All other transitions are automatic.
|
|
194
218
|
|
|
195
219
|
### Rejection Handling
|
|
196
220
|
|
|
197
221
|
If the user says **no** at any gate:
|
|
198
222
|
- **RFC rejected** → Architect revises based on feedback, re-submits (max config `pipeline.max_rfc_rounds`)
|
|
199
|
-
- **Push rejected** → Conductor creates fix phase, implements, re-submits push gate
|
|
200
223
|
- **Milestone rejected** → PM revises in PM terminal
|
|
201
224
|
|
|
202
225
|
Rejections are normal. The system does not stall — it loops back with feedback.
|
|
@@ -215,9 +238,9 @@ Conductor calls reviewer agent
|
|
|
215
238
|
→ Returns: approved / approved-with-comments / changes-requested
|
|
216
239
|
```
|
|
217
240
|
|
|
218
|
-
**If approved** →
|
|
241
|
+
**If approved** → push immediately.
|
|
219
242
|
|
|
220
|
-
**If approved-with-comments** →
|
|
243
|
+
**If approved-with-comments** → push immediately. Comments are logged in context.md.
|
|
221
244
|
|
|
222
245
|
**If changes-requested** → Conductor continues the phase's sub-agent via SendMessage with
|
|
223
246
|
reviewer findings. Re-review triggered if fix >= config `re_review_lines` threshold.
|
|
@@ -285,16 +308,21 @@ PM and conductor run in **separate terminals**. They communicate through milesto
|
|
|
285
308
|
|
|
286
309
|
### Context Persistence
|
|
287
310
|
|
|
288
|
-
Conductor maintains `context.md` in each milestone directory
|
|
289
|
-
-
|
|
290
|
-
-
|
|
291
|
-
-
|
|
311
|
+
Conductor maintains `context.md` in each milestone directory with a fixed structure:
|
|
312
|
+
- `## Status` — milestone id, start date, pipeline type
|
|
313
|
+
- `## Phases` — per-phase status, commit hash, files changed, errors
|
|
314
|
+
- `## Codebase Map` — scout-generated file map (survives milestone clear)
|
|
315
|
+
- `## Decisions` — key choices from each phase that affect later phases
|
|
316
|
+
- `## Metrics` — phase duration and verification retries (used by `/orchestra status`)
|
|
317
|
+
|
|
318
|
+
This enables resume after terminal close/reopen. On restart, conductor reads context.md and skips completed phases.
|
|
292
319
|
|
|
293
320
|
### Approval Gates (Conductor Terminal)
|
|
294
321
|
|
|
295
|
-
Conductor asks the user directly (not PM) at
|
|
296
|
-
1. **RFC ready** — "Approve RFC to start implementation?"
|
|
297
|
-
|
|
322
|
+
Conductor asks the user directly (not PM) at this point:
|
|
323
|
+
1. **RFC ready** — "Approve RFC to start implementation?" (if `rfc_approval` is not `skip`)
|
|
324
|
+
|
|
325
|
+
Push is automatic after review passes — no approval needed.
|
|
298
326
|
|
|
299
327
|
---
|
|
300
328
|
|
|
@@ -332,16 +360,18 @@ sequenceDiagram
|
|
|
332
360
|
C->>C: Fix → commit
|
|
333
361
|
end
|
|
334
362
|
|
|
335
|
-
C->>U: Push to origin?
|
|
336
|
-
U->>C: Yes
|
|
337
363
|
C->>C: git push → milestone done
|
|
338
364
|
|
|
339
|
-
|
|
365
|
+
alt Inline mode (default)
|
|
366
|
+
C->>C: STOP — user compacts and restarts
|
|
367
|
+
else Agent mode
|
|
368
|
+
C->>C: Next milestone? → loop or done
|
|
369
|
+
end
|
|
340
370
|
|
|
341
371
|
Note over PM: PM is free the entire time<br/>Can plan M2 while M1 executes
|
|
342
372
|
```
|
|
343
373
|
|
|
344
|
-
### 2. Conductor Execution Loop
|
|
374
|
+
### 2. Conductor Execution Loop (Inline Mode)
|
|
345
375
|
|
|
346
376
|
```mermaid
|
|
347
377
|
sequenceDiagram
|
|
@@ -356,11 +386,27 @@ sequenceDiagram
|
|
|
356
386
|
C->>C: reviewer → approved
|
|
357
387
|
C->>C: Push → M1 done
|
|
358
388
|
|
|
359
|
-
C
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
389
|
+
Note over C: STOP. "Run /compact then /orchestra start"
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
### 3. Conductor Execution Loop (Agent Mode)
|
|
393
|
+
|
|
394
|
+
```mermaid
|
|
395
|
+
sequenceDiagram
|
|
396
|
+
participant C as Conductor
|
|
397
|
+
participant MA as Milestone Agent
|
|
398
|
+
|
|
399
|
+
C->>C: Scan milestones/
|
|
400
|
+
|
|
401
|
+
C->>MA: Spawn Agent(M1)
|
|
402
|
+
MA->>MA: phase-1 → phase-2 → review → push
|
|
403
|
+
MA-->>C: {status: done, retro: ...}
|
|
404
|
+
Note over C: Write retro, ~1-2k tokens retained
|
|
405
|
+
|
|
406
|
+
C->>MA: Spawn Agent(M2)
|
|
407
|
+
MA->>MA: phase-1 → phase-2 → review → push
|
|
408
|
+
MA-->>C: {status: done, retro: ...}
|
|
409
|
+
Note over C: Write retro, ~1-2k tokens retained
|
|
364
410
|
|
|
365
411
|
C->>C: No more milestones
|
|
366
412
|
Note over C: "All done. Waiting for new work."
|
|
@@ -22,6 +22,11 @@ pipeline:
|
|
|
22
22
|
# When enabled, phases with depends_on: [] run in parallel
|
|
23
23
|
parallel: disabled
|
|
24
24
|
|
|
25
|
+
# Milestone isolation mode: inline | agent
|
|
26
|
+
# inline: conductor runs milestones directly, stops after each. User compacts manually. (default)
|
|
27
|
+
# agent: each milestone runs in its own sub-agent. Context freed automatically. Best for --auto.
|
|
28
|
+
milestone_isolation: inline
|
|
29
|
+
|
|
25
30
|
# Default pipeline when milestone Complexity is missing
|
|
26
31
|
default_pipeline: full # quick | standard | full
|
|
27
32
|
|
|
@@ -69,7 +69,7 @@ Last 5 milestones. Conductor reads before every milestone start. PM reads before
|
|
|
69
69
|
|
|
70
70
|
### Decisions
|
|
71
71
|
- Skill System (markdown-only): Lightweight `.orchestra/skills/` with domain checklists (auth, CRUD, deployment). No registry, no keyword matching — PM manually assigns via `skills:` frontmatter in phase files. Preserves zero-infrastructure philosophy.
|
|
72
|
-
- Cost Awareness: Track duration + verification retries per phase in context.md
|
|
72
|
+
- Cost Awareness: Track duration + verification retries per phase in context.md `## Metrics` section. PM sees this in `/orchestra status`. No token counting (unreliable from prompt), focus on observable metrics.
|
|
73
73
|
- Re-review Threshold: Fix < 30 lines → no re-review. Fix >= 30 lines → abbreviated re-review (only the fix commit). Balances quality vs speed.
|
|
74
74
|
- Rejection Flow: RFC rejected → architect revises (max 3 rounds). Push rejected → create fix phase. System no longer stalls on "no".
|
|
75
75
|
|
package/template/CLAUDE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
1
|
+
# CLAUDE.md
|
|
2
2
|
|
|
3
|
-
This file
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
4
|
|
|
5
5
|
<!-- orchestra -->
|
|
6
6
|
## Orchestra — AI Team Orchestration System
|
|
@@ -46,6 +46,22 @@ Role IDs: orchestrator, product-manager, architect, backend-engineer, frontend-e
|
|
|
46
46
|
- Rules (`.claude/rules/*.orchestra.md`) auto-loaded. Skills loaded per phase.
|
|
47
47
|
- **PROTECTED:** Non-Orchestrator roles NEVER modify `.orchestra/roles/`, `.orchestra/config.yml`, `.orchestra/README.md`, `.orchestra/blueprints/`, `.claude/agents/`, `.claude/rules/*.orchestra.md`, `.claude/skills/*.orchestra.md`, `.claude/commands/orchestra/`, `CLAUDE.md`, or `docs/`.
|
|
48
48
|
|
|
49
|
+
## Development
|
|
50
|
+
|
|
51
|
+
This is an npm package (`@sulhadin/orchestrator`) — a CLI installer that copies Orchestra template files into user projects.
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
yarn test # Run tests (node:test, test/**/*.test.js)
|
|
55
|
+
yarn template # Rebuild template/ from source files (bin/build-template.js)
|
|
56
|
+
yarn build # Full build (defined in lint-staged)
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Architecture:** `bin/index.js` is the CLI entry point (runs via `npx`). It copies files from `template/` into the user's project, with smart YAML merge for `config.yml` (preserves user values, adds new keys). `bin/build-template.js` generates the `template/` directory from the source `.orchestra/` and `.claude/` files.
|
|
60
|
+
|
|
61
|
+
**npm publishes:** Only `bin/` and `template/` directories (see `package.json` `files` field). Tests, docs, and source orchestra files are excluded.
|
|
62
|
+
|
|
63
|
+
**Pre-commit:** Husky + lint-staged runs `yarn template && yarn build` on staged `.js`, `.md`, `.yml`, `.json` files.
|
|
64
|
+
|
|
49
65
|
## Installation
|
|
50
66
|
|
|
51
67
|
See `docs/getting-started.md` for setup instructions.
|