uctm 1.3.2 → 1.5.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.
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "uc-taskmanager",
3
+ "version": "1.4.0",
4
+ "agents": [
5
+ "./agents/specifier.md",
6
+ "./agents/planner.md",
7
+ "./agents/scheduler.md",
8
+ "./agents/builder.md",
9
+ "./agents/verifier.md",
10
+ "./agents/committer.md"
11
+ ],
12
+ "description": "SDD WORK-PIPELINE Agent — Requirements analysis & development 6-agent full pipeline with DAG-based orchestration and sliding window context management",
13
+ "author": {
14
+ "name": "UCJung",
15
+ "url": "https://github.com/UCJung"
16
+ },
17
+ "homepage": "https://github.com/UCJung/uc-taskmanager-claude-agent",
18
+ "repository": "https://github.com/UCJung/uc-taskmanager-claude-agent",
19
+ "license": "GPL-3.0",
20
+ "keywords": [
21
+ "task-manager",
22
+ "pipeline",
23
+ "sub-agents",
24
+ "sdd",
25
+ "dag-orchestration",
26
+ "work-pipeline",
27
+ "automation"
28
+ ]
29
+ }
@@ -28,41 +28,37 @@
28
28
 
29
29
  ```
30
30
  1. Invoke specifier → creates Requirement.md + PLAN.md + TASK-00 + returns builder dispatch XML
31
- 2. [1 approval] User review (integrated requirement + design)
31
+ 2. STOP Present summary to user and WAIT for approval (do NOT invoke builder)
32
32
  3. Invoke builder (dispatch XML as prompt) — includes self-check
33
- 4. Invoke committer (builder result as prompt)
33
+ 4. Invoke verifier+committer (builder result as prompt) — verify then commit in one spawn
34
34
  ```
35
35
 
36
- > Verifier skipped: Builder performs self-check (build/lint), so separate verification is unnecessary for a single TASK.
36
+ > Verifier+Committer combined: single spawn performs verification, then creates result.md and git commit.
37
37
 
38
38
  ---
39
39
 
40
40
  ## Pipeline Mode (Separate Planner Invocation)
41
41
 
42
42
  ```
43
- 1. Invoke specifier → creates Requirement.md + returns planner dispatch XML
44
- 2. [Planning approval] User review (Requirement.md)
45
- 3. Invoke planner (dispatch XML as prompt) → creates PLAN.md + TASK-NN + determines execution-mode
46
- 4. [Development approval] User review (PLAN.md + TASK list)
47
- 5. Invoke builder (per-TASK dispatch XML as prompt)
48
- 6. Invoke verifier (builder result as prompt)
49
- 7. Invoke committer (verifier result as prompt)
43
+ 1. Invoke specifier+planner (single spawn) → creates Requirement.md + PLAN.md + TASK-NN + determines execution-mode
44
+ 2. STOP Present Requirement.md + PLAN.md + TASK list and WAIT for approval
45
+ 3. Invoke builder (per-TASK dispatch XML as prompt)
46
+ 4. Invoke verifier+committer (builder result as prompt) verify then commit in one spawn
50
47
  ```
51
48
 
49
+ > Specifier+Planner combined: specifier.md role first (Requirement.md), then planner.md role (PLAN.md + TASKs) in one spawn.
50
+
52
51
  ---
53
52
 
54
53
  ## Full Mode (With Scheduler)
55
54
 
56
55
  ```
57
- 1. Invoke specifier → creates Requirement.md + returns planner dispatch XML
58
- 2. [Planning approval] User review (Requirement.md)
59
- 3. Invoke plannerPLAN.md + TASK decomposition + execution-mode: full
60
- 4. [Development approval] User review (PLAN.md + TASK list)
61
- 5. Invoke scheduler DAG analysis + READY TASK + returns builder dispatch XML
62
- 6. Invoke builder (dispatch XML as prompt) implementation
63
- 7. Invoke verifier (builder result as prompt) → verification
64
- 8. Invoke committer (verifier result as prompt) → commit
65
- 9. If incomplete TASKs remain, return to step 5
56
+ 1. Invoke specifier+planner (single spawn) → Requirement.md + PLAN.md + TASKs + execution-mode: full
57
+ 2. STOP Present Requirement.md + PLAN.md + TASK list and WAIT for approval
58
+ 3. Invoke schedulerDAG analysis + READY TASK + returns builder dispatch XML
59
+ 4. Invoke builder (dispatch XML as prompt) implementation
60
+ 5. Invoke verifier+committer (builder result as prompt) verify then commit in one spawn
61
+ 6. If incomplete TASKs remain, return to step 3
66
62
  ```
67
63
 
68
64
  Parallel execution: When scheduler returns multiple READY TASKs, invoke builders concurrently.
@@ -75,42 +71,102 @@ Resume pipeline for a WORK that already has PLAN.md + TASKs:
75
71
 
76
72
  ```
77
73
  1. Invoke scheduler → check READY TASKs + return builder dispatch XML
78
- 2. Execute builder → verifier → committer in sequence
79
- 3. If incomplete TASKs remain, return to step 1
74
+ 2. Invoke builder → implementation
75
+ 3. Invoke verifier+committer verify then commit in one spawn
76
+ 4. If incomplete TASKs remain, return to step 1
80
77
  ```
81
78
 
82
79
  ---
83
80
 
81
+ ## Combined Agent Invocation
82
+
83
+ ### Specifier+Planner (single spawn)
84
+
85
+ When invoking specifier in pipeline/full mode, include both agent definitions:
86
+
87
+ ```
88
+ Prompt to agent:
89
+ "You will perform two roles in sequence.
90
+
91
+ Role 1 — Specifier: Read specifier.md and create Requirement.md.
92
+ Role 2 — Planner: Read planner.md and create PLAN.md + TASK files.
93
+
94
+ Execute Role 1 first, then Role 2. Return the combined result."
95
+ ```
96
+
97
+ - Use specifier's model (opus) for the spawn
98
+ - Agent reads both specifier.md and planner.md from REFERENCES_DIR
99
+ - Returns: Requirement.md + PLAN.md + TASK files + execution-mode
100
+
101
+ ### Verifier+Committer (single spawn)
102
+
103
+ When invoking verification after builder completes:
104
+
105
+ ```
106
+ Prompt to agent:
107
+ "You will perform two roles in sequence.
108
+
109
+ Role 1 — Verifier: Read verifier.md and verify build/lint/test.
110
+ Role 2 — Committer: Read committer.md and create result.md + git commit.
111
+
112
+ Execute Role 1 first. If verification PASSES, execute Role 2.
113
+ If verification FAILS, skip Role 2 and return FAIL result."
114
+ ```
115
+
116
+ - Use verifier's model (haiku) for the spawn
117
+ - Agent reads both verifier.md and committer.md from REFERENCES_DIR
118
+ - On PASS: returns verification result + commit hash
119
+ - On FAIL: returns verification failure only (no commit)
120
+
121
+ ---
122
+
84
123
  ## Agent Role Summary
85
124
 
86
- | Agent | Return Value | Invoked By |
87
- |-------|-------------|------------|
88
- | specifier | Requirement.md + (when assumed) PLAN.md/TASK + dispatch XML | Main Claude |
89
- | planner | PLAN.md/TASK files created + execution-mode | Main Claude |
90
- | scheduler | READY TASK + dispatch XML | Main Claude |
91
- | builder | task-result XML (including context-handoff) | Main Claude |
92
- | verifier | task-result XML | Main Claude |
93
- | committer | task-result XML + commit hash | Main Claude |
125
+ | Agent | Role | Model | Combined With |
126
+ |-------|------|-------|---------------|
127
+ | specifier | Requirement analysis | opus | + planner (pipeline/full) |
128
+ | planner | PLAN + TASK decomposition | opus | combined into specifier spawn |
129
+ | scheduler | DAG management + dispatch | haiku | standalone |
130
+ | builder | Code implementation | sonnet | standalone |
131
+ | verifier | Build/lint/test verification | haiku | + committer |
132
+ | committer | Result report + git commit | haiku | combined into verifier spawn |
94
133
 
95
134
  ---
96
135
 
97
- ## Sub-agent Invocation Count by Mode
136
+ ## Sub-agent Spawn Count by Mode
137
+
138
+ | Mode | Spec+Plan | Scheduler | Builder | Veri+Commit | Total |
139
+ |------|:---------:|:---------:|:-------:|:-----------:|:-----:|
140
+ | direct | 1 (assumed) | — | 1 | 1 | **3** |
141
+ | pipeline | 1 (combined) | — | 1 | 1 | **3** |
142
+ | full (N TASKs) | 1 (combined) | 1 | N | N | **2 + 2N** |
98
143
 
99
- | Mode | Specifier | Planner | Scheduler | Builder | Verifier | Committer | Total |
100
- |------|:---------:|:-------:|:---------:|:-------:|:--------:|:---------:|:-----:|
101
- | direct | O (assumed) | X | X | O | X | O | **3** |
102
- | pipeline | O | O | X | O | O | O | **5** |
103
- | full | O | O | O | O | O | O | **6** |
144
+ **Before vs After (6 TASKs):**
145
+
146
+ | | Before | After | Reduction |
147
+ |---|:---:|:---:|:---:|
148
+ | Spawns | 2 + 3×6 = 20 | 2 + 2×6 = 14 | **-30%** |
104
149
 
105
150
  ---
106
151
 
107
- ## Approval Gates
152
+ ## Approval Gates (CRITICAL)
153
+
154
+ > **MUST STOP and wait for explicit user approval before invoking the next agent.**
155
+ > Do NOT proceed until the user says "approve", "승인", "proceed", "go ahead", or equivalent.
156
+ > The only exception is auto mode — when the user's original message contains "auto" or "자동으로".
108
157
 
109
- | Mode | Approvals | Timing |
110
- |------|:---------:|--------|
111
- | direct | 1 | After Specifier completes (integrated requirement + design) |
112
- | pipeline/full | 2 | Planning approval (Requirement.md) Development approval (PLAN.md) |
113
- | auto-approve | 0 | When "proceed automatically" is explicitly stated |
158
+ | Mode | Approvals | Timing | What to show user |
159
+ |------|:---------:|--------|-------------------|
160
+ | direct | 1 | After Specifier completes | Requirement.md + PLAN.md + TASK-00.md summary |
161
+ | pipeline/full | 1 | After Specifier+Planner completes | Requirement.md + PLAN.md + TASK list |
162
+ | auto-approve | 0 | | Skip all approval gates |
163
+
164
+ > Note: pipeline/full now has **1 approval** (not 2), since specifier and planner run in one spawn.
165
+
166
+ **How to request approval:**
167
+ 1. Present a summary of what the specifier+planner created (files, scope, execution-mode)
168
+ 2. Ask: "Proceed?" or equivalent
169
+ 3. **WAIT for user response** — do NOT invoke builder until approved
114
170
 
115
171
  ---
116
172
 
@@ -173,3 +229,51 @@ If REFERENCES_DIR is not available (e.g., npm installation without plugin), sub-
173
229
  | Previous | FULL | what + why + caution + incomplete |
174
230
  | 2 steps back | SUMMARY | what 1-2 lines |
175
231
  | 3+ steps | DROP | Not passed |
232
+
233
+ ---
234
+
235
+ ## ref-cache Chain Propagation
236
+
237
+ `<ref-cache>` carries pre-loaded reference file contents through the pipeline, eliminating redundant disk reads in each sub-agent.
238
+
239
+ ### Rules
240
+
241
+ 1. **First agent (typically specifier)** — no ref-cache available on dispatch. Reads reference files from `REFERENCES_DIR` normally.
242
+
243
+ 2. **Agent returns task-result** — if the agent supports ref-cache, it includes `<ref-cache>` in its task-result XML containing all reference files it loaded.
244
+
245
+ 3. **Main Claude propagates ref-cache** — when dispatching the next agent, copy the `<ref-cache>` block from the previous task-result into the new dispatch XML unchanged.
246
+
247
+ 4. **Receiving agent skips file reads** — when `<ref-cache>` is present in the dispatch XML, the agent reads reference content from `<ref>` elements instead of reading files from disk.
248
+
249
+ 5. **Missing ref-cache** — if a task-result does not contain `<ref-cache>` (agent does not support it yet), omit `<ref-cache>` from the next dispatch. The receiving agent falls back to reading files from disk.
250
+
251
+ ### Flow Example
252
+
253
+ ```
254
+ specifier+planner (no ref-cache in) → reads files → returns task-result with <ref-cache>
255
+ ↓ Main Claude copies <ref-cache> into dispatch
256
+ builder (ref-cache in) → skips file reads → returns task-result with <ref-cache>
257
+ ↓ Main Claude copies <ref-cache> into dispatch
258
+ verifier+committer (ref-cache in) → skips file reads → commit
259
+ ```
260
+
261
+ ### Phase 2: Selective Section Delivery
262
+
263
+ Instead of passing full reference files, Main Claude extracts only the sections each agent needs. This reduces dispatch token size by 50-70%.
264
+
265
+ **Main Claude reads reference files once at pipeline start**, then delivers condensed `<ref-cache>` per agent using this mapping:
266
+
267
+ | Agent | shared-prompt-sections | file-content-schema | xml-schema | context-policy | work-activity-log |
268
+ |-------|:---:|:---:|:---:|:---:|:---:|
269
+ | **specifier+planner** | §1,§2,§7,§8,§9,§11 | §0,§1,§2,§3 | §1,§3 | — | full |
270
+ | **scheduler** | §4,§8,§10 | §1,§6 | §1,§3,§4,§5 | full | full |
271
+ | **builder** | §1,§2,§10,§12 | §2,§3 | §1,§2,§4 | Builder section | full |
272
+ | **verifier+committer** | §1,§2,§8,§10,§12 | §3,§4,§5,§6,§7 | §1,§2,§4 | Verifier+Committer | full |
273
+
274
+ **Delivery format**: Condense each `<ref key="">` to contain only the needed sections, not the full file. Use one-line summaries for simple rules, keep full content only for templates and code blocks.
275
+
276
+ ### Constraints
277
+
278
+ - **ref-cache does not replace REFERENCES_DIR** — always pass `REFERENCES_DIR` (or `<references-dir>`) in every dispatch regardless of ref-cache presence, for backward compatibility.
279
+ - **Agents may still read files** — if ref-cache content is insufficient, agents fall back to reading from disk.
package/agents/builder.md CHANGED
@@ -35,13 +35,24 @@ You are the **Builder** — the implementation agent that receives a TASK specif
35
35
 
36
36
  **Resolve REFERENCES_DIR**: Check your input for `REFERENCES_DIR=...` line or `<references-dir>` XML element. Use that absolute path. If not provided, default to `.claude/agents`.
37
37
 
38
- | File | Purpose |
39
- |------|---------|
40
- | `{REFERENCES_DIR}/file-content-schema.md` | File format schema |
41
- | `{REFERENCES_DIR}/shared-prompt-sections.md` | Common rules (TASK ID, PLAN.md 7 fields, WORK-LIST) |
42
- | `{REFERENCES_DIR}/xml-schema.md` | XML communication format |
43
- | `{REFERENCES_DIR}/context-policy.md` | Sliding window rules |
44
- | `{REFERENCES_DIR}/work-activity-log.md` | Activity Log rules (log_work function, STAGE table) |
38
+ #### Reference Loading (ref-cache)
39
+
40
+ 1. Check if `<ref-cache>` exists in the received dispatch XML
41
+ 2. For each required reference file:
42
+ - If present in ref-cache **SKIP file read**, use cached content
43
+ - If absent from ref-cache → Read from `{REFERENCES_DIR}/{filename}.md` and add to ref-cache
44
+ 3. On task completion, include the merged `<ref-cache>` in the returned task-result XML
45
+ 4. **Backward compatibility**: If dispatch contains no `<ref-cache>`, read all reference files normally (existing behavior)
46
+
47
+ Required reference files for this agent:
48
+
49
+ | File | ref-cache key |
50
+ |------|---------------|
51
+ | `{REFERENCES_DIR}/file-content-schema.md` | `file-content-schema` |
52
+ | `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
53
+ | `{REFERENCES_DIR}/xml-schema.md` | `xml-schema` |
54
+ | `{REFERENCES_DIR}/context-policy.md` | `context-policy` |
55
+ | `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
45
56
 
46
57
  ### 3-2. XML Input Parsing
47
58
 
@@ -115,6 +126,7 @@ Invoked after each major checkpoint update. Continues implementation even on fai
115
126
 
116
127
  → task-result XML base structure: see `xml-schema.md` § 2
117
128
  → context-handoff element: see `xml-schema.md` § 4
129
+ → ref-cache element: see `xml-schema.md` § 6
118
130
 
119
131
  Builder-specific additional fields:
120
132
 
@@ -124,6 +136,12 @@ Builder-specific additional fields:
124
136
  <check name="lint" status="PASS" />
125
137
  </self-check>
126
138
  <notes>{items for verifier to check}</notes>
139
+ <ref-cache>
140
+ <!-- Include all reference files loaded during this execution (from disk or received ref-cache) -->
141
+ <ref key="shared-prompt-sections">{content}</ref>
142
+ <ref key="xml-schema">{content}</ref>
143
+ <!-- ... other keys loaded ... -->
144
+ </ref-cache>
127
145
  ```
128
146
 
129
147
  ### 3-9. Retry Protocol
@@ -34,13 +34,24 @@ You are the **Committer** — the agent that generates the result report for a v
34
34
 
35
35
  **Resolve REFERENCES_DIR**: Check your input for `REFERENCES_DIR=...` line or `<references-dir>` XML element. Use that absolute path. If not provided, default to `.claude/agents`.
36
36
 
37
- | File | Purpose |
38
- |------|---------|
39
- | `{REFERENCES_DIR}/file-content-schema.md` | File format schema |
40
- | `{REFERENCES_DIR}/shared-prompt-sections.md` | Common rules |
41
- | `{REFERENCES_DIR}/xml-schema.md` | XML communication format |
42
- | `{REFERENCES_DIR}/context-policy.md` | Sliding window rules |
43
- | `{REFERENCES_DIR}/work-activity-log.md` | Activity Log rules (log_work function, STAGE table) |
37
+ #### Reference Loading (ref-cache)
38
+
39
+ 1. Check if `<ref-cache>` exists in the received dispatch XML
40
+ 2. For each required reference file:
41
+ - If present in ref-cache **SKIP file read**, use cached content
42
+ - If absent from ref-cache → Read from `{REFERENCES_DIR}/{filename}.md` and add to ref-cache
43
+ 3. On task completion, include the merged `<ref-cache>` in the returned task-result XML
44
+ 4. **Backward compatibility**: If dispatch contains no `<ref-cache>`, read all reference files normally (existing behavior)
45
+
46
+ Required reference files for this agent:
47
+
48
+ | File | ref-cache key |
49
+ |------|---------------|
50
+ | `{REFERENCES_DIR}/file-content-schema.md` | `file-content-schema` |
51
+ | `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
52
+ | `{REFERENCES_DIR}/xml-schema.md` | `xml-schema` |
53
+ | `{REFERENCES_DIR}/context-policy.md` | `context-policy` |
54
+ | `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
44
55
 
45
56
  ### 3-2. XML Input Parsing
46
57
 
@@ -96,38 +107,31 @@ fi
96
107
 
97
108
  ### 3-6. Git Check
98
109
 
99
- ```bash
100
- if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
101
- echo "WARNING: No git repository found. Skipping git commit."
102
- echo "Result file saved at: works/${WORK_ID}/TASK-XX_result.md"
103
- # → Jump directly to step 7 (TaskCallback)
104
- fi
105
- ```
110
+ → **Bash command rules: see `shared-prompt-sections.md` § 13**
106
111
 
107
- If git is not available, skip step 3-7 (Git Commit). The result.md, PROGRESS.md, and WORK-LIST.md are already saved — the user can `git init && git add . && git commit` later.
112
+ Run `git rev-parse --is-inside-work-tree` (single command). If it fails, skip steps 3-7 and jump to step 7 (TaskCallback). The result.md, PROGRESS.md, and WORK-LIST.md are already saved.
108
113
 
109
114
  ### 3-7. Git Commit
110
115
 
111
- ```bash
112
- RESULT_FILE="works/${WORK_ID}/TASK-XX_result.md"
113
- [ ! -f "$RESULT_FILE" ] && echo "ABORT: result file not found" && exit 1
116
+ **Each command below is a separate Bash call — do NOT chain with `&&` or `;`:**
114
117
 
115
- # Stage WORK management files (Requirement, PLAN, TASK, progress, result)
116
- git add "works/${WORK_ID}/"
118
+ 1. Verify result file exists: use `Read` tool on `works/{WORK_ID}/TASK-XX_result.md`
119
+ 2. `git add works/{WORK_ID}/`
120
+ 3. `git add works/WORK-LIST.md`
121
+ 4. `git add <builder-changed-file-1>` (one `git add` per file, or space-separated in one call)
122
+ 5. `git commit -m "{type}(TASK-XX): {title}..."` (commit message via heredoc)
117
123
 
118
- # Stage WORK-LIST.md (includes DONE status if last TASK)
124
+ ```
125
+ # Example — each line is a SEPARATE Bash call:
126
+ git add works/WORK-01/
119
127
  git add works/WORK-LIST.md
128
+ git add src/app.js
129
+ git commit -m "feat(TASK-00): Add authentication module
120
130
 
121
- # Stage builder-changed files from progress.md
122
- # (parse Files changed section and add each file)
123
- git add <builder-changed-files>
124
-
125
- git commit -m "{type}(TASK-XX): {title}
126
-
127
- - {change 1}
128
- - {change 2}
131
+ - Created auth middleware
132
+ - Added JWT token validation
129
133
 
130
- Result: works/${WORK_ID}/TASK-XX_result.md"
134
+ Result: works/WORK-01/TASK-00_result.md"
131
135
  ```
132
136
 
133
137
  | Content | Type |
@@ -148,6 +152,7 @@ Payload fields: `"status": "SUCCESS"`, `"commitHash": "${COMMIT_HASH}"` (run `gi
148
152
  ### 3-9. Result Report
149
153
 
150
154
  → task-result XML base structure: see `xml-schema.md` § 2
155
+ → ref-cache element: see `xml-schema.md` § 6
151
156
 
152
157
  Committer-specific additional fields:
153
158
 
@@ -165,6 +170,12 @@ Committer-specific additional fields:
165
170
  <next-tasks>
166
171
  <task id="TASK-YY" status="READY">{title}</task>
167
172
  </next-tasks>
173
+ <ref-cache>
174
+ <!-- Include all reference files loaded during this execution (from disk or received ref-cache) -->
175
+ <ref key="shared-prompt-sections">{content}</ref>
176
+ <ref key="xml-schema">{content}</ref>
177
+ <!-- ... other keys loaded ... -->
178
+ </ref-cache>
168
179
  ```
169
180
 
170
181
  → see `{REFERENCES_DIR}/shared-prompt-sections.md` § 8
@@ -28,41 +28,37 @@
28
28
 
29
29
  ```
30
30
  1. specifier 호출 → Requirement.md + PLAN.md + TASK-00 생성 + builder dispatch XML 반환
31
- 2. [승인 1회] 사용자 검토 (요구사항 + 설계 통합)
31
+ 2. STOP 산출물 요약을 사용자에게 제시하고 승인을 기다린다 (builder 호출 금지)
32
32
  3. builder 호출 (dispatch XML을 prompt로) — self-check 포함
33
- 4. committer 호출 (builder 결과를 prompt로)
33
+ 4. verifier+committer 호출 (builder 결과를 prompt로) — 단일 spawn에서 검증 후 커밋
34
34
  ```
35
35
 
36
- > Verifier 생략: Builder가 self-check(build/lint)를 수행하므로 단일 TASK에서 별도 검증 불필요.
36
+ > Verifier+Committer 통합: 단일 spawn에서 검증 수행 result.md 생성 + git commit.
37
37
 
38
38
  ---
39
39
 
40
40
  ## pipeline 모드 (Planner 별도 호출)
41
41
 
42
42
  ```
43
- 1. specifier 호출 → Requirement.md 생성 + planner dispatch XML 반환
44
- 2. [기획 승인] 사용자 검토 (Requirement.md)
45
- 3. planner 호출 (dispatch XML을 prompt로) → PLAN.md + TASK-NN 생성 + execution-mode 결정
46
- 4. [개발 승인] 사용자 검토 (PLAN.md + TASK 목록)
47
- 5. builder 호출 (TASK별 dispatch XML을 prompt로)
48
- 6. verifier 호출 (builder 결과를 prompt로)
49
- 7. committer 호출 (verifier 결과를 prompt로)
43
+ 1. specifier+planner 호출 (단일 spawn) → Requirement.md + PLAN.md + TASK-NN 생성 + execution-mode 결정
44
+ 2. STOP Requirement.md + PLAN.md + TASK 목록을 제시하고 승인을 기다린다
45
+ 3. builder 호출 (TASK별 dispatch XML을 prompt로)
46
+ 4. verifier+committer 호출 (builder 결과를 prompt로) 단일 spawn에서 검증 후 커밋
50
47
  ```
51
48
 
49
+ > Specifier+Planner 통합: specifier.md 역할 (Requirement.md) 수행 후 planner.md 역할 (PLAN.md + TASKs) 순차 수행.
50
+
52
51
  ---
53
52
 
54
53
  ## full 모드 (Scheduler 포함)
55
54
 
56
55
  ```
57
- 1. specifier 호출 → Requirement.md 생성 + planner dispatch XML 반환
58
- 2. [기획 승인] 사용자 검토 (Requirement.md)
59
- 3. planner 호출 → PLAN.md + TASK 분해 + execution-mode: full 결정
60
- 4. [개발 승인] 사용자 검토 (PLAN.md + TASK 목록)
61
- 5. scheduler 호출 DAG 분석 + READY TASK + builder dispatch XML 반환
62
- 6. builder 호출 (dispatch XML을 prompt로) → 구현
63
- 7. verifier 호출 (builder 결과를 prompt로) → 검증
64
- 8. committer 호출 (verifier 결과를 prompt로) → commit
65
- 9. 미완료 TASK 있으면 5번으로 돌아감
56
+ 1. specifier+planner 호출 (단일 spawn) → Requirement.md + PLAN.md + TASK 분해 + execution-mode: full
57
+ 2. STOP Requirement.md + PLAN.md + TASK 목록을 제시하고 승인을 기다린다
58
+ 3. scheduler 호출 → DAG 분석 + READY TASK + builder dispatch XML 반환
59
+ 4. builder 호출 (dispatch XML을 prompt로) 구현
60
+ 5. verifier+committer 호출 (builder 결과를 prompt로) 단일 spawn에서 검증 커밋
61
+ 6. 미완료 TASK 있으면 3번으로 돌아감
66
62
  ```
67
63
 
68
64
  병렬 실행: scheduler가 복수의 READY TASK를 반환하면 builder를 동시에 호출한다.
@@ -75,42 +71,102 @@
75
71
 
76
72
  ```
77
73
  1. scheduler 호출 → READY TASK 확인 + builder dispatch XML 반환
78
- 2. builder verifier committer 순서대로 실행
79
- 3. 미완료 TASK 있으면 1번으로 돌아감
74
+ 2. builder 호출구현
75
+ 3. verifier+committer 호출 단일 spawn에서 검증 후 커밋
76
+ 4. 미완료 TASK 있으면 1번으로 돌아감
80
77
  ```
81
78
 
82
79
  ---
83
80
 
81
+ ## 통합 에이전트 호출
82
+
83
+ ### Specifier+Planner (단일 spawn)
84
+
85
+ pipeline/full 모드에서 specifier 호출 시 양쪽 에이전트 정의를 포함:
86
+
87
+ ```
88
+ 에이전트에 전달할 프롬프트:
89
+ "두 가지 역할을 순서대로 수행하라.
90
+
91
+ 역할 1 — Specifier: specifier.md를 읽고 Requirement.md를 생성하라.
92
+ 역할 2 — Planner: planner.md를 읽고 PLAN.md + TASK 파일을 생성하라.
93
+
94
+ 역할 1을 먼저 수행한 후 역할 2를 수행하라. 통합 결과를 반환하라."
95
+ ```
96
+
97
+ - specifier의 모델(opus)로 spawn
98
+ - REFERENCES_DIR에서 specifier.md와 planner.md 양쪽 참조
99
+ - 반환: Requirement.md + PLAN.md + TASK 파일 + execution-mode
100
+
101
+ ### Verifier+Committer (단일 spawn)
102
+
103
+ builder 완료 후 검증 호출 시:
104
+
105
+ ```
106
+ 에이전트에 전달할 프롬프트:
107
+ "두 가지 역할을 순서대로 수행하라.
108
+
109
+ 역할 1 — Verifier: verifier.md를 읽고 build/lint/test를 검증하라.
110
+ 역할 2 — Committer: committer.md를 읽고 result.md를 생성하고 git commit하라.
111
+
112
+ 역할 1을 먼저 수행하라. 검증 통과 시 역할 2를 수행하라.
113
+ 검증 실패 시 역할 2를 건너뛰고 FAIL 결과만 반환하라."
114
+ ```
115
+
116
+ - verifier의 모델(haiku)로 spawn
117
+ - REFERENCES_DIR에서 verifier.md와 committer.md 양쪽 참조
118
+ - 통과 시: 검증 결과 + commit hash 반환
119
+ - 실패 시: 검증 실패만 반환 (커밋 없음)
120
+
121
+ ---
122
+
84
123
  ## 에이전트 역할 요약
85
124
 
86
- | 에이전트 | 반환값 | 호출 주체 |
87
- |---------|-------|---------|
88
- | specifier | Requirement.md + (겸임 시) PLAN.md/TASK + dispatch XML | Main Claude |
89
- | planner | PLAN.md/TASK 파일 생성 완료 + execution-mode | Main Claude |
90
- | scheduler | READY TASK + dispatch XML | Main Claude |
91
- | builder | task-result XML (context-handoff 포함) | Main Claude |
92
- | verifier | task-result XML | Main Claude |
93
- | committer | task-result XML + commit hash | Main Claude |
125
+ | 에이전트 | 역할 | 모델 | 통합 대상 |
126
+ |---------|------|------|----------|
127
+ | specifier | 요구사항 분석 | opus | + planner (pipeline/full) |
128
+ | planner | PLAN + TASK 분해 | opus | specifier spawn에 통합 |
129
+ | scheduler | DAG 관리 + dispatch | haiku | 단독 |
130
+ | builder | 코드 구현 | sonnet | 단독 |
131
+ | verifier | build/lint/test 검증 | haiku | + committer |
132
+ | committer | 결과 보고 + git commit | haiku | verifier spawn에 통합 |
94
133
 
95
134
  ---
96
135
 
97
- ## 모드별 서브에이전트 호출 횟수
136
+ ## 모드별 서브에이전트 Spawn 횟수
137
+
138
+ | 모드 | Spec+Plan | Scheduler | Builder | Veri+Commit | 합계 |
139
+ |------|:---------:|:---------:|:-------:|:-----------:|:----:|
140
+ | direct | 1 (겸임) | — | 1 | 1 | **3** |
141
+ | pipeline | 1 (통합) | — | 1 | 1 | **3** |
142
+ | full (N TASK) | 1 (통합) | 1 | N | N | **2 + 2N** |
143
+
144
+ **Before vs After (6 TASK 기준):**
98
145
 
99
- | 모드 | Specifier | Planner | Scheduler | Builder | Verifier | Committer | 합계 |
100
- |------|:---------:|:-------:|:---------:|:-------:|:--------:|:---------:|:----:|
101
- | direct | O (겸임) | X | X | O | X | O | **3회** |
102
- | pipeline | O | O | X | O | O | O | **5회** |
103
- | full | O | O | O | O | O | O | **6회** |
146
+ | | Before | After | 감소율 |
147
+ |---|:---:|:---:|:---:|
148
+ | Spawn 횟수 | 2 + 3×6 = 20 | 2 + 2×6 = 14 | **-30%** |
104
149
 
105
150
  ---
106
151
 
107
- ## 승인 게이트
152
+ ## 승인 게이트 (CRITICAL)
153
+
154
+ > **반드시 STOP하고 사용자의 명시적 승인을 기다린 후 다음 에이전트를 호출하라.**
155
+ > 사용자가 "승인", "approve", "진행", "go ahead" 등으로 응답할 때까지 다음 단계로 넘어가지 마라.
156
+ > 유일한 예외는 auto 모드 — 사용자의 원래 메시지에 "auto" 또는 "자동으로"가 포함된 경우.
157
+
158
+ | 모드 | 승인 횟수 | 시점 | 사용자에게 보여줄 내용 |
159
+ |------|:---------:|------|----------------------|
160
+ | direct | 1회 | Specifier 완료 후 | Requirement.md + PLAN.md + TASK-00.md 요약 |
161
+ | pipeline/full | 1회 | Specifier+Planner 완료 후 | Requirement.md + PLAN.md + TASK 목록 |
162
+ | 자동 승인 | 0회 | — | 모든 승인 게이트 생략 |
163
+
164
+ > 참고: pipeline/full 승인이 **2회에서 1회**로 줄었다 (specifier+planner가 단일 spawn이므로).
108
165
 
109
- | 모드 | 승인 횟수 | 시점 |
110
- |------|:---------:|------|
111
- | direct | 1회 | Specifier 완료 후 (요구사항 + 설계 통합) |
112
- | pipeline/full | 2회 | 기획 승인 (Requirement.md) 개발 승인 (PLAN.md) |
113
- | 자동 승인 | 0회 | "자동으로 진행" 명시 시 |
166
+ **승인 요청 방법:**
167
+ 1. specifier+planner가 생성한 산출물 요약을 제시 (파일, 범위, execution-mode)
168
+ 2. "진행할까요?" 또는 동등한 질문
169
+ 3. **사용자 응답을 기다린다** 승인 전까지 builder를 호출하지 마라
114
170
 
115
171
  ---
116
172
 
@@ -35,13 +35,24 @@ You are the **Builder** — TASK 명세를 받아 실제 코드를 구현하고
35
35
 
36
36
  **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
37
37
 
38
- | 파일 | 목적 |
39
- |------|------|
40
- | `{REFERENCES_DIR}/file-content-schema.md` | 파일 포맷 스키마 |
41
- | `{REFERENCES_DIR}/shared-prompt-sections.md` | 공통 규칙 (TASK ID, PLAN.md 7개 필드, WORK-LIST) |
42
- | `{REFERENCES_DIR}/xml-schema.md` | XML 통신 포맷 |
43
- | `{REFERENCES_DIR}/context-policy.md` | 슬라이딩 윈도우 규칙 |
44
- | `{REFERENCES_DIR}/work-activity-log.md` | Activity Log 규칙 (log_work 함수, STAGE 테이블) |
38
+ #### Reference Loading (ref-cache)
39
+
40
+ 1. 수신한 dispatch XML에 `<ref-cache>`가 있는지 확인한다
41
+ 2. 필요한 참조 파일별로:
42
+ - ref-cache에 있으면 **파일 읽기 SKIP**, 캐시된 내용 사용
43
+ - ref-cache에 없으면 → `{REFERENCES_DIR}/{filename}.md`에서 읽고 ref-cache에 추가
44
+ 3. 작업 완료 병합된 `<ref-cache>`를 반환 task-result XML에 포함한다
45
+ 4. **하위 호환성**: dispatch에 `<ref-cache>`가 없으면 기존 방식대로 모든 참조 파일을 읽는다 (기존 동작 유지)
46
+
47
+ 이 에이전트의 필수 참조 파일:
48
+
49
+ | 파일 | ref-cache key |
50
+ |------|---------------|
51
+ | `{REFERENCES_DIR}/file-content-schema.md` | `file-content-schema` |
52
+ | `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
53
+ | `{REFERENCES_DIR}/xml-schema.md` | `xml-schema` |
54
+ | `{REFERENCES_DIR}/context-policy.md` | `context-policy` |
55
+ | `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
45
56
 
46
57
  ### 3-2. XML Input 파싱
47
58