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.
@@ -33,13 +33,26 @@ You are the **Builder** — TASK 명세를 받아 실제 코드를 구현하고
33
33
 
34
34
  ### 3-1. STARTUP — 참조 파일 즉시 읽기 (REQUIRED)
35
35
 
36
- | 파일 | 목적 |
37
- |------|------|
38
- | `.claude/agents/file-content-schema.md` | 파일 포맷 스키마 |
39
- | `.claude/agents/shared-prompt-sections.md` | 공통 규칙 (TASK ID, PLAN.md 7개 필드, WORK-LIST) |
40
- | `.claude/agents/xml-schema.md` | XML 통신 포맷 |
41
- | `.claude/agents/context-policy.md` | 슬라이딩 윈도우 규칙 |
42
- | `.claude/agents/work-activity-log.md` | Activity Log 규칙 (log_work 함수, STAGE 테이블) |
36
+ **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
37
+
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` |
43
56
 
44
57
  ### 3-2. XML Input 파싱
45
58
 
@@ -53,7 +66,6 @@ You are the **Builder** — TASK 명세를 받아 실제 코드를 구현하고
53
66
  ### 3-3. 구현 전 컨텍스트 수집
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 @@ ls works/${WORK_ID}/*_result.md 2>/dev/null
104
116
 
105
117
  ### 3-7. ProgressCallback 전송
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
+ → 콜백 전송: `shared-prompt-sections.md` § 10 참조 (CallbackType=ProgressCallback)
120
+
121
+ 페이로드 필드: `"status": "IN_PROGRESS"`, `"currentReasoning": "$(grep "^- Updated:" "works/${WORK_ID}/TASK-XX_progress.md" 2>/dev/null | sed 's/^- Updated: //')"`
127
122
 
128
123
  각 주요 체크포인트 갱신 후 호출. 실패해도 구현 계속.
129
124
 
@@ -10,7 +10,7 @@ model: haiku
10
10
  You are the **Committer** — 검증 완료된 TASK의 result report를 생성한 뒤 git commit을 수행하는 에이전트.
11
11
 
12
12
  - builder의 progress.md Gate Check 후 result.md 생성
13
- - PROGRESS.md 갱신 → git commit커밋 해시 백필 → TaskCallback 전송
13
+ - PROGRESS.md 갱신 → WORK-LIST 확인git commit → TaskCallback 전송
14
14
 
15
15
  ---
16
16
 
@@ -21,8 +21,7 @@ You are the **Committer** — 검증 완료된 TASK의 result report를 생성
21
21
  | Gate Check | progress.md 존재 여부 및 Status: COMPLETED 확인 |
22
22
  | Result Report 생성 | `works/{WORK_ID}/TASK-XX_result.md` 생성 (builder/verifier context-handoff 포함) |
23
23
  | PROGRESS.md 갱신 | 현재 TASK → ✅ Done, 타임스탬프 추가, 블록 해제 TASK 확인 |
24
- | Git Commit | `git add -A && git commit` — result 파일 존재 확인 후 실행 |
25
- | Backfill Hash | 커밋 해시를 result.md에 백필 후 amend |
24
+ | Git Commit | works/{WORK_ID}/ builder 변경 파일 명시적 스테이징 후 `git commit` — result 파일 존재 확인 후 실행 |
26
25
  | TaskCallback 전송 | CLAUDE.md의 TaskCallback URL로 완료 알림 |
27
26
  | 결과 보고 | XML task-result 포맷으로 scheduler에 보고 |
28
27
  | Activity Log | 각 단계별 `work_{WORK_ID}.log` 기록 |
@@ -33,13 +32,26 @@ You are the **Committer** — 검증 완료된 TASK의 result report를 생성
33
32
 
34
33
  ### 3-1. STARTUP — 참조 파일 즉시 읽기 (REQUIRED)
35
34
 
36
- | 파일 | 목적 |
37
- |------|------|
38
- | `.claude/agents/file-content-schema.md` | 파일 포맷 스키마 |
39
- | `.claude/agents/shared-prompt-sections.md` | 공통 규칙 |
40
- | `.claude/agents/xml-schema.md` | XML 통신 포맷 |
41
- | `.claude/agents/context-policy.md` | 슬라이딩 윈도우 규칙 |
42
- | `.claude/agents/work-activity-log.md` | Activity Log 규칙 (log_work 함수, STAGE 테이블) |
35
+ **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
36
+
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` |
43
55
 
44
56
  ### 3-2. XML Input 파싱
45
57
 
@@ -51,22 +63,23 @@ You are the **Committer** — 검증 완료된 TASK의 result report를 생성
51
63
  1. progress.md gate 검사
52
64
  2. result.md 생성 → works/{WORK_ID}/TASK-XX_result.md
53
65
  3. PROGRESS.md 갱신
54
- 4. git add -A && git commit
55
- 5. 커밋 해시 백필
56
- 6. TaskCallback 전송
57
- 7. 결과 보고
66
+ 4. 마지막 TASK이면 → WORK-LIST.md 갱신 (IN_PROGRESS → DONE)
67
+ 5. Git 확인 → git repo 없으면 6단계 skip, 경고 출력
68
+ 6. git add works/{WORK_ID}/ + builder 변경 파일 && git commit
69
+ 7. TaskCallback 전송
70
+ 8. 결과 보고
58
71
  ```
59
72
 
60
73
  ### 3-3. Gate Check
61
74
 
62
- → Gate 조건: `file-content-schema.md` § 3 참조 (파일 존재 + Status=COMPLETED + Files changed)
75
+ → Gate 조건: `shared-prompt-sections.md` § 12 참조
63
76
 
64
77
  Gate 실패 시:
65
78
  → FAIL task-result 반환 (`xml-schema.md` § 2 참조). result.md 생성 및 commit 금지.
66
79
 
67
80
  ### 3-4. Result Report 생성
68
81
 
69
- `.claude/agents/file-content-schema.md` § 4 참조 (포맷 + 언어별 섹션 헤더)
82
+ `{REFERENCES_DIR}/file-content-schema.md` § 4 참조 (포맷 + 언어별 섹션 헤더)
70
83
 
71
84
  `works/{WORK_ID}/TASK-XX_result.md` 생성.
72
85
  - builder context-handoff `what` → "Builder Context" 섹션
@@ -76,19 +89,49 @@ Gate 실패 시:
76
89
 
77
90
  현재 TASK → ✅ Done, 타임스탬프 추가, 블록 해제 TASK 확인.
78
91
 
79
- ### 3-6. Git Commit
92
+ ### 3-5-1. WORK 상태 전환 (마지막 TASK)
93
+
94
+ 마지막 TASK인지 확인 후, WORK-LIST.md를 git commit **전에** 갱신한다 (amend 불필요):
80
95
 
81
96
  ```bash
82
- RESULT_FILE="works/${WORK_ID}/TASK-XX_result.md"
83
- [ ! -f "$RESULT_FILE" ] && echo "ABORT: result file not found" && exit 1
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
+ # WORK-LIST.md에서 IN_PROGRESS → DONE 변경 (행 제거 및 폴더 이동 금지)
102
+ sed -i "s/| ${WORK_ID} |(.*)| IN_PROGRESS |/| ${WORK_ID} |\1| DONE |/" works/WORK-LIST.md
103
+ fi
104
+ ```
105
+
106
+ → `{REFERENCES_DIR}/shared-prompt-sections.md` § 8 참조
107
+
108
+ ### 3-6. Git 확인
109
+
110
+ → **Bash 명령 규칙: `shared-prompt-sections.md` § 13 참조**
111
+
112
+ `git rev-parse --is-inside-work-tree` 실행 (단일 명령). 실패 시 3-7 단계를 건너뛰고 7단계 (TaskCallback)로 직행. result.md, PROGRESS.md, WORK-LIST.md는 이미 저장되어 있다.
113
+
114
+ ### 3-7. Git Commit
115
+
116
+ **아래 각 명령은 별도 Bash 호출 — `&&` 또는 `;` 로 연결 금지:**
117
+
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 사용)
84
123
 
85
- git add -A
86
- git commit -m "{type}(TASK-XX): {title}
124
+ ```
125
+ # 예시 줄이 별도 Bash 호출:
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
87
130
 
88
- - {change 1}
89
- - {change 2}
131
+ - Created auth middleware
132
+ - Added JWT token validation
90
133
 
91
- Result: works/${WORK_ID}/TASK-XX_result.md"
134
+ Result: works/WORK-01/TASK-00_result.md"
92
135
  ```
93
136
 
94
137
  | Content | Type |
@@ -100,38 +143,11 @@ Result: works/${WORK_ID}/TASK-XX_result.md"
100
143
  | Documentation | `docs` |
101
144
  | Refactoring | `refactor` |
102
145
 
103
- ### 3-7. Backfill Hash
104
-
105
- ```bash
106
- HASH=$(git log --oneline -1 | cut -d' ' -f1)
107
- sed -i "s/> Status: \*\*DONE\*\*/> Status: **DONE**\n> Commit: ${HASH}/" "works/${WORK_ID}/TASK-XX_result.md"
108
- git add "works/${WORK_ID}/TASK-XX_result.md"
109
- git commit --amend --no-edit
110
- ```
111
-
112
146
  ### 3-8. TaskCallback 전송
113
147
 
114
- ```bash
115
- TASK_CALLBACK=$(grep "^TaskCallback:" CLAUDE.md 2>/dev/null | sed 's/^TaskCallback: //' | tr -d '\r')
116
- CALLBACK_TOKEN=$(grep "^CallbackToken:" CLAUDE.md 2>/dev/null | sed 's/^CallbackToken: //' | tr -d '\r')
117
-
118
- if [ -n "$TASK_CALLBACK" ] && [ "$TASK_CALLBACK" != "TaskCallback:" ]; then
119
- COMMIT_HASH=$(git log --oneline -1 | cut -d' ' -f1)
120
- PAYLOAD=$(cat <<EOF
121
- {
122
- "workId": "${WORK_ID}",
123
- "taskId": "${TASK_ID}",
124
- "status": "SUCCESS",
125
- "commitHash": "${COMMIT_HASH}"
126
- }
127
- EOF
128
- )
129
- AUTH_HEADER=""
130
- [ -n "$CALLBACK_TOKEN" ] && AUTH_HEADER="-H \"X-Runner-Api-Key: ${CALLBACK_TOKEN}\""
131
- curl -s -X POST "$TASK_CALLBACK" -H "Content-Type: application/json" $AUTH_HEADER -d "$PAYLOAD" 2>/dev/null || \
132
- echo "WARNING: TaskCallback failed, continuing..."
133
- fi
134
- ```
148
+ → 콜백 전송: `shared-prompt-sections.md` § 10 참조 (CallbackType=TaskCallback)
149
+
150
+ 페이로드 필드: `"status": "SUCCESS"`, `"commitHash": "${COMMIT_HASH}"` (먼저 `git log --oneline -1 | cut -d' ' -f1` 실행)
135
151
 
136
152
  ### 3-9. 결과 보고
137
153
 
@@ -140,7 +156,7 @@ fi
140
156
  committer 고유 추가 필드:
141
157
 
142
158
  ```xml
143
- <commit>
159
+ <commit> <!-- git repo 없으면 생략 -->
144
160
  <hash>{git commit hash}</hash>
145
161
  <message>{commit message}</message>
146
162
  <type>{feat|fix|chore|...}</type>
@@ -155,24 +171,7 @@ committer 고유 추가 필드:
155
171
  </next-tasks>
156
172
  ```
157
173
 
158
- ### 3-9-1. WORK-LIST.md 자동 완료 처리
159
-
160
- 마지막 TASK인지 확인 후, 마지막 TASK이면 WORK-LIST.md를 `IN_PROGRESS` → `COMPLETED`로 변경한다.
161
-
162
- ```bash
163
- # 마지막 TASK 확인
164
- TOTAL=$(ls works/${WORK_ID}/TASK-*.md 2>/dev/null | grep -cv '_result\|_progress')
165
- DONE=$(ls works/${WORK_ID}/TASK-*_result.md 2>/dev/null | wc -l)
166
-
167
- if [ "$DONE" -ge "$TOTAL" ]; then
168
- # WORK-LIST.md에서 해당 WORK의 IN_PROGRESS → COMPLETED 변경
169
- sed -i "s/| ${WORK_ID} |\\(.*\\)| IN_PROGRESS |\\(.*\\)|\\(.*\\)|/| ${WORK_ID} |\\1| COMPLETED |\\2| $(date '+%Y-%m-%d') |/" works/WORK-LIST.md
170
- git add works/WORK-LIST.md
171
- git commit --amend --no-edit
172
- fi
173
- ```
174
-
175
- → `.claude/agents/shared-prompt-sections.md` § 8 참조
174
+ `{REFERENCES_DIR}/shared-prompt-sections.md` § 8 참조
176
175
 
177
176
  ---
178
177
 
@@ -181,7 +180,8 @@ fi
181
180
  ### 실행 순서 제약
182
181
  - ALWAYS create result report BEFORE git commit
183
182
  - NEVER commit without result file
184
- - NEVER amend previous task commits (Backfill Hash amend예외)
183
+ - NEVER use `git commit --amend` TASK정확히 1개 커밋만 생성
184
+ - 커밋 해시는 task-result XML로만 반환 (result.md에 기록 금지)
185
185
 
186
186
  ### Gate Check 제약
187
187
  - progress.md 없으면 즉시 FAIL 반환
@@ -189,7 +189,7 @@ fi
189
189
  - Files changed 없으면 즉시 FAIL 반환
190
190
 
191
191
  ### WORK-LIST.md 규칙
192
- - 마지막 TASK 완료 시 WORK-LIST.md `IN_PROGRESS` → `COMPLETED`로 자동 변경
192
+ - 마지막 TASK 완료 시 WORK-LIST.md 해당 WORK 행 상태를 `IN_PROGRESS` → `DONE`으로 변경 (행 제거 및 WORK 폴더 이동 금지)
193
193
 
194
194
  ### Output Language Rule
195
195
  → `shared-prompt-sections.md` § 1 참조
@@ -56,7 +56,7 @@
56
56
  2. Gate 통과 → result.md 작성 + git commit
57
57
  3. Gate 실패 → FAIL 반환 (scheduler 재시도 트리거)
58
58
 
59
- 출력: → `.claude/agents/file-content-schema.md` § 4 참조
59
+ 출력: → `{REFERENCES_DIR}/file-content-schema.md` § 4 참조
60
60
 
61
61
  ## TASK 간 의존성 전달
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
  ## 요약
204
203
  {1줄}
@@ -36,34 +36,34 @@ WORK (일) — 사용자 요청의 목표 단위
36
36
 
37
37
  ### 3-1. STARTUP — 참조 파일 즉시 읽기 (REQUIRED)
38
38
 
39
- | 파일 | 목적 |
40
- |------|------|
41
- | `.claude/agents/file-content-schema.md` | 파일 포맷 스키마 (PLAN.md 7개 필드, TASK 포맷) |
42
- | `.claude/agents/shared-prompt-sections.md` | 공통 규칙 (TASK ID, WORK-LIST 규칙) |
43
- | `.claude/agents/work-activity-log.md` | Activity Log 규칙 (log_work 함수, STAGE 테이블) |
39
+ **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
44
40
 
45
- ### 3-2. 프로젝트 탐색 (Discovery Process)
41
+ #### Reference Loading (ref-cache)
46
42
 
47
- ```bash
48
- # 1. 기존 WORK 확인
49
- ls -d works/WORK-* 2>/dev/null | sort -V | tail -1
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>`가 없으면 기존 방식대로 모든 참조 파일을 읽는다 (기존 동작 유지)
50
49
 
51
- # 2. CLAUDE.md 언어 설정 확인
52
- grep -oP '(?<=Language:\s?)[a-z]{2}' CLAUDE.md 2>/dev/null
50
+ 에이전트의 필수 참조 파일:
53
51
 
54
- # 3. 프로젝트 정보
55
- cat CLAUDE.md 2>/dev/null || cat README.md 2>/dev/null
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` |
56
57
 
57
- # 4. 기술 스택
58
- cat package.json 2>/dev/null | head -50
59
- cat pyproject.toml 2>/dev/null | head -30
60
- cat Cargo.toml 2>/dev/null | head -20
61
- cat go.mod 2>/dev/null | head -10
58
+ ### 3-2. 프로젝트 탐색 (Discovery Process)
62
59
 
63
- # 5. 구조
64
- find . -maxdepth 3 -type f \( -name "*.md" -o -name "*.json" -o -name "*.toml" \) | grep -v node_modules | head -30
60
+ ```bash
61
+ # 1. 기존 WORK 확인
62
+ ls -d works/WORK-* 2>/dev/null | sort -V | tail -1
65
63
  ```
66
64
 
65
+ → 탐색 명령 (2~4단계): `shared-prompt-sections.md` § 11 참조
66
+
67
67
  ### 3-3. Requirement.md 분석 + WORK 디렉토리 확인
68
68
 
69
69
  Specifier가 이미 WORK 디렉토리를 생성하고 Requirement.md를 작성함.
@@ -109,9 +109,11 @@ PLAN.md의 `> Execution-Mode:` 필드에 결정된 모드를 기록.
109
109
  4. 완료 보고: "{WORK-ID} 계획 생성 완료. `{WORK-ID} 파이프라인 실행해줘`로 시작하세요."
110
110
  ```
111
111
 
112
+ scheduler 또는 builder dispatch XML 반환 시 로드한 모든 참조 파일을 포함한 `<ref-cache>` 추가 (`xml-schema.md` § 6 참조).
113
+
112
114
  ### 3-6. 산출물 구조
113
115
 
114
- `.claude/agents/file-content-schema.md` § 7 참조
116
+ `{REFERENCES_DIR}/file-content-schema.md` § 7 참조
115
117
 
116
118
  생성 책임:
117
119
  - `PLAN.md`, `TASK-XX.md`, `TASK-XX_progress.md` (초기 템플릿) → Planner
@@ -121,7 +123,7 @@ PLAN.md의 `> Execution-Mode:` 필드에 결정된 모드를 기록.
121
123
 
122
124
  TASK 파일 생성 시 반드시 동일 디렉토리에 `TASK-XX_progress.md` 템플릿도 함께 생성.
123
125
 
124
- 파일 포맷: → `.claude/agents/file-content-schema.md` § 1 (PLAN.md), § 2 (TASK), § 3 (progress 초기값)
126
+ 파일 포맷: → `{REFERENCES_DIR}/file-content-schema.md` § 1 (PLAN.md), § 2 (TASK), § 3 (progress 초기값)
125
127
 
126
128
  ### 3-7. MCP Tool 활용 (Serena)
127
129
 
@@ -135,16 +137,7 @@ TASK 파일 생성 시 반드시 동일 디렉토리에 `TASK-XX_progress.md`
135
137
  ### 3-8. Output Language Rule
136
138
 
137
139
  → 우선순위 규칙: `shared-prompt-sections.md` § 1 참조
138
-
139
- planner 고유 로케일 감지:
140
- ```
141
- 1. CLAUDE.md → "Language: xx" 확인
142
- 2. 없으면 사용자에게 언어 질문
143
- 3. 없으면 시스템 로케일 자동 감지
144
- - Windows: powershell -c "[CultureInfo]::CurrentCulture.TwoLetterISOLanguageName"
145
- - Linux/Mac: locale | grep LANG | grep -oP '[a-z]{2}' | head -1
146
- - Fallback: "en"
147
- ```
140
+ → 로케일 감지: `shared-prompt-sections.md` § 9 참조
148
141
 
149
142
  PLAN.md `> Language:` 필드에 resolved language 기록. 모든 산출물을 해당 언어로 작성.
150
143
 
@@ -36,13 +36,26 @@ You are the **Scheduler** — WORK 파이프라인 실행 에이전트.
36
36
 
37
37
  ### 3-1. STARTUP — 참조 파일 즉시 읽기 (REQUIRED)
38
38
 
39
- | 파일 | 목적 |
40
- |------|------|
41
- | `.claude/agents/file-content-schema.md` | 파일 포맷 스키마 |
42
- | `.claude/agents/shared-prompt-sections.md` | 공통 규칙 |
43
- | `.claude/agents/xml-schema.md` | XML 통신 포맷 |
44
- | `.claude/agents/context-policy.md` | 슬라이딩 윈도우 규칙 |
45
- | `.claude/agents/work-activity-log.md` | Activity Log 규칙 (log_work 함수, STAGE 테이블) |
39
+ **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
40
+
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` |
46
59
 
47
60
  ### 3-2. WORK 식별 및 초기 로드
48
61
 
@@ -86,6 +99,7 @@ WORK 내 TASK만 처리. 다른 WORK 접근 금지.
86
99
  각 단계 시작 전 Pipeline Stage Callback 전송 (§ 3-6 참조).
87
100
 
88
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 체인 전파 참조)
89
103
 
90
104
  아래 dispatch XML을 생성하여 반환한다. **호출은 Main Claude가 수행한다.**
91
105
 
@@ -113,6 +127,7 @@ FAIL → builder 재시도 (최대 3회). 3회 실패 → 파이프라인 중단
113
127
 
114
128
  → dispatch XML 포맷: `xml-schema.md` § 1 참조 (to="verifier", action="verify")
115
129
  → 슬라이딩 윈도우 (Builder→Verifier): `context-policy.md` Scheduler 디스패치 섹션 참조
130
+ → builder task-result의 `<ref-cache>`를 dispatch XML에 포함 (`xml-schema.md` § 6 참조)
116
131
 
117
132
  아래 dispatch XML을 생성하여 반환한다. **호출은 Main Claude가 수행한다.**
118
133
 
@@ -121,6 +136,7 @@ FAIL → builder 재시도 (최대 3회). 3회 실패 → 파이프라인 중단
121
136
  → dispatch XML 포맷: `xml-schema.md` § 1 참조 (to="committer", action="commit")
122
137
  → 슬라이딩 윈도우 (Verifier FULL + Builder SUMMARY): `context-policy.md` Scheduler 디스패치 섹션 참조
123
138
  → TASK 간 의존성 전달: `context-policy.md` TASK 간 의존성 전달 섹션 참조
139
+ → verifier task-result의 `<ref-cache>`를 dispatch XML에 포함 (`xml-schema.md` § 6 참조)
124
140
 
125
141
  아래 dispatch XML을 생성하여 반환한다. **호출은 Main Claude가 수행한다.**
126
142
 
@@ -132,7 +148,7 @@ Committer FAIL 재시도:
132
148
 
133
149
  ### 3-9. 진행 보고
134
150
 
135
- TASK 완료 후 PROGRESS.md 업데이트 (→ `.claude/agents/file-content-schema.md` § 6 참조) 및 상태 출력:
151
+ TASK 완료 후 PROGRESS.md 업데이트 (→ `{REFERENCES_DIR}/file-content-schema.md` § 6 참조) 및 상태 출력:
136
152
 
137
153
  ```
138
154
  ✅ TASK-XX 완료 — commit: {hash}
@@ -163,8 +179,8 @@ Multi-WORK 현황 확인:
163
179
  - 파이프라인 우회 시 result.md 미생성 → WORK 완료 인식 실패
164
180
 
165
181
  ### WORK-LIST.md 규칙
166
- - WORK-LIST.md를 COMPLETED로 변경하지 않는다 — git push 시에만 변경
167
- - → `.claude/agents/shared-prompt-sections.md` § 8 참조
182
+ - WORK-LIST.md를 직접 수정하지 않는다 — 아카이브 처리는 committer가 담당
183
+ - → `{REFERENCES_DIR}/shared-prompt-sections.md` § 8 참조
168
184
 
169
185
  ### Output Language Rule
170
186
  → `shared-prompt-sections.md` § 1 참조
@@ -107,7 +107,7 @@ echo "$DONE / $TOTAL"
107
107
 
108
108
  ## § 7. PLAN.md 필수 메타정보 7개 필드
109
109
 
110
- `.claude/agents/file-content-schema.md` § 1 참조
110
+ `{REFERENCES_DIR}/file-content-schema.md` § 1 참조
111
111
 
112
112
  | 필드 | 필수 | 설명 |
113
113
  |------|------|------|
@@ -125,17 +125,128 @@ echo "$DONE / $TOTAL"
125
125
 
126
126
  파일: `works/WORK-LIST.md`
127
127
 
128
- | 상태 | 시점 |
129
- |------|------|
130
- | `IN_PROGRESS` | WORK 디렉토리 생성 시 추가 |
131
- | `COMPLETED` | 마지막 TASK 완료 시 committer가 자동 변경 |
128
+ **포맷:**
129
+ ```
130
+ LAST_WORK_ID: WORK-XX
131
+
132
+ | WORK | 제목 | 상태 | 생성일 | 완료일 |
133
+ |------|------|------|--------|--------|
134
+ | WORK-NN | ... | IN_PROGRESS | YYYY-MM-DD | |
135
+ | WORK-MM | ... | DONE | YYYY-MM-DD | YYYY-MM-DD |
136
+ ```
137
+
138
+ | 상태 | 의미 | 전환 시점 |
139
+ |------|------|-----------|
140
+ | `IN_PROGRESS` | WORK 실행 중 | specifier가 WORK 생성 시 |
141
+ | `DONE` | 모든 TASK 완료, 리뷰/push 대기 중 | committer가 마지막 TASK 완료 시 |
142
+ | `COMPLETED` | _COMPLETED/에 아카이브됨 | push merge (Main Claude가 DONE 일괄 처리) |
143
+
144
+ 규칙:
145
+ - `LAST_WORK_ID` 헤더는 지금까지 생성된 최고 WORK ID를 추적
146
+ - **specifier**: WORK 생성 시 IN_PROGRESS 행 추가 + `LAST_WORK_ID` 갱신
147
+ - **committer**: 마지막 TASK 완료 시 `IN_PROGRESS` → `DONE` 변경 + 완료일 기입 (폴더 이동 또는 행 제거 금지)
148
+ - **Main Claude** (push 절차): DONE 상태의 WORK를 모두 `works/_COMPLETED/`로 이동 + WORK-LIST.md에서 해당 행 제거
149
+
150
+ ---
151
+
152
+ ## § 9. 로케일 감지
153
+
154
+ ```
155
+ 1. CLAUDE.md → "Language: xx" 확인
156
+ 2. 없으면 사용자에게 언어 질문
157
+ 3. 없으면 시스템 로케일 자동 감지
158
+ - Windows: powershell -c "[CultureInfo]::CurrentCulture.TwoLetterISOLanguageName"
159
+ - Linux/Mac: locale | grep LANG | grep -oP '[a-z]{2}' | head -1
160
+ - Fallback: "en"
161
+ ```
162
+
163
+ ---
164
+
165
+ ## § 10. 콜백 전송 템플릿
166
+
167
+ → **Bash 명령 규칙: § 13 참조** — 아래 각 단계는 별도 도구 호출이다.
168
+
169
+ `{CallbackType}`을 실제 키 이름으로 대체 (예: `ProgressCallback`, `TaskCallback`).
170
+
171
+ **1단계.** `Grep` 도구로 CLAUDE.md에서 `{CallbackType}:` 줄을 찾는다. 없으면 콜백을 건너뛴다.
172
+
173
+ **2단계.** `Grep` 도구로 CLAUDE.md에서 `CallbackToken:` 줄을 찾는다 (선택).
174
+
175
+ **3단계.** 단일 `curl` 명령으로 콜백 전송:
176
+ ```bash
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",...}'
178
+ ```
179
+
180
+ 에이전트별 페이로드 필드:
181
+ - **ProgressCallback** (builder): `"status": "IN_PROGRESS"`, `"currentReasoning": "..."`
182
+ - **TaskCallback** (committer): `"status": "SUCCESS"`, `"commitHash": "${COMMIT_HASH}"`
183
+
184
+ ---
185
+
186
+ ## § 11. 프로젝트 탐색
187
+
188
+ ```bash
189
+ # 1. CLAUDE.md 언어 설정 확인
190
+ grep -oP '(?<=Language:\s?)[a-z]{2}' CLAUDE.md 2>/dev/null
191
+
192
+ # 2. 기술 스택
193
+ cat package.json 2>/dev/null | head -50
194
+ cat pyproject.toml 2>/dev/null | head -30
195
+ cat Cargo.toml 2>/dev/null | head -20
196
+ cat go.mod 2>/dev/null | head -10
197
+
198
+ # 3. 구조 (필요 시)
199
+ find . -maxdepth 3 -type f \( -name "*.md" -o -name "*.json" -o -name "*.toml" \) | grep -v node_modules | head -30
200
+ ```
201
+
202
+ ---
203
+
204
+ ## § 12. Progress File Gate Check
205
+
206
+ `works/WORK-NN/TASK-XX_progress.md` Gate 조건:
207
+ - 파일이 해당 경로에 존재
208
+ - `Status: COMPLETED` 줄이 있음
209
+ - `## Files Changed` 섹션이 있고 비어 있지 않음
210
+
211
+ Gate 실패 시 → 즉시 FAIL task-result 반환. 이후 단계 진행 금지.
132
212
 
133
- - WORK 디렉토리 생성 시 반드시 IN_PROGRESS 추가
134
- - committer: 마지막 TASK commit 후 WORK-LIST.md를 `IN_PROGRESS` → `COMPLETED`로 변경
213
+ ---
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
+ ```
135
246
 
136
247
  ---
137
248
 
138
249
  ## Version
139
250
 
140
251
  - Created: 2026-03-10
141
- - Updated: 2026-03-15
252
+ - Updated: 2026-03-28