uctm 1.3.2 → 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.
@@ -28,7 +28,7 @@
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
33
  4. Invoke committer (builder result as prompt)
34
34
  ```
@@ -41,9 +41,9 @@
41
41
 
42
42
  ```
43
43
  1. Invoke specifier → creates Requirement.md + returns planner dispatch XML
44
- 2. [Planning approval] User review (Requirement.md)
44
+ 2. STOP Present Requirement.md summary and WAIT for planning approval
45
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)
46
+ 4. STOP Present PLAN.md + TASK list and WAIT for development approval
47
47
  5. Invoke builder (per-TASK dispatch XML as prompt)
48
48
  6. Invoke verifier (builder result as prompt)
49
49
  7. Invoke committer (verifier result as prompt)
@@ -55,9 +55,9 @@
55
55
 
56
56
  ```
57
57
  1. Invoke specifier → creates Requirement.md + returns planner dispatch XML
58
- 2. [Planning approval] User review (Requirement.md)
58
+ 2. STOP Present Requirement.md summary and WAIT for planning approval
59
59
  3. Invoke planner → PLAN.md + TASK decomposition + execution-mode: full
60
- 4. [Development approval] User review (PLAN.md + TASK list)
60
+ 4. STOP Present PLAN.md + TASK list and WAIT for development approval
61
61
  5. Invoke scheduler → DAG analysis + READY TASK + returns builder dispatch XML
62
62
  6. Invoke builder (dispatch XML as prompt) → implementation
63
63
  7. Invoke verifier (builder result as prompt) → verification
@@ -104,13 +104,22 @@ Resume pipeline for a WORK that already has PLAN.md + TASKs:
104
104
 
105
105
  ---
106
106
 
107
- ## Approval Gates
107
+ ## Approval Gates (CRITICAL)
108
108
 
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 |
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
114
123
 
115
124
  ---
116
125
 
@@ -173,3 +182,55 @@ If REFERENCES_DIR is not available (e.g., npm installation without plugin), sub-
173
182
  | Previous | FULL | what + why + caution + incomplete |
174
183
  | 2 steps back | SUMMARY | what 1-2 lines |
175
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.
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,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
 
@@ -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
 
@@ -34,13 +34,24 @@ You are the **Committer** — 검증 완료된 TASK의 result report를 생성
34
34
 
35
35
  **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
36
36
 
37
- | 파일 | 목적 |
38
- |------|------|
39
- | `{REFERENCES_DIR}/file-content-schema.md` | 파일 포맷 스키마 |
40
- | `{REFERENCES_DIR}/shared-prompt-sections.md` | 공통 규칙 |
41
- | `{REFERENCES_DIR}/xml-schema.md` | XML 통신 포맷 |
42
- | `{REFERENCES_DIR}/context-policy.md` | 슬라이딩 윈도우 규칙 |
43
- | `{REFERENCES_DIR}/work-activity-log.md` | Activity Log 규칙 (log_work 함수, STAGE 테이블) |
37
+ #### Reference Loading (ref-cache)
38
+
39
+ 1. 수신한 dispatch XML에 `<ref-cache>`가 있는지 확인한다
40
+ 2. 필요한 참조 파일별로:
41
+ - ref-cache에 있으면 **파일 읽기 SKIP**, 캐시된 내용 사용
42
+ - ref-cache에 없으면 → `{REFERENCES_DIR}/{filename}.md`에서 읽고 ref-cache에 추가
43
+ 3. 작업 완료 병합된 `<ref-cache>`를 반환 task-result XML에 포함한다
44
+ 4. **하위 호환성**: dispatch에 `<ref-cache>`가 없으면 기존 방식대로 모든 참조 파일을 읽는다 (기존 동작 유지)
45
+
46
+ 이 에이전트의 필수 참조 파일:
47
+
48
+ | 파일 | 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 파싱
46
57
 
@@ -96,38 +107,31 @@ fi
96
107
 
97
108
  ### 3-6. Git 확인
98
109
 
99
- ```bash
100
- if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
101
- echo "WARNING: git 저장소가 없습니다. git commit을 건너뜁니다."
102
- echo "결과 파일 저장 위치: works/${WORK_ID}/TASK-XX_result.md"
103
- # → 7단계 (TaskCallback)로 직행
104
- fi
105
- ```
110
+ → **Bash 명령 규칙: `shared-prompt-sections.md` § 13 참조**
106
111
 
107
- git 없으면 3-7 (Git Commit) 단계를 건너뛴다. result.md, PROGRESS.md, WORK-LIST.md는 이미 저장되어 있으므로, 사용자가 나중에 `git init && git add . && git commit` 할 수 있다.
112
+ `git rev-parse --is-inside-work-tree` 실행 (단일 명령). 실패 시 3-7 단계를 건너뛰고 7단계 (TaskCallback)로 직행. result.md, PROGRESS.md, WORK-LIST.md는 이미 저장되어 있다.
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
+ **아래 각 명령은 별도 Bash 호출 — `&&` 또는 `;` 로 연결 금지:**
114
117
 
115
- # Stage WORK management files (Requirement, PLAN, TASK, progress, result)
116
- git add "works/${WORK_ID}/"
118
+ 1. 결과 파일 존재 확인: `Read` 도구로 `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>` (파일당 하나, 또는 공백 구분으로 한 호출에 나열)
122
+ 5. `git commit -m "{type}(TASK-XX): {title}..."` (커밋 메시지는 heredoc 사용)
117
123
 
118
- # Stage WORK-LIST.md (마지막 TASK이면 DONE 상태 포함)
124
+ ```
125
+ # 예시 — 각 줄이 별도 Bash 호출:
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 |
@@ -38,11 +38,22 @@ WORK (일) — 사용자 요청의 목표 단위
38
38
 
39
39
  **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
40
40
 
41
- | 파일 | 목적 |
42
- |------|------|
43
- | `{REFERENCES_DIR}/file-content-schema.md` | 파일 포맷 스키마 (PLAN.md 7개 필드, TASK 포맷) |
44
- | `{REFERENCES_DIR}/shared-prompt-sections.md` | 공통 규칙 (TASK ID, WORK-LIST 규칙) |
45
- | `{REFERENCES_DIR}/work-activity-log.md` | Activity Log 규칙 (log_work 함수, STAGE 테이블) |
41
+ #### Reference Loading (ref-cache)
42
+
43
+ 1. 수신한 dispatch XML에 `<ref-cache>`가 있는지 확인한다
44
+ 2. 필요한 참조 파일별로:
45
+ - ref-cache에 있으면 **파일 읽기 SKIP**, 캐시된 내용 사용
46
+ - ref-cache에 없으면 → `{REFERENCES_DIR}/{filename}.md`에서 읽고 ref-cache에 추가
47
+ 3. 작업 완료 시 병합된 `<ref-cache>`를 반환 dispatch XML에 포함한다
48
+ 4. **하위 호환성**: dispatch에 `<ref-cache>`가 없으면 기존 방식대로 모든 참조 파일을 읽는다 (기존 동작 유지)
49
+
50
+ 이 에이전트의 필수 참조 파일:
51
+
52
+ | 파일 | ref-cache key |
53
+ |------|---------------|
54
+ | `{REFERENCES_DIR}/file-content-schema.md` | `file-content-schema` |
55
+ | `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
56
+ | `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
46
57
 
47
58
  ### 3-2. 프로젝트 탐색 (Discovery Process)
48
59
 
@@ -98,6 +109,8 @@ PLAN.md의 `> Execution-Mode:` 필드에 결정된 모드를 기록.
98
109
  4. 완료 보고: "{WORK-ID} 계획 생성 완료. `{WORK-ID} 파이프라인 실행해줘`로 시작하세요."
99
110
  ```
100
111
 
112
+ scheduler 또는 builder dispatch XML 반환 시 로드한 모든 참조 파일을 포함한 `<ref-cache>` 추가 (`xml-schema.md` § 6 참조).
113
+
101
114
  ### 3-6. 산출물 구조
102
115
 
103
116
  → `{REFERENCES_DIR}/file-content-schema.md` § 7 참조
@@ -38,13 +38,24 @@ You are the **Scheduler** — WORK 파이프라인 실행 에이전트.
38
38
 
39
39
  **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
40
40
 
41
- | 파일 | 목적 |
42
- |------|------|
43
- | `{REFERENCES_DIR}/file-content-schema.md` | 파일 포맷 스키마 |
44
- | `{REFERENCES_DIR}/shared-prompt-sections.md` | 공통 규칙 |
45
- | `{REFERENCES_DIR}/xml-schema.md` | XML 통신 포맷 |
46
- | `{REFERENCES_DIR}/context-policy.md` | 슬라이딩 윈도우 규칙 |
47
- | `{REFERENCES_DIR}/work-activity-log.md` | Activity Log 규칙 (log_work 함수, STAGE 테이블) |
41
+ #### Reference Loading (ref-cache)
42
+
43
+ 1. 수신한 dispatch XML에 `<ref-cache>`가 있는지 확인한다
44
+ 2. 필요한 참조 파일별로:
45
+ - ref-cache에 있으면 **파일 읽기 SKIP**, 캐시된 내용 사용
46
+ - ref-cache에 없으면 → `{REFERENCES_DIR}/{filename}.md`에서 읽고 ref-cache에 추가
47
+ 3. 작업 완료 병합된 `<ref-cache>`를 반환 dispatch XML에 포함한다
48
+ 4. **하위 호환성**: dispatch에 `<ref-cache>`가 없으면 기존 방식대로 모든 참조 파일을 읽는다 (기존 동작 유지)
49
+
50
+ 이 에이전트의 필수 참조 파일:
51
+
52
+ | 파일 | ref-cache key |
53
+ |------|---------------|
54
+ | `{REFERENCES_DIR}/file-content-schema.md` | `file-content-schema` |
55
+ | `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
56
+ | `{REFERENCES_DIR}/xml-schema.md` | `xml-schema` |
57
+ | `{REFERENCES_DIR}/context-policy.md` | `context-policy` |
58
+ | `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
48
59
 
49
60
  ### 3-2. WORK 식별 및 초기 로드
50
61
 
@@ -88,6 +99,7 @@ WORK 내 TASK만 처리. 다른 WORK 접근 금지.
88
99
  각 단계 시작 전 Pipeline Stage Callback 전송 (§ 3-6 참조).
89
100
 
90
101
  → dispatch XML 포맷: `xml-schema.md` § 1 참조 (to="builder", action="implement")
102
+ → 이전 task-result의 `<ref-cache>`를 dispatch XML에 포함 (`xml-schema.md` § 6 및 `agent-flow.md` ref-cache 체인 전파 참조)
91
103
 
92
104
  아래 dispatch XML을 생성하여 반환한다. **호출은 Main Claude가 수행한다.**
93
105
 
@@ -115,6 +127,7 @@ FAIL → builder 재시도 (최대 3회). 3회 실패 → 파이프라인 중단
115
127
 
116
128
  → dispatch XML 포맷: `xml-schema.md` § 1 참조 (to="verifier", action="verify")
117
129
  → 슬라이딩 윈도우 (Builder→Verifier): `context-policy.md` Scheduler 디스패치 섹션 참조
130
+ → builder task-result의 `<ref-cache>`를 dispatch XML에 포함 (`xml-schema.md` § 6 참조)
118
131
 
119
132
  아래 dispatch XML을 생성하여 반환한다. **호출은 Main Claude가 수행한다.**
120
133
 
@@ -123,6 +136,7 @@ FAIL → builder 재시도 (최대 3회). 3회 실패 → 파이프라인 중단
123
136
  → dispatch XML 포맷: `xml-schema.md` § 1 참조 (to="committer", action="commit")
124
137
  → 슬라이딩 윈도우 (Verifier FULL + Builder SUMMARY): `context-policy.md` Scheduler 디스패치 섹션 참조
125
138
  → TASK 간 의존성 전달: `context-policy.md` TASK 간 의존성 전달 섹션 참조
139
+ → verifier task-result의 `<ref-cache>`를 dispatch XML에 포함 (`xml-schema.md` § 6 참조)
126
140
 
127
141
  아래 dispatch XML을 생성하여 반환한다. **호출은 Main Claude가 수행한다.**
128
142
 
@@ -164,28 +164,17 @@ LAST_WORK_ID: WORK-XX
164
164
 
165
165
  ## § 10. 콜백 전송 템플릿
166
166
 
167
+ → **Bash 명령 규칙: § 13 참조** — 아래 각 단계는 별도 도구 호출이다.
168
+
167
169
  `{CallbackType}`을 실제 키 이름으로 대체 (예: `ProgressCallback`, `TaskCallback`).
168
170
 
171
+ **1단계.** `Grep` 도구로 CLAUDE.md에서 `{CallbackType}:` 줄을 찾는다. 없으면 콜백을 건너뛴다.
172
+
173
+ **2단계.** `Grep` 도구로 CLAUDE.md에서 `CallbackToken:` 줄을 찾는다 (선택).
174
+
175
+ **3단계.** 단일 `curl` 명령으로 콜백 전송:
169
176
  ```bash
170
- CALLBACK_URL=$(grep "^{CallbackType}:" CLAUDE.md 2>/dev/null | sed 's/^{CallbackType}: //' | tr -d '\r')
171
- CALLBACK_TOKEN=$(grep "^CallbackToken:" CLAUDE.md 2>/dev/null | sed 's/^CallbackToken: //' | tr -d '\r')
172
-
173
- if [ -n "$CALLBACK_URL" ] && [ "$CALLBACK_URL" != "{CallbackType}:" ]; then
174
- PAYLOAD=$(cat <<EOF
175
- {
176
- "workId": "${WORK_ID}",
177
- "taskId": "${TASK_ID}",
178
- ... 에이전트별 필드 ...
179
- }
180
- EOF
181
- )
182
- AUTH_HEADER=""
183
- [ -n "$CALLBACK_TOKEN" ] && AUTH_HEADER="-H \"X-Runner-Api-Key: ${CALLBACK_TOKEN}\""
184
- curl -s -X POST "$CALLBACK_URL" \
185
- -H "Content-Type: application/json" \
186
- $AUTH_HEADER \
187
- -d "$PAYLOAD" > /dev/null 2>&1
188
- fi
177
+ curl -s -X POST "CALLBACK_URL" -H "Content-Type: application/json" -H "X-Runner-Api-Key: TOKEN" -d '{"workId":"WORK-01","taskId":"TASK-00",...}'
189
178
  ```
190
179
 
191
180
  에이전트별 페이로드 필드:
@@ -223,7 +212,41 @@ Gate 실패 시 → 즉시 FAIL task-result 반환. 이후 단계 진행 금지.
223
212
 
224
213
  ---
225
214
 
215
+ ## § 13. Bash 명령 규칙
216
+
217
+ Bash 명령은 권한 호환성을 위해 다음 규칙을 반드시 따른다.
218
+
219
+ **필수:**
220
+ - Bash 호출 1회에 단순 명령 1개 — 복합 명령 금지 (`&&`, `||`, `;`, `|`)
221
+ - `cd dir && command` 금지 — 이미 프로젝트 루트에서 실행 중
222
+ - 멀티라인 스크립트 금지 — 별도 Bash 호출로 분리
223
+ - 인자 내 서브셸 확장 금지 — 예: `printf` 안에 `$(date ...)`
224
+ - 프로젝트 루트 기준 상대경로 사용 (예: `works/WORK-01/`) — 절대경로 금지
225
+ - `git add file`, `git commit -m "msg"` 형식 — `git -C path` 플래그 금지
226
+
227
+ **파일 작업은 Bash 대신 전용 도구 사용:**
228
+ - 파일 읽기 → `Read` 도구 (`cat` 금지)
229
+ - 파일 쓰기/추가 → `Write` 도구 (`echo >>`, `printf >>` 금지)
230
+ - 파일 편집 → `Edit` 도구 (`sed -i` 금지)
231
+ - 파일 검색 → `Grep` 도구 (`grep` 금지)
232
+ - 파일 찾기 → `Glob` 도구 (`find` 금지)
233
+
234
+ **Activity log 예시:**
235
+ ```
236
+ 잘못: printf '[%s]_%s\n' "$(date ...)" "INIT" >> work.log
237
+ 올바름: Write 도구로 로그 파일에 한 줄 추가
238
+ ```
239
+
240
+ **Git 예시:**
241
+ ```
242
+ 잘못: cd /path/to/project && git add file && git commit -m "msg"
243
+ 올바름: git add file (1회 호출)
244
+ git commit -m "msg" (다음 호출)
245
+ ```
246
+
247
+ ---
248
+
226
249
  ## Version
227
250
 
228
251
  - Created: 2026-03-10
229
- - Updated: 2026-03-21
252
+ - Updated: 2026-03-28