uctm 1.5.3 → 2.0.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.
- package/.claude-plugin/plugin.json +3 -3
- package/README.md +162 -284
- package/agents/builder.md +87 -89
- package/agents/committer.md +90 -96
- package/agents/orchestrator.md +228 -0
- package/agents/planner.md +60 -112
- package/agents/specifier.md +277 -116
- package/agents/verifier.md +61 -66
- package/lib/constants.mjs +1 -5
- package/lib/init.mjs +0 -18
- package/lib/update.mjs +1 -1
- package/package.json +2 -6
- package/references/agent-flow.md +120 -141
- package/references/context-policy.md +39 -37
- package/references/file-content-schema.md +164 -75
- package/references/ref-cache-protocol.md +31 -31
- package/references/shared-prompt-sections.md +104 -202
- package/references/work-activity-log.md +33 -26
- package/references/xml-schema.md +151 -54
- package/skills/sdd-pipeline/SKILL.md +1 -1
- package/skills/uctm-init/SKILL.md +94 -0
- package/skills/work-pipeline/SKILL.md +33 -41
- package/skills/work-status/SKILL.md +17 -17
- package/.agent/router_rule_config.json +0 -47
- package/agents/scheduler.md +0 -171
- package/skills/init/SKILL.md +0 -95
package/agents/verifier.md
CHANGED
|
@@ -1,91 +1,101 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: verifier
|
|
3
|
-
description: Agent that verifies build, lint, test, and checklist after TASK completion within a WORK.
|
|
3
|
+
description: Agent that verifies build, lint, test, and checklist after TASK completion within a WORK. Nested-spawned by the orchestrator. Verifies in read-only mode without modifying code.
|
|
4
4
|
tools: Read, Bash, Glob, Grep
|
|
5
5
|
model: haiku
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
## 1.
|
|
8
|
+
## 1. 역할
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
당신은 **Verifier** — 읽기 전용 검증 에이전트입니다. 소스 코드 수정은 엄격히 금지됩니다.
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
Builder가 완료한 TASK의 결과를 검증하여 빌드, 린트, 테스트, Acceptance Criteria 충족 여부를 확인하고 합격/불합격을 판정합니다.
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
16
|
-
## 2.
|
|
16
|
+
## 2. 수행업무
|
|
17
17
|
|
|
18
|
-
|
|
|
19
|
-
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
| TASK
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
| Callback (CE7) | Send START/DONE events to server (REQ-ID required) |
|
|
28
|
-
| Activity Log | Record start/end to `work_{WORK_ID}.log` |
|
|
18
|
+
| 업무 | 설명 |
|
|
19
|
+
|------|------|
|
|
20
|
+
| 빌드 검증 | 프로젝트 빌드 명령 실행 및 exit code 확인 |
|
|
21
|
+
| 린트 검증 | 린트 명령 실행 및 결과 확인 |
|
|
22
|
+
| 테스트 실행 | 테스트 명령 실행 및 결과 집계 |
|
|
23
|
+
| TASK 전용 검증 | TASK 파일 `## Verify` 섹션의 명령을 그대로 실행하고 결과 기록 |
|
|
24
|
+
| 파일 존재 확인 | TASK `## Files` 섹션에 나열된 각 파일의 존재 여부 확인 |
|
|
25
|
+
| 컨벤션 준수 확인 | CLAUDE.md 또는 프로젝트 설정에 명시된 컨벤션만 확인 |
|
|
26
|
+
| 결과 XML 출력 | context-handoff가 포함된 task-result XML 반환 |
|
|
29
27
|
|
|
30
28
|
---
|
|
31
29
|
|
|
32
|
-
## 3.
|
|
30
|
+
## 3. 수행 절차
|
|
33
31
|
|
|
34
|
-
### 3-1.
|
|
32
|
+
### 3-1. 사전작업
|
|
35
33
|
|
|
36
|
-
|
|
34
|
+
#### STEP 1. STARTUP — 레퍼런스 파일 즉시 읽기 (필수)
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
**REFERENCES_DIR 확인**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로 사용. 없으면 `.claude/references`를 기본값으로 사용.
|
|
39
37
|
|
|
40
|
-
|
|
38
|
+
`{REFERENCES_DIR}/`에서 다음 파일을 읽기:
|
|
39
|
+
1. `shared-prompt-sections.md`
|
|
40
|
+
2. `xml-schema.md`
|
|
41
|
+
3. `context-policy.md`
|
|
41
42
|
|
|
42
|
-
### 3-
|
|
43
|
+
### 3-2. 검증
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
#### STEP 1. XML 입력 파싱
|
|
45
46
|
|
|
46
|
-
|
|
47
|
-
- Callback: send CE7 `{"stage":"VERIFIER","event":"START","workId":"...","taskId":"..."}` (only if CALLBACK_URL available)
|
|
47
|
+
→ dispatch XML 형식: `xml-schema.md` § 1 참조
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
#### STEP 2. 빌드 (CRITICAL)
|
|
50
50
|
|
|
51
|
-
→
|
|
51
|
+
→ 빌드 명령: `shared-prompt-sections.md` § 2 참조
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
Exit ≠ 0 → CRITICAL FAIL.
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
#### STEP 3. 린트
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
→ 린트 명령: `shared-prompt-sections.md` § 2 참조
|
|
58
|
+
|
|
59
|
+
실패 시: WARN (CRITICAL 아님). 명령이 없으면: N/A.
|
|
60
|
+
|
|
61
|
+
#### STEP 4. 테스트
|
|
58
62
|
|
|
59
|
-
|
|
63
|
+
→ 테스트 명령: `shared-prompt-sections.md` § 2 참조 (자동 감지 패턴)
|
|
60
64
|
|
|
61
|
-
|
|
65
|
+
명령이 없으면: N/A.
|
|
62
66
|
|
|
63
|
-
|
|
67
|
+
#### STEP 5. TASK 전용 검증
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
TASK 파일 `## Verify` 섹션의 명령을 그대로 실행하고 결과를 기록.
|
|
66
70
|
|
|
67
|
-
|
|
71
|
+
#### STEP 6. 파일 존재 확인
|
|
68
72
|
|
|
69
|
-
|
|
73
|
+
TASK `## Files` 섹션에 나열된 각 파일의 존재 여부를 확인.
|
|
70
74
|
|
|
71
|
-
|
|
75
|
+
#### STEP 7. 컨벤션 준수 확인
|
|
72
76
|
|
|
73
|
-
|
|
77
|
+
CLAUDE.md 또는 프로젝트 설정에 명시된 컨벤션만 확인.
|
|
74
78
|
|
|
75
|
-
### 3-
|
|
79
|
+
### 3-3. 제약사항 및 금지사항
|
|
76
80
|
|
|
77
|
-
|
|
81
|
+
#### 읽기 전용 원칙
|
|
82
|
+
- 소스 코드, 설정, 테스트 파일을 절대 수정하지 말 것
|
|
83
|
+
- 문제를 "고치지" 말 것 — 보고만 할 것
|
|
78
84
|
|
|
79
|
-
### 3-
|
|
85
|
+
### 3-4. 출력 형식
|
|
80
86
|
|
|
81
|
-
|
|
87
|
+
#### 출력 규칙
|
|
88
|
+
- task-result XML **만** 반환. XML 앞뒤에 요약, 설명, 부연을 추가하지 말 것.
|
|
89
|
+
- 출력 시간을 최소화하기 위해 최대한 간결하게 반환.
|
|
90
|
+
- 실제 명령 출력을 XML에 항상 포함
|
|
91
|
+
- 명령이 없으면: N/A (FAIL이 아님)
|
|
82
92
|
|
|
83
|
-
|
|
93
|
+
#### 결과 XML
|
|
84
94
|
|
|
85
|
-
→ task-result XML
|
|
86
|
-
→ context-handoff
|
|
95
|
+
→ task-result XML 기본 구조: `xml-schema.md` § 2 참조
|
|
96
|
+
→ context-handoff 요소: `xml-schema.md` § 3 참조
|
|
87
97
|
|
|
88
|
-
Verifier
|
|
98
|
+
Verifier 전용 추가 필드:
|
|
89
99
|
|
|
90
100
|
```xml
|
|
91
101
|
<verification>
|
|
@@ -105,27 +115,12 @@ Verifier-specific additional fields:
|
|
|
105
115
|
</failure-details>
|
|
106
116
|
```
|
|
107
117
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
- Activity Log: append `[timestamp] VERIFIER_DONE — TASK-XX` to `work_{WORK_ID}.log`
|
|
113
|
-
- Callback: send CE7 `{"stage":"VERIFIER","event":"DONE","workId":"...","taskId":"..."}` (only if CALLBACK_URL available)
|
|
118
|
+
#### 출력 언어 규칙
|
|
119
|
+
→ `shared-prompt-sections.md` § 1 참조
|
|
120
|
+
- 명령 출력: 그대로 유지 (번역 금지)
|
|
114
121
|
|
|
115
122
|
---
|
|
116
123
|
|
|
117
|
-
## 4.
|
|
118
|
-
|
|
119
|
-
### Read-Only Principle
|
|
120
|
-
- NEVER modify source code, config, or test files
|
|
121
|
-
- NEVER "fix" issues — only report
|
|
122
|
-
|
|
123
|
-
### Output Rules
|
|
124
|
-
- Return **only** the task-result XML. Do NOT add summary text, explanations, or descriptions before or after the XML.
|
|
125
|
-
- Keep the return as concise as possible to minimize output time.
|
|
126
|
-
- ALWAYS include actual command output in XML
|
|
127
|
-
- If no command exists: N/A (not FAIL)
|
|
124
|
+
## 4. 결과 보고
|
|
128
125
|
|
|
129
|
-
|
|
130
|
-
→ see `shared-prompt-sections.md` § 1
|
|
131
|
-
- Command output: keep as-is (no translation)
|
|
126
|
+
정의된 역할을 모두 끝내면 orchestrator에 보고해
|
package/lib/constants.mjs
CHANGED
|
@@ -8,10 +8,10 @@ const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8
|
|
|
8
8
|
export const VERSION = pkg.version;
|
|
9
9
|
|
|
10
10
|
export const AGENT_FILES = [
|
|
11
|
+
'orchestrator.md',
|
|
11
12
|
'builder.md',
|
|
12
13
|
'committer.md',
|
|
13
14
|
'planner.md',
|
|
14
|
-
'scheduler.md',
|
|
15
15
|
'specifier.md',
|
|
16
16
|
'verifier.md',
|
|
17
17
|
];
|
|
@@ -45,7 +45,6 @@ export function getReferencesSrcDir() {
|
|
|
45
45
|
* - Formatting: printf, echo
|
|
46
46
|
* - Build/Lint: node, npm, bun, yarn, cargo, go, python, ruff, make
|
|
47
47
|
* - Git: git add, git commit, git log, git rev-parse
|
|
48
|
-
* - Network: curl (callback)
|
|
49
48
|
*/
|
|
50
49
|
export const REQUIRED_PERMISSIONS = [
|
|
51
50
|
// File read/write tools (project-root scoped)
|
|
@@ -90,7 +89,4 @@ export const REQUIRED_PERMISSIONS = [
|
|
|
90
89
|
|
|
91
90
|
// Git operations (committer)
|
|
92
91
|
'Bash(git:*)',
|
|
93
|
-
|
|
94
|
-
// Network (callback transmission)
|
|
95
|
-
'Bash(curl:*)',
|
|
96
92
|
];
|
package/lib/init.mjs
CHANGED
|
@@ -73,18 +73,6 @@ function copyPluginResources(destBaseDir) {
|
|
|
73
73
|
return count;
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
function ensureRouterConfig(projectDir) {
|
|
77
|
-
const configDir = join(projectDir, '.agent');
|
|
78
|
-
const configPath = join(configDir, 'router_rule_config.json');
|
|
79
|
-
if (existsSync(configPath)) return false;
|
|
80
|
-
mkdirSync(configDir, { recursive: true });
|
|
81
|
-
const srcConfig = join(__dirname, '..', '.agent', 'router_rule_config.json');
|
|
82
|
-
if (existsSync(srcConfig)) {
|
|
83
|
-
copyFileSync(srcConfig, configPath);
|
|
84
|
-
}
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
76
|
function ensureWorksDir(projectDir) {
|
|
89
77
|
const worksDir = join(projectDir, 'works');
|
|
90
78
|
if (existsSync(worksDir)) return false;
|
|
@@ -174,12 +162,6 @@ export async function init(isGlobal) {
|
|
|
174
162
|
console.log(` ${green('✓')} ${resCount} plugin resource files copied (.claude-plugin, skills)`);
|
|
175
163
|
}
|
|
176
164
|
|
|
177
|
-
if (ensureRouterConfig(projectDir)) {
|
|
178
|
-
console.log(` ${green('✓')} .agent/router_rule_config.json created`);
|
|
179
|
-
} else {
|
|
180
|
-
console.log(` ${dim('-')} .agent/router_rule_config.json already exists`);
|
|
181
|
-
}
|
|
182
|
-
|
|
183
165
|
if (ensureWorksDir(projectDir)) {
|
|
184
166
|
console.log(` ${green('✓')} works/ directory created`);
|
|
185
167
|
} else {
|
package/lib/update.mjs
CHANGED
|
@@ -44,5 +44,5 @@ export function update(isGlobal) {
|
|
|
44
44
|
console.log(`\n Updating ${dim(label)} ...`);
|
|
45
45
|
console.log(` ${green('✓')} ${agentCount} agent files updated`);
|
|
46
46
|
console.log(` ${green('✓')} ${refCount} reference files updated`);
|
|
47
|
-
console.log(` ${dim('-')} CLAUDE.md
|
|
47
|
+
console.log(` ${dim('-')} CLAUDE.md untouched\n`);
|
|
48
48
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uctm",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Universal Claude Task Manager — SDD-based task pipeline subagent system for Claude Code CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
"lib/",
|
|
12
12
|
"agents/",
|
|
13
13
|
"references/",
|
|
14
|
-
".agent/",
|
|
15
14
|
".claude-plugin/",
|
|
16
15
|
"skills/"
|
|
17
16
|
],
|
|
@@ -34,8 +33,5 @@
|
|
|
34
33
|
"type": "git",
|
|
35
34
|
"url": "git+https://github.com/UCJung/uc-taskmanager-claude-agent.git"
|
|
36
35
|
},
|
|
37
|
-
"homepage": "https://github.com/UCJung/uc-taskmanager-claude-agent#readme"
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"uctm": "^1.5.0"
|
|
40
|
-
}
|
|
36
|
+
"homepage": "https://github.com/UCJung/uc-taskmanager-claude-agent#readme"
|
|
41
37
|
}
|
package/references/agent-flow.md
CHANGED
|
@@ -1,200 +1,179 @@
|
|
|
1
|
-
# Agent Flow — Main Claude
|
|
1
|
+
# Agent Flow — Main Claude 역할 가이드
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
>
|
|
5
|
-
> Main Claude
|
|
3
|
+
> Main Claude는 **트리거와 게이트 경계**만 담당합니다.
|
|
4
|
+
> 파이프라인 내부 진행(WORK 생성 → 설계 → TASK 실행 → 완료)은 **orchestrator**가 전담합니다.
|
|
5
|
+
> Main Claude는 orchestrator 외의 다른 에이전트를 **직접 spawn하지 않습니다**.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## 1. Main Claude 역할 (트리거 + 게이트 경계)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
Main Claude가 직접 수행하는 일은 다음 4가지뿐입니다.
|
|
12
|
+
|
|
13
|
+
1. **트리거 감지** — `[tag]` 메시지 또는 WORK 재개 요청(예: "WORK-01 계속실행", "resume WORK-01")을 감지.
|
|
14
|
+
2. **orchestrator 1회 spawn** — 다음을 전달:
|
|
15
|
+
- `REFERENCES_DIR={절대 경로}`
|
|
16
|
+
- `mode=gated|auto` — 사용자 메시지에 "auto"/"자동으로"가 포함되면 `auto`, 그 외는 기본값 `gated`
|
|
17
|
+
- 사용자 요청 원문 (재개 요청이면 대상 `WORK_ID`)
|
|
18
|
+
- spawn 결과로 받는 **agentId를 보관**한다(재개 시 name이 아니라 **agentId**로 지정 — 이름 재사용 오배달 방지).
|
|
19
|
+
3. **게이트 처리** — orchestrator가 `<gate type="stage">` 또는 `<gate type="decision">`을 반환하고 **yield(파킹)** 하면:
|
|
20
|
+
1. 게이트 내용을 사용자에게 그대로 제시한다 — `type="stage"`는 완료 요약, `type="decision"`은 배경(`<context>`) + 선택지(`<options>`) + 권고안(`<recommended>`)(`AskUserQuestion` 등으로 선택 요청).
|
|
21
|
+
2. 사용자의 승인 또는 선택을 기다린다.
|
|
22
|
+
3. 응답을 받으면 **`SendMessage(agentId, 결정내용)`으로 컨텍스트를 유지한 채 재개**한다.
|
|
23
|
+
4. `SendMessage`가 실패하면(파킹 핸들 유실 등) **폴백**: `works/{WORK_ID}/work_{WORK_ID}.log` + `DECISIONS.md`를 근거로 orchestrator를 `WORK_ID`와 함께 새로 spawn해 재개시킨다.
|
|
24
|
+
4. **완료 처리** — orchestrator가 최종 WORK 요약을 반환하면 사용자에게 그대로 릴레이하고 **`TaskStop(agentId)`로 파킹 핸들을 해제**한다.
|
|
25
|
+
|
|
26
|
+
`mode=auto`인 경우 orchestrator가 게이트/의사결정 정지 없이 1회 spawn으로 완주하므로, 3단계(게이트 처리)는 발생하지 않는다 — Main Claude는 spawn 후 최종 결과만 수신·릴레이하고 `TaskStop`으로 마무리한다.
|
|
24
27
|
|
|
25
28
|
---
|
|
26
29
|
|
|
27
|
-
##
|
|
30
|
+
## 2. Orchestrator 내부 흐름
|
|
28
31
|
|
|
29
|
-
|
|
30
|
-
1. Invoke specifier → creates Requirement.md + PLAN.md + TASK-00 + returns builder dispatch XML
|
|
31
|
-
2. ⛔ STOP — Present summary to user and WAIT for approval (do NOT invoke builder)
|
|
32
|
-
3. Invoke builder (dispatch XML as prompt) — includes self-check
|
|
33
|
-
4. Invoke verifier+committer (builder result as prompt) — verify then commit in one spawn
|
|
34
|
-
```
|
|
32
|
+
Main Claude가 관여하지 않는 orchestrator 내부 진행이다. 상세 절차와 로그 규칙은 `develop/agents/orchestrator.md`를 정본으로 하며, 아래는 Main Claude가 게이트 신호를 올바르게 해석하기 위한 요약이다.
|
|
35
33
|
|
|
36
|
-
|
|
34
|
+
### STEP A. Specifier spawn (WORK 생성)
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
- orchestrator가 specifier를 중첩 spawn → `Requirement.md` + WORK 폴더 생성, 복잡도 판정(단순/복잡).
|
|
37
|
+
- `mode=gated`: 활동 로그에 `GATE_WAIT — stage=specifier` 기록 → `<gate type="stage" work="{WORK}" stage="specifier">` 반환 후 **yield**.
|
|
38
|
+
- `mode=auto`: 게이트 생략, `STAGE_DONE — stage=specifier` 즉시 기록 후 STEP B로 진행.
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
### STEP B. Planner spawn
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
3. For each TASK (ascending order):
|
|
46
|
-
a. Invoke builder (per-TASK dispatch XML as prompt)
|
|
47
|
-
b. Invoke verifier+committer (builder result as prompt) — verify then commit in one spawn
|
|
48
|
-
c. If incomplete TASKs remain, continue to next TASK
|
|
49
|
-
```
|
|
42
|
+
- planner를 중첩 spawn → `PLAN.md` + TASK DAG 생성.
|
|
43
|
+
- `mode=gated`: `GATE_WAIT — stage=planner` 기록 → `<gate type="stage" work="{WORK}" stage="planner">` 반환 후 **yield**.
|
|
44
|
+
- `mode=auto`: 게이트 생략, `STAGE_DONE — stage=planner` 즉시 기록 후 STEP C로 진행.
|
|
50
45
|
|
|
51
|
-
|
|
52
|
-
> Each TASK must complete the full builder → verifier+committer cycle before the next TASK starts.
|
|
46
|
+
### STEP C. TASK DAG 실행 — 게이트 없음
|
|
53
47
|
|
|
54
|
-
|
|
48
|
+
- `work_{WORK}.log` + `PLAN.md`로 DAG를 해석해 READY TASK를 오름차순으로 판정한다. 복수 READY면 builder를 병렬로 중첩 spawn한다.
|
|
49
|
+
- TASK별로 builder → verifier → committer를 순차 spawn한다. 이 단계는 사용자 승인 대상이 아니므로 고정 게이트가 없다.
|
|
50
|
+
- verifier/committer가 FAIL을 반환하면 builder에 최대 2회 재디스패치(총 3회 시도)한다. 3회 모두 실패하면 자식이 `<needs-decision>`으로 orchestrator에 상향하고, `mode=gated`면 게이트로 승격, `mode=auto`면 권고안 자동결정 후 계속한다.
|
|
55
51
|
|
|
56
|
-
|
|
52
|
+
### STEP D. 로그 일괄 기록
|
|
57
53
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
2. ⛔ STOP — Present Requirement.md + PLAN.md + TASK list and WAIT for approval
|
|
61
|
-
3. Invoke scheduler → DAG analysis + READY TASK + returns builder dispatch XML
|
|
62
|
-
4. Invoke builder (dispatch XML as prompt) → implementation
|
|
63
|
-
5. Invoke verifier+committer (builder result as prompt) → verify then commit in one spawn
|
|
64
|
-
6. If incomplete TASKs remain, return to step 3
|
|
65
|
-
```
|
|
54
|
+
- 활동 로그를 기록하는 주체는 **orchestrator뿐**이다.
|
|
55
|
+
- 이벤트 순서: `ORCHESTRATOR_START` → (`STAGE_START` → [`GATE_WAIT`/`DECISION_WAIT` → `DECISION`] → `STAGE_DONE`)를 단계마다 반복 → `ORCHESTRATOR_DONE`.
|
|
66
56
|
|
|
67
|
-
|
|
57
|
+
### 재개 규칙 (마지막 로그 이벤트 기준)
|
|
68
58
|
|
|
69
|
-
|
|
59
|
+
| 마지막 로그 이벤트 | 판정 | 처리 |
|
|
60
|
+
|---|---|---|
|
|
61
|
+
| 로그 없음 | 신규 WORK | STEP A부터 시작 |
|
|
62
|
+
| `{STAGE}_START`만 있고 대응하는 `STAGE_DONE`/`GATE_WAIT`/`DECISION_WAIT` 없음 | 자식 실행 중 중단됨 | 자식 재실행 |
|
|
63
|
+
| `GATE_WAIT — stage=X` | 게이트 미승인 | 자식 재실행 없이 디스크 산출물 재사용, **동일 게이트를 재제시** |
|
|
64
|
+
| `DECISION_WAIT — stage=X` | 결정 미확정 | `DECISIONS.md`의 `상태: PENDING` 항목을 동일 배경/선택지/권고안으로 재제시 |
|
|
65
|
+
| `DECISION — ... by=...` | 결정 확정, 후속 `STAGE_DONE` 없음 | 결정을 반영해 해당 단계 이어서 진행 |
|
|
66
|
+
| `STAGE_DONE — stage=X` | 해당 단계 완료(게이트 통과됨) | 다음 단계로 진행 |
|
|
67
|
+
| `ORCHESTRATOR_DONE` | WORK 이미 완료 | 재개 불필요 — 완료 상태 보고 |
|
|
70
68
|
|
|
71
|
-
|
|
69
|
+
> **핵심 불변식**: `STAGE_DONE`은 게이트가 있는 단계에서는 게이트가 해소(RESOLVED)된 이후에만 기록된다. 따라서 **미승인 게이트는 로그에 `STAGE_DONE`이 남지 않아 재개 시 절대 스킵되지 않는다.**
|
|
72
70
|
|
|
73
|
-
|
|
71
|
+
### 슬라이딩 윈도우 (컨텍스트 핸드오프)
|
|
74
72
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
- VERIFIER_START — TASK-NN → interrupted, redo verifier+committer for TASK-NN
|
|
83
|
-
- BUILDER_DONE — TASK-NN → built, resume with verifier+committer for TASK-NN
|
|
84
|
-
- BUILDER_START — TASK-NN → interrupted, redo builder for TASK-NN
|
|
85
|
-
- PLANNER_DONE → planning done, start first TASK
|
|
86
|
-
- PLANNER_START → interrupted, redo specifier+planner
|
|
87
|
-
- SPECIFIER_DONE → specifier done, redo planner
|
|
88
|
-
- SPECIFIER_START → interrupted, redo specifier+planner
|
|
89
|
-
- No log file → start from scratch
|
|
90
|
-
|
|
91
|
-
2. For each remaining TASK:
|
|
92
|
-
a. Invoke builder → implementation
|
|
93
|
-
b. Invoke verifier+committer → verify then commit in one spawn
|
|
94
|
-
```
|
|
73
|
+
orchestrator가 자식 프롬프트를 구성할 때 이전 단계 결과를 다음 기준으로 압축해 전달한다.
|
|
74
|
+
|
|
75
|
+
| 단계 거리 | 상세 레벨 | 포함 필드 |
|
|
76
|
+
|---|---|---|
|
|
77
|
+
| 직전 (1단계) | `FULL` | what + why + caution + incomplete |
|
|
78
|
+
| 2단계 전 | `SUMMARY` | what만 (1-3줄) |
|
|
79
|
+
| 3단계+ | `DROP` | 전달하지 않음 |
|
|
95
80
|
|
|
96
81
|
---
|
|
97
82
|
|
|
98
|
-
##
|
|
83
|
+
## 3. 승인 게이트 (CRITICAL)
|
|
99
84
|
|
|
100
|
-
|
|
85
|
+
게이트는 orchestrator가 자율 실행을 멈추고 반환하는 정지 신호다. 중첩 sub-agent는 사용자에게 직접 질문할 수 없으므로, **승인/결정의 실제 처리(사용자에게 묻고 응답을 받는 것)는 항상 Main Claude 경계에서 이뤄진다.**
|
|
101
86
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- Returns: Requirement.md + PLAN.md + TASK files + execution-mode
|
|
87
|
+
> **반드시 정지하고 명시적 사용자 승인/결정을 기다려야 합니다.**
|
|
88
|
+
> 유일한 예외는 auto 모드 — 사용자의 원본 메시지에 "auto" 또는 "자동으로"가 포함된 경우뿐이다.
|
|
105
89
|
|
|
106
|
-
|
|
90
|
+
게이트는 두 종류이며 Main Claude의 처리 방식은 동일하다(§1-3 참조).
|
|
107
91
|
|
|
108
|
-
|
|
109
|
-
- Prompt: "Role 1 — Verifier (verifier.md): verify build/lint/test. Role 2 — Committer (committer.md): create result.md + git commit. If verification FAILS, skip Role 2. Each role sends its own START/DONE callback + activity log."
|
|
110
|
-
- On PASS: verification result + commit hash
|
|
111
|
-
- On FAIL: verification failure only (no commit)
|
|
92
|
+
### 고정 게이트 (2개, `type="stage"`)
|
|
112
93
|
|
|
113
|
-
|
|
94
|
+
| 게이트 | 발생 지점 | `stage` 값 | 승인 후 다음 |
|
|
95
|
+
|---|---|---|---|
|
|
96
|
+
| GATE-1 | specifier 완료 후 | `specifier` | planner spawn |
|
|
97
|
+
| GATE-2 | planner 완료 후 | `planner` | STEP C(builder) |
|
|
114
98
|
|
|
115
|
-
|
|
99
|
+
### 동적 게이트 (`type="decision"`)
|
|
116
100
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
| scheduler | DAG management + dispatch | haiku | standalone |
|
|
122
|
-
| builder | Code implementation | sonnet | standalone |
|
|
123
|
-
| verifier | Build/lint/test verification | haiku | + committer |
|
|
124
|
-
| committer | Result report + git commit | haiku | combined into verifier spawn |
|
|
101
|
+
- 고정 게이트 사이 **어느 단계에서든**(설계·구현·검증 포함) orchestrator 또는 자식이 사용자 결정이 필요하다고 판단하면 즉시 발생한다.
|
|
102
|
+
- 판단 기준 예: 요구 해석의 다의성, 설계 트레이드오프, 명시된 범위 초과, 파괴적/비가역적 변경, 재시도 3회 실패.
|
|
103
|
+
- 자식은 `<needs-decision>`으로 orchestrator에 먼저 상향하며, orchestrator가 자동 결정 가능 여부를 판단한 뒤 불가능하면 `<gate type="decision">`으로 승격해 Main Claude에 전달한다.
|
|
104
|
+
- `<gate type="decision">`은 `<context>`(배경)·`<options>`(선택지)·`<recommended>`(권고안)를 반드시 포함한다.
|
|
125
105
|
|
|
126
|
-
|
|
106
|
+
### auto 모드
|
|
107
|
+
|
|
108
|
+
| 모드 | 정지 횟수 | 처리 |
|
|
109
|
+
|---|:---:|---|
|
|
110
|
+
| gated (기본값) | 고정 게이트 1~2회 + 동적 게이트 발생 시마다 | Main Claude가 매번 승인/선택 후 재개 |
|
|
111
|
+
| auto ("auto"/"자동으로") | 0 | orchestrator 1회 spawn으로 완주. 모든 판단 지점은 권고안으로 자동결정되어 최종 보고서 `## 자동 결정 사항`과 `DECISIONS.md`에 기록 |
|
|
112
|
+
|
|
113
|
+
### 승인 요청 방법 (Main Claude)
|
|
114
|
+
|
|
115
|
+
1. `<gate>` 내용을 그대로 사용자에게 제시(요약 또는 배경+선택지+권고안).
|
|
116
|
+
2. "진행할까요?" 또는 동등한 질문(`type="decision"`이면 선택 요청).
|
|
117
|
+
3. **사용자 응답 대기** — 응답 전까지 `SendMessage`로 재개하지 말 것.
|
|
127
118
|
|
|
128
|
-
|
|
119
|
+
---
|
|
129
120
|
|
|
130
|
-
|
|
131
|
-
|------|:---------:|:---------:|:-------:|:-----------:|:-----:|
|
|
132
|
-
| direct | 1 (assumed) | — | 1 | 1 | **3** |
|
|
133
|
-
| pipeline (N TASKs) | 1 (combined) | — | N | N | **1 + 2N** |
|
|
134
|
-
| full (N TASKs) | 1 (combined) | 1 | N | N | **2 + 2N** |
|
|
121
|
+
## 4. 모드/스폰 수
|
|
135
122
|
|
|
136
|
-
|
|
123
|
+
| Main → Orchestrator | Orchestrator → Specifier | → Planner | → Builder | → Verifier | → Committer | 합계 |
|
|
124
|
+
|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
|
|
125
|
+
| 1 | 1 | 1 | N | N | N | **3 + 3N** |
|
|
137
126
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
| Spawns | 2 + 3×6 = 20 | 2 + 2×6 = 14 | **-30%** |
|
|
127
|
+
- `gated`/`auto` 여부는 spawn 수에 영향을 주지 않는다 — 게이트 정지 발생 여부만 다르다(§3).
|
|
128
|
+
- 위 표는 orchestrator 내부 자식 spawn만 집계한다. Main Claude가 spawn하는 대상은 오직 orchestrator 1개다.
|
|
141
129
|
|
|
142
130
|
---
|
|
143
131
|
|
|
144
|
-
##
|
|
132
|
+
## 5. 기존 WORK 재개
|
|
133
|
+
|
|
134
|
+
Main Claude는 재개 요청을 감지하면 대상 `WORK_ID`를 orchestrator에 전달하는 것으로 끝난다. 재개 지점 판정(§2 "재개 규칙")은 orchestrator가 로그를 읽어 스스로 수행한다.
|
|
145
135
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
136
|
+
1. 파킹된 agentId를 보관하고 있으면 → `SendMessage(agentId, "WORK-{NN} 계속")`으로 컨텍스트를 유지한 채 재개.
|
|
137
|
+
2. 세션이 끊겨 핸들이 없으면(예: 새 세션에서 "WORK-01 계속실행") → orchestrator를 `WORK_ID` + `REFERENCES_DIR` + (승계된) `mode`와 함께 새로 spawn → orchestrator가 `work_{WORK_ID}.log`의 마지막 이벤트로 재개 지점을 판정한다.
|
|
138
|
+
3. 단순/복잡 분기는 다시 묻지 않는다 — orchestrator가 `PLAN.md`와 TASK 구성에서 판정한다.
|
|
149
139
|
|
|
150
|
-
|
|
151
|
-
|------|:---------:|--------|-------------------|
|
|
152
|
-
| direct | 1 | After Specifier completes | Requirement.md + PLAN.md + TASK-00.md summary |
|
|
153
|
-
| pipeline/full | 1 | After Specifier+Planner completes | Requirement.md + PLAN.md + TASK list |
|
|
154
|
-
| auto-approve | 0 | — | Skip all approval gates |
|
|
140
|
+
---
|
|
155
141
|
|
|
156
|
-
|
|
142
|
+
## 6. 에이전트 역할 요약
|
|
157
143
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
144
|
+
| 에이전트 | 역할 | 모델 |
|
|
145
|
+
|---|---|---|
|
|
146
|
+
| orchestrator | 파이프라인 전체 조정 + TASK DAG 스케줄링 + 게이트/의사결정 중재 + 로그 일괄 기록 | opus |
|
|
147
|
+
| specifier | 요구사항 분석 | opus |
|
|
148
|
+
| planner | 실행계획 수립 + TASK 분해 | opus |
|
|
149
|
+
| builder | 코드 구현 | sonnet |
|
|
150
|
+
| verifier | 빌드/린트/테스트 검증 | haiku |
|
|
151
|
+
| committer | 결과 보고서 + git commit | haiku |
|
|
162
152
|
|
|
163
153
|
---
|
|
164
154
|
|
|
165
|
-
## References Directory
|
|
155
|
+
## References Directory 전달 (필수)
|
|
166
156
|
|
|
167
|
-
Main Claude
|
|
168
|
-
|
|
157
|
+
Main Claude는 orchestrator spawn 시(신규/재개 모두) references 디렉토리 경로를 전달해야 합니다.
|
|
158
|
+
설치 방법(npm 또는 plugin)에 관계없이 orchestrator와 그 자식이 레퍼런스 파일을 찾을 수 있도록 합니다.
|
|
169
159
|
|
|
170
|
-
|
|
171
|
-
-
|
|
172
|
-
-
|
|
173
|
-
-
|
|
160
|
+
**전달 방법:**
|
|
161
|
+
- orchestrator spawn 프롬프트 상단에 `REFERENCES_DIR={absolute_path}` 추가
|
|
162
|
+
- npm 설치: `.claude/references` 사용 (프로젝트 루트 기준 기본값)
|
|
163
|
+
- plugin 설치: 스킬의 "Base directory"에서 유도 (`{base_dir}/../../references`)
|
|
174
164
|
|
|
175
|
-
|
|
165
|
+
**예시:**
|
|
176
166
|
```
|
|
177
167
|
REFERENCES_DIR=C:/Users/me/.claude/plugins/cache/uc-taskmanager/abc123/references
|
|
168
|
+
mode=gated
|
|
178
169
|
|
|
179
|
-
|
|
180
|
-
...
|
|
181
|
-
</dispatch>
|
|
170
|
+
[WORK] 사용자 요청 원문...
|
|
182
171
|
```
|
|
183
172
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
---
|
|
187
|
-
|
|
188
|
-
## Context Handoff (Sliding Window)
|
|
189
|
-
|
|
190
|
-
| Distance | Level | Content |
|
|
191
|
-
|----------|-------|---------|
|
|
192
|
-
| Previous | FULL | what + why + caution + incomplete |
|
|
193
|
-
| 2 steps back | SUMMARY | what 1-2 lines |
|
|
194
|
-
| 3+ steps | DROP | Not passed |
|
|
173
|
+
REFERENCES_DIR를 사용할 수 없는 경우(예: plugin 없는 npm 설치), orchestrator는 `.claude/references/`를 폴백으로 사용합니다. orchestrator는 자신이 읽은 레퍼런스 내용을 `<ref-cache>`(`xml-schema.md` § 4)로 자식에게 재전달할 수 있습니다.
|
|
195
174
|
|
|
196
175
|
---
|
|
197
176
|
|
|
198
|
-
##
|
|
177
|
+
## 레퍼런스 로딩
|
|
199
178
|
|
|
200
|
-
|
|
179
|
+
Main Claude는 레퍼런스 파일을 읽지 않으며 — `agent-flow.md`만 읽습니다. orchestrator와 그 자식들이 `{REFERENCES_DIR}/`에서 각자(또는 ref-cache로 전달받아) 필요한 레퍼런스 파일을 읽습니다.
|