uctm 1.2.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.
- package/agents/agent-flow.md +175 -0
- package/agents/{en/builder.md → builder.md} +10 -26
- package/agents/{en/committer.md → committer.md} +63 -67
- package/agents/{en/context-policy.md → context-policy.md} +1 -1
- package/agents/{en/file-content-schema.md → file-content-schema.md} +30 -5
- package/agents/ko/agent-flow.md +175 -106
- package/agents/ko/builder.md +10 -26
- package/agents/ko/committer.md +63 -67
- package/agents/ko/context-policy.md +1 -1
- package/agents/ko/file-content-schema.md +30 -5
- package/agents/ko/planner.md +38 -49
- package/agents/ko/scheduler.md +10 -8
- package/agents/ko/shared-prompt-sections.md +97 -8
- package/agents/ko/specifier.md +181 -0
- package/agents/ko/verifier.md +7 -5
- package/agents/ko/work-activity-log.md +45 -45
- package/agents/ko/xml-schema.md +109 -109
- package/agents/{en/planner.md → planner.md} +38 -49
- package/agents/{en/scheduler.md → scheduler.md} +10 -8
- package/agents/{en/shared-prompt-sections.md → shared-prompt-sections.md} +97 -8
- package/agents/specifier.md +181 -0
- package/agents/{en/verifier.md → verifier.md} +7 -5
- package/agents/{en/work-activity-log.md → work-activity-log.md} +45 -45
- package/agents/{en/xml-schema.md → xml-schema.md} +109 -109
- package/lib/constants.mjs +6 -1
- package/package.json +2 -3
- package/README.md +0 -946
- package/agents/en/agent-flow.md +0 -106
- package/agents/en/router.md +0 -165
- package/agents/ko/router.md +0 -164
package/agents/ko/agent-flow.md
CHANGED
|
@@ -1,106 +1,175 @@
|
|
|
1
|
-
# Agent Flow — Main Claude 오케스트레이션 가이드
|
|
2
|
-
|
|
3
|
-
> **모든 에이전트 호출은 Main Claude가 수행한다.**
|
|
4
|
-
> 서브에이전트는 작업 완료 후 결과(dispatch XML 또는 task-result XML)만 반환한다.
|
|
5
|
-
> Main Claude가 반환값을 받아 다음 에이전트를 호출한다.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
[] 태그 감지 →
|
|
13
|
-
│
|
|
14
|
-
|
|
15
|
-
│
|
|
16
|
-
├─ direct
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
##
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
1.
|
|
44
|
-
2.
|
|
45
|
-
3.
|
|
46
|
-
4.
|
|
47
|
-
5.
|
|
48
|
-
6.
|
|
49
|
-
7.
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
1
|
+
# Agent Flow — Main Claude 오케스트레이션 가이드
|
|
2
|
+
|
|
3
|
+
> **모든 에이전트 호출은 Main Claude가 수행한다.**
|
|
4
|
+
> 서브에이전트는 작업 완료 후 결과(dispatch XML 또는 task-result XML)만 반환한다.
|
|
5
|
+
> Main Claude가 반환값을 받아 다음 에이전트를 호출한다.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 파이프라인 흐름
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
[] 태그 감지 → specifier 호출
|
|
13
|
+
│
|
|
14
|
+
specifier 반환값 확인
|
|
15
|
+
│
|
|
16
|
+
├─ 겸임 (direct) → specifier가 Requirement.md + PLAN.md + TASK-00 생성
|
|
17
|
+
│ → builder dispatch XML 반환
|
|
18
|
+
│ → § direct 절차 실행
|
|
19
|
+
│
|
|
20
|
+
└─ 위임 (pipeline/full) → specifier가 Requirement.md만 생성
|
|
21
|
+
→ planner dispatch XML 반환
|
|
22
|
+
→ § planner-driven 절차 실행
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## direct 모드 (Specifier 겸임)
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
1. specifier 호출 → Requirement.md + PLAN.md + TASK-00 생성 + builder dispatch XML 반환
|
|
31
|
+
2. [승인 1회] 사용자 검토 (요구사항 + 설계 통합)
|
|
32
|
+
3. builder 호출 (dispatch XML을 prompt로) — self-check 포함
|
|
33
|
+
4. committer 호출 (builder 결과를 prompt로)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
> Verifier 생략: Builder가 self-check(build/lint)를 수행하므로 단일 TASK에서 별도 검증 불필요.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## pipeline 모드 (Planner 별도 호출)
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
1. specifier 호출 → Requirement.md 생성 + planner dispatch XML 반환
|
|
44
|
+
2. [기획 승인] 사용자 검토 (Requirement.md)
|
|
45
|
+
3. planner 호출 (dispatch XML을 prompt로) → PLAN.md + TASK-NN 생성 + execution-mode 결정
|
|
46
|
+
4. [개발 승인] 사용자 검토 (PLAN.md + TASK 목록)
|
|
47
|
+
5. builder 호출 (TASK별 dispatch XML을 prompt로)
|
|
48
|
+
6. verifier 호출 (builder 결과를 prompt로)
|
|
49
|
+
7. committer 호출 (verifier 결과를 prompt로)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## full 모드 (Scheduler 포함)
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
1. specifier 호출 → Requirement.md 생성 + planner dispatch XML 반환
|
|
58
|
+
2. [기획 승인] 사용자 검토 (Requirement.md)
|
|
59
|
+
3. planner 호출 → PLAN.md + TASK 분해 + execution-mode: full 결정
|
|
60
|
+
4. [개발 승인] 사용자 검토 (PLAN.md + TASK 목록)
|
|
61
|
+
5. scheduler 호출 → DAG 분석 + READY TASK + builder dispatch XML 반환
|
|
62
|
+
6. builder 호출 (dispatch XML을 prompt로) → 구현
|
|
63
|
+
7. verifier 호출 (builder 결과를 prompt로) → 검증
|
|
64
|
+
8. committer 호출 (verifier 결과를 prompt로) → commit
|
|
65
|
+
9. 미완료 TASK 있으면 5번으로 돌아감
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
병렬 실행: scheduler가 복수의 READY TASK를 반환하면 builder를 동시에 호출한다.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 기존 WORK 재개
|
|
73
|
+
|
|
74
|
+
이미 PLAN.md + TASK가 존재하는 WORK의 파이프라인 재개:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
1. scheduler 호출 → READY TASK 확인 + builder dispatch XML 반환
|
|
78
|
+
2. builder → verifier → committer 순서대로 실행
|
|
79
|
+
3. 미완료 TASK 있으면 1번으로 돌아감
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 에이전트 역할 요약
|
|
85
|
+
|
|
86
|
+
| 에이전트 | 반환값 | 호출 주체 |
|
|
87
|
+
|---------|-------|---------|
|
|
88
|
+
| specifier | Requirement.md + (겸임 시) PLAN.md/TASK + dispatch XML | Main Claude |
|
|
89
|
+
| planner | PLAN.md/TASK 파일 생성 완료 + execution-mode | Main Claude |
|
|
90
|
+
| scheduler | READY TASK + dispatch XML | Main Claude |
|
|
91
|
+
| builder | task-result XML (context-handoff 포함) | Main Claude |
|
|
92
|
+
| verifier | task-result XML | Main Claude |
|
|
93
|
+
| committer | task-result XML + commit hash | Main Claude |
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## 모드별 서브에이전트 호출 횟수
|
|
98
|
+
|
|
99
|
+
| 모드 | Specifier | Planner | Scheduler | Builder | Verifier | Committer | 합계 |
|
|
100
|
+
|------|:---------:|:-------:|:---------:|:-------:|:--------:|:---------:|:----:|
|
|
101
|
+
| direct | O (겸임) | X | X | O | X | O | **3회** |
|
|
102
|
+
| pipeline | O | O | X | O | O | O | **5회** |
|
|
103
|
+
| full | O | O | O | O | O | O | **6회** |
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## 승인 게이트
|
|
108
|
+
|
|
109
|
+
| 모드 | 승인 횟수 | 시점 |
|
|
110
|
+
|------|:---------:|------|
|
|
111
|
+
| direct | 1회 | Specifier 완료 후 (요구사항 + 설계 통합) |
|
|
112
|
+
| pipeline/full | 2회 | 기획 승인 (Requirement.md) → 개발 승인 (PLAN.md) |
|
|
113
|
+
| 자동 승인 | 0회 | "자동으로 진행" 명시 시 |
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Bash CLI 실행 (서버 자동화)
|
|
118
|
+
|
|
119
|
+
대화 세션 없이 파이프라인을 독립 실행하는 방법. `claude -p`가 Main Claude 역할을 수행한다.
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
env -u CLAUDECODE -u ANTHROPIC_API_KEY claude -p \
|
|
123
|
+
"[WORK 시작] {작업 내용}" \
|
|
124
|
+
--dangerously-skip-permissions \
|
|
125
|
+
--output-format stream-json \
|
|
126
|
+
--verbose \
|
|
127
|
+
2>&1 | tee /tmp/pipeline.log
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
| 옵션 | 목적 |
|
|
131
|
+
|------|------|
|
|
132
|
+
| `env -u CLAUDECODE` | 중첩 실행 차단 우회 |
|
|
133
|
+
| `env -u ANTHROPIC_API_KEY` | API 키 대신 구독 인증(Max) 사용 |
|
|
134
|
+
| `--dangerously-skip-permissions` | 무인 실행 시 권한 프롬프트 스킵 |
|
|
135
|
+
| `--output-format stream-json --verbose` | 실시간 모니터링용 스트리밍 |
|
|
136
|
+
|
|
137
|
+
중단된 파이프라인 재개:
|
|
138
|
+
```bash
|
|
139
|
+
env -u CLAUDECODE -u ANTHROPIC_API_KEY claude -p \
|
|
140
|
+
"WORK-XX 파이프라인을 이어서 실행하라." \
|
|
141
|
+
--dangerously-skip-permissions
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
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
|
+
|
|
169
|
+
## 컨텍스트 전달 (슬라이딩 윈도우)
|
|
170
|
+
|
|
171
|
+
| 거리 | Level | 내용 |
|
|
172
|
+
|------|-------|------|
|
|
173
|
+
| 직전 | FULL | what + why + caution + incomplete |
|
|
174
|
+
| 2단계 전 | SUMMARY | what 1~2줄 |
|
|
175
|
+
| 3단계+ | DROP | 전달 안 함 |
|
package/agents/ko/builder.md
CHANGED
|
@@ -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
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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
|
|
package/agents/ko/committer.md
CHANGED
|
@@ -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 갱신 →
|
|
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 |
|
|
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
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
|
42
|
-
|
|
|
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.
|
|
55
|
-
5.
|
|
56
|
-
6.
|
|
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 조건: `
|
|
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
|
-
→
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
188
|
+
- 마지막 TASK 완료 시 WORK-LIST.md의 해당 WORK 행 상태를 `IN_PROGRESS` → `DONE`으로 변경 (행 제거 및 WORK 폴더 이동 금지)
|
|
193
189
|
|
|
194
190
|
### Output Language Rule
|
|
195
191
|
→ `shared-prompt-sections.md` § 1 참조
|
|
@@ -15,6 +15,31 @@
|
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
+
## § 0. Requirement.md
|
|
19
|
+
|
|
20
|
+
경로: `works/{WORK_ID}/Requirement.md`
|
|
21
|
+
|
|
22
|
+
```markdown
|
|
23
|
+
# Requirement — WORK-NN
|
|
24
|
+
|
|
25
|
+
## Original Request
|
|
26
|
+
> 사용자가 입력한 그대로
|
|
27
|
+
|
|
28
|
+
## Functional Requirements (기능 요구사항)
|
|
29
|
+
- FR-01: ...
|
|
30
|
+
- FR-02: ...
|
|
31
|
+
|
|
32
|
+
## Non-Functional Requirements (비기능 요구사항)
|
|
33
|
+
- NFR-01: ...
|
|
34
|
+
|
|
35
|
+
## Acceptance Criteria
|
|
36
|
+
- [ ] 검증 가능한 기준들
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
생성 주체: Specifier (모든 요청에 필수)
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
18
43
|
## § 1. PLAN.md
|
|
19
44
|
|
|
20
45
|
경로: `works/{WORK_ID}/PLAN.md`
|
|
@@ -173,7 +198,6 @@ None
|
|
|
173
198
|
> Completed: {YYYY-MM-DD HH:MM}
|
|
174
199
|
> Execution-Mode: direct
|
|
175
200
|
> Status: **DONE**
|
|
176
|
-
> Commit: {hash}
|
|
177
201
|
|
|
178
202
|
## 요약
|
|
179
203
|
{1줄}
|
|
@@ -215,10 +239,11 @@ None
|
|
|
215
239
|
|
|
216
240
|
| 종류 | 형식 | 생성 주체 |
|
|
217
241
|
|------|------|----------|
|
|
218
|
-
|
|
|
219
|
-
|
|
|
220
|
-
| TASK
|
|
221
|
-
| TASK
|
|
242
|
+
| 요구사항 | `Requirement.md` | specifier |
|
|
243
|
+
| WORK 계획 | `PLAN.md` | planner / specifier |
|
|
244
|
+
| TASK 계획 | `TASK-NN.md` | planner / specifier |
|
|
245
|
+
| TASK 진행 | `TASK-NN_progress.md` | planner / specifier(템플릿) / builder(갱신) |
|
|
246
|
+
| TASK 결과 | `TASK-NN_result.md` | committer |
|
|
222
247
|
| WORK 진행 | `PROGRESS.md` | scheduler |
|
|
223
248
|
|
|
224
249
|
`WORK-NN-TASK-NN.md` 형식 금지 → `parseTaskFilename()` 인식 불가.
|