uctm 1.5.3 → 2.0.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 CHANGED
@@ -70,14 +70,14 @@ The agents analyze your request, plan the work, and execute through isolated sub
70
70
  [game-dev] Build a brick breaker game in HTML
71
71
  ```
72
72
 
73
- * **Requirement Analysis**: The agent analyzes your requirement and asks for approval. Review `works/WORK-NN/Requirement.md` and type **"approve"** to proceed.
73
+ * **Requirement Analysis**: Main Claude spawns a single `orchestrator` agent (`mode=gated` by default), which nests a `specifier` call to analyze your requirement. Orchestrator pauses at **[GATE-1]** and returns a summary for approval. Review `works/WORK-NN/Requirement.md` and type **"approve"** to proceed.
74
74
  ```
75
75
  {Requirement specification content}
76
- If you approve Requirement.md, I will call the Planner to create PLAN.md + TASK decomposition.
76
+ If you approve Requirement.md, orchestrator will nest-spawn the Planner to create PLAN.md + TASK decomposition.
77
77
  Let me know if you want to modify anything.
78
78
  ```
79
79
 
80
- * **WORK Execution Plan**: The agent builds an execution plan and asks again. Review `works/WORK-NN/PLAN.md` and `TASK-NN.md`, then type **"approve"** to proceed.
80
+ * **WORK Execution Plan**: Orchestrator nests a `planner` call to build an execution plan, then pauses again at **[GATE-2]**. Review `works/WORK-NN/PLAN.md` and `TASK-NN.md`, then type **"approve"** to proceed.
81
81
  ```
82
82
  WORK-31 Development Approval Request
83
83
 
@@ -86,8 +86,6 @@ WORK-31 Development Approval Request
86
86
  ┌─────────┬─────────────────────────┐
87
87
  │ Item │ Details │
88
88
  ├─────────┼─────────────────────────┤
89
- │ Mode │ full │
90
- ├─────────┼─────────────────────────┤
91
89
  │ TASKs │ 6 (TASK-00 ~ TASK-05) │
92
90
  └─────────┴─────────────────────────┘
93
91
 
@@ -99,11 +97,11 @@ WORK-31 Development Approval Request
99
97
  └─────────────────────────────────→ TASK-05 ($$$$$$$$$)
100
98
 
101
99
  - TASK-01/02 parallel, TASK-03/04 parallel, TASK-05 final integration
102
- - If approved, scheduler builder → verifier → committer pipeline will execute.
100
+ - If approved, orchestrator schedules the TASK DAG itself and nest-spawns builder → verifier → committer for each TASK — no further approval gates in this phase.
103
101
 
104
102
  Proceed?
105
103
  ```
106
- * Per-TASK: build → verify → commit repeats automatically for each TASK.
104
+ * Per-TASK: build → verify → commit repeats automatically for each TASK, all inside the same nested orchestrator run.
107
105
  ```
108
106
  ● TASK-05 committed. Updating PROGRESS.md and finalizing WORK-31.
109
107
  ```
@@ -118,7 +116,7 @@ WORK-31 Development Approval Request
118
116
  ```
119
117
  [WORK start] Change the submit button label to "Send" — auto
120
118
  ```
121
- Add "auto" to skip all approval steps and run the entire process automatically.
119
+ Add "auto" to run orchestrator in `mode=auto` — it completes the entire WORK in one nested spawn with **zero approval gates**, and records every judgment call it had to make on your behalf in `works/WORK-NN/DECISIONS.md` and the final report's `## 자동 결정 사항` section.
122
120
 
123
121
  ### 2. Token Economy
124
122
 
@@ -127,11 +125,10 @@ I'm cost-conscious (honestly). So this agent applies four token-saving strategie
127
125
  **(1) Serena MCP for codebase analysis.**
128
126
  The agent prioritizes [Serena MCP](https://github.com/oraios/serena) for code exploration — reading symbols instead of entire files. (Huge thanks to the Serena team.)
129
127
 
130
- **(2) Three execution modes + spawn consolidation to minimize subagent overhead.** The WORK-PIPELINE has 6 agent stages running sequentially. For a single-TASK WORK, that's 6 subagent sessions each consuming tokens just to boot up. Wasteful. So the specifier agent decides the execution mode based on complexity: **direct** mode uses only 3 agent calls (specifier → builder → verifier+committer), skipping planner and scheduler. On top of this, related agents are combined into a single spawn: specifier+planner run together, and verifier+committer run together reducing total spawns by **~30%** (6 TASKs: 20 → 14 spawns). See [Three Execution Modes](#concept-three-execution-modes).
128
+ **(2) A single nested orchestrator instead of per-stage round-trips.** The WORK-PIPELINE has up to 6 agent stages. Instead of Main Claude calling each stage one at a time, Main Claude spawns a single `orchestrator` agent **once**, which nests specifier planner → builder → verifier committer as sub-spawns of its own (Claude Code sub-agent nesting, depth 2). The orchestrator schedules the TASK DAG itself instead of round-tripping through Main Claude for every stage. See [Concept: Orchestrator Modes](#concept-orchestrator-modes-gated-vs-auto).
131
129
 
132
- **(3) Structured XML communication.** Subagents can't nestMain Claude orchestrates everything.
133
- * When one agent finishes and the next agent starts, Main Claude sits in between, causing data to be transmitted twice. This communication is a blob of text
134
- * The receiving side has to parse it again. So we standardized the communication format as XML.
130
+ **(3) Structured XML communication.** Even with nesting, every hop between agents is still a text boundary gate summaries and hand-offs are still just blobs of text.
131
+ * Whichever side receives it has to parse it again. So we standardized the communication format as XML.
135
132
  * Every bit helps.
136
133
  * (This also made agent log monitoring much easier.) See [Structured Agent Communication](#structured-agent-communication).
137
134
 
@@ -164,23 +161,15 @@ Six subagents work across any project and any language, automatically handling *
164
161
 
165
162
  ## Usage
166
163
 
167
- ### Trivial Fix (direct mode)
164
+ ### Small Fix
168
165
 
169
166
  ```
170
167
  > [bugfix] Fix typo in login error message
171
168
  ```
172
169
 
173
- Main Claude calls specifier, which selects `execution-mode: direct` and returns a dispatch XML. Main Claude then calls builder (implements the change) and committer (commits). Creates WORK-NN directory + PLAN + result.md + commit.
174
-
175
- ### Quick Task (pipeline mode)
176
-
177
- ```
178
- > [bugfix] Fix the login button not responding on mobile
179
- ```
180
-
181
- Main Claude calls specifier, which selects `execution-mode: pipeline` and creates PLAN. Then Main Claude calls builder → verifier → committer in sequence.
170
+ Main Claude spawns `orchestrator` once (`mode=gated` by default). Orchestrator nests specifier **[GATE-1]** planner → **[GATE-2]** → builder verifier committer. Creates WORK-NN directory + PLAN + result.md + commit — all inside the same orchestrator run. Every WORK takes this path, so even a one-line change is planned and recorded.
182
171
 
183
- ### Complex Feature (WORK)
172
+ ### Feature (WORK)
184
173
 
185
174
  #### 1. Create WORK (Planning)
186
175
 
@@ -188,7 +177,7 @@ Main Claude calls specifier, which selects `execution-mode: pipeline` and create
188
177
  > [new-feature] Build a user authentication feature. Plan it.
189
178
  ```
190
179
 
191
- The planner analyzes the project and creates WORK-01:
180
+ Orchestrator nests specifier → planner, which analyzes the project and creates WORK-01:
192
181
 
193
182
  ```
194
183
  WORK-01: User Authentication
@@ -208,7 +197,7 @@ WORK-01: User Authentication
208
197
  > Run WORK-01 pipeline
209
198
  ```
210
199
 
211
- The scheduler executes WORK-01's TASKs in dependency order.
200
+ Orchestrator's internal DAG scheduling (STEP C) executes WORK-01's TASKs in dependency order, nesting builder → verifier → committer for each TASK — this phase has no approval gates.
212
201
 
213
202
  #### 3. Add to Existing WORK
214
203
 
@@ -235,6 +224,8 @@ WORK Status
235
224
  > Resume WORK-02
236
225
  ```
237
226
 
227
+ "automatically" triggers `mode=auto` — orchestrator completes in a single nested spawn without gates. "Resume" reattaches to the parked orchestrator via `SendMessage` (context preserved), or falls back to a fresh nested re-spawn reconstructed from `work_{WORK}.log` if the handle was lost.
228
+
238
229
  #### 6. Run a Specific TASK
239
230
 
240
231
  Skip to a specific TASK within a WORK (e.g., retry after a failure):
@@ -243,7 +234,7 @@ Skip to a specific TASK within a WORK (e.g., retry after a failure):
243
234
  > Run WORK-02: TASK-02
244
235
  ```
245
236
 
246
- The scheduler returns the next TASK, then Main Claude calls builder → verifier → committer in sequence.
237
+ Orchestrator's DAG scheduling (STEP C) identifies the next READY TASK, then nests builder → verifier → committer in sequence.
247
238
 
248
239
  #### 7. Force WORK Creation (Skip Complexity Check)
249
240
 
@@ -255,7 +246,7 @@ Use the `[new-work]` tag to always create a new WORK regardless of complexity:
255
246
 
256
247
  #### 8. Handle Failure / Retry
257
248
 
258
- If a TASK fails during the pipeline, the scheduler retries up to 3 times automatically.
249
+ If a TASK fails during the pipeline, orchestrator re-dispatches builder up to 3 times automatically (STEP C). If all 3 attempts fail, it escalates via `<needs-decision>` — a `<gate type="decision">` in `mode=gated`, or an auto-decision recorded in `DECISIONS.md` in `mode=auto`.
259
250
  If it still fails, you can inspect the result file and retry manually:
260
251
 
261
252
  ```
@@ -284,7 +275,7 @@ If WORK-02 is `IN_PROGRESS`, the specifier asks:
284
275
  > What's the status of WORK-03: TASK-02?
285
276
  ```
286
277
 
287
- The scheduler reads `PROGRESS.md` and `result.md` files to report current state.
278
+ Orchestrator reads `PROGRESS.md` and `result.md` files to report current state.
288
279
 
289
280
  ---
290
281
 
@@ -337,10 +328,11 @@ uctm update --lang en
337
328
 
338
329
  ```bash
339
330
  git clone https://github.com/UCJung/uc-taskmanager-claude-agent.git /tmp/uc-tm
340
- mkdir -p .claude/agents
341
- cp /tmp/uc-tm/npm/agents/*.md .claude/agents/
331
+ mkdir -p .claude/agents .claude/references
332
+ cp /tmp/uc-tm/npm/agents/*.md .claude/agents/ # 6 agents (orchestrator, specifier, planner, builder, verifier, committer)
333
+ cp /tmp/uc-tm/npm/references/*.md .claude/references/ # 7 reference files
342
334
  rm -rf /tmp/uc-tm
343
- git add .claude/agents/ && git commit -m "chore: add uc-taskmanager agents"
335
+ git add .claude/agents/ .claude/references/ && git commit -m "chore: add uc-taskmanager agents"
344
336
  ```
345
337
 
346
338
  ### Local Plugin Test
@@ -355,50 +347,48 @@ claude --plugin-dir ./
355
347
  ```bash
356
348
  claude
357
349
  > /agents
358
- # specifier, planner, scheduler, builder, verifier, committer → confirm all 6
350
+ # orchestrator, specifier, planner, builder, verifier, committer → confirm all 6
359
351
  ```
360
352
 
361
353
  ---
362
354
 
363
- ## Concept: Three Execution Modes
355
+ ## Concept: Orchestrator Modes (Gated vs Auto)
364
356
 
365
- Main Claude detects the `[]` tag and calls the **specifier** subagent, which selects one of three `execution-mode` values:
357
+ Main Claude detects the `[]` tag and spawns a single **orchestrator** subagent, passing `mode=gated` (default) or `mode=auto` (when the request contains "auto"/"자동으로"). Orchestrator nests every other agent itself — Main Claude never calls specifier/planner/builder/verifier/committer directly:
366
358
 
367
359
  ```
368
- User Request → Main Claude (orchestrator)
369
-
370
-
371
- ┌───────────┐
372
- │ specifier │ (called by Main Claude)
373
- └─────┬─────┘
360
+ User Request → Main Claude
374
361
 
375
- execution-mode returned
376
-
377
- ├─ direct (no build/test required)
378
- │ → specifier returns dispatch XML → Main Claude calls builder → [verifier+committer]
379
-
380
- ├─ pipeline (build/test required, single domain, sequential)
381
- │ → Main Claude calls: [specifier+planner]builder [verifier+committer]
382
-
383
- └─ full (multi-domain / complex DAG / new module / 5+ tasks)
384
- → Main Claude calls: [specifier+planner] → scheduler → [builder → verifier+committer] × N
362
+ ▼ spawn once, mode=gated|auto
363
+ ┌──────────────┐
364
+ orchestrator │ TASK DAG scheduling + gate/decision mediation
365
+ └──────┬───────┘
366
+ nested spawn (depth 2)
367
+
368
+ specifier → Requirement.md ← [GATE-1]
369
+
370
+ planner → PLAN.md + TASK DAG [GATE-2]
371
+
372
+ STEP C: DAG-ordered [builder → verifier → committer] × N (parallel where READY)
385
373
  ```
386
374
 
387
- **Sub-agent Spawn Count by Mode:**
375
+ - `mode=gated`: pauses with `<gate type="stage">` after specifier (**[GATE-1]**) and after planner (**[GATE-2]**); also pauses anytime with `<gate type="decision">` (background + options + recommendation) when orchestrator or a nested child needs a user call. Main Claude relays the gate, waits for approval/choice, then resumes the parked orchestrator with `SendMessage` (falls back to a log-based re-spawn if the handle is gone).
376
+ - `mode=auto`: **one spawn, zero gates** — every judgment point is resolved with the recommended option and logged to `works/{WORK}/DECISIONS.md` plus the final report's `## 자동 결정 사항` section.
377
+ - Execution (STEP C: builder → verifier → committer) never gates on the user — only WORK creation (specifier) and planning (planner) do.
378
+
379
+ **Sub-agent Spawn Count:**
388
380
 
389
- | Mode | Spawns | Agents |
390
- |------|--------|--------|
391
- | direct | 3 | specifier + builder + verifier+committer |
392
- | pipeline | 3 | specifier+planner + builder + verifier+committer |
393
- | full (N TASKs) | 2+2N | specifier+planner + scheduler + [builder + verifier+committer] × N |
381
+ | Main → Orchestrator | Specifier | Planner | → Builder | → Verifier | → Committer | Total |
382
+ |:---:|:---:|:---:|:---:|:---:|:---:|:---:|
383
+ | 1 | 1 | 1 | N | N | N | **3 + 3N** |
394
384
 
395
- Compared to the previous approach (separate spawns): **6 TASKs: 20 14 spawns (-30%)**.
385
+ `gated` vs `auto` doesn't change the spawn count only whether execution pauses for approval (see [Approval Gates, Nested Autonomy, and DECISIONS.md](#approval-gates-nested-autonomy-and-decisionsmd) below, `agent-flow.md` § 4).
396
386
 
397
- All three modes output to `works/WORK-NN/` and guarantee `result.md` + `COMMITTER DONE` callback.
387
+ Every WORK outputs to `works/WORK-NN/` and guarantees `result.md` + `DECISIONS.md`.
398
388
 
399
- ### WORK (Multi-Task, full mode)
389
+ ### WORK and TASK
400
390
 
401
- A two-level hierarchy for complex features:
391
+ A two-level hierarchy:
402
392
 
403
393
  ```
404
394
  WORK (unit of work) A single goal. The unit requested by the user.
@@ -406,94 +396,83 @@ WORK (unit of work) A single goal. The unit requested by the user.
406
396
  └── result Completion proof. Auto-generated after verification.
407
397
  ```
408
398
 
409
- ### pipeline mode (Single Task, Delegated)
410
-
411
- Subagent-delegated path for moderate single tasks. specifier+planner run in a single spawn, then builder, then verifier+committer.
412
-
413
- ```
414
- Main Claude → [specifier+planner](opus) → builder(sonnet) → [verifier+committer](haiku)
415
- (each group called as a single spawn by Main Claude)
416
- ```
417
-
418
- ### direct mode (Trivial)
419
-
420
- Main Claude calls specifier, which determines direct mode and returns a dispatch XML. Main Claude then calls builder (implements the change) and verifier+committer (verifies and commits) as a single spawn.
399
+ Orchestrator nests planner once, then loops builder → verifier → committer per TASK in DAG order.
421
400
 
422
401
  ```
423
- Main Claude specifier: Analyze return dispatch XML → [back to Main Claude]
424
- Main Claude → builder: Implement Self-check[back to Main Claude]
425
- Main Claude [verifier+committer]: Verify Commit result.md
402
+ orchestratorplanner(opus, nested) PLAN.md + TASK DAG
403
+ [builder(sonnet)verifier(haiku)committer(haiku)] × N ← STEP C, no gates
404
+ (each nested spawn made by orchestrator, not Main Claude)
426
405
  ```
427
406
 
428
407
  ---
429
408
 
430
409
  ## Pipeline
431
410
 
432
- ### WORK Pipeline (Complex)
411
+ ### WORK Pipeline (Nested)
433
412
 
434
- > Subagents cannot nest — Main Claude (CLI terminal) orchestrates every call.
413
+ > Main Claude spawns `orchestrator` **once**. Every other call below is a *nested* sub-agent spawn made by orchestrator itself — Main Claude is not in this loop.
435
414
 
436
415
  ```
437
- Main Claude (orchestrator)
438
- ┌─────────────┼──────────────────────┐
439
- │ │ │
440
- specifier planner scheduler builder verifier committer
441
- ┌──────────┐ ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
442
- │Request │────▶│Create │────▶│Dependency│────▶│Code │────▶│Build/Test│────▶│Result
443
- Analysis │ │WORK/TASK│ │DAG+Order │ │Implement │ │Verify │→ git │
444
- └──────────┘ └─────────┘ └──────────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘
445
- │ │ │
446
- └── Retry on fail┘
447
- (max 3 times)
448
- Next TASK loop ◀┘
416
+ Main Claude ── spawn once (mode=gated|auto) ──▶ orchestrator
417
+ │ nested spawn (depth 2)
418
+ ┌─────────────┬──────────────────┴──────────────────┐
419
+ │ │ │
420
+ specifier planner builder verifier committer
421
+ ┌──────────┐ ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
422
+ Request │────▶│Create │──────────────▶│Code │────▶│Build/Test│────▶│Result
423
+ │Analysis │ │WORK/TASK│ │Implement │ │Verify │ │→ git
424
+ └────┬─────┘ └────┬────┘ └────┬─────┘ └────┬─────┘ └────┬─────┘
425
+ │ │ │
426
+ [GATE-1] [GATE-2] └── Retry on fail┘
427
+ (gated mode (gated mode (max 3 times, then │
428
+ only; yield only; yield <needs-decision> escalation) │
429
+ + SendMessage + SendMessage) Next READY TASK loop ◀┘
430
+ to resume) (orchestrator schedules the DAG itself — STEP C, no gate)
449
431
  ```
450
432
 
451
- ### pipeline mode (Simple Delegated)
433
+ - `mode=gated` (default): pause + yield at **[GATE-1]** (after specifier) and **[GATE-2]** (after planner); resume via `SendMessage(agentId, decision)`, fallback to log-based re-spawn.
434
+ - `mode=auto`: no gates — orchestrator completes the entire diagram in one spawn and records any judgment calls to `DECISIONS.md`.
435
+ - STEP C (the builder → verifier → committer loop) never gates on the user, in either mode.
452
436
 
453
- ```
454
- specifier+planner builder verifier+committer
455
- ┌──────────────┐ ┌──────────┐ ┌────────────────┐
456
- │PLAN │────▶│Code │────▶│Build/Test │
457
- │+TASK │ │Implement │ │Verify→ git │
458
- └──────────────┘ └──────────┘ └────────────────┘
459
- (opus, 1 spawn) (sonnet) (haiku, 1 spawn)
460
- ← each group called by Main Claude →
461
- ```
462
-
463
- ### direct mode (Trivial)
437
+ ### Stage Detail
464
438
 
465
439
  ```
466
- specifier builder verifier+committer
467
- ┌──────────┐ ┌──────────────────────┐ ┌──────────────┐
468
- Analyze │────▶│ Implement Self-chk │────▶│Verify→Commit
469
- dispatch └──────────────────────┘ │→ result
470
- └──────────┘ (no build/test required) └──────────────┘
440
+ specifier → planner → [builderverifiercommitter] × N
441
+ ┌──────────┐ ┌─────────┐ ┌──────────┐ ┌──────────┐ ┌────────────┐
442
+ Request │──▶│PLAN │──▶│Code │─▶│Build/Test│─▶│Resultgit
443
+ Analysis │ │+TASK DAG │Implement │Verify │ │ │
444
+ └──────────┘ └─────────┘ └──────────┘ └──────────┘ └────────────┘
445
+ (opus) (opus) (sonnet) (haiku) (haiku)
446
+ ← all nested spawns made by orchestrator →
471
447
  ```
472
448
 
473
449
  ### Agents
474
450
 
475
- Six agents work together in a clean, isolated pipeline:
451
+ Six agents work together in a clean, isolated pipeline — Main Claude spawns only `orchestrator`; orchestrator nests the rest:
476
452
 
477
453
  | Agent | Role | Model | Permission | MCP | Spawn |
478
454
  |-------|------|-------|------------|-----|-------|
479
- | **specifier** | `[]` tag detection, execution-mode selection (direct/pipeline/full), PLAN creation, WORK-LIST management, returns dispatch XML for all modes | **opus** | read + dispatch | Serena (codebase exploration), sequential-thinking (complexity check) | combined with planner (pipeline/full) |
480
- | **planner** | Create WORK + decompose TASKs + generate PLAN.md (full mode) + pre-create progress templates | **opus** | read-only | Serena (codebase exploration), sequential-thinking (task decomposition) | combined with specifier |
481
- | **scheduler** | Manage DAG for a specific WORK + run pipeline with sliding window context | **haiku** | read + dispatch | | standalone (full mode only) |
482
- | **builder** | Code implementation + progress.md checkpoint recording | **sonnet** | full access | Serena (symbol-level explore/edit) | standalone |
483
- | **verifier** | Progress gate (Status=COMPLETED) → build/lint/test verification (read-only) | **haiku** | read + execute | — | combined with committer |
484
- | **committer** | Gate check (progress.md) → write result.md → git commit → COMMITTER DONE callback | **haiku** | read + write + git | — | combined with verifier |
455
+ | **orchestrator** | Nests specifier→(planner)→builder→verifier→committer; schedules the TASK DAG (STEP C); mediates fixed/dynamic gates; batch-records the activity log | **opus** | read + nested spawn | Serena (optional) | spawned **once** by Main Claude per WORK |
456
+ | **specifier** | `[]` tag detection, requirement analysis, complexity assessment, WORK-LIST management, returns dispatch XML | **opus** | read + dispatch | Serena (codebase exploration), sequential-thinking (complexity check) | nested by orchestrator |
457
+ | **planner** | Create WORK + decompose TASKs + generate PLAN.md + pre-create progress templates | **opus** | read-only | Serena (codebase exploration), sequential-thinking (task decomposition) | nested by orchestrator |
458
+ | **builder** | Code implementation + progress.md checkpoint recording | **sonnet** | full access | Serena (symbol-level explore/edit) | nested by orchestrator, per TASK |
459
+ | **verifier** | Progress gate (Status=COMPLETED) → build/lint/test verification (read-only) | **haiku** | read + execute | — | nested by orchestrator, per TASK |
460
+ | **committer** | Gate check (progress.md) → write result.md → git commit | **haiku** | read + write + git | — | nested by orchestrator, per TASK |
461
+
462
+ > Activity-log recording is done **once, by orchestrator**, on behalf of the agent it just nested — child agents do not write logs themselves.
485
463
 
486
464
  ### Support Files (included in Plugin)
487
465
 
488
- In addition to the 6 pipeline agents, the plugin includes 6 support files that agents reference at startup.
489
- These are located in `plugin/skills/sdd-pipeline/references/` (synced from `develop/references/`):
466
+ In addition to the 6 pipeline agents, the plugin includes 7 support files that agents reference at startup.
467
+ These are located in `plugin/references/` (synced from `develop/references/`); when installed via npm they land in `.claude/references/`:
490
468
 
491
469
  | File | Purpose |
492
470
  |------|---------|
493
- | `agent-flow.md` | Pipeline orchestration rules — how Main Claude calls each agent in sequence |
471
+ | `agent-flow.md` | Pipeline orchestration rules — Main Claude's trigger/gate boundary + orchestrator's internal nested-spawn flow |
472
+ | `context-policy.md` | Sliding window context transfer rules between agents |
494
473
  | `file-content-schema.md` | Single source of truth for all file formats (PLAN.md, TASK.md, progress.md, result.md) |
474
+ | `ref-cache-protocol.md` | 4-step ref-cache protocol — checks `<ref-cache>` in the dispatch XML and skips disk reads when cached references are present |
495
475
  | `shared-prompt-sections.md` | Shared prompt sections with cache_control — reduces repeated token cost up to 90% |
496
- | `context-policy.md` | Sliding window context transfer rules between agents |
497
476
  | `work-activity-log.md` | Activity log format for builder stage tracking |
498
477
  | `xml-schema.md` | XML communication format for dispatch and task-result messages |
499
478
 
@@ -507,6 +486,8 @@ works/
507
486
  ├── WORK-01/ ← "User Authentication"
508
487
  │ ├── PLAN.md ← Plan + dependency graph
509
488
  │ ├── PROGRESS.md ← Progress tracking (auto-updated)
489
+ │ ├── work_WORK-01.log ← Orchestrator activity log (STAGE_*/GATE_WAIT/DECISION_WAIT/DECISION)
490
+ │ ├── DECISIONS.md ← Auto-decisions + resolved gate decisions (PENDING to RESOLVED)
510
491
  │ ├── TASK-00.md ← Task specification
511
492
  │ ├── TASK-00_progress.md ← Real-time checkpoint (builder writes)
512
493
  │ ├── TASK-00_result.md ← Completion report (committer writes)
@@ -525,6 +506,8 @@ works/
525
506
  | Completion report | `TASK-NN_result.md` |
526
507
  | Plan | `PLAN.md` |
527
508
  | Work progress | `PROGRESS.md` |
509
+ | Activity log | `work_{WORK_ID}.log` (orchestrator writes; drives gate resume) |
510
+ | Decision log | `DECISIONS.md` (auto-decisions + user-approved decisions, `PENDING`/`RESOLVED`) |
528
511
 
529
512
  ### WORK-LIST.md
530
513
 
@@ -572,7 +555,7 @@ Requests without `[]` tags are handled directly by Claude without routing. If yo
572
555
 
573
556
  ### Parallel TASKs
574
557
 
575
- The planner creates dependency-aware TASK graphs. Independent TASKs (same `blockedBy` set) can be dispatched concurrently by the scheduler — mention it when approving:
558
+ The planner creates dependency-aware TASK graphs. Independent TASKs (same `blockedBy` set) are dispatched concurrently by orchestrator's DAG scheduling (STEP C) — mention it when approving:
576
559
 
577
560
  ```
578
561
  > Approve. Run independent tasks in parallel.
@@ -586,7 +569,7 @@ If Claude loses context mid-pipeline, you can always resume:
586
569
  > Resume WORK-02 from where it stopped
587
570
  ```
588
571
 
589
- The scheduler reads `PROGRESS.md` to determine the last completed TASK and continues.
572
+ Orchestrator reads `work_{WORK}.log` (and `PROGRESS.md`) to determine the last completed stage/TASK and continues — reattaching via `SendMessage` if its parked handle is still alive, or a fresh nested re-spawn reconstructed from the log otherwise. An unresolved `GATE_WAIT`/`DECISION_WAIT` is always re-presented rather than skipped.
590
573
 
591
574
  ---
592
575
 
@@ -595,11 +578,15 @@ The scheduler reads `PROGRESS.md` to determine the last completed TASK and conti
595
578
  ```
596
579
  User: [new-feature] Build a comment feature for the blog system.
597
580
 
598
- Claude: [specifier WORK path]
599
- Complexity: 4+ files, DB schema change, multiple modules
581
+ Claude: [Main Claude spawns orchestrator once, mode=gated]
582
+
583
+ Claude: [orchestrator nests specifier → WORK path]
584
+ Complexity: 4+ files, DB schema change, multiple modules → Large
600
585
  → Creating new WORK
601
586
 
602
- Claude: [planner]
587
+ [GATE-1] Requirement approved — continuing to planner
588
+
589
+ Claude: [orchestrator nests planner]
603
590
  Project analysis
604
591
  Tech Stack: Next.js + Prisma + PostgreSQL
605
592
  Existing code: Post CRUD done, Auth done
@@ -612,11 +599,11 @@ Claude: [planner]
612
599
  WORK-03: TASK-03: Frontend comment component ← TASK-00 (parallelizable)
613
600
  WORK-03: TASK-04: Integration + notifications ← TASK-02, TASK-03
614
601
 
615
- Do you approve?
602
+ [GATE-2] Do you approve this plan?
616
603
 
617
- User: Approve. Run automatically.
604
+ User: Approve.
618
605
 
619
- Claude: [schedulerauto mode]
606
+ Claude: [orchestrator resumed via SendMessage STEP C: DAG execution, no further gates]
620
607
  WORK-03: TASK-00 → builder → verifier ✅ → committer [a1b2c3d]
621
608
  WORK-03: TASK-01 → builder → verifier ✅ → committer [d4e5f6g]
622
609
  WORK-03: TASK-02 → builder → verifier ✅ → committer [h7i8j9k]
@@ -624,6 +611,7 @@ Claude: [scheduler → auto mode]
624
611
  WORK-03: TASK-04 → builder → verifier ✅ → committer [p3q4r5s]
625
612
 
626
613
  🎉 WORK-03 completed! 5 tasks, 5 commits
614
+ ## 자동 결정 사항: 없음 (both gates required explicit approval)
627
615
  ```
628
616
 
629
617
  ---
@@ -664,13 +652,13 @@ Each agent file follows a consistent four-section structure:
664
652
 
665
653
  Each agent reads 4-5 shared reference files (shared-prompt-sections.md, file-content-schema.md, xml-schema.md, etc.) on startup — totaling ~26 file reads across a full pipeline. **ref-cache** eliminates this redundancy:
666
654
 
667
- 1. **First agent** reads reference files normally and returns `<ref-cache>` in its result XML
668
- 2. **Main Claude** copies ref-cache into the next agent's dispatch
669
- 3. **Subsequent agents** use cached content instead of reading files from disk
655
+ 1. **First agent** (orchestrator itself, per its STARTUP step) reads reference files normally and can return `<ref-cache>` when nesting the next agent's dispatch
656
+ 2. **Orchestrator** copies ref-cache into each nested child's dispatch instead of Main Claude relaying it
657
+ 3. **Subsequent nested agents** use cached content instead of reading files from disk
670
658
 
671
- Phase 2 (selective delivery) further reduces token usage by passing only the sections each agent needs — not the full file contents. The section mapping per agent is defined in `agent-flow.md`.
659
+ The protocol itself is defined in `references/ref-cache-protocol.md` (4 steps). Phase 2 (selective delivery) further reduces token usage by passing only the sections each agent needs — not the full file contents. The section mapping per agent is defined in `agent-flow.md`.
672
660
 
673
- **Measured impact** (direct mode, 3 agents):
661
+ **Measured impact** (3 agents):
674
662
  - File reads: 14 → 5 (**-64%**)
675
663
  - Token usage: ~85K → ~72K (**-15%**)
676
664
 
@@ -689,10 +677,10 @@ This ensures:
689
677
 
690
678
  ### Context Isolation
691
679
 
692
- Each subagent runs in an independent context. Even if the builder creates 50 files using 20,000 tokens, the scheduler only receives a 3-line summary.
680
+ Each subagent runs in an independent context. Even if the builder creates 50 files using 20,000 tokens, orchestrator (which nested it) only receives a 3-line summary via the sliding-window context-handoff.
693
681
 
694
682
  ```
695
- scheduler's context after 5 TASKs:
683
+ orchestrator's context after 5 TASKs:
696
684
 
697
685
  PLAN.md (loaded once) ~500 tokens
698
686
  WORK-01: TASK-00 result: "20 files, PASS" ~200 tokens
@@ -714,113 +702,19 @@ scheduler's context after 5 TASKs:
714
702
  | Tracking | Scroll chat history | File-based (PLAN.md, result.md) |
715
703
  | Verification | Manual | Automated (build/lint/test) |
716
704
 
717
- ### Router Rule Config (`.agent/router_rule_config.json`)
705
+ ### Approval Gates, Nested Autonomy, and DECISIONS.md
718
706
 
719
- The specifier reads `.agent/router_rule_config.json` from the project root to determine routing criteria. If the file is absent, the specifier uses its built-in defaults.
707
+ Main Claude spawns `orchestrator` exactly once per WORK; orchestrator alone decides when to nest specifier/planner/builder/verifier/committer, and when to pause and ask a human. Since nested sub-agents cannot prompt the user directly, **every approval or decision is surfaced at the Main Claude boundary**:
720
708
 
721
- **File location:**
722
- ```
723
- {project-root}/.agent/router_rule_config.json
724
- ```
709
+ - **Fixed gates** (`<gate type="stage">`) — exactly two, and only in `mode=gated` (the default): **[GATE-1]** right after specifier (Requirement.md ready), and **[GATE-2]** right after planner (PLAN.md + TASK DAG ready).
710
+ - **Dynamic gates** (`<gate type="decision">`) — raised by orchestrator or any nested child, at *any* point (design trade-off, scope creep, destructive change, 3 failed retries, ambiguous requirement…), carrying `<context>` + `<options>` + `<recommended>`.
711
+ - At a gate, orchestrator **yields (parks)** rather than exiting. Main Claude presents the gate, waits for the human, then resumes the parked orchestrator with `SendMessage(agentId, decision)` — context is preserved, no re-reading of files. If the handle is lost (new session, crashed terminal), Main Claude re-spawns orchestrator with the `WORK_ID`; orchestrator replays `work_{WORK}.log` and re-presents the exact same unresolved gate — **an unapproved gate is never silently skipped**, because `STAGE_DONE` is only ever written *after* the gate resolves.
712
+ - Once the final report lands, Main Claude calls `TaskStop(agentId)` to release the parked handle.
713
+ - `mode=auto` ("auto"/"자동으로" in the request) skips every gate: orchestrator resolves each judgment point with its own recommended option and completes in a single spawn.
725
714
 
726
- **JSON structure:**
727
- ```json
728
- {
729
- "$schema": "http://uc-taskmanager.local/schemas/specifier-rules/v1.0.json",
730
- "version": "1.1.0",
731
- "description": "Specifier execution-mode decision criteria. Customize per project.",
732
- "decision_flow": [
733
- "1. build_test_required? → false → direct",
734
- "2. single_domain + sequential DAG → pipeline",
735
- "3. any full_conditions met → full"
736
- ],
737
- "rules": {
738
- "direct": {
739
- "criteria": {
740
- "build_test_required": false,
741
- "note": "File/line count irrelevant. If no build/test needed → direct (text edits, config changes, simple substitutions)"
742
- }
743
- },
744
- "pipeline": {
745
- "criteria": {
746
- "build_test_required": true,
747
- "single_domain_only": true,
748
- "max_tasks": 5,
749
- "dag_complexity": "sequential"
750
- }
751
- },
752
- "full": {
753
- "criteria": {
754
- "any_of": [
755
- "task_count > 5",
756
- "dag_complexity == complex (2+ dependency levels)",
757
- "multi_domain == true (BE + FE simultaneously)",
758
- "new_module == true (design → implement → verify multi-phase)",
759
- "partial_rollback_needed == true"
760
- ]
761
- }
762
- }
763
- },
764
- "customization_guide": {
765
- "doc-heavy projects (md edits)": "Widen direct scope. Most build_test_required=false cases → direct",
766
- "code-heavy projects": "Center on pipeline/full. Simple bug fixes → pipeline, multi-domain → full",
767
- "max_tasks tuning": "Adjust pipeline max_tasks between 3–7 based on team size or context limits"
768
- }
769
- }
770
- ```
715
+ Every decision — whether a human approved it or orchestrator auto-resolved it — is written to `works/{WORK_ID}/DECISIONS.md` (status `PENDING` while parked, `RESOLVED` once settled) and summarized in the final report's `## 자동 결정 사항` section. STEP C itself (the builder → verifier → committer TASK loop) never gates, in either mode — it's the part of the pipeline nobody needs to approve.
771
716
 
772
- **Key fields:**
773
- | Field | Description |
774
- |-------|-------------|
775
- | `rules.direct.criteria.build_test_required` | `false` → specifier handles implementation, then committer commits |
776
- | `rules.pipeline.criteria.max_tasks` | Max task count before escalating to full (default: 5) |
777
- | `rules.pipeline.criteria.dag_complexity` | `sequential` only; complex DAG → escalates to full |
778
- | `rules.full.criteria.any_of` | List of conditions — any match triggers full mode |
779
-
780
- **Fallback behavior:** If `.agent/router_rule_config.json` is absent or malformed, the specifier falls back to its built-in defaults (equivalent to the structure above).
781
-
782
- **Per-project customization example:**
783
-
784
- For a documentation-heavy project where most changes are text edits:
785
- ```json
786
- {
787
- "rules": {
788
- "direct": {
789
- "criteria": { "build_test_required": false }
790
- },
791
- "pipeline": {
792
- "criteria": { "max_tasks": 3, "single_domain_only": true, "dag_complexity": "sequential" }
793
- }
794
- }
795
- }
796
- ```
797
-
798
- For a monorepo with strict build requirements:
799
- ```json
800
- {
801
- "rules": {
802
- "pipeline": {
803
- "criteria": { "max_tasks": 7 }
804
- },
805
- "full": {
806
- "criteria": {
807
- "any_of": ["task_count > 7", "multi_domain == true"]
808
- }
809
- }
810
- }
811
- }
812
- ```
813
-
814
- ### Three Execution Modes
815
-
816
- The specifier matches effort to complexity via `execution-mode`:
817
- - **direct**: 1-line typo fix — Main Claude calls specifier, which returns a dispatch XML. Main Claude then calls builder (implements) + [verifier+committer] (verifies and commits). 3 spawns total.
818
- - **pipeline**: Moderate fix — Main Claude calls [specifier+planner] → builder → [verifier+committer] in sequence. 3 spawns total.
819
- - **full**: Complex features — [specifier+planner] → scheduler → [builder + verifier+committer] × N. 2+2N spawns total.
820
-
821
- Agent pairs are combined into a single spawn to eliminate redundant context loading. This reduces total spawns by **~30%** across all modes.
822
-
823
- All three modes output to `works/WORK-NN/` with identical artifact structure (PLAN.md + result.md + COMMITTER DONE callback), ensuring Runner integration works regardless of mode.
717
+ Both modes (gated/auto) output to `works/WORK-NN/` with identical artifact structure (PLAN.md + result.md + `DECISIONS.md`), ensuring downstream integration works regardless of mode.
824
718
 
825
719
  ### Structured Agent Communication
826
720
 
@@ -828,7 +722,7 @@ Instead of ambiguous natural language prompts, agents communicate using structur
828
722
 
829
723
  **Dispatch Format** (Caller → Receiver):
830
724
  ```xml
831
- <dispatch to="builder" work="WORK-03" task="TASK-00" execution-mode="pipeline">
725
+ <dispatch to="builder" work="WORK-03" task="TASK-00">
832
726
  <context>
833
727
  <project>uc-taskmanager</project>
834
728
  <language>ko</language>
@@ -848,7 +742,7 @@ Instead of ambiguous natural language prompts, agents communicate using structur
848
742
  <task-result work="WORK-03" task="TASK-00" agent="builder" status="PASS">
849
743
  <summary>Created shared-prompt-sections.md and xml-schema.md</summary>
850
744
  <files-changed>
851
- <file action="created" path="agents/shared-prompt-sections.md">Common sections with cache_control</file>
745
+ <file action="created" path="references/shared-prompt-sections.md">Common sections with cache_control</file>
852
746
  </files-changed>
853
747
  <verification>
854
748
  <check name="file_existence" status="PASS">Both files created</check>
@@ -862,7 +756,7 @@ Instead of ambiguous natural language prompts, agents communicate using structur
862
756
  - **Prompt Caching**: Common sections (Output Language Rule, Build Commands) are marked with Anthropic API `cache_control`, saving up to **90% on repeated tokens**
863
757
  - **Scalability**: Cache hit rates improve with WORK count (5 TASKs at ~0.03 tokens/token vs 2K+ tokens without cache)
864
758
 
865
- See `agents/xml-schema.md` for complete format, and `agents/shared-prompt-sections.md` for cacheable sections.
759
+ See `references/xml-schema.md` for complete format, and `references/shared-prompt-sections.md` for cacheable sections.
866
760
 
867
761
  ### Sliding Window Context Transfer
868
762
 
@@ -893,24 +787,6 @@ Each agent outputs a **context-handoff** — a structured reasoning document, no
893
787
 
894
788
  See `docs/spec_sliding-window-context.md` for full design details.
895
789
 
896
- ### External System Callback (Optional)
897
-
898
- uc-taskmanager is generic by default. To integrate with an external system (e.g., a CI/CD backend), add callback URLs to `CLAUDE.md`:
899
-
900
- ```markdown
901
- ## Task Callbacks
902
- TaskCallback: http://localhost:3000/api/v1/runner/{{executionId}}/task-result
903
- ProgressCallback: http://localhost:3000/api/v1/runner/{{executionId}}/task-progress
904
- CallbackToken: <your-token>
905
- ```
906
-
907
- - **No config** → works as-is, no external calls made
908
- - **TaskCallback** → committer POSTs result after each TASK commit
909
- - **ProgressCallback** → builder POSTs checkpoint after each progress.md update
910
- - Callback failures are non-fatal — a warning is printed and the pipeline continues
911
-
912
- See `docs/spec_callback-integration.md` for payload schema and implementation guide.
913
-
914
790
  ---
915
791
 
916
792
  ## Output Language
@@ -963,8 +839,9 @@ Place a file with the same name in `.claude/agents/` to override.
963
839
 
964
840
  | What | File | Section |
965
841
  |------|------|---------|
966
- | Routing criteria | `specifier.md` | 3-2. Execution-Mode 결정 |
967
- | Approval policy | `scheduler.md` | Phase 1: User Approval |
842
+ | Complexity criteria | `specifier.md` | 4. 역할 결정 |
843
+ | Approval gates / mode handling | `orchestrator.md` | 3-3. 게이트 동적 의사결정 |
844
+ | TASK DAG scheduling / retries | `orchestrator.md` | STEP C: TASK DAG 실행 |
968
845
  | Commit message format | `committer.md` | Step 3: Stage + Commit |
969
846
  | Verification steps | `verifier.md` | Verification Pipeline |
970
847
  | Task granularity | `planner.md` | Task Decomposition Rules |
@@ -995,27 +872,32 @@ Auto-detected from project files. No configuration needed.
995
872
  uc-taskmanager/
996
873
  ├── develop/ ← Source of truth (edit here)
997
874
  │ ├── agents/ ← 6 agent prompts (language-agnostic)
998
- │ │ ├── specifier.md [] tag detection + execution-mode routing
875
+ │ │ ├── orchestrator.md Nested spawn coordinator: specifier→(planner)→builder→verifier→committer, TASK DAG scheduling, gates/decisions, batch log
876
+ │ │ ├── specifier.md ← [] tag detection + requirement analysis
999
877
  │ │ ├── planner.md ← WORK creation + TASK decomposition
1000
- │ │ ├── scheduler.md ← DAG management + pipeline orchestration
1001
878
  │ │ ├── builder.md ← Code implementation
1002
879
  │ │ ├── verifier.md ← Build/lint/test verification
1003
880
  │ │ └── committer.md ← git commit + result.md
1004
- │ ├── references/ ← 6 support files (shared across agents)
1005
- │ │ ├── agent-flow.md ← Pipeline orchestration rules
1006
- │ │ ├── file-content-schema.md File format definitions
1007
- │ │ ├── shared-prompt-sections.md Cacheable shared sections
1008
- │ │ ├── context-policy.md Sliding window context rules
1009
- │ │ ├── work-activity-log.md ← Activity log format
1010
- │ │ └── xml-schema.md XML communication format
1011
- ├── skills/ Skill definitions
1012
- └── hooks/ Hook scripts
881
+ │ ├── references/ ← 7 support files (shared across agents)
882
+ │ │ ├── agent-flow.md ← Pipeline orchestration rules
883
+ │ │ ├── context-policy.md Sliding window context rules
884
+ │ │ ├── file-content-schema.md File format definitions
885
+ │ │ ├── ref-cache-protocol.md ref-cache protocol (4 steps)
886
+ │ │ ├── shared-prompt-sections.md ← Cacheable shared sections
887
+ │ │ ├── work-activity-log.md Activity log format
888
+ │ └── xml-schema.md XML communication format
889
+ ├── skills/ Skill definitions (sdd-pipeline, uctm-init, work-pipeline, work-status)
890
+ │ └── .claude-plugin/
891
+ │ └── plugin.json ← Plugin manifest source (name, version, agents array)
1013
892
  ├── npm/ ← npm package (published as `uctm`)
1014
- │ ├── agents/ ← Synced from develop/agents/ + develop/references/
893
+ │ ├── agents/ ← Synced from develop/agents/
894
+ │ ├── references/ ← Synced from develop/references/ (7 files)
895
+ │ ├── skills/ ← Synced from develop/skills/ (4 SKILL.md)
1015
896
  │ ├── bin/cli.mjs ← CLI entry point (uctm init/update)
1016
897
  │ ├── lib/ ← CLI implementation (constants.mjs, init.mjs, update.mjs)
1017
- │ ├── .agent/ ← Default router config bundled with npm
1018
- │ │ └── router_rule_config.json
898
+ │ ├── .claude-plugin/
899
+ │ │ └── plugin.json ← Synced from develop/.claude-plugin/plugin.json
900
+ │ ├── README.md ← Synced from README.md (exposed on npmjs.com)
1019
901
  │ ├── package.json ← npm package config
1020
902
  │ ├── .npmignore
1021
903
  │ └── LICENSE
@@ -1024,17 +906,15 @@ uc-taskmanager/
1024
906
  │ ├── references/ ← Synced from develop/references/
1025
907
  │ ├── skills/ ← Plugin skills
1026
908
  │ │ ├── sdd-pipeline/
1027
- │ │ │ ├── SKILL.md ← Skill manifest
1028
- │ │ │ └── references/ ← Synced from develop/references/
909
+ │ │ │ └── SKILL.md ← Skill manifest
910
+ │ │ ├── uctm-init/
911
+ │ │ │ └── SKILL.md ← /uctm-init (setup works/, CLAUDE.md, permissions)
1029
912
  │ │ ├── work-pipeline/
1030
913
  │ │ │ └── SKILL.md
1031
- │ │ ├── work-status/
1032
- │ │└── SKILL.md
1033
- └── init/
1034
- └── SKILL.md /uctm-init (setup works/, CLAUDE.md, permissions)
1035
- │ ├── .claude-plugin/
1036
- │ │ └── plugin.json ← Plugin manifest (name, version, agents array)
1037
- │ └── README.md
914
+ │ │ └── work-status/
915
+ │ │ └── SKILL.md
916
+ │ └── .claude-plugin/
917
+ │ └── plugin.json Plugin manifest (name, version, agents array)
1038
918
  ├── .claude/ ← Local Claude settings (not committed)
1039
919
  │ └── settings.local.json
1040
920
  ├── README.md ← English (default, this file)
@@ -1044,16 +924,14 @@ uc-taskmanager/
1044
924
  ├── docs/ ← Design specifications
1045
925
  │ ├── spec_pipeline-architecture_v1.3.md ← Pipeline architecture v1.3 (ref-cache, Specifier-based)
1046
926
  │ ├── spec_sliding-window-context.md ← Sliding window context design
1047
- │ ├── spec_callback-integration.md ← External system callback integration
1048
927
  │ ├── spec_SDD_with_ucagent_requirement.md ← SDD v1.5 requirement management system design
1049
928
  │ ├── pipeline-architecture-v1.3-visual.html ← Interactive pipeline visualization (with ref-cache tab)
1050
929
  │ ├── SDD-requirement-visual.html ← Interactive SDD visualization (with ref-cache tab)
1051
- │ ├── callback-integration-visual.html ← Interactive callback visualization
1052
930
  │ ├── sliding-window-context-visual.html ← Interactive sliding window visualization
1053
931
  │ └── _archive/ ← Legacy docs (Router-based)
1054
932
  └── works/ ← WORK directories (auto-generated)
1055
933
  ├── WORK-LIST.md ← Master index
1056
- ├── WORK-01/ ← all modes output here (direct/pipeline/full)
934
+ ├── WORK-01/ ← every WORK outputs here
1057
935
  └── ...
1058
936
  ```
1059
937