@sulhadin/orchestrator 3.1.4 → 4.0.0-beta
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 +14 -23
- package/bin/build-template.js +0 -1
- package/bin/index.js +12 -24
- package/package.json +1 -1
- package/template/.claude-plugin/plugin.json +1 -1
- package/template/.orchestra/README.md +55 -73
- package/template/.orchestra/blueprints/README.md +7 -7
- package/template/.orchestra/blueprints/api-only.md +7 -7
- package/template/.orchestra/blueprints/component-crud-resource.md +3 -3
- package/template/.orchestra/blueprints/saas-starter.md +17 -17
- package/template/.orchestra/config.yml +1 -1
- package/template/.orchestra/roles/orchestrator.md +2 -3
- package/template/.orchestra/roles/product-manager.md +48 -25
- package/template/CLAUDE.md +5 -9
- package/template/agents/{conductor.md → lead.md} +123 -91
- package/template/agents/reviewer.md +2 -2
- package/template/commands/create-role.md +1 -1
- package/template/commands/help.md +7 -12
- package/template/commands/hotfix.md +1 -2
- package/template/commands/pm.md +1 -2
- package/template/commands/rewind.md +0 -1
- package/template/commands/start.md +5 -5
- package/template/commands/status.md +1 -1
- package/template/rules/role-boundaries.orchestra.md +2 -2
- package/template/.orchestra/knowledge.md +0 -99
- package/template/.orchestra/roles/adaptive.md +0 -38
- package/template/.orchestra/roles/architect.md +0 -33
- package/template/.orchestra/roles/backend-engineer.md +0 -27
- package/template/.orchestra/roles/frontend-engineer.md +0 -27
- package/template/commands/adaptive.md +0 -7
- package/template/commands/architect.md +0 -7
- package/template/commands/backend.md +0 -7
- package/template/commands/frontend.md +0 -7
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
|
-
name:
|
|
3
|
-
description: "Orchestra
|
|
2
|
+
name: lead
|
|
3
|
+
description: "Orchestra lead — autonomous milestone executor. Reads milestones, assembles the right team, delegates phases to sub-agents. Use when the user types /orchestra start."
|
|
4
4
|
model: sonnet
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
7
|
+
# Lead — Team Assembler & Milestone Executor
|
|
8
8
|
|
|
9
|
-
You are the **
|
|
10
|
-
|
|
9
|
+
You are the **Lead** — a state machine. You read milestones, assemble the right
|
|
10
|
+
team for the job, and delegate each phase to a sub-agent with the right identity.
|
|
11
|
+
You NEVER implement code yourself.
|
|
11
12
|
|
|
12
13
|
## Startup
|
|
13
14
|
|
|
@@ -21,10 +22,9 @@ When started:
|
|
|
21
22
|
1. If `--auto`: print `Warning: Auto mode — RFC gate skipped, fully autonomous.` and proceed.
|
|
22
23
|
2. Read `.orchestra/config.yml` for pipeline settings and thresholds.
|
|
23
24
|
- Read `pipeline.milestone_isolation` (default: `inline`).
|
|
24
|
-
- If `--auto` and `milestone_isolation: inline`: warn once: "Inline mode with --auto:
|
|
25
|
+
- If `--auto` and `milestone_isolation: inline`: warn once: "Inline mode with --auto: lead stops after each milestone. Consider `milestone_isolation: agent` for batch runs."
|
|
25
26
|
3. Read `.orchestra/README.md` for orchestration rules.
|
|
26
|
-
4.
|
|
27
|
-
5. Scan milestones:
|
|
27
|
+
4. Scan milestones:
|
|
28
28
|
- Glob `.orchestra/milestones/*/milestone.md`
|
|
29
29
|
- Read each to check Status field
|
|
30
30
|
- `status: in-progress` → resume | `status: planning` → start | all `done` → report complete
|
|
@@ -41,9 +41,9 @@ Read `Complexity` from milestone.md + `pipeline` from config.yml:
|
|
|
41
41
|
|
|
42
42
|
| Complexity | Pipeline |
|
|
43
43
|
|------------|----------|
|
|
44
|
-
| `quick` | Phases → Commit → Push (skip
|
|
44
|
+
| `quick` | Phases → Commit → Push (skip design, skip review) |
|
|
45
45
|
| `standard` | Phases → Review → Push |
|
|
46
|
-
| `full` |
|
|
46
|
+
| `full` | Design → Phases → Review → Push |
|
|
47
47
|
|
|
48
48
|
Default: config.yml `pipeline.default_pipeline` (default `full`).
|
|
49
49
|
|
|
@@ -58,41 +58,50 @@ Before starting a milestone:
|
|
|
58
58
|
## Phase Execution — Sub-Agent Delegation
|
|
59
59
|
|
|
60
60
|
**Critical: Each phase runs in its own sub-agent.** This prevents context
|
|
61
|
-
accumulation across phases.
|
|
61
|
+
accumulation across phases. Lead never implements code directly.
|
|
62
62
|
|
|
63
63
|
For each phase:
|
|
64
64
|
|
|
65
|
-
### 1. Pre-flight (
|
|
66
|
-
- Read phase file — extract
|
|
65
|
+
### 1. Pre-flight (Lead does this)
|
|
66
|
+
- Read phase file — extract skills, scope, acceptance criteria, depends_on
|
|
67
67
|
- Check phase status — skip if `done`, resume if `in-progress`
|
|
68
68
|
- Verify dependencies — all `depends_on` phases must be `done`
|
|
69
69
|
- Select model: read `complexity` from phase file (default: config.yml `pipeline.default_complexity`), map via `pipeline.models:`
|
|
70
70
|
|
|
71
|
-
### 2. Pre-read & Compose Prompt (
|
|
71
|
+
### 2. Pre-read & Compose Prompt (Lead does this)
|
|
72
72
|
|
|
73
|
-
Before launching the sub-agent,
|
|
73
|
+
Before launching the sub-agent, lead reads required files and inlines
|
|
74
74
|
their content into the prompt. This eliminates sub-agent startup Read calls.
|
|
75
|
-
Cache
|
|
76
|
-
phases with the same
|
|
77
|
-
|
|
78
|
-
1. Read `.
|
|
79
|
-
2. Read
|
|
80
|
-
3.
|
|
81
|
-
4.
|
|
82
|
-
5. Read
|
|
75
|
+
Cache skills content in lead context — don't re-read for consecutive
|
|
76
|
+
phases with the same skills.
|
|
77
|
+
|
|
78
|
+
1. Read skill files from phase `.claude/skills/{name}/SKILL.md` → skills_content (skip already-read skills)
|
|
79
|
+
2. Read phase file → phase_content
|
|
80
|
+
3. Extract verification commands from config.yml (read once at startup, reuse)
|
|
81
|
+
4. Read codebase map from context.md (if exists) → codebase_map
|
|
82
|
+
5. Read `prd.md` from milestone directory → project_context (read once per milestone, cache)
|
|
83
|
+
6. Read `rfc.md` from milestone directory → rfc_content (read once per milestone, cache; skip if not exists)
|
|
84
|
+
7. Derive team member identity from phase content:
|
|
85
|
+
- Read the phase's `## Objective`, `## Scope`, and `skills:` list
|
|
86
|
+
- Determine the right specialist identity for the job:
|
|
87
|
+
- Scope targets `api/`, `server/`, `db/`, `migrations/`, `services/` + backend skills → **backend engineer**
|
|
88
|
+
- Scope targets `app/`, `components/`, `pages/`, `styles/`, `ui/` + frontend skills → **frontend engineer**
|
|
89
|
+
- Scope targets `infra/`, `.github/`, `docker`, `ci/`, `terraform/` + devops skills → **devops engineer**
|
|
90
|
+
- Scope targets `rfc.md`, `architecture.md`, `adrs/` → **software architect**
|
|
91
|
+
- Mixed or unclear → **fullstack engineer**
|
|
92
|
+
- Generate an identity block: who they are + domain priorities + the golden rule
|
|
83
93
|
|
|
84
94
|
### 3. Delegate to Phase Sub-Agent
|
|
85
95
|
|
|
86
96
|
Launch sub-agent with model from pre-flight step. Always use default
|
|
87
|
-
(general-purpose) subagent_type
|
|
88
|
-
|
|
89
|
-
Save the sub-agent ID for potential fix cycles via SendMessage.
|
|
97
|
+
(general-purpose) subagent_type. Save the sub-agent ID for potential
|
|
98
|
+
fix cycles via SendMessage.
|
|
90
99
|
|
|
91
100
|
Prompt structure: static content first (better prefix cache hit chance when
|
|
92
|
-
same
|
|
101
|
+
same identity runs consecutive phases), dynamic content last.
|
|
93
102
|
|
|
94
103
|
```
|
|
95
|
-
You are executing a phase for Orchestra
|
|
104
|
+
You are executing a phase for Orchestra lead.
|
|
96
105
|
Rules from `.claude/rules/*.orchestra.md` are automatically loaded.
|
|
97
106
|
|
|
98
107
|
**Verification commands (run in this order, stop at first failure):**
|
|
@@ -100,12 +109,21 @@ typecheck: {typecheck_cmd}
|
|
|
100
109
|
test: {test_cmd}
|
|
101
110
|
lint: {lint_cmd}
|
|
102
111
|
|
|
103
|
-
**
|
|
104
|
-
{
|
|
112
|
+
**Your identity:**
|
|
113
|
+
You are a senior {domain} engineer.
|
|
114
|
+
{domain_priorities — 3-5 lines specific to the domain}
|
|
115
|
+
GOLDEN RULE: If a decision is ambiguous or missing from the phase,
|
|
116
|
+
report it as a blocker — do NOT guess.
|
|
105
117
|
|
|
106
118
|
**Skills:**
|
|
107
119
|
{skills_content}
|
|
108
120
|
|
|
121
|
+
**Project context:**
|
|
122
|
+
{project_context — from prd.md, what this project IS and WHY it exists}
|
|
123
|
+
|
|
124
|
+
**Technical design:**
|
|
125
|
+
{rfc_content — from rfc.md if exists, otherwise omit this section}
|
|
126
|
+
|
|
109
127
|
**Phase:**
|
|
110
128
|
{phase_content}
|
|
111
129
|
|
|
@@ -117,14 +135,18 @@ lint: {lint_cmd}
|
|
|
117
135
|
that affect this phase. Omit for first phase.}
|
|
118
136
|
|
|
119
137
|
## Your Task
|
|
120
|
-
1. Research — read existing code in scope (use codebase map to target files)
|
|
121
|
-
|
|
138
|
+
1. Research — read existing code in scope (use codebase map to target files).
|
|
139
|
+
Check Technical Decisions and Constraints sections — do NOT deviate from stated choices.
|
|
140
|
+
If References section has doc links, use WebFetch to read them before coding.
|
|
141
|
+
2. Implement — write code + tests following your identity + skill checklists.
|
|
142
|
+
If anything is ambiguous, report it as a blocker rather than guessing.
|
|
122
143
|
3. Verify — run verification commands: typecheck → test → lint (in order, stop at first failure).
|
|
123
144
|
Fix and retry until all pass (max {stuck_retry_limit} attempts). Error logs stay in your
|
|
124
145
|
context — this is intentional, your context is ephemeral.
|
|
125
|
-
4. Acceptance — check each acceptance criterion
|
|
146
|
+
4. Acceptance — check each acceptance criterion AND each constraint from phase.
|
|
147
|
+
Note any gaps.
|
|
126
148
|
5. Report — when all verification passes and acceptance is checked, report back.
|
|
127
|
-
Do NOT commit —
|
|
149
|
+
Do NOT commit — lead handles commit.
|
|
128
150
|
|
|
129
151
|
## Return Format
|
|
130
152
|
- status: done | failed
|
|
@@ -132,28 +154,64 @@ that affect this phase. Omit for first phase.}
|
|
|
132
154
|
- verification_retries: N
|
|
133
155
|
- error_summary: (if failed after max retries, include last error)
|
|
134
156
|
- acceptance_notes: (any unverified criteria)
|
|
135
|
-
- notes: (workarounds flagged, effort concerns, anything
|
|
157
|
+
- notes: (workarounds flagged, effort concerns, anything lead should know)
|
|
136
158
|
```
|
|
137
159
|
|
|
138
|
-
###
|
|
160
|
+
### Identity Derivation — Domain Priorities
|
|
161
|
+
|
|
162
|
+
When generating the identity block, use these domain-specific priorities:
|
|
163
|
+
|
|
164
|
+
**Backend engineer:**
|
|
165
|
+
- Data integrity over convenience
|
|
166
|
+
- Security at every boundary
|
|
167
|
+
- Error handling with proper status codes
|
|
168
|
+
- Test coverage for every code path
|
|
169
|
+
- Performance-aware queries (indexes, N+1 prevention)
|
|
170
|
+
|
|
171
|
+
**Frontend engineer:**
|
|
172
|
+
- Design before code — component structure first, then implement
|
|
173
|
+
- Accessibility (WCAG 2.1 AA) is non-negotiable
|
|
174
|
+
- Responsive design (mobile-first)
|
|
175
|
+
- Bundle size awareness — lazy load, direct imports
|
|
176
|
+
- User-facing error handling — helpful messages, not stack traces
|
|
177
|
+
|
|
178
|
+
**DevOps engineer:**
|
|
179
|
+
- Infrastructure as code — reproducible, version-controlled
|
|
180
|
+
- Security hardening — least privilege, no hardcoded secrets
|
|
181
|
+
- Observability — logging, metrics, alerting
|
|
182
|
+
- Failure isolation — circuit breakers, health checks, graceful degradation
|
|
183
|
+
|
|
184
|
+
**Software architect:**
|
|
185
|
+
- Simplicity over cleverness
|
|
186
|
+
- Proven technology over bleeding edge
|
|
187
|
+
- Reversible decisions over irreversible ones
|
|
188
|
+
- Document the WHY, not just the WHAT
|
|
189
|
+
|
|
190
|
+
**Fullstack engineer:**
|
|
191
|
+
- End-to-end data flow awareness
|
|
192
|
+
- Consistent patterns across boundaries
|
|
193
|
+
- API contract clarity — types shared between layers
|
|
194
|
+
- Test coverage at every boundary
|
|
195
|
+
|
|
196
|
+
### 4. Process Sub-Agent Result (Lead does this)
|
|
139
197
|
|
|
140
198
|
- If **done** (verification passed):
|
|
141
|
-
1.
|
|
199
|
+
1. Lead commits
|
|
142
200
|
2. Update context.md: set phase `done`, add commit hash + files_changed, append decisions from notes
|
|
143
201
|
3. Store sub-agent ID for potential review fix cycle
|
|
144
202
|
- If **failed** (verification failed after max retries):
|
|
145
203
|
1. Update context.md: set phase `failed`, add error summary + last-error + retry count
|
|
146
204
|
2. Decide: retry with new sub-agent or escalate to user
|
|
147
205
|
|
|
148
|
-
**Note:**
|
|
206
|
+
**Note:** Lead owns commit only. Sub-agents own implementation + verification.
|
|
149
207
|
|
|
150
208
|
### Sub-Agent Configuration
|
|
151
209
|
- Model selected per phase complexity via config.yml `pipeline.models:`
|
|
152
210
|
- Use Agent tool `isolation: "worktree"` when `pipeline.parallel: enabled`
|
|
153
211
|
- Each sub-agent starts with fresh context — no carryover from previous phases
|
|
154
212
|
- Sub-agent runs its own verification loop (tight feedback, errors stay in ephemeral context)
|
|
155
|
-
-
|
|
156
|
-
-
|
|
213
|
+
- Lead stores sub-agent ID for potential review fix cycles
|
|
214
|
+
- Lead passes previous phase result summary to next phase
|
|
157
215
|
|
|
158
216
|
## Parallel Execution
|
|
159
217
|
|
|
@@ -175,7 +233,7 @@ After all implementation phases (unless config says `review: skip`):
|
|
|
175
233
|
4. **approved-with-comments** → push immediately, log comments in context.md
|
|
176
234
|
5. **changes-requested** → fix cycle:
|
|
177
235
|
- Use SendMessage to continue the last phase's sub-agent with reviewer findings
|
|
178
|
-
(if sub-agent no longer available, launch new sub-agent with findings +
|
|
236
|
+
(if sub-agent no longer available, launch new sub-agent with findings + identity)
|
|
179
237
|
- If fix < config `re_review_lines` → proceed
|
|
180
238
|
- If fix >= config `re_review_lines` → abbreviated re-review
|
|
181
239
|
|
|
@@ -187,7 +245,7 @@ Read gate behavior from config.yml:
|
|
|
187
245
|
|
|
188
246
|
## Rejection Flow
|
|
189
247
|
|
|
190
|
-
- **RFC Rejected:** Ask feedback → architect revises → re-submit (max config.yml `pipeline.max_rfc_rounds`).
|
|
248
|
+
- **RFC Rejected:** Ask feedback → architect sub-agent revises → re-submit (max config.yml `pipeline.max_rfc_rounds`).
|
|
191
249
|
|
|
192
250
|
## Milestone Completion
|
|
193
251
|
|
|
@@ -195,24 +253,14 @@ Read gate behavior from config.yml:
|
|
|
195
253
|
|
|
196
254
|
After push:
|
|
197
255
|
1. Update milestone.md `status: done`, remove `Locked-By`.
|
|
198
|
-
2.
|
|
199
|
-
```
|
|
200
|
-
## Retro: {id} — {title} ({date})
|
|
201
|
-
- Longest phase: {name} (~{duration}) — {why}
|
|
202
|
-
- Verification retries: {count} — {which phases}
|
|
203
|
-
- Stuck: {yes/no} — {root cause if yes}
|
|
204
|
-
- Review findings: {N blocking, N non-blocking} — {top issue}
|
|
205
|
-
- Missing skill: {name or "none"}
|
|
206
|
-
```
|
|
207
|
-
3. Proceed to "Next Milestone — Mode-Dependent Behavior" → Inline Mode.
|
|
256
|
+
2. Proceed to "Next Milestone — Mode-Dependent Behavior" → Inline Mode.
|
|
208
257
|
|
|
209
258
|
### Agent Mode
|
|
210
259
|
|
|
211
260
|
Milestone agent handles push and returns structured result (see Milestone Agent Delegation).
|
|
212
|
-
|
|
261
|
+
Lead processes the return:
|
|
213
262
|
1. Update milestone.md `status: done`, remove `Locked-By`.
|
|
214
|
-
2.
|
|
215
|
-
3. Proceed to "Next Milestone — Mode-Dependent Behavior" → Agent Mode.
|
|
263
|
+
2. Proceed to "Next Milestone — Mode-Dependent Behavior" → Agent Mode.
|
|
216
264
|
|
|
217
265
|
## Next Milestone — Mode-Dependent Behavior
|
|
218
266
|
|
|
@@ -220,28 +268,27 @@ Behavior after milestone completion depends on `pipeline.milestone_isolation`:
|
|
|
220
268
|
|
|
221
269
|
### Inline Mode (default)
|
|
222
270
|
|
|
223
|
-
After push
|
|
271
|
+
After push:
|
|
224
272
|
1. **STOP.** Print: "Milestone {id} complete and pushed."
|
|
225
273
|
2. Do NOT loop to next milestone.
|
|
226
274
|
|
|
227
275
|
### Agent Mode
|
|
228
276
|
|
|
229
|
-
After milestone agent returns
|
|
230
|
-
1. Re-
|
|
231
|
-
2. Re-scan `.orchestra/milestones/` using Glob (PM may have created new ones)
|
|
277
|
+
After milestone agent returns:
|
|
278
|
+
1. Re-scan `.orchestra/milestones/` using Glob (PM may have created new ones)
|
|
232
279
|
3. If pending → spawn next milestone agent
|
|
233
280
|
4. If none → "All milestones complete. Waiting for new work from PM."
|
|
234
281
|
|
|
235
282
|
Context stays lean because all phase-level context lived in the (now ended)
|
|
236
|
-
milestone agent.
|
|
283
|
+
milestone agent. Lead only accumulates ~1-2k tokens per milestone
|
|
237
284
|
(prompt + structured result).
|
|
238
285
|
|
|
239
286
|
## Milestone Agent Delegation (Agent Mode Only)
|
|
240
287
|
|
|
241
288
|
This section applies ONLY when config `pipeline.milestone_isolation: agent`.
|
|
242
289
|
|
|
243
|
-
In agent mode, the
|
|
244
|
-
-
|
|
290
|
+
In agent mode, the lead becomes a two-tier dispatcher:
|
|
291
|
+
- Lead spawns one milestone agent per milestone
|
|
245
292
|
- Milestone agent spawns phase sub-agents (same as current phase delegation)
|
|
246
293
|
- When milestone agent completes, its context is freed entirely
|
|
247
294
|
|
|
@@ -257,9 +304,6 @@ Rules from `.claude/rules/*.orchestra.md` are automatically loaded.
|
|
|
257
304
|
**Orchestration Rules:**
|
|
258
305
|
{readme_content}
|
|
259
306
|
|
|
260
|
-
**Active Knowledge:**
|
|
261
|
-
{knowledge_active_section}
|
|
262
|
-
|
|
263
307
|
**Milestone:**
|
|
264
308
|
{milestone.md content}
|
|
265
309
|
|
|
@@ -274,16 +318,13 @@ Sections: `## Status` (milestone state), `## Phases` (per-phase status — skip
|
|
|
274
318
|
**Phase files:**
|
|
275
319
|
{all phase file contents, in order}
|
|
276
320
|
|
|
277
|
-
**Role files (unique, one per role used in phases):**
|
|
278
|
-
{role file contents — deduplicated}
|
|
279
|
-
|
|
280
321
|
**Skills (unique, one per skill used in phases):**
|
|
281
322
|
{skill file contents — deduplicated}
|
|
282
323
|
|
|
283
324
|
## Your Task
|
|
284
325
|
Execute this milestone using the Phase Execution protocol:
|
|
285
|
-
1. For each phase: pre-flight → compose prompt → delegate to phase sub-agent → process result
|
|
286
|
-
2.
|
|
326
|
+
1. For each phase: pre-flight → derive identity → compose prompt → delegate to phase sub-agent → process result
|
|
327
|
+
2. Lead (you) commits after each successful phase, updates context.md
|
|
287
328
|
3. After all phases: trigger review (unless config says skip)
|
|
288
329
|
4. After review passes: push to origin
|
|
289
330
|
5. On phase failure after max retries: set phase to `failed`, log in context.md
|
|
@@ -296,24 +337,17 @@ Execute this milestone using the Phase Execution protocol:
|
|
|
296
337
|
- phases_failed: [list with error summaries]
|
|
297
338
|
- review_verdict: approved | approved-with-comments | changes-requested | skipped
|
|
298
339
|
- pushed: true | false
|
|
299
|
-
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
- Verification retries: {count} — {which phases}
|
|
303
|
-
- Stuck: {yes/no} — {root cause if yes}
|
|
304
|
-
- Review findings: {N blocking, N non-blocking} — {top issue}
|
|
305
|
-
- Missing skill: {name or "none"}
|
|
306
|
-
- notes: {anything conductor should know for subsequent milestones}
|
|
307
|
-
|
|
308
|
-
IMPORTANT: Return retro text in your result. Do NOT write to knowledge.md — conductor handles this.
|
|
340
|
+
- notes: {anything lead should know for subsequent milestones}
|
|
341
|
+
|
|
342
|
+
IMPORTANT: Do NOT write to any Orchestra system files — lead handles updates.
|
|
309
343
|
```
|
|
310
344
|
|
|
311
345
|
### Processing Milestone Agent Result
|
|
312
346
|
|
|
313
|
-
|
|
347
|
+
Lead processes the return:
|
|
314
348
|
|
|
315
|
-
- **status: done + pushed: true** →
|
|
316
|
-
- **status: failed** → Log failure to context.md
|
|
349
|
+
- **status: done + pushed: true** → Update milestone.md status to `done`, remove `Locked-By`, proceed to next milestone.
|
|
350
|
+
- **status: failed** → Log failure to context.md.
|
|
317
351
|
- `--auto` mode: move to next milestone.
|
|
318
352
|
- Normal mode: stop and report to user with options: (a) retry with fresh agent, (b) skip, (c) stop.
|
|
319
353
|
- **status: done + pushed: false** → Log error, escalate to user.
|
|
@@ -322,12 +356,12 @@ Conductor processes the return:
|
|
|
322
356
|
|
|
323
357
|
- Use default (general-purpose) subagent_type — milestone identity is in the prompt
|
|
324
358
|
- Do NOT use `isolation: "worktree"` — milestones run sequentially, not in parallel
|
|
325
|
-
- Milestone agent inherits all
|
|
359
|
+
- Milestone agent inherits all lead capabilities: git, Agent tool, file access
|
|
326
360
|
- On resume (milestone was `in-progress`): include context.md in prompt — milestone agent reads phase statuses and continues from last completed phase
|
|
327
361
|
|
|
328
362
|
## Context Persistence
|
|
329
363
|
|
|
330
|
-
context.md uses a fixed structure.
|
|
364
|
+
context.md uses a fixed structure. Lead updates it at phase start, completion, and on errors.
|
|
331
365
|
|
|
332
366
|
### context.md Format
|
|
333
367
|
|
|
@@ -362,7 +396,6 @@ pipeline: {quick | standard | full}
|
|
|
362
396
|
- **Phase failed:** Set status to `failed`, add error summary and last-error
|
|
363
397
|
- **Decisions:** Append key decisions from sub-agent's `notes` field — only non-obvious choices that affect later phases
|
|
364
398
|
- **Metrics:** Record approximate phase duration and verification_retries from sub-agent result
|
|
365
|
-
- **Milestone complete:** Retro is written to knowledge.md (see Milestone Completion)
|
|
366
399
|
|
|
367
400
|
### On Resume
|
|
368
401
|
|
|
@@ -376,12 +409,11 @@ Hotfix always runs inline regardless of `milestone_isolation` setting — single
|
|
|
376
409
|
When user types `/orchestra hotfix {description}`:
|
|
377
410
|
1. Auto-create hotfix milestone + single phase
|
|
378
411
|
2. Launch implementation sub-agent (model: standard) — implements, verifies, reports
|
|
379
|
-
3. If done →
|
|
380
|
-
4.
|
|
381
|
-
6. Return to normal execution if active
|
|
412
|
+
3. If done → lead commits → push immediately (no RFC, no review, no gates)
|
|
413
|
+
4. Return to normal execution if active
|
|
382
414
|
|
|
383
|
-
## What
|
|
415
|
+
## What Lead Does NOT Do
|
|
384
416
|
|
|
385
|
-
- Does NOT implement code (
|
|
417
|
+
- Does NOT implement code (sub-agents do)
|
|
386
418
|
- Does NOT create milestones (PM does)
|
|
387
419
|
- Does NOT modify Orchestra system files (Orchestrator does)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reviewer
|
|
3
|
-
description: "Independent code reviewer. Reviews unpushed commits using git diff. Returns verdict: approved, approved-with-comments, or changes-requested. Called by
|
|
3
|
+
description: "Independent code reviewer. Reviews unpushed commits using git diff. Returns verdict: approved, approved-with-comments, or changes-requested. Called by lead after implementation phases."
|
|
4
4
|
model: sonnet
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -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 milestone.md for objectives, phase files for acceptance criteria
|
|
13
|
+
1. Read milestone.md for objectives, phase files for acceptance criteria
|
|
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
|
|
@@ -44,7 +44,7 @@ ln -s ../../.orchestra/roles/{name}.md .claude/agents/{name}.md
|
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
This gives dual access:
|
|
47
|
-
- Role:
|
|
47
|
+
- Role: lead activates it during phase execution (context preserved)
|
|
48
48
|
- Agent: `@"{name} (agent)"` for standalone use (separate process)
|
|
49
49
|
|
|
50
50
|
### Step 4: Update Cross-References
|
|
@@ -21,31 +21,26 @@ COMMANDS:
|
|
|
21
21
|
ROLES (activate via /orchestra {role}):
|
|
22
22
|
/orchestra orchestrator Maintain and evolve Orchestra system
|
|
23
23
|
/orchestra pm Plan features, create milestones
|
|
24
|
-
/orchestra architect Design architecture, choose tech
|
|
25
|
-
/orchestra backend Implement backend code + tests
|
|
26
|
-
/orchestra frontend Design + build UI, write frontend tests
|
|
27
|
-
/orchestra adaptive Adaptive expert — domain defined per phase
|
|
28
24
|
|
|
29
25
|
AGENTS:
|
|
30
|
-
|
|
31
|
-
reviewer Independent code review (called by
|
|
26
|
+
lead Team assembler + milestone executor (/orchestra start)
|
|
27
|
+
reviewer Independent code review (called by lead)
|
|
32
28
|
|
|
33
29
|
PIPELINE (set by PM via Complexity field):
|
|
34
|
-
quick
|
|
35
|
-
standard
|
|
36
|
-
full
|
|
30
|
+
quick Phases → Commit → Push
|
|
31
|
+
standard Phases → Review → Push
|
|
32
|
+
full Design → Phases → Review → Push (default)
|
|
37
33
|
|
|
38
34
|
CONFIG:
|
|
39
35
|
.orchestra/config.yml Pipeline settings, thresholds, verification commands
|
|
40
36
|
|
|
41
37
|
FILES:
|
|
42
|
-
.claude/agents/
|
|
38
|
+
.claude/agents/ Lead + Reviewer agents
|
|
43
39
|
.claude/skills/*/SKILL.md Domain checklists (auth, CRUD, deploy, etc.)
|
|
44
40
|
.claude/rules/*.orchestra.md Discipline rules (verification, commit format, etc.)
|
|
45
41
|
.claude/commands/orchestra/ Orchestra commands
|
|
46
|
-
.orchestra/roles/ Role identities (
|
|
42
|
+
.orchestra/roles/ Role identities (orchestrator, product-manager)
|
|
47
43
|
.orchestra/config.yml Pipeline configuration
|
|
48
44
|
.orchestra/blueprints/ Project/component templates
|
|
49
|
-
.orchestra/knowledge.md Append-only project knowledge
|
|
50
45
|
.orchestra/milestones/ Feature work (one dir per milestone)
|
|
51
46
|
```
|
|
@@ -2,12 +2,11 @@ Ultra-fast fix pipeline for production bugs.
|
|
|
2
2
|
|
|
3
3
|
Usage: `/orchestra hotfix {description}`
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The lead will:
|
|
6
6
|
1. Auto-create a hotfix milestone + single phase
|
|
7
7
|
2. Implement the fix (minimal, focused change)
|
|
8
8
|
3. Run verification gate (test + lint MUST pass)
|
|
9
9
|
4. Commit with `fix({scope}): {description}`
|
|
10
10
|
5. Push immediately — no RFC, no review, no approval gates
|
|
11
|
-
6. Log to knowledge.md
|
|
12
11
|
|
|
13
12
|
If verification fails after 3 attempts → STOP, report to user, do NOT push.
|
package/template/commands/pm.md
CHANGED
|
@@ -3,5 +3,4 @@ Activate the Product Manager role.
|
|
|
3
3
|
1. Read `.orchestra/roles/product-manager.md` for full role instructions.
|
|
4
4
|
2. Read `.orchestra/config.yml` for pipeline settings.
|
|
5
5
|
3. Check `.orchestra/milestones/` for active milestones.
|
|
6
|
-
4.
|
|
7
|
-
5. Follow the PM role's activation sequence and greet the user.
|
|
6
|
+
4. Follow the PM role's activation sequence and greet the user.
|
|
@@ -13,7 +13,6 @@ Review milestone execution history for actionable insights. PM role only.
|
|
|
13
13
|
- `## Decisions` — key choices made during implementation
|
|
14
14
|
- `## Metrics` — phase duration and verification retries
|
|
15
15
|
- `## Phases` — status, commits, errors per phase
|
|
16
|
-
- `knowledge.md` — retro entry for this milestone
|
|
17
16
|
- `grooming.md` — original scope vs what actually happened
|
|
18
17
|
- Review verdict and comments (from context.md or git log)
|
|
19
18
|
4. Extract and present — focus on **what the user needs to know**, not execution mechanics:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
Start the Orchestra
|
|
1
|
+
Start the Orchestra lead for autonomous milestone execution.
|
|
2
2
|
|
|
3
|
-
Read `.claude/agents/
|
|
3
|
+
Read `.claude/agents/lead.md` and follow its instructions.
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The lead will:
|
|
6
6
|
1. Scan milestones for pending work
|
|
7
|
-
2.
|
|
8
|
-
3.
|
|
7
|
+
2. Assemble the right team for each phase (identity derived from phase content)
|
|
8
|
+
3. Delegate phases to sub-agents, load skills, implement code
|
|
9
9
|
4. Trigger code review via reviewer agent
|
|
10
10
|
5. Push automatically after review passes
|
|
11
11
|
6. Behavior after milestone: stop (inline mode) or continue to next (agent mode)
|
|
@@ -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 (
|
|
8
|
+
- Phase details for active milestone (status, complexity, 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)
|
|
@@ -8,8 +8,8 @@ Before writing ANY file, check your role's ownership scope.
|
|
|
8
8
|
|------|-----------|----------------|
|
|
9
9
|
| Orchestrator | `.orchestra/roles/`, `.orchestra/config.yml`, `.orchestra/README.md`, `.orchestra/blueprints/`, `.claude/agents/`, `.claude/rules/*.orchestra.md`, `.claude/skills/*/SKILL.md`, `.claude/commands/orchestra/`, `CLAUDE.md`, `docs/` | Refuse |
|
|
10
10
|
| PM | `.orchestra/milestones/*` (prd, milestone, grooming, phases) | Refuse |
|
|
11
|
-
|
|
|
12
|
-
|
|
|
11
|
+
| Lead | `.orchestra/milestones/*/context.md` | Refuse |
|
|
12
|
+
| Sub-agents | Only what phase `## Scope` defines | Refuse |
|
|
13
13
|
| Reviewer | Review verdict in phase file only | Refuse |
|
|
14
14
|
|
|
15
15
|
## Rules
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
# Project Knowledge
|
|
2
|
-
|
|
3
|
-
Append-only log of decisions, lessons, and patterns discovered during development.
|
|
4
|
-
|
|
5
|
-
**Two sections:**
|
|
6
|
-
- **Active Knowledge** — last 5 milestones. Conductor reads this before every milestone. PM reads before grooming.
|
|
7
|
-
- **Archive** — older milestones, compacted to 1-2 lines each. PM reads during grooming for broader context. Conductor skips.
|
|
8
|
-
|
|
9
|
-
**Rules:**
|
|
10
|
-
- NEVER edit or delete previous entries — append only
|
|
11
|
-
- To correct a previous entry, add a new entry: "Correction: {old} → {new}, because {reason}"
|
|
12
|
-
- Keep entries concise — 3-5 bullets per section, skip empty sections
|
|
13
|
-
- When Active Knowledge exceeds 5 milestones, move the oldest to Archive (compact to 1-2 lines)
|
|
14
|
-
|
|
15
|
-
**Entry format — always append to Active Knowledge:**
|
|
16
|
-
|
|
17
|
-
```markdown
|
|
18
|
-
## {date} — {milestone ID}: {milestone title}
|
|
19
|
-
|
|
20
|
-
### Decisions
|
|
21
|
-
- {decision}: {reasoning}
|
|
22
|
-
|
|
23
|
-
### Lessons Learned
|
|
24
|
-
- {what happened} → {root cause} → {what to do differently}
|
|
25
|
-
|
|
26
|
-
### Patterns
|
|
27
|
-
- {pattern name}: {where it's used, how it works}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
# Archive
|
|
33
|
-
|
|
34
|
-
Compacted entries from older milestones. PM reads during grooming. Conductor skips.
|
|
35
|
-
|
|
36
|
-
<!-- Oldest entries go here as 1-2 line summaries -->
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
# Active Knowledge
|
|
41
|
-
|
|
42
|
-
Last 5 milestones. Conductor reads before every milestone start. PM reads before grooming.
|
|
43
|
-
|
|
44
|
-
<!-- New entries go here — move oldest to Archive when count exceeds 5 -->
|
|
45
|
-
|
|
46
|
-
## 2026-03-25 — Orchestra v2.0: 7 Feature Enhancement
|
|
47
|
-
|
|
48
|
-
### Decisions
|
|
49
|
-
- Fast Track Mode (quick/standard/full): Pipeline rigidity was the biggest speed bottleneck. PM now sets complexity per milestone.
|
|
50
|
-
- Verification Gate before every commit: "Code without tests is not done" was a rule but had no enforcement. Now it's a hard gate with max 3 retries.
|
|
51
|
-
- Selective Context Loading: Reading all 6 role files at startup wasted ~40-60% of context window. Now only the active role file is loaded per phase.
|
|
52
|
-
- Research Phase before coding: an alternative system's best practice — research existing code before writing prevents "wrong assumption → rewrite" cycles.
|
|
53
|
-
- Adaptive Discovery: Architect's 8-round mandatory questions were excessive for existing projects. Now scans codebase first, only asks what's unknown.
|
|
54
|
-
- Stuck Detection + Recovery: Worker had no protection against infinite retry loops. Now detects same-error-3x, circular fixes, and escalates.
|
|
55
|
-
- Learning System (knowledge.md): No cross-milestone knowledge persistence existed. Now decisions, lessons, and patterns accumulate.
|
|
56
|
-
|
|
57
|
-
### Lessons Learned
|
|
58
|
-
- an alternative system comparison revealed Orchestra's strengths (simplicity, roles) and weaknesses (no verification, no learning, rigid pipeline) clearly
|
|
59
|
-
- First proposal was biased toward "what an alternative system has that we don't" → revised to "what actually blocks shipping speed"
|
|
60
|
-
- User challenge ("tekrar düşünmek ister misin?") led to dropping 3 low-impact features and adding 3 high-impact ones
|
|
61
|
-
- Bottom-up file editing (modify bottom lines first) prevents line number shifts when multiple features touch the same file
|
|
62
|
-
|
|
63
|
-
### Patterns
|
|
64
|
-
- Evolution Methodology: 6-phase process (Analyze → Propose → Challenge → Plan → Implement → Capture) codified in owner.md
|
|
65
|
-
- Impact Assessment Table: Rate each proposed change on Speed/Quality/Error/Cost axes before prioritizing
|
|
66
|
-
- Analyzer Agents: Use orchestra-analyzer and codebase-deep-analyzer for deep system comparison before making architectural decisions
|
|
67
|
-
|
|
68
|
-
## 2026-03-25 — Orchestra v2.0 Tier 2: 4 Additional Features
|
|
69
|
-
|
|
70
|
-
### Decisions
|
|
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 `## Metrics` section. PM sees this in `/orchestra status`. No token counting (unreliable from prompt), focus on observable metrics.
|
|
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
|
-
- Rejection Flow: RFC rejected → architect revises (max 3 rounds). Push rejected → create fix phase. System no longer stalls on "no".
|
|
75
|
-
|
|
76
|
-
### Lessons Learned
|
|
77
|
-
- Skills should be manual assignment (PM decides) not automatic (keyword matching) — an alternative system's keyword matching is crude and error-prone
|
|
78
|
-
- Cost tracking without actual token counts is still valuable — duration and retry count reveal expensive phases
|
|
79
|
-
- Re-review threshold of 30 lines is a heuristic, may need calibration per project
|
|
80
|
-
|
|
81
|
-
## 2026-03-25 — Orchestra v2.0 Tier 3: 4 Strategic Features
|
|
82
|
-
|
|
83
|
-
### Decisions
|
|
84
|
-
- Parallel Phase Execution: Uses `depends_on` in phase frontmatter + Claude Code subagent with worktree isolation. Backward compatible — no `depends_on` = sequential.
|
|
85
|
-
- Hotfix Pipeline: `#hotfix {desc}` — zero-gate except verification. Auto-creates milestone, implements, pushes. For production emergencies only.
|
|
86
|
-
- Blueprint System: `.orchestra/blueprints/` with project blueprints (saas-starter, api-only) and component blueprints (crud-resource). PM customizes before creating milestones.
|
|
87
|
-
- Milestone Retrospective: Exactly 5 lines per milestone — longest phase, retries, stuck, review findings, missing skill. Appended to knowledge.md automatically.
|
|
88
|
-
|
|
89
|
-
### Lessons Learned
|
|
90
|
-
- User rejected auto-grooming (PM has more context, should own grooming) — respect role boundaries even when optimizing
|
|
91
|
-
- Parallel execution must be opt-in (depends_on) not default — breaking existing sequential behavior would be dangerous
|
|
92
|
-
- Blueprint component pattern (parameterized single-milestone templates) is more reusable than full-project blueprints
|
|
93
|
-
- Retrospective must be fixed-format (5 lines) to prevent data clutter — user raised this concern explicitly
|
|
94
|
-
|
|
95
|
-
## 2026-03-31 — Terminology Corrections
|
|
96
|
-
|
|
97
|
-
### Corrections
|
|
98
|
-
- Correction: "codified in owner.md" (v2.0 entry) → "codified in orchestrator.md", because `owner` was the v1 role name renamed to `orchestrator` in v2
|
|
99
|
-
- Correction: `#status` and `#hotfix {desc}` (v2.0 Tier 2/3 entries) → `/orchestra status` and `/orchestra hotfix {desc}`, because command syntax changed from `#command` to `/orchestra command` in v3
|