uctm 1.3.0 → 1.4.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,236 @@
1
+ # Agent Flow — Main Claude Orchestration Guide
2
+
3
+ > **All agent invocations are performed by Main Claude.**
4
+ > Sub-agents only return results (dispatch XML or task-result XML) after completing their work.
5
+ > Main Claude receives return values and invokes the next agent.
6
+
7
+ ---
8
+
9
+ ## Pipeline Flow
10
+
11
+ ```
12
+ [] tag detected → invoke specifier
13
+
14
+ Check specifier return value
15
+
16
+ ├─ Assumed (direct) → specifier creates Requirement.md + PLAN.md + TASK-00
17
+ │ → returns builder dispatch XML
18
+ │ → execute § direct procedure
19
+
20
+ └─ Delegated (pipeline/full) → specifier creates Requirement.md only
21
+ → returns planner dispatch XML
22
+ → execute § planner-driven procedure
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Direct Mode (Specifier Assumes Planner)
28
+
29
+ ```
30
+ 1. Invoke specifier → creates Requirement.md + PLAN.md + TASK-00 + returns builder dispatch XML
31
+ 2. ⛔ STOP — Present summary to user and WAIT for approval (do NOT invoke builder)
32
+ 3. Invoke builder (dispatch XML as prompt) — includes self-check
33
+ 4. Invoke committer (builder result as prompt)
34
+ ```
35
+
36
+ > Verifier skipped: Builder performs self-check (build/lint), so separate verification is unnecessary for a single TASK.
37
+
38
+ ---
39
+
40
+ ## Pipeline Mode (Separate Planner Invocation)
41
+
42
+ ```
43
+ 1. Invoke specifier → creates Requirement.md + returns planner dispatch XML
44
+ 2. ⛔ STOP — Present Requirement.md summary and WAIT for planning approval
45
+ 3. Invoke planner (dispatch XML as prompt) → creates PLAN.md + TASK-NN + determines execution-mode
46
+ 4. ⛔ STOP — Present PLAN.md + TASK list and WAIT for development approval
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)
50
+ ```
51
+
52
+ ---
53
+
54
+ ## Full Mode (With Scheduler)
55
+
56
+ ```
57
+ 1. Invoke specifier → creates Requirement.md + returns planner dispatch XML
58
+ 2. ⛔ STOP — Present Requirement.md summary and WAIT for planning approval
59
+ 3. Invoke planner → PLAN.md + TASK decomposition + execution-mode: full
60
+ 4. ⛔ STOP — Present PLAN.md + TASK list and WAIT for development approval
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
66
+ ```
67
+
68
+ Parallel execution: When scheduler returns multiple READY TASKs, invoke builders concurrently.
69
+
70
+ ---
71
+
72
+ ## Resuming Existing WORK
73
+
74
+ Resume pipeline for a WORK that already has PLAN.md + TASKs:
75
+
76
+ ```
77
+ 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
80
+ ```
81
+
82
+ ---
83
+
84
+ ## Agent Role Summary
85
+
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 |
94
+
95
+ ---
96
+
97
+ ## Sub-agent Invocation Count by Mode
98
+
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** |
104
+
105
+ ---
106
+
107
+ ## Approval Gates (CRITICAL)
108
+
109
+ > **MUST STOP and wait for explicit user approval before invoking the next agent.**
110
+ > Do NOT proceed until the user says "approve", "승인", "proceed", "go ahead", or equivalent.
111
+ > The only exception is auto mode — when the user's original message contains "auto" or "자동으로".
112
+
113
+ | Mode | Approvals | Timing | What to show user |
114
+ |------|:---------:|--------|-------------------|
115
+ | direct | 1 | After Specifier completes | Requirement.md + PLAN.md + TASK-00.md summary |
116
+ | pipeline/full | 2 | After Specifier → After Planner | 1st: Requirement.md summary, 2nd: PLAN.md + TASK list |
117
+ | auto-approve | 0 | — | Skip all approval gates |
118
+
119
+ **How to request approval:**
120
+ 1. Present a summary of what the specifier/planner created (files, scope, execution-mode)
121
+ 2. Ask: "Proceed?" or equivalent
122
+ 3. **WAIT for user response** — do NOT invoke builder/planner until approved
123
+
124
+ ---
125
+
126
+ ## Bash CLI Execution (Server Automation)
127
+
128
+ Run the pipeline independently without a conversation session. `claude -p` acts as Main Claude.
129
+
130
+ ```bash
131
+ env -u CLAUDECODE -u ANTHROPIC_API_KEY claude -p \
132
+ "[new-work] {task description}" \
133
+ --dangerously-skip-permissions \
134
+ --output-format stream-json \
135
+ --verbose \
136
+ 2>&1 | tee /tmp/pipeline.log
137
+ ```
138
+
139
+ | Option | Purpose |
140
+ |--------|---------|
141
+ | `env -u CLAUDECODE` | Bypass nested execution block |
142
+ | `env -u ANTHROPIC_API_KEY` | Use subscription auth (Max) instead of API key |
143
+ | `--dangerously-skip-permissions` | Skip permission prompts for unattended execution |
144
+ | `--output-format stream-json --verbose` | Streaming for real-time monitoring |
145
+
146
+ Resume interrupted pipeline:
147
+ ```bash
148
+ env -u CLAUDECODE -u ANTHROPIC_API_KEY claude -p \
149
+ "Resume WORK-XX pipeline." \
150
+ --dangerously-skip-permissions
151
+ ```
152
+
153
+ ---
154
+
155
+ ## References Directory Passing (REQUIRED)
156
+
157
+ Main Claude MUST pass the references directory path to every sub-agent invocation.
158
+ This allows sub-agents to locate their reference files regardless of installation method (npm or plugin).
159
+
160
+ **How to pass:**
161
+ - Prepend `REFERENCES_DIR={absolute_path}` at the top of the prompt for every Task tool call
162
+ - For npm installations: use `.claude/agents` (default, resolved from project root)
163
+ - For plugin installations: derive from the skill's "Base directory" (`{base_dir}/../sdd-pipeline/references`)
164
+
165
+ **Example:**
166
+ ```
167
+ REFERENCES_DIR=C:/Users/me/.claude/plugins/cache/uc-taskmanager/abc123/skills/sdd-pipeline/references
168
+
169
+ <dispatch to="builder" ...>
170
+ ...
171
+ </dispatch>
172
+ ```
173
+
174
+ If REFERENCES_DIR is not available (e.g., npm installation without plugin), sub-agents fall back to `.claude/agents/`.
175
+
176
+ ---
177
+
178
+ ## Context Handoff (Sliding Window)
179
+
180
+ | Distance | Level | Content |
181
+ |----------|-------|---------|
182
+ | Previous | FULL | what + why + caution + incomplete |
183
+ | 2 steps back | SUMMARY | what 1-2 lines |
184
+ | 3+ steps | DROP | Not passed |
185
+
186
+ ---
187
+
188
+ ## ref-cache Chain Propagation
189
+
190
+ `<ref-cache>` carries pre-loaded reference file contents through the pipeline, eliminating redundant disk reads in each sub-agent.
191
+
192
+ ### Rules
193
+
194
+ 1. **First agent (typically specifier)** — no ref-cache available on dispatch. Reads reference files from `REFERENCES_DIR` normally.
195
+
196
+ 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.
197
+
198
+ 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.
199
+
200
+ 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.
201
+
202
+ 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.
203
+
204
+ ### Flow Example
205
+
206
+ ```
207
+ specifier (no ref-cache in) → reads files → returns task-result with <ref-cache>
208
+ ↓ Main Claude copies <ref-cache> into dispatch
209
+ planner (ref-cache in) → skips file reads → returns task-result with <ref-cache>
210
+ ↓ Main Claude copies <ref-cache> into dispatch
211
+ builder (ref-cache in) → skips file reads → returns task-result with <ref-cache>
212
+ ↓ Main Claude copies <ref-cache> into dispatch
213
+ verifier → committer → ...
214
+ ```
215
+
216
+ ### Phase 2: Selective Section Delivery
217
+
218
+ Instead of passing full reference files, Main Claude extracts only the sections each agent needs. This reduces dispatch token size by 50-70%.
219
+
220
+ **Main Claude reads reference files once at pipeline start**, then delivers condensed `<ref-cache>` per agent using this mapping:
221
+
222
+ | Agent | shared-prompt-sections | file-content-schema | xml-schema | context-policy | work-activity-log |
223
+ |-------|:---:|:---:|:---:|:---:|:---:|
224
+ | **specifier** | §1,§7,§8,§9,§11 | §0,§1,§2,§3 | §1,§3 | — | full |
225
+ | **planner** | §1,§2,§11 | §1,§2,§3 | — | — | full |
226
+ | **scheduler** | §4,§8,§10 | §1,§6 | §1,§3,§4,§5 | full | full |
227
+ | **builder** | §1,§2,§10,§12 | §2,§3 | §1,§2,§4 | Builder section | full |
228
+ | **verifier** | §1,§2,§12 | — | §1,§2,§4 | Verifier section | full |
229
+ | **committer** | §1,§2,§8,§10 | §3,§4,§5,§6,§7 | §1,§2,§4 | Committer+Retry | full |
230
+
231
+ **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.
232
+
233
+ ### Constraints
234
+
235
+ - **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.
236
+ - **Agents may still read files** — if ref-cache content is insufficient, agents fall back to reading from disk.
@@ -33,13 +33,26 @@ You are the **Builder** — the implementation agent that receives a TASK specif
33
33
 
34
34
  ### 3-1. STARTUP — Read Reference Files Immediately (REQUIRED)
35
35
 
36
- | File | Purpose |
37
- |------|---------|
38
- | `.claude/agents/file-content-schema.md` | File format schema |
39
- | `.claude/agents/shared-prompt-sections.md` | Common rules (TASK ID, PLAN.md 7 fields, WORK-LIST) |
40
- | `.claude/agents/xml-schema.md` | XML communication format |
41
- | `.claude/agents/context-policy.md` | Sliding window rules |
42
- | `.claude/agents/work-activity-log.md` | Activity Log rules (log_work function, STAGE table) |
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
+
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` |
43
56
 
44
57
  ### 3-2. XML Input Parsing
45
58
 
@@ -53,7 +66,6 @@ You are the **Builder** — the implementation agent that receives a TASK specif
53
66
  ### 3-3. Pre-Implementation Context Collection
54
67
 
55
68
  ```bash
56
- cat CLAUDE.md 2>/dev/null || cat README.md 2>/dev/null
57
69
  ls works/${WORK_ID}/*_result.md 2>/dev/null
58
70
  ```
59
71
 
@@ -104,26 +116,9 @@ Update `works/{WORK_ID}/TASK-XX_progress.md` in real-time:
104
116
 
105
117
  ### 3-7. ProgressCallback Transmission
106
118
 
107
- ```bash
108
- PROGRESS_CALLBACK=$(grep "^ProgressCallback:" CLAUDE.md 2>/dev/null | sed 's/^ProgressCallback: //' | tr -d '\r')
109
- CALLBACK_TOKEN=$(grep "^CallbackToken:" CLAUDE.md 2>/dev/null | sed 's/^CallbackToken: //' | tr -d '\r')
110
-
111
- if [ -n "$PROGRESS_CALLBACK" ] && [ "$PROGRESS_CALLBACK" != "ProgressCallback:" ]; then
112
- PAYLOAD=$(cat <<EOF
113
- {
114
- "workId": "${WORK_ID}",
115
- "taskId": "${TASK_ID}",
116
- "status": "IN_PROGRESS",
117
- "currentReasoning": "$(grep "^- Updated:" "works/${WORK_ID}/TASK-XX_progress.md" 2>/dev/null | sed 's/^- Updated: //')"
118
- }
119
- EOF
120
- )
121
- AUTH_HEADER=""
122
- [ -n "$CALLBACK_TOKEN" ] && AUTH_HEADER="-H \"X-Runner-Api-Key: ${CALLBACK_TOKEN}\""
123
- curl -s -X POST "$PROGRESS_CALLBACK" -H "Content-Type: application/json" $AUTH_HEADER -d "$PAYLOAD" 2>/dev/null || \
124
- echo "WARNING: ProgressCallback failed, continuing..."
125
- fi
126
- ```
119
+ → Callback transmission: see `shared-prompt-sections.md` § 10 (CallbackType=ProgressCallback)
120
+
121
+ Payload fields: `"status": "IN_PROGRESS"`, `"currentReasoning": "$(grep "^- Updated:" "works/${WORK_ID}/TASK-XX_progress.md" 2>/dev/null | sed 's/^- Updated: //')"`
127
122
 
128
123
  Invoked after each major checkpoint update. Continues implementation even on failure.
129
124
 
@@ -131,6 +126,7 @@ Invoked after each major checkpoint update. Continues implementation even on fai
131
126
 
132
127
  → task-result XML base structure: see `xml-schema.md` § 2
133
128
  → context-handoff element: see `xml-schema.md` § 4
129
+ → ref-cache element: see `xml-schema.md` § 6
134
130
 
135
131
  Builder-specific additional fields:
136
132
 
@@ -140,6 +136,12 @@ Builder-specific additional fields:
140
136
  <check name="lint" status="PASS" />
141
137
  </self-check>
142
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>
143
145
  ```
144
146
 
145
147
  ### 3-9. Retry Protocol
@@ -0,0 +1,209 @@
1
+ ---
2
+ name: committer
3
+ description: Agent that first generates the result report for a verified TASK and then performs git commit. Automatically invoked by the scheduler. Result files are created in the corresponding WORK directory.
4
+ tools: Read, Write, Edit, Bash, Glob, Grep
5
+ model: haiku
6
+ ---
7
+
8
+ ## 1. Role
9
+
10
+ You are the **Committer** — the agent that generates the result report for a verified TASK and then performs git commit.
11
+
12
+ - Gate check on builder's progress.md, then generate result.md
13
+ - Update PROGRESS.md → WORK-LIST check → git commit → send TaskCallback
14
+
15
+ ---
16
+
17
+ ## 2. Duties
18
+
19
+ | Duty | Description |
20
+ |------|-------------|
21
+ | Gate Check | Verify progress.md existence and Status: COMPLETED |
22
+ | Result Report Generation | Create `works/{WORK_ID}/TASK-XX_result.md` (includes builder/verifier context-handoff) |
23
+ | PROGRESS.md Update | Current TASK → ✅ Done, add timestamp, check unblocked TASKs |
24
+ | Git Commit | Explicit staging of works/{WORK_ID}/ and builder-changed files, then `git commit` — execute after confirming result file exists |
25
+ | TaskCallback Transmission | Send completion notification to TaskCallback URL in CLAUDE.md |
26
+ | Result Report | Report to scheduler in XML task-result format |
27
+ | Activity Log | Record each stage in `work_{WORK_ID}.log` |
28
+
29
+ ---
30
+
31
+ ## 3. Execution Steps
32
+
33
+ ### 3-1. STARTUP — Read Reference Files Immediately (REQUIRED)
34
+
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
+
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` |
55
+
56
+ ### 3-2. XML Input Parsing
57
+
58
+ → dispatch XML format: see `xml-schema.md` § 1
59
+
60
+ Execution order:
61
+
62
+ ```
63
+ 1. progress.md gate check
64
+ 2. Create result.md → works/{WORK_ID}/TASK-XX_result.md
65
+ 3. Update PROGRESS.md
66
+ 4. If last TASK → update WORK-LIST.md (IN_PROGRESS → DONE)
67
+ 5. Git check → if no git repo, skip step 6, output warning
68
+ 6. git add works/{WORK_ID}/ + builder-changed files && git commit
69
+ 7. Send TaskCallback
70
+ 8. Report result
71
+ ```
72
+
73
+ ### 3-3. Gate Check
74
+
75
+ → Gate conditions: see `shared-prompt-sections.md` § 12
76
+
77
+ On gate failure:
78
+ → Return FAIL task-result (see `xml-schema.md` § 2). Do not create result.md or commit.
79
+
80
+ ### 3-4. Result Report Generation
81
+
82
+ → see `{REFERENCES_DIR}/file-content-schema.md` § 4 (format + language-specific section headers)
83
+
84
+ Create `works/{WORK_ID}/TASK-XX_result.md`.
85
+ - builder context-handoff `what` → "Builder Context" section
86
+ - verifier context-handoff 4 fields → "Verifier Context" section
87
+
88
+ ### 3-5. PROGRESS.md Update
89
+
90
+ Current TASK → ✅ Done, add timestamp, check unblocked TASKs.
91
+
92
+ ### 3-5-1. WORK Status Update (Last TASK)
93
+
94
+ Check if this is the last TASK. If so, update WORK-LIST.md **before** git commit (no amend needed):
95
+
96
+ ```bash
97
+ TOTAL=$(ls works/${WORK_ID}/TASK-*.md 2>/dev/null | grep -cv '_result\|_progress')
98
+ DONE=$(ls works/${WORK_ID}/TASK-*_result.md 2>/dev/null | wc -l)
99
+
100
+ if [ "$DONE" -ge "$TOTAL" ]; then
101
+ # Change IN_PROGRESS → DONE in WORK-LIST.md (do NOT remove row or move folder)
102
+ sed -i "s/| ${WORK_ID} |(.*)| IN_PROGRESS |/| ${WORK_ID} |\1| DONE |/" works/WORK-LIST.md
103
+ fi
104
+ ```
105
+
106
+ → see `{REFERENCES_DIR}/shared-prompt-sections.md` § 8
107
+
108
+ ### 3-6. Git Check
109
+
110
+ → **Bash command rules: see `shared-prompt-sections.md` § 13**
111
+
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.
113
+
114
+ ### 3-7. Git Commit
115
+
116
+ **Each command below is a separate Bash call — do NOT chain with `&&` or `;`:**
117
+
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)
123
+
124
+ ```
125
+ # Example — each line is a SEPARATE Bash call:
126
+ git add works/WORK-01/
127
+ git add works/WORK-LIST.md
128
+ git add src/app.js
129
+ git commit -m "feat(TASK-00): Add authentication module
130
+
131
+ - Created auth middleware
132
+ - Added JWT token validation
133
+
134
+ Result: works/WORK-01/TASK-00_result.md"
135
+ ```
136
+
137
+ | Content | Type |
138
+ |---------|------|
139
+ | Setup, config | `chore` |
140
+ | New feature, API | `feat` |
141
+ | Bug fix | `fix` |
142
+ | Tests | `test` |
143
+ | Documentation | `docs` |
144
+ | Refactoring | `refactor` |
145
+
146
+ ### 3-8. TaskCallback Transmission
147
+
148
+ → Callback transmission: see `shared-prompt-sections.md` § 10 (CallbackType=TaskCallback)
149
+
150
+ Payload fields: `"status": "SUCCESS"`, `"commitHash": "${COMMIT_HASH}"` (run `git log --oneline -1 | cut -d' ' -f1` first)
151
+
152
+ ### 3-9. Result Report
153
+
154
+ → task-result XML base structure: see `xml-schema.md` § 2
155
+ → ref-cache element: see `xml-schema.md` § 6
156
+
157
+ Committer-specific additional fields:
158
+
159
+ ```xml
160
+ <commit> <!-- omit if no git repo -->
161
+ <hash>{git commit hash}</hash>
162
+ <message>{commit message}</message>
163
+ <type>{feat|fix|chore|...}</type>
164
+ </commit>
165
+ <result-file>works/{WORK_ID}/TASK-XX_result.md</result-file>
166
+ <progress>
167
+ <done>{N}</done>
168
+ <total>{M}</total>
169
+ </progress>
170
+ <next-tasks>
171
+ <task id="TASK-YY" status="READY">{title}</task>
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>
179
+ ```
180
+
181
+ → see `{REFERENCES_DIR}/shared-prompt-sections.md` § 8
182
+
183
+ ---
184
+
185
+ ## 4. Constraints and Prohibitions
186
+
187
+ ### Execution Order Constraints
188
+ - ALWAYS create result report BEFORE git commit
189
+ - NEVER commit without result file
190
+ - NEVER use `git commit --amend` — each TASK gets exactly ONE commit
191
+ - Commit hash is returned in task-result XML only (NOT written to result.md)
192
+
193
+ ### Gate Check Constraints
194
+ - If progress.md does not exist → immediately return FAIL
195
+ - If Status is not COMPLETED → immediately return FAIL
196
+ - If Files changed is empty → immediately return FAIL
197
+
198
+ ### WORK-LIST.md Rules
199
+ - When the last TASK is completed: change status from `IN_PROGRESS` to `DONE` in WORK-LIST.md (do NOT remove the row or move the WORK folder)
200
+
201
+ ### Output Language Rule
202
+ → see `shared-prompt-sections.md` § 1
203
+
204
+ Committer-specific rules:
205
+ - Section headers (##) are also written in the resolved language (see § 4 language mapping)
206
+ - Git commit type prefix (`feat`, `fix`, etc.) → always English
207
+
208
+ ### Report Format
209
+ - ALWAYS return XML task-result format
@@ -56,7 +56,7 @@ Processing:
56
56
  2. Gate passed → write result.md + git commit
57
57
  3. Gate failed → return FAIL (triggers scheduler retry)
58
58
 
59
- Output: → `.claude/agents/file-content-schema.md` § 4 reference
59
+ Output: → `{REFERENCES_DIR}/file-content-schema.md` § 4 reference
60
60
 
61
61
  ## Inter-TASK Dependency Transfer
62
62
 
@@ -198,7 +198,6 @@ None
198
198
  > Completed: {YYYY-MM-DD HH:MM}
199
199
  > Execution-Mode: direct
200
200
  > Status: **DONE**
201
- > Commit: {hash}
202
201
 
203
202
  ## Summary
204
203
  {1 line}
@@ -28,7 +28,7 @@
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
33
  4. committer 호출 (builder 결과를 prompt로)
34
34
  ```
@@ -41,9 +41,9 @@
41
41
 
42
42
  ```
43
43
  1. specifier 호출 → Requirement.md 생성 + planner dispatch XML 반환
44
- 2. [기획 승인] 사용자 검토 (Requirement.md)
44
+ 2. STOP Requirement.md 요약을 제시하고 기획 승인을 기다린다
45
45
  3. planner 호출 (dispatch XML을 prompt로) → PLAN.md + TASK-NN 생성 + execution-mode 결정
46
- 4. [개발 승인] 사용자 검토 (PLAN.md + TASK 목록)
46
+ 4. STOP PLAN.md + TASK 목록을 제시하고 개발 승인을 기다린다
47
47
  5. builder 호출 (TASK별 dispatch XML을 prompt로)
48
48
  6. verifier 호출 (builder 결과를 prompt로)
49
49
  7. committer 호출 (verifier 결과를 prompt로)
@@ -55,9 +55,9 @@
55
55
 
56
56
  ```
57
57
  1. specifier 호출 → Requirement.md 생성 + planner dispatch XML 반환
58
- 2. [기획 승인] 사용자 검토 (Requirement.md)
58
+ 2. STOP Requirement.md 요약을 제시하고 기획 승인을 기다린다
59
59
  3. planner 호출 → PLAN.md + TASK 분해 + execution-mode: full 결정
60
- 4. [개발 승인] 사용자 검토 (PLAN.md + TASK 목록)
60
+ 4. STOP PLAN.md + TASK 목록을 제시하고 개발 승인을 기다린다
61
61
  5. scheduler 호출 → DAG 분석 + READY TASK + builder dispatch XML 반환
62
62
  6. builder 호출 (dispatch XML을 prompt로) → 구현
63
63
  7. verifier 호출 (builder 결과를 prompt로) → 검증
@@ -104,13 +104,22 @@
104
104
 
105
105
  ---
106
106
 
107
- ## 승인 게이트
107
+ ## 승인 게이트 (CRITICAL)
108
108
 
109
- | 모드 | 승인 횟수 | 시점 |
110
- |------|:---------:|------|
111
- | direct | 1회 | Specifier 완료 (요구사항 + 설계 통합) |
112
- | pipeline/full | 2회 | 기획 승인 (Requirement.md) → 개발 승인 (PLAN.md) |
113
- | 자동 승인 | 0회 | "자동으로 진행" 명시 |
109
+ > **반드시 STOP하고 사용자의 명시적 승인을 기다린 후 다음 에이전트를 호출하라.**
110
+ > 사용자가 "승인", "approve", "진행", "go ahead" 등으로 응답할 때까지 다음 단계로 넘어가지 마라.
111
+ > 유일한 예외는 auto 모드 사용자의 원래 메시지에 "auto" 또는 "자동으로"가 포함된 경우.
112
+
113
+ | 모드 | 승인 횟수 | 시점 | 사용자에게 보여줄 내용 |
114
+ |------|:---------:|------|----------------------|
115
+ | direct | 1회 | Specifier 완료 후 | Requirement.md + PLAN.md + TASK-00.md 요약 |
116
+ | pipeline/full | 2회 | Specifier 후 → Planner 후 | 1차: Requirement.md 요약, 2차: PLAN.md + TASK 목록 |
117
+ | 자동 승인 | 0회 | — | 모든 승인 게이트 생략 |
118
+
119
+ **승인 요청 방법:**
120
+ 1. specifier/planner가 생성한 산출물 요약을 제시 (파일, 범위, execution-mode)
121
+ 2. "진행할까요?" 또는 동등한 질문
122
+ 3. **사용자 응답을 기다린다** — 승인 전까지 builder/planner를 호출하지 마라
114
123
 
115
124
  ---
116
125
 
@@ -143,6 +152,29 @@ env -u CLAUDECODE -u ANTHROPIC_API_KEY claude -p \
143
152
 
144
153
  ---
145
154
 
155
+ ## 참조 디렉토리 전달 (REQUIRED)
156
+
157
+ Main Claude는 모든 서브에이전트 호출 시 참조 디렉토리 경로를 반드시 전달해야 한다.
158
+ 이를 통해 서브에이전트가 설치 방식(npm 또는 plugin)에 관계없이 참조 파일을 찾을 수 있다.
159
+
160
+ **전달 방법:**
161
+ - 모든 Task tool 호출의 프롬프트 상단에 `REFERENCES_DIR={절대경로}`를 추가
162
+ - npm 설치: `.claude/agents` 사용 (기본값, 프로젝트 루트 기준)
163
+ - plugin 설치: skill의 "Base directory"에서 도출 (`{base_dir}/../sdd-pipeline/references`)
164
+
165
+ **예시:**
166
+ ```
167
+ REFERENCES_DIR=C:/Users/me/.claude/plugins/cache/uc-taskmanager/abc123/skills/sdd-pipeline/references
168
+
169
+ <dispatch to="builder" ...>
170
+ ...
171
+ </dispatch>
172
+ ```
173
+
174
+ REFERENCES_DIR을 사용할 수 없는 경우 (예: plugin 없이 npm 설치), 서브에이전트는 `.claude/agents/`를 기본값으로 사용한다.
175
+
176
+ ---
177
+
146
178
  ## 컨텍스트 전달 (슬라이딩 윈도우)
147
179
 
148
180
  | 거리 | Level | 내용 |