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.
@@ -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,17 +38,29 @@ 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
 
49
- ```bash
50
- # 1. 기존 WORK 확인
51
- ls -d works/WORK-* 2>/dev/null | sort -V | tail -1
60
+ ```
61
+ # 1. 기존 WORK 확인 — Glob 도구 사용
62
+ Glob pattern: "works/WORK-*/"
63
+ → 마지막 항목이 최신 WORK 번호
52
64
  ```
53
65
 
54
66
  → 탐색 명령 (2~4단계): `shared-prompt-sections.md` § 11 참조
@@ -98,6 +110,8 @@ PLAN.md의 `> Execution-Mode:` 필드에 결정된 모드를 기록.
98
110
  4. 완료 보고: "{WORK-ID} 계획 생성 완료. `{WORK-ID} 파이프라인 실행해줘`로 시작하세요."
99
111
  ```
100
112
 
113
+ scheduler 또는 builder dispatch XML 반환 시 로드한 모든 참조 파일을 포함한 `<ref-cache>` 추가 (`xml-schema.md` § 6 참조).
114
+
101
115
  ### 3-6. 산출물 구조
102
116
 
103
117
  → `{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
 
@@ -28,7 +28,7 @@ elif [ -f "Cargo.toml" ]; then
28
28
  elif [ -f "go.mod" ]; then
29
29
  go build ./... 2>&1
30
30
  elif [ -f "pyproject.toml" ] || [ -f "setup.py" ]; then
31
- python -m py_compile $(find . -name "*.py" -not -path "*/venv/*" | head -20) 2>&1
31
+ python -m py_compile $(find . -maxdepth 3 -name "*.py" -not -path "*/venv/*" 2>/dev/null) 2>&1
32
32
  elif [ -f "Makefile" ]; then
33
33
  make build 2>&1 || make 2>&1
34
34
  fi
@@ -68,22 +68,20 @@ works/{WORK_ID}/
68
68
 
69
69
  ## § 4. File System Discovery Scripts
70
70
 
71
- ```bash
71
+ ```
72
72
  # 미완료 TASK가 있는 최신 WORK 찾기
73
- for dir in $(ls -d works/WORK-* 2>/dev/null | sort -V -r); do
74
- WORK_ID=$(basename $dir)
75
- TOTAL=$(ls $dir/TASK-*.md 2>/dev/null | grep -v result | wc -l)
76
- DONE=$(ls $dir/TASK-*_result.md 2>/dev/null | wc -l)
77
- [ "$DONE" -lt "$TOTAL" ] && echo "$WORK_ID" && break
78
- done
73
+ # Glob 도구 사용: pattern "works/WORK-*/" 전체 WORK 디렉토리 목록 (정렬됨)
74
+ # 각 WORK (역순)에 대해 비교:
75
+ # Glob "works/WORK-NN/TASK-*.md" (*_result.md, *_progress.md 제외) TOTAL
76
+ # Glob "works/WORK-NN/TASK-*_result.md" DONE
77
+ # DONE < TOTAL 번째 WORK가 활성 WORK
79
78
 
80
79
  # 전체 WORK 목록
81
- ls -d works/WORK-* 2>/dev/null | sort -V
80
+ # Glob 도구 사용: pattern "works/WORK-*/"
82
81
 
83
82
  # TASK 완료 현황
84
- TOTAL=$(ls works/${WORK_ID}/TASK-*.md 2>/dev/null | grep -v result | wc -l)
85
- DONE=$(ls works/${WORK_ID}/TASK-*_result.md 2>/dev/null | wc -l)
86
- echo "$DONE / $TOTAL"
83
+ # TOTAL = Glob "works/${WORK_ID}/TASK-??.md" 개수
84
+ # DONE = Glob "works/${WORK_ID}/TASK-*_result.md" 개수
87
85
  ```
88
86
 
89
87
  ---
@@ -164,28 +162,17 @@ LAST_WORK_ID: WORK-XX
164
162
 
165
163
  ## § 10. 콜백 전송 템플릿
166
164
 
165
+ → **Bash 명령 규칙: § 13 참조** — 아래 각 단계는 별도 도구 호출이다.
166
+
167
167
  `{CallbackType}`을 실제 키 이름으로 대체 (예: `ProgressCallback`, `TaskCallback`).
168
168
 
169
+ **1단계.** `Grep` 도구로 CLAUDE.md에서 `{CallbackType}:` 줄을 찾는다. 없으면 콜백을 건너뛴다.
170
+
171
+ **2단계.** `Grep` 도구로 CLAUDE.md에서 `CallbackToken:` 줄을 찾는다 (선택).
172
+
173
+ **3단계.** 단일 `curl` 명령으로 콜백 전송:
169
174
  ```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
175
+ 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
176
  ```
190
177
 
191
178
  에이전트별 페이로드 필드:
@@ -201,13 +188,13 @@ fi
201
188
  grep -oP '(?<=Language:\s?)[a-z]{2}' CLAUDE.md 2>/dev/null
202
189
 
203
190
  # 2. 기술 스택
204
- cat package.json 2>/dev/null | head -50
205
- cat pyproject.toml 2>/dev/null | head -30
206
- cat Cargo.toml 2>/dev/null | head -20
207
- cat go.mod 2>/dev/null | head -10
191
+ head -50 package.json 2>/dev/null
192
+ head -30 pyproject.toml 2>/dev/null
193
+ head -20 Cargo.toml 2>/dev/null
194
+ head -10 go.mod 2>/dev/null
208
195
 
209
196
  # 3. 구조 (필요 시)
210
- find . -maxdepth 3 -type f \( -name "*.md" -o -name "*.json" -o -name "*.toml" \) | grep -v node_modules | head -30
197
+ find . -maxdepth 3 -type f \( -name "*.md" -o -name "*.json" -o -name "*.toml" \) -not -path "*/node_modules/*" 2>/dev/null
211
198
  ```
212
199
 
213
200
  ---
@@ -223,7 +210,41 @@ Gate 실패 시 → 즉시 FAIL task-result 반환. 이후 단계 진행 금지.
223
210
 
224
211
  ---
225
212
 
213
+ ## § 13. Bash 명령 규칙
214
+
215
+ Bash 명령은 권한 호환성을 위해 다음 규칙을 반드시 따른다.
216
+
217
+ **필수:**
218
+ - Bash 호출 1회에 단순 명령 1개 — 복합 명령 금지 (`&&`, `||`, `;`, `|`)
219
+ - `cd dir && command` 금지 — 이미 프로젝트 루트에서 실행 중
220
+ - 멀티라인 스크립트 금지 — 별도 Bash 호출로 분리
221
+ - 인자 내 서브셸 확장 금지 — 예: `printf` 안에 `$(date ...)`
222
+ - 프로젝트 루트 기준 상대경로 사용 (예: `works/WORK-01/`) — 절대경로 금지
223
+ - `git add file`, `git commit -m "msg"` 형식 — `git -C path` 플래그 금지
224
+
225
+ **파일 작업은 Bash 대신 전용 도구 사용:**
226
+ - 파일 읽기 → `Read` 도구 (`cat` 금지)
227
+ - 파일 쓰기/추가 → `Write` 도구 (`echo >>`, `printf >>` 금지)
228
+ - 파일 편집 → `Edit` 도구 (`sed -i` 금지)
229
+ - 파일 검색 → `Grep` 도구 (`grep` 금지)
230
+ - 파일 찾기 → `Glob` 도구 (`find` 금지)
231
+
232
+ **Activity log 예시:**
233
+ ```
234
+ 잘못: printf '[%s]_%s\n' "$(date ...)" "INIT" >> work.log
235
+ 올바름: Write 도구로 로그 파일에 한 줄 추가
236
+ ```
237
+
238
+ **Git 예시:**
239
+ ```
240
+ 잘못: cd /path/to/project && git add file && git commit -m "msg"
241
+ 올바름: git add file (1회 호출)
242
+ git commit -m "msg" (다음 호출)
243
+ ```
244
+
245
+ ---
246
+
226
247
  ## Version
227
248
 
228
249
  - Created: 2026-03-10
229
- - Updated: 2026-03-21
250
+ - Updated: 2026-03-28
@@ -34,12 +34,23 @@ You are the **Specifier** — 사용자 요청을 요구사항으로 명세화
34
34
 
35
35
  **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인을 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
36
36
 
37
- | 파일 | 목적 |
38
- |------|------|
39
- | `{REFERENCES_DIR}/file-content-schema.md` | 파일 포맷 스키마 (PLAN.md, TASK, Requirement.md 포맷) |
40
- | `{REFERENCES_DIR}/shared-prompt-sections.md` | 공통 규칙 (TASK ID 패턴, WORK-LIST 규칙, log_work 함수) |
41
- | `{REFERENCES_DIR}/xml-schema.md` | XML 통신 포맷 (dispatch / task-result 구조) |
42
- | `{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>`를 반환 dispatch 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}/work-activity-log.md` | `work-activity-log` |
43
54
 
44
55
  ### 3-2. WORK ID 결정
45
56
 
@@ -116,6 +127,7 @@ Requirement.md 작성 완료 후, **요구사항 자체의 복잡도**로 판단
116
127
  ```
117
128
 
118
129
  → dispatch XML 포맷: `xml-schema.md` § 1 참조 (to="builder", task="TASK-00", execution-mode="direct")
130
+ → 로드한 모든 참조 파일을 포함한 `<ref-cache>` 추가 (`xml-schema.md` § 6 참조)
119
131
 
120
132
  ### 3-7. Planner 위임 — 복잡 요구사항 (pipeline/full)
121
133
 
@@ -136,6 +148,7 @@ Requirement.md 작성 완료 후, **요구사항 자체의 복잡도**로 판단
136
148
  ```
137
149
 
138
150
  → dispatch XML 포맷: `xml-schema.md` § 1 참조 (to="planner", execution-mode="full")
151
+ → 로드한 모든 참조 파일을 포함한 `<ref-cache>` 추가 (`xml-schema.md` § 6 참조)
139
152
 
140
153
  ### 3-8. Output Language Rule
141
154
 
@@ -35,12 +35,23 @@ Builder가 완료한 TASK 결과물을 검증하여 빌드, 린트, 테스트, A
35
35
 
36
36
  **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
37
37
 
38
- | 파일 | 목적 |
39
- |------|------|
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 테이블) |
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}/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 입력 파싱
46
57
 
@@ -10,19 +10,21 @@
10
10
  * 작업 진행 시 : 작업항목 및 작업내용
11
11
  * 수행작업 완료 시 : 타 Agent에 전송한 프롬프트 메시지** Agent 시작 시 수신한 프롬프트 메시지 내용 (Required 필수)
12
12
 
13
- ## log_work 함수
14
-
15
- ```bash
16
- AGENT_NAME="SPECIFIER" # 각 에이전트 파일에서 적절히 설정
17
-
18
- log_work() {
19
- local WORK_ID="$1" AGENT="$2" STAGE="$3" DESC="$4"
20
- mkdir -p "works/${WORK_ID}"
21
- printf '[%s]_%s_%s_%s\n' \
22
- "$(date '+%Y-%m-%dT%H:%M:%S')" "$AGENT" "$STAGE" "$DESC" \
23
- >> "works/${WORK_ID}/work_${WORK_ID}.log"
24
- }
13
+ ## log_work 방법
14
+
15
+ Activity log 기록에 **Bash를 사용하지 않는다**. `Write` 도구 (또는 `Edit` 도구로 추가)를 사용한다.
16
+
17
+ 각 로그 항목 포맷:
25
18
  ```
19
+ [YYYY-MM-DDTHH:MM:SS]_AGENT_STAGE_설명
20
+ ```
21
+
22
+ 예시: INIT 단계 로그 기록 시, **Write** 도구로 `works/{WORK_ID}/work_{WORK_ID}.log`에 추가:
23
+ ```
24
+ [2026-03-28T14:30:00]_SPECIFIER_INIT_WORK-09 생성 — Execution-Mode: direct
25
+ ```
26
+
27
+ → **Bash 명령 규칙: `shared-prompt-sections.md` § 13 참조**
26
28
 
27
29
  ---
28
30
 
package/agents/planner.md CHANGED
@@ -38,17 +38,29 @@ WORK (unit of work) — Goal unit of the user's request
38
38
 
39
39
  **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`.
40
40
 
41
- | File | Purpose |
42
- |------|---------|
43
- | `{REFERENCES_DIR}/file-content-schema.md` | File format schema (PLAN.md 7 fields, TASK format) |
44
- | `{REFERENCES_DIR}/shared-prompt-sections.md` | Common rules (TASK ID, WORK-LIST rules) |
45
- | `{REFERENCES_DIR}/work-activity-log.md` | Activity Log rules (log_work function, STAGE table) |
41
+ #### Reference Loading (ref-cache)
42
+
43
+ 1. Check if `<ref-cache>` exists in the received dispatch XML
44
+ 2. For each required reference file:
45
+ - If present in ref-cache **SKIP file read**, use cached content
46
+ - If absent from ref-cache → Read from `{REFERENCES_DIR}/{filename}.md` and add to ref-cache
47
+ 3. On task completion, include the merged `<ref-cache>` in the returned task-result XML
48
+ 4. **Backward compatibility**: If dispatch contains no `<ref-cache>`, read all reference files normally (existing behavior)
49
+
50
+ Required reference files for this agent:
51
+
52
+ | File | 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. Project Exploration (Discovery Process)
48
59
 
49
- ```bash
50
- # 1. Check existing WORKs
51
- ls -d works/WORK-* 2>/dev/null | sort -V | tail -1
60
+ ```
61
+ # 1. Check existing WORKs — use Glob tool
62
+ Glob pattern: "works/WORK-*/"
63
+ → Take the last entry (latest WORK number)
52
64
  ```
53
65
 
54
66
  → Discovery commands (steps 2–4): see `shared-prompt-sections.md` § 11
@@ -98,6 +110,8 @@ Record the determined mode in PLAN.md's `> Execution-Mode:` field.
98
110
  4. Completion report: "{WORK-ID} plan created. Start with `Run {WORK-ID} pipeline`."
99
111
  ```
100
112
 
113
+ When returning scheduler or builder dispatch XML, include `<ref-cache>` with all reference files loaded (see `xml-schema.md` § 6).
114
+
101
115
  ### 3-6. Output Structure
102
116
 
103
117
  → see `{REFERENCES_DIR}/file-content-schema.md` § 7
@@ -38,13 +38,24 @@ You are the **Scheduler** — the WORK pipeline execution agent.
38
38
 
39
39
  **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`.
40
40
 
41
- | File | Purpose |
42
- |------|---------|
43
- | `{REFERENCES_DIR}/file-content-schema.md` | File format schema |
44
- | `{REFERENCES_DIR}/shared-prompt-sections.md` | Common rules |
45
- | `{REFERENCES_DIR}/xml-schema.md` | XML communication format |
46
- | `{REFERENCES_DIR}/context-policy.md` | Sliding Window rules |
47
- | `{REFERENCES_DIR}/work-activity-log.md` | Activity Log rules (log_work function, STAGE table) |
41
+ #### Reference Loading (ref-cache)
42
+
43
+ 1. Check if `<ref-cache>` exists in the received dispatch XML
44
+ 2. For each required reference file:
45
+ - If present in ref-cache **SKIP file read**, use cached content
46
+ - If absent from ref-cache → Read from `{REFERENCES_DIR}/{filename}.md` and add to ref-cache
47
+ 3. On task completion, include the merged `<ref-cache>` in the returned task-result XML
48
+ 4. **Backward compatibility**: If dispatch contains no `<ref-cache>`, read all reference files normally (existing behavior)
49
+
50
+ Required reference files for this agent:
51
+
52
+ | File | 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 Identification and Initial Load
50
61
 
@@ -88,6 +99,7 @@ Process only TASKs within the WORK. Access to other WORKs prohibited.
88
99
  Send Pipeline Stage Callback before each stage starts (see § 3-6).
89
100
 
90
101
  → dispatch XML format: see `xml-schema.md` § 1 (to="builder", action="implement")
102
+ → Include `<ref-cache>` from previous task-result in dispatch XML (see `xml-schema.md` § 6 and `agent-flow.md` ref-cache Chain Propagation)
91
103
 
92
104
  Generate the dispatch XML below and return it. **Invocation is performed by Main Claude.**
93
105
 
@@ -115,6 +127,7 @@ FAIL → retry builder (max 3 times). 3 failures → pipeline halted.
115
127
 
116
128
  → dispatch XML format: see `xml-schema.md` § 1 (to="verifier", action="verify")
117
129
  → Sliding Window (Builder→Verifier): see `context-policy.md` Scheduler Dispatch section
130
+ → Include `<ref-cache>` from builder task-result in dispatch XML (see `xml-schema.md` § 6)
118
131
 
119
132
  Generate the dispatch XML below and return it. **Invocation is performed by Main Claude.**
120
133
 
@@ -123,6 +136,7 @@ Generate the dispatch XML below and return it. **Invocation is performed by Main
123
136
  → dispatch XML format: see `xml-schema.md` § 1 (to="committer", action="commit")
124
137
  → Sliding Window (Verifier FULL + Builder SUMMARY): see `context-policy.md` Scheduler Dispatch section
125
138
  → Inter-TASK Dependency Transfer: see `context-policy.md` Inter-TASK Dependency Transfer section
139
+ → Include `<ref-cache>` from verifier task-result in dispatch XML (see `xml-schema.md` § 6)
126
140
 
127
141
  Generate the dispatch XML below and return it. **Invocation is performed by Main Claude.**
128
142