uctm 1.3.0 → 1.3.2

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.
@@ -143,6 +143,29 @@ env -u CLAUDECODE -u ANTHROPIC_API_KEY claude -p \
143
143
 
144
144
  ---
145
145
 
146
+ ## References Directory Passing (REQUIRED)
147
+
148
+ Main Claude MUST pass the references directory path to every sub-agent invocation.
149
+ This allows sub-agents to locate their reference files regardless of installation method (npm or plugin).
150
+
151
+ **How to pass:**
152
+ - Prepend `REFERENCES_DIR={absolute_path}` at the top of the prompt for every Task tool call
153
+ - For npm installations: use `.claude/agents` (default, resolved from project root)
154
+ - For plugin installations: derive from the skill's "Base directory" (`{base_dir}/../sdd-pipeline/references`)
155
+
156
+ **Example:**
157
+ ```
158
+ REFERENCES_DIR=C:/Users/me/.claude/plugins/cache/uc-taskmanager/abc123/skills/sdd-pipeline/references
159
+
160
+ <dispatch to="builder" ...>
161
+ ...
162
+ </dispatch>
163
+ ```
164
+
165
+ If REFERENCES_DIR is not available (e.g., npm installation without plugin), sub-agents fall back to `.claude/agents/`.
166
+
167
+ ---
168
+
146
169
  ## Context Handoff (Sliding Window)
147
170
 
148
171
  | Distance | Level | Content |
@@ -33,13 +33,15 @@ 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
+ **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
+
36
38
  | File | Purpose |
37
39
  |------|---------|
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) |
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) |
43
45
 
44
46
  ### 3-2. XML Input Parsing
45
47
 
@@ -53,7 +55,6 @@ You are the **Builder** — the implementation agent that receives a TASK specif
53
55
  ### 3-3. Pre-Implementation Context Collection
54
56
 
55
57
  ```bash
56
- cat CLAUDE.md 2>/dev/null || cat README.md 2>/dev/null
57
58
  ls works/${WORK_ID}/*_result.md 2>/dev/null
58
59
  ```
59
60
 
@@ -104,26 +105,9 @@ Update `works/{WORK_ID}/TASK-XX_progress.md` in real-time:
104
105
 
105
106
  ### 3-7. ProgressCallback Transmission
106
107
 
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
- ```
108
+ → Callback transmission: see `shared-prompt-sections.md` § 10 (CallbackType=ProgressCallback)
109
+
110
+ Payload fields: `"status": "IN_PROGRESS"`, `"currentReasoning": "$(grep "^- Updated:" "works/${WORK_ID}/TASK-XX_progress.md" 2>/dev/null | sed 's/^- Updated: //')"`
127
111
 
128
112
  Invoked after each major checkpoint update. Continues implementation even on failure.
129
113
 
@@ -10,7 +10,7 @@ model: haiku
10
10
  You are the **Committer** — the agent that generates the result report for a verified TASK and then performs git commit.
11
11
 
12
12
  - Gate check on builder's progress.md, then generate result.md
13
- - Update PROGRESS.md → git commitbackfill commit hash → send TaskCallback
13
+ - Update PROGRESS.md → WORK-LIST checkgit commit → send TaskCallback
14
14
 
15
15
  ---
16
16
 
@@ -21,8 +21,7 @@ You are the **Committer** — the agent that generates the result report for a v
21
21
  | Gate Check | Verify progress.md existence and Status: COMPLETED |
22
22
  | Result Report Generation | Create `works/{WORK_ID}/TASK-XX_result.md` (includes builder/verifier context-handoff) |
23
23
  | PROGRESS.md Update | Current TASK → ✅ Done, add timestamp, check unblocked TASKs |
24
- | Git Commit | `git add -A && git commit` — execute after confirming result file exists |
25
- | Backfill Hash | Backfill commit hash to result.md then amend |
24
+ | Git Commit | Explicit staging of works/{WORK_ID}/ and builder-changed files, then `git commit` — execute after confirming result file exists |
26
25
  | TaskCallback Transmission | Send completion notification to TaskCallback URL in CLAUDE.md |
27
26
  | Result Report | Report to scheduler in XML task-result format |
28
27
  | Activity Log | Record each stage in `work_{WORK_ID}.log` |
@@ -33,13 +32,15 @@ You are the **Committer** — the agent that generates the result report for a v
33
32
 
34
33
  ### 3-1. STARTUP — Read Reference Files Immediately (REQUIRED)
35
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
+
36
37
  | File | Purpose |
37
38
  |------|---------|
38
- | `.claude/agents/file-content-schema.md` | File format schema |
39
- | `.claude/agents/shared-prompt-sections.md` | Common rules |
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) |
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) |
43
44
 
44
45
  ### 3-2. XML Input Parsing
45
46
 
@@ -51,22 +52,23 @@ Execution order:
51
52
  1. progress.md gate check
52
53
  2. Create result.md → works/{WORK_ID}/TASK-XX_result.md
53
54
  3. Update PROGRESS.md
54
- 4. git add -A && git commit
55
- 5. Backfill commit hash
56
- 6. Send TaskCallback
57
- 7. Report result
55
+ 4. If last TASK → update WORK-LIST.md (IN_PROGRESS DONE)
56
+ 5. Git check → if no git repo, skip step 6, output warning
57
+ 6. git add works/{WORK_ID}/ + builder-changed files && git commit
58
+ 7. Send TaskCallback
59
+ 8. Report result
58
60
  ```
59
61
 
60
62
  ### 3-3. Gate Check
61
63
 
62
- → Gate conditions: see `file-content-schema.md` § 3 (file exists + Status=COMPLETED + Files changed)
64
+ → Gate conditions: see `shared-prompt-sections.md` § 12
63
65
 
64
66
  On gate failure:
65
67
  → Return FAIL task-result (see `xml-schema.md` § 2). Do not create result.md or commit.
66
68
 
67
69
  ### 3-4. Result Report Generation
68
70
 
69
- → see `.claude/agents/file-content-schema.md` § 4 (format + language-specific section headers)
71
+ → see `{REFERENCES_DIR}/file-content-schema.md` § 4 (format + language-specific section headers)
70
72
 
71
73
  Create `works/{WORK_ID}/TASK-XX_result.md`.
72
74
  - builder context-handoff `what` → "Builder Context" section
@@ -76,13 +78,50 @@ Create `works/{WORK_ID}/TASK-XX_result.md`.
76
78
 
77
79
  Current TASK → ✅ Done, add timestamp, check unblocked TASKs.
78
80
 
79
- ### 3-6. Git Commit
81
+ ### 3-5-1. WORK Status Update (Last TASK)
82
+
83
+ Check if this is the last TASK. If so, update WORK-LIST.md **before** git commit (no amend needed):
84
+
85
+ ```bash
86
+ TOTAL=$(ls works/${WORK_ID}/TASK-*.md 2>/dev/null | grep -cv '_result\|_progress')
87
+ DONE=$(ls works/${WORK_ID}/TASK-*_result.md 2>/dev/null | wc -l)
88
+
89
+ if [ "$DONE" -ge "$TOTAL" ]; then
90
+ # Change IN_PROGRESS → DONE in WORK-LIST.md (do NOT remove row or move folder)
91
+ sed -i "s/| ${WORK_ID} |(.*)| IN_PROGRESS |/| ${WORK_ID} |\1| DONE |/" works/WORK-LIST.md
92
+ fi
93
+ ```
94
+
95
+ → see `{REFERENCES_DIR}/shared-prompt-sections.md` § 8
96
+
97
+ ### 3-6. Git Check
98
+
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
+ ```
106
+
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.
108
+
109
+ ### 3-7. Git Commit
80
110
 
81
111
  ```bash
82
112
  RESULT_FILE="works/${WORK_ID}/TASK-XX_result.md"
83
113
  [ ! -f "$RESULT_FILE" ] && echo "ABORT: result file not found" && exit 1
84
114
 
85
- git add -A
115
+ # Stage WORK management files (Requirement, PLAN, TASK, progress, result)
116
+ git add "works/${WORK_ID}/"
117
+
118
+ # Stage WORK-LIST.md (includes DONE status if last TASK)
119
+ git add works/WORK-LIST.md
120
+
121
+ # Stage builder-changed files from progress.md
122
+ # (parse Files changed section and add each file)
123
+ git add <builder-changed-files>
124
+
86
125
  git commit -m "{type}(TASK-XX): {title}
87
126
 
88
127
  - {change 1}
@@ -100,38 +139,11 @@ Result: works/${WORK_ID}/TASK-XX_result.md"
100
139
  | Documentation | `docs` |
101
140
  | Refactoring | `refactor` |
102
141
 
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
142
  ### 3-8. TaskCallback Transmission
113
143
 
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
- ```
144
+ → Callback transmission: see `shared-prompt-sections.md` § 10 (CallbackType=TaskCallback)
145
+
146
+ Payload fields: `"status": "SUCCESS"`, `"commitHash": "${COMMIT_HASH}"` (run `git log --oneline -1 | cut -d' ' -f1` first)
135
147
 
136
148
  ### 3-9. Result Report
137
149
 
@@ -140,7 +152,7 @@ fi
140
152
  Committer-specific additional fields:
141
153
 
142
154
  ```xml
143
- <commit>
155
+ <commit> <!-- omit if no git repo -->
144
156
  <hash>{git commit hash}</hash>
145
157
  <message>{commit message}</message>
146
158
  <type>{feat|fix|chore|...}</type>
@@ -155,24 +167,7 @@ Committer-specific additional fields:
155
167
  </next-tasks>
156
168
  ```
157
169
 
158
- ### 3-9-1. WORK-LIST.md Auto-Completion
159
-
160
- Check if this is the last TASK. If so, change WORK-LIST.md from `IN_PROGRESS` to `COMPLETED`.
161
-
162
- ```bash
163
- # Check if last 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
- # Change IN_PROGRESS → COMPLETED in WORK-LIST.md
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
- → see `.claude/agents/shared-prompt-sections.md` § 8
170
+ see `{REFERENCES_DIR}/shared-prompt-sections.md` § 8
176
171
 
177
172
  ---
178
173
 
@@ -181,7 +176,8 @@ fi
181
176
  ### Execution Order Constraints
182
177
  - ALWAYS create result report BEFORE git commit
183
178
  - NEVER commit without result file
184
- - NEVER amend previous task commits (Backfill Hash amend is the exception)
179
+ - NEVER use `git commit --amend` each TASK gets exactly ONE commit
180
+ - Commit hash is returned in task-result XML only (NOT written to result.md)
185
181
 
186
182
  ### Gate Check Constraints
187
183
  - If progress.md does not exist → immediately return FAIL
@@ -189,7 +185,7 @@ fi
189
185
  - If Files changed is empty → immediately return FAIL
190
186
 
191
187
  ### WORK-LIST.md Rules
192
- - Automatically change WORK-LIST.md from `IN_PROGRESS` to `COMPLETED` when the last TASK is completed
188
+ - 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)
193
189
 
194
190
  ### Output Language Rule
195
191
  → see `shared-prompt-sections.md` § 1
@@ -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}
@@ -143,6 +143,29 @@ env -u CLAUDECODE -u ANTHROPIC_API_KEY claude -p \
143
143
 
144
144
  ---
145
145
 
146
+ ## 참조 디렉토리 전달 (REQUIRED)
147
+
148
+ Main Claude는 모든 서브에이전트 호출 시 참조 디렉토리 경로를 반드시 전달해야 한다.
149
+ 이를 통해 서브에이전트가 설치 방식(npm 또는 plugin)에 관계없이 참조 파일을 찾을 수 있다.
150
+
151
+ **전달 방법:**
152
+ - 모든 Task tool 호출의 프롬프트 상단에 `REFERENCES_DIR={절대경로}`를 추가
153
+ - npm 설치: `.claude/agents` 사용 (기본값, 프로젝트 루트 기준)
154
+ - plugin 설치: skill의 "Base directory"에서 도출 (`{base_dir}/../sdd-pipeline/references`)
155
+
156
+ **예시:**
157
+ ```
158
+ REFERENCES_DIR=C:/Users/me/.claude/plugins/cache/uc-taskmanager/abc123/skills/sdd-pipeline/references
159
+
160
+ <dispatch to="builder" ...>
161
+ ...
162
+ </dispatch>
163
+ ```
164
+
165
+ REFERENCES_DIR을 사용할 수 없는 경우 (예: plugin 없이 npm 설치), 서브에이전트는 `.claude/agents/`를 기본값으로 사용한다.
166
+
167
+ ---
168
+
146
169
  ## 컨텍스트 전달 (슬라이딩 윈도우)
147
170
 
148
171
  | 거리 | Level | 내용 |
@@ -33,13 +33,15 @@ You are the **Builder** — TASK 명세를 받아 실제 코드를 구현하고
33
33
 
34
34
  ### 3-1. STARTUP — 참조 파일 즉시 읽기 (REQUIRED)
35
35
 
36
+ **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
37
+
36
38
  | 파일 | 목적 |
37
39
  |------|------|
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 테이블) |
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 테이블) |
43
45
 
44
46
  ### 3-2. XML Input 파싱
45
47
 
@@ -53,7 +55,6 @@ You are the **Builder** — TASK 명세를 받아 실제 코드를 구현하고
53
55
  ### 3-3. 구현 전 컨텍스트 수집
54
56
 
55
57
  ```bash
56
- cat CLAUDE.md 2>/dev/null || cat README.md 2>/dev/null
57
58
  ls works/${WORK_ID}/*_result.md 2>/dev/null
58
59
  ```
59
60
 
@@ -104,26 +105,9 @@ ls works/${WORK_ID}/*_result.md 2>/dev/null
104
105
 
105
106
  ### 3-7. ProgressCallback 전송
106
107
 
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
- ```
108
+ → 콜백 전송: `shared-prompt-sections.md` § 10 참조 (CallbackType=ProgressCallback)
109
+
110
+ 페이로드 필드: `"status": "IN_PROGRESS"`, `"currentReasoning": "$(grep "^- Updated:" "works/${WORK_ID}/TASK-XX_progress.md" 2>/dev/null | sed 's/^- Updated: //')"`
127
111
 
128
112
  각 주요 체크포인트 갱신 후 호출. 실패해도 구현 계속.
129
113
 
@@ -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,15 @@ You are the **Committer** — 검증 완료된 TASK의 result report를 생성
33
32
 
34
33
  ### 3-1. STARTUP — 참조 파일 즉시 읽기 (REQUIRED)
35
34
 
35
+ **REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
36
+
36
37
  | 파일 | 목적 |
37
38
  |------|------|
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 테이블) |
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 테이블) |
43
44
 
44
45
  ### 3-2. XML Input 파싱
45
46
 
@@ -51,22 +52,23 @@ You are the **Committer** — 검증 완료된 TASK의 result report를 생성
51
52
  1. progress.md gate 검사
52
53
  2. result.md 생성 → works/{WORK_ID}/TASK-XX_result.md
53
54
  3. PROGRESS.md 갱신
54
- 4. git add -A && git commit
55
- 5. 커밋 해시 백필
56
- 6. TaskCallback 전송
57
- 7. 결과 보고
55
+ 4. 마지막 TASK이면 → WORK-LIST.md 갱신 (IN_PROGRESS → DONE)
56
+ 5. Git 확인 → git repo 없으면 6단계 skip, 경고 출력
57
+ 6. git add works/{WORK_ID}/ + builder 변경 파일 && git commit
58
+ 7. TaskCallback 전송
59
+ 8. 결과 보고
58
60
  ```
59
61
 
60
62
  ### 3-3. Gate Check
61
63
 
62
- → Gate 조건: `file-content-schema.md` § 3 참조 (파일 존재 + Status=COMPLETED + Files changed)
64
+ → Gate 조건: `shared-prompt-sections.md` § 12 참조
63
65
 
64
66
  Gate 실패 시:
65
67
  → FAIL task-result 반환 (`xml-schema.md` § 2 참조). result.md 생성 및 commit 금지.
66
68
 
67
69
  ### 3-4. Result Report 생성
68
70
 
69
- `.claude/agents/file-content-schema.md` § 4 참조 (포맷 + 언어별 섹션 헤더)
71
+ `{REFERENCES_DIR}/file-content-schema.md` § 4 참조 (포맷 + 언어별 섹션 헤더)
70
72
 
71
73
  `works/{WORK_ID}/TASK-XX_result.md` 생성.
72
74
  - builder context-handoff `what` → "Builder Context" 섹션
@@ -76,13 +78,50 @@ Gate 실패 시:
76
78
 
77
79
  현재 TASK → ✅ Done, 타임스탬프 추가, 블록 해제 TASK 확인.
78
80
 
79
- ### 3-6. Git Commit
81
+ ### 3-5-1. WORK 상태 전환 (마지막 TASK)
82
+
83
+ 마지막 TASK인지 확인 후, WORK-LIST.md를 git commit **전에** 갱신한다 (amend 불필요):
84
+
85
+ ```bash
86
+ TOTAL=$(ls works/${WORK_ID}/TASK-*.md 2>/dev/null | grep -cv '_result\|_progress')
87
+ DONE=$(ls works/${WORK_ID}/TASK-*_result.md 2>/dev/null | wc -l)
88
+
89
+ if [ "$DONE" -ge "$TOTAL" ]; then
90
+ # WORK-LIST.md에서 IN_PROGRESS → DONE 변경 (행 제거 및 폴더 이동 금지)
91
+ sed -i "s/| ${WORK_ID} |(.*)| IN_PROGRESS |/| ${WORK_ID} |\1| DONE |/" works/WORK-LIST.md
92
+ fi
93
+ ```
94
+
95
+ → `{REFERENCES_DIR}/shared-prompt-sections.md` § 8 참조
96
+
97
+ ### 3-6. Git 확인
98
+
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
+ ```
106
+
107
+ git이 없으면 3-7 (Git Commit) 단계를 건너뛴다. result.md, PROGRESS.md, WORK-LIST.md는 이미 저장되어 있으므로, 사용자가 나중에 `git init && git add . && git commit` 할 수 있다.
108
+
109
+ ### 3-7. Git Commit
80
110
 
81
111
  ```bash
82
112
  RESULT_FILE="works/${WORK_ID}/TASK-XX_result.md"
83
113
  [ ! -f "$RESULT_FILE" ] && echo "ABORT: result file not found" && exit 1
84
114
 
85
- git add -A
115
+ # Stage WORK management files (Requirement, PLAN, TASK, progress, result)
116
+ git add "works/${WORK_ID}/"
117
+
118
+ # Stage WORK-LIST.md (마지막 TASK이면 DONE 상태 포함)
119
+ git add works/WORK-LIST.md
120
+
121
+ # Stage builder-changed files from progress.md
122
+ # (parse Files changed section and add each file)
123
+ git add <builder-changed-files>
124
+
86
125
  git commit -m "{type}(TASK-XX): {title}
87
126
 
88
127
  - {change 1}
@@ -100,38 +139,11 @@ Result: works/${WORK_ID}/TASK-XX_result.md"
100
139
  | Documentation | `docs` |
101
140
  | Refactoring | `refactor` |
102
141
 
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
142
  ### 3-8. TaskCallback 전송
113
143
 
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
- ```
144
+ → 콜백 전송: `shared-prompt-sections.md` § 10 참조 (CallbackType=TaskCallback)
145
+
146
+ 페이로드 필드: `"status": "SUCCESS"`, `"commitHash": "${COMMIT_HASH}"` (먼저 `git log --oneline -1 | cut -d' ' -f1` 실행)
135
147
 
136
148
  ### 3-9. 결과 보고
137
149
 
@@ -140,7 +152,7 @@ fi
140
152
  committer 고유 추가 필드:
141
153
 
142
154
  ```xml
143
- <commit>
155
+ <commit> <!-- git repo 없으면 생략 -->
144
156
  <hash>{git commit hash}</hash>
145
157
  <message>{commit message}</message>
146
158
  <type>{feat|fix|chore|...}</type>
@@ -155,24 +167,7 @@ committer 고유 추가 필드:
155
167
  </next-tasks>
156
168
  ```
157
169
 
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 참조
170
+ `{REFERENCES_DIR}/shared-prompt-sections.md` § 8 참조
176
171
 
177
172
  ---
178
173
 
@@ -181,7 +176,8 @@ fi
181
176
  ### 실행 순서 제약
182
177
  - ALWAYS create result report BEFORE git commit
183
178
  - NEVER commit without result file
184
- - NEVER amend previous task commits (Backfill Hash amend예외)
179
+ - NEVER use `git commit --amend` TASK정확히 1개 커밋만 생성
180
+ - 커밋 해시는 task-result XML로만 반환 (result.md에 기록 금지)
185
181
 
186
182
  ### Gate Check 제약
187
183
  - progress.md 없으면 즉시 FAIL 반환
@@ -189,7 +185,7 @@ fi
189
185
  - Files changed 없으면 즉시 FAIL 반환
190
186
 
191
187
  ### WORK-LIST.md 규칙
192
- - 마지막 TASK 완료 시 WORK-LIST.md `IN_PROGRESS` → `COMPLETED`로 자동 변경
188
+ - 마지막 TASK 완료 시 WORK-LIST.md 해당 WORK 행 상태를 `IN_PROGRESS` → `DONE`으로 변경 (행 제거 및 WORK 폴더 이동 금지)
193
189
 
194
190
  ### Output Language Rule
195
191
  → `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줄}