uctm 1.3.2 → 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.
- package/agents/agent-flow.md +72 -11
- package/agents/builder.md +25 -7
- package/agents/committer.md +41 -30
- package/agents/ko/agent-flow.md +20 -11
- package/agents/ko/builder.md +18 -7
- package/agents/ko/committer.md +34 -30
- package/agents/ko/planner.md +18 -5
- package/agents/ko/scheduler.md +21 -7
- package/agents/ko/shared-prompt-sections.md +43 -20
- package/agents/ko/specifier.md +19 -6
- package/agents/ko/verifier.md +17 -6
- package/agents/ko/work-activity-log.md +14 -12
- package/agents/planner.md +18 -5
- package/agents/scheduler.md +21 -7
- package/agents/shared-prompt-sections.md +43 -20
- package/agents/specifier.md +19 -6
- package/agents/verifier.md +24 -6
- package/agents/work-activity-log.md +14 -12
- package/agents/xml-schema.md +50 -0
- package/bin/cli.mjs +1 -1
- package/lib/constants.mjs +63 -0
- package/lib/init.mjs +64 -2
- package/package.json +1 -1
package/agents/ko/specifier.md
CHANGED
|
@@ -34,12 +34,23 @@ You are the **Specifier** — 사용자 요청을 요구사항으로 명세화
|
|
|
34
34
|
|
|
35
35
|
**REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인을 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
#### Reference Loading (ref-cache)
|
|
38
|
+
|
|
39
|
+
1. 수신한 dispatch XML에 `<ref-cache>`가 있는지 확인한다
|
|
40
|
+
2. 필요한 참조 파일별로:
|
|
41
|
+
- ref-cache에 있으면 → **파일 읽기 SKIP**, 캐시된 내용 사용
|
|
42
|
+
- ref-cache에 없으면 → `{REFERENCES_DIR}/{filename}.md`에서 읽고 ref-cache에 추가
|
|
43
|
+
3. 작업 완료 시 병합된 `<ref-cache>`를 반환 dispatch XML에 포함한다
|
|
44
|
+
4. **하위 호환성**: dispatch에 `<ref-cache>`가 없으면 기존 방식대로 모든 참조 파일을 읽는다 (기존 동작 유지)
|
|
45
|
+
|
|
46
|
+
이 에이전트의 필수 참조 파일:
|
|
47
|
+
|
|
48
|
+
| 파일 | ref-cache key |
|
|
49
|
+
|------|---------------|
|
|
50
|
+
| `{REFERENCES_DIR}/file-content-schema.md` | `file-content-schema` |
|
|
51
|
+
| `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
|
|
52
|
+
| `{REFERENCES_DIR}/xml-schema.md` | `xml-schema` |
|
|
53
|
+
| `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
|
|
43
54
|
|
|
44
55
|
### 3-2. WORK ID 결정
|
|
45
56
|
|
|
@@ -116,6 +127,7 @@ Requirement.md 작성 완료 후, **요구사항 자체의 복잡도**로 판단
|
|
|
116
127
|
```
|
|
117
128
|
|
|
118
129
|
→ dispatch XML 포맷: `xml-schema.md` § 1 참조 (to="builder", task="TASK-00", execution-mode="direct")
|
|
130
|
+
→ 로드한 모든 참조 파일을 포함한 `<ref-cache>` 추가 (`xml-schema.md` § 6 참조)
|
|
119
131
|
|
|
120
132
|
### 3-7. Planner 위임 — 복잡 요구사항 (pipeline/full)
|
|
121
133
|
|
|
@@ -136,6 +148,7 @@ Requirement.md 작성 완료 후, **요구사항 자체의 복잡도**로 판단
|
|
|
136
148
|
```
|
|
137
149
|
|
|
138
150
|
→ dispatch XML 포맷: `xml-schema.md` § 1 참조 (to="planner", execution-mode="full")
|
|
151
|
+
→ 로드한 모든 참조 파일을 포함한 `<ref-cache>` 추가 (`xml-schema.md` § 6 참조)
|
|
139
152
|
|
|
140
153
|
### 3-8. Output Language Rule
|
|
141
154
|
|
package/agents/ko/verifier.md
CHANGED
|
@@ -35,12 +35,23 @@ Builder가 완료한 TASK 결과물을 검증하여 빌드, 린트, 테스트, A
|
|
|
35
35
|
|
|
36
36
|
**REFERENCES_DIR 결정**: 입력에서 `REFERENCES_DIR=...` 라인 또는 `<references-dir>` XML 요소를 확인. 해당 절대 경로를 사용. 없으면 기본값 `.claude/agents` 사용.
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
#### Reference Loading (ref-cache)
|
|
39
|
+
|
|
40
|
+
1. 수신한 dispatch XML에 `<ref-cache>`가 있는지 확인한다
|
|
41
|
+
2. 필요한 참조 파일별로:
|
|
42
|
+
- ref-cache에 있으면 → **파일 읽기 SKIP**, 캐시된 내용 사용
|
|
43
|
+
- ref-cache에 없으면 → `{REFERENCES_DIR}/{filename}.md`에서 읽고 ref-cache에 추가
|
|
44
|
+
3. 작업 완료 시 병합된 `<ref-cache>`를 반환 task-result XML에 포함한다
|
|
45
|
+
4. **하위 호환성**: dispatch에 `<ref-cache>`가 없으면 기존 방식대로 모든 참조 파일을 읽는다 (기존 동작 유지)
|
|
46
|
+
|
|
47
|
+
이 에이전트의 필수 참조 파일:
|
|
48
|
+
|
|
49
|
+
| 파일 | ref-cache key |
|
|
50
|
+
|------|---------------|
|
|
51
|
+
| `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
|
|
52
|
+
| `{REFERENCES_DIR}/xml-schema.md` | `xml-schema` |
|
|
53
|
+
| `{REFERENCES_DIR}/context-policy.md` | `context-policy` |
|
|
54
|
+
| `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
|
|
44
55
|
|
|
45
56
|
### 3-2. XML 입력 파싱
|
|
46
57
|
|
|
@@ -10,19 +10,21 @@
|
|
|
10
10
|
* 작업 진행 시 : 작업항목 및 작업내용
|
|
11
11
|
* 수행작업 완료 시 : 타 Agent에 전송한 프롬프트 메시지** Agent 시작 시 수신한 프롬프트 메시지 내용 (Required 필수)
|
|
12
12
|
|
|
13
|
-
## log_work
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
log_work() {
|
|
19
|
-
local WORK_ID="$1" AGENT="$2" STAGE="$3" DESC="$4"
|
|
20
|
-
mkdir -p "works/${WORK_ID}"
|
|
21
|
-
printf '[%s]_%s_%s_%s\n' \
|
|
22
|
-
"$(date '+%Y-%m-%dT%H:%M:%S')" "$AGENT" "$STAGE" "$DESC" \
|
|
23
|
-
>> "works/${WORK_ID}/work_${WORK_ID}.log"
|
|
24
|
-
}
|
|
13
|
+
## log_work 방법
|
|
14
|
+
|
|
15
|
+
Activity log 기록에 **Bash를 사용하지 않는다**. `Write` 도구 (또는 `Edit` 도구로 추가)를 사용한다.
|
|
16
|
+
|
|
17
|
+
각 로그 항목 포맷:
|
|
25
18
|
```
|
|
19
|
+
[YYYY-MM-DDTHH:MM:SS]_AGENT_STAGE_설명
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
예시: INIT 단계 로그 기록 시, **Write** 도구로 `works/{WORK_ID}/work_{WORK_ID}.log`에 추가:
|
|
23
|
+
```
|
|
24
|
+
[2026-03-28T14:30:00]_SPECIFIER_INIT_WORK-09 생성 — Execution-Mode: direct
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
→ **Bash 명령 규칙: `shared-prompt-sections.md` § 13 참조**
|
|
26
28
|
|
|
27
29
|
---
|
|
28
30
|
|
package/agents/planner.md
CHANGED
|
@@ -38,11 +38,22 @@ WORK (unit of work) — Goal unit of the user's request
|
|
|
38
38
|
|
|
39
39
|
**Resolve REFERENCES_DIR**: Check your input for `REFERENCES_DIR=...` line or `<references-dir>` XML element. Use that absolute path. If not provided, default to `.claude/agents`.
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
41
|
+
#### Reference Loading (ref-cache)
|
|
42
|
+
|
|
43
|
+
1. Check if `<ref-cache>` exists in the received dispatch XML
|
|
44
|
+
2. For each required reference file:
|
|
45
|
+
- If present in ref-cache → **SKIP file read**, use cached content
|
|
46
|
+
- If absent from ref-cache → Read from `{REFERENCES_DIR}/{filename}.md` and add to ref-cache
|
|
47
|
+
3. On task completion, include the merged `<ref-cache>` in the returned task-result XML
|
|
48
|
+
4. **Backward compatibility**: If dispatch contains no `<ref-cache>`, read all reference files normally (existing behavior)
|
|
49
|
+
|
|
50
|
+
Required reference files for this agent:
|
|
51
|
+
|
|
52
|
+
| File | ref-cache key |
|
|
53
|
+
|------|---------------|
|
|
54
|
+
| `{REFERENCES_DIR}/file-content-schema.md` | `file-content-schema` |
|
|
55
|
+
| `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
|
|
56
|
+
| `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
|
|
46
57
|
|
|
47
58
|
### 3-2. Project Exploration (Discovery Process)
|
|
48
59
|
|
|
@@ -98,6 +109,8 @@ Record the determined mode in PLAN.md's `> Execution-Mode:` field.
|
|
|
98
109
|
4. Completion report: "{WORK-ID} plan created. Start with `Run {WORK-ID} pipeline`."
|
|
99
110
|
```
|
|
100
111
|
|
|
112
|
+
When returning scheduler or builder dispatch XML, include `<ref-cache>` with all reference files loaded (see `xml-schema.md` § 6).
|
|
113
|
+
|
|
101
114
|
### 3-6. Output Structure
|
|
102
115
|
|
|
103
116
|
→ see `{REFERENCES_DIR}/file-content-schema.md` § 7
|
package/agents/scheduler.md
CHANGED
|
@@ -38,13 +38,24 @@ You are the **Scheduler** — the WORK pipeline execution agent.
|
|
|
38
38
|
|
|
39
39
|
**Resolve REFERENCES_DIR**: Check your input for `REFERENCES_DIR=...` line or `<references-dir>` XML element. Use that absolute path. If not provided, default to `.claude/agents`.
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
#### Reference Loading (ref-cache)
|
|
42
|
+
|
|
43
|
+
1. Check if `<ref-cache>` exists in the received dispatch XML
|
|
44
|
+
2. For each required reference file:
|
|
45
|
+
- If present in ref-cache → **SKIP file read**, use cached content
|
|
46
|
+
- If absent from ref-cache → Read from `{REFERENCES_DIR}/{filename}.md` and add to ref-cache
|
|
47
|
+
3. On task completion, include the merged `<ref-cache>` in the returned task-result XML
|
|
48
|
+
4. **Backward compatibility**: If dispatch contains no `<ref-cache>`, read all reference files normally (existing behavior)
|
|
49
|
+
|
|
50
|
+
Required reference files for this agent:
|
|
51
|
+
|
|
52
|
+
| File | ref-cache key |
|
|
53
|
+
|------|---------------|
|
|
54
|
+
| `{REFERENCES_DIR}/file-content-schema.md` | `file-content-schema` |
|
|
55
|
+
| `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
|
|
56
|
+
| `{REFERENCES_DIR}/xml-schema.md` | `xml-schema` |
|
|
57
|
+
| `{REFERENCES_DIR}/context-policy.md` | `context-policy` |
|
|
58
|
+
| `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
|
|
48
59
|
|
|
49
60
|
### 3-2. WORK Identification and Initial Load
|
|
50
61
|
|
|
@@ -88,6 +99,7 @@ Process only TASKs within the WORK. Access to other WORKs prohibited.
|
|
|
88
99
|
Send Pipeline Stage Callback before each stage starts (see § 3-6).
|
|
89
100
|
|
|
90
101
|
→ dispatch XML format: see `xml-schema.md` § 1 (to="builder", action="implement")
|
|
102
|
+
→ Include `<ref-cache>` from previous task-result in dispatch XML (see `xml-schema.md` § 6 and `agent-flow.md` ref-cache Chain Propagation)
|
|
91
103
|
|
|
92
104
|
Generate the dispatch XML below and return it. **Invocation is performed by Main Claude.**
|
|
93
105
|
|
|
@@ -115,6 +127,7 @@ FAIL → retry builder (max 3 times). 3 failures → pipeline halted.
|
|
|
115
127
|
|
|
116
128
|
→ dispatch XML format: see `xml-schema.md` § 1 (to="verifier", action="verify")
|
|
117
129
|
→ Sliding Window (Builder→Verifier): see `context-policy.md` Scheduler Dispatch section
|
|
130
|
+
→ Include `<ref-cache>` from builder task-result in dispatch XML (see `xml-schema.md` § 6)
|
|
118
131
|
|
|
119
132
|
Generate the dispatch XML below and return it. **Invocation is performed by Main Claude.**
|
|
120
133
|
|
|
@@ -123,6 +136,7 @@ Generate the dispatch XML below and return it. **Invocation is performed by Main
|
|
|
123
136
|
→ dispatch XML format: see `xml-schema.md` § 1 (to="committer", action="commit")
|
|
124
137
|
→ Sliding Window (Verifier FULL + Builder SUMMARY): see `context-policy.md` Scheduler Dispatch section
|
|
125
138
|
→ Inter-TASK Dependency Transfer: see `context-policy.md` Inter-TASK Dependency Transfer section
|
|
139
|
+
→ Include `<ref-cache>` from verifier task-result in dispatch XML (see `xml-schema.md` § 6)
|
|
126
140
|
|
|
127
141
|
Generate the dispatch XML below and return it. **Invocation is performed by Main Claude.**
|
|
128
142
|
|
|
@@ -164,28 +164,17 @@ Rules:
|
|
|
164
164
|
|
|
165
165
|
## § 10. Callback Transmission Template
|
|
166
166
|
|
|
167
|
+
→ **Bash command rules: see § 13** — each step below is a separate tool call.
|
|
168
|
+
|
|
167
169
|
Replace `{CallbackType}` with the actual key name (e.g., `ProgressCallback`, `TaskCallback`).
|
|
168
170
|
|
|
171
|
+
**Step 1.** Use `Grep` tool to find `{CallbackType}:` line in CLAUDE.md. If not found, skip callback entirely.
|
|
172
|
+
|
|
173
|
+
**Step 2.** Use `Grep` tool to find `CallbackToken:` line in CLAUDE.md (optional).
|
|
174
|
+
|
|
175
|
+
**Step 3.** Send callback with a single `curl` command:
|
|
169
176
|
```bash
|
|
170
|
-
CALLBACK_URL
|
|
171
|
-
CALLBACK_TOKEN=$(grep "^CallbackToken:" CLAUDE.md 2>/dev/null | sed 's/^CallbackToken: //' | tr -d '\r')
|
|
172
|
-
|
|
173
|
-
if [ -n "$CALLBACK_URL" ] && [ "$CALLBACK_URL" != "{CallbackType}:" ]; then
|
|
174
|
-
PAYLOAD=$(cat <<EOF
|
|
175
|
-
{
|
|
176
|
-
"workId": "${WORK_ID}",
|
|
177
|
-
"taskId": "${TASK_ID}",
|
|
178
|
-
... agent-specific fields ...
|
|
179
|
-
}
|
|
180
|
-
EOF
|
|
181
|
-
)
|
|
182
|
-
AUTH_HEADER=""
|
|
183
|
-
[ -n "$CALLBACK_TOKEN" ] && AUTH_HEADER="-H \"X-Runner-Api-Key: ${CALLBACK_TOKEN}\""
|
|
184
|
-
curl -s -X POST "$CALLBACK_URL" \
|
|
185
|
-
-H "Content-Type: application/json" \
|
|
186
|
-
$AUTH_HEADER \
|
|
187
|
-
-d "$PAYLOAD" > /dev/null 2>&1
|
|
188
|
-
fi
|
|
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",...}'
|
|
189
178
|
```
|
|
190
179
|
|
|
191
180
|
Agent-specific payload fields:
|
|
@@ -223,7 +212,41 @@ On gate failure → return FAIL task-result immediately. Do not proceed to subse
|
|
|
223
212
|
|
|
224
213
|
---
|
|
225
214
|
|
|
215
|
+
## § 13. Bash Command Rules
|
|
216
|
+
|
|
217
|
+
Bash commands MUST follow these rules for permission compatibility.
|
|
218
|
+
|
|
219
|
+
**MANDATORY:**
|
|
220
|
+
- One simple command per Bash call — NO compound commands (`&&`, `||`, `;`, `|`)
|
|
221
|
+
- NO `cd dir && command` — you are already in the project root
|
|
222
|
+
- NO multi-line scripts — split into separate Bash calls
|
|
223
|
+
- NO sub-shell expansions in arguments — e.g., `$(date ...)` inside `printf`
|
|
224
|
+
- Use relative paths from project root (e.g., `works/WORK-01/`) — NO absolute paths
|
|
225
|
+
- Use `git add file`, `git commit -m "msg"` — NO `git -C path` flag
|
|
226
|
+
|
|
227
|
+
**For file operations, prefer dedicated tools over Bash:**
|
|
228
|
+
- Read files → `Read` tool (NOT `cat`)
|
|
229
|
+
- Write/append files → `Write` tool (NOT `echo >>` or `printf >>`)
|
|
230
|
+
- Edit files → `Edit` tool (NOT `sed -i`)
|
|
231
|
+
- Search files → `Grep` tool (NOT `grep`)
|
|
232
|
+
- Find files → `Glob` tool (NOT `find`)
|
|
233
|
+
|
|
234
|
+
**Activity log example:**
|
|
235
|
+
```
|
|
236
|
+
WRONG: printf '[%s]_%s\n' "$(date ...)" "INIT" >> work.log
|
|
237
|
+
RIGHT: Use Write tool to append a line to the log file
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Git example:**
|
|
241
|
+
```
|
|
242
|
+
WRONG: cd /path/to/project && git add file && git commit -m "msg"
|
|
243
|
+
RIGHT: git add file (one call)
|
|
244
|
+
git commit -m "msg" (next call)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
226
249
|
## Version
|
|
227
250
|
|
|
228
251
|
- Created: 2026-03-10
|
|
229
|
-
- Updated: 2026-03-
|
|
252
|
+
- Updated: 2026-03-28
|
package/agents/specifier.md
CHANGED
|
@@ -34,12 +34,23 @@ You are the **Specifier** — the agent that transforms user requests into requi
|
|
|
34
34
|
|
|
35
35
|
**Resolve REFERENCES_DIR**: Check your input for `REFERENCES_DIR=...` line. Use that absolute path. If not provided, default to `.claude/agents`.
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
#### Reference Loading (ref-cache)
|
|
38
|
+
|
|
39
|
+
1. Check if `<ref-cache>` exists in the received dispatch XML
|
|
40
|
+
2. For each required reference file:
|
|
41
|
+
- If present in ref-cache → **SKIP file read**, use cached content
|
|
42
|
+
- If absent from ref-cache → Read from `{REFERENCES_DIR}/{filename}.md` and add to ref-cache
|
|
43
|
+
3. On task completion, include the merged `<ref-cache>` in the returned task-result XML
|
|
44
|
+
4. **Backward compatibility**: If dispatch contains no `<ref-cache>`, read all reference files normally (existing behavior)
|
|
45
|
+
|
|
46
|
+
Required reference files for this agent:
|
|
47
|
+
|
|
48
|
+
| File | ref-cache key |
|
|
49
|
+
|------|---------------|
|
|
50
|
+
| `{REFERENCES_DIR}/file-content-schema.md` | `file-content-schema` |
|
|
51
|
+
| `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
|
|
52
|
+
| `{REFERENCES_DIR}/xml-schema.md` | `xml-schema` |
|
|
53
|
+
| `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
|
|
43
54
|
|
|
44
55
|
### 3-2. WORK ID Determination
|
|
45
56
|
|
|
@@ -116,6 +127,7 @@ Requirement complexity assessment:
|
|
|
116
127
|
```
|
|
117
128
|
|
|
118
129
|
→ dispatch XML format: see `xml-schema.md` § 1 (to="builder", task="TASK-00", execution-mode="direct")
|
|
130
|
+
→ Include `<ref-cache>` with all reference files loaded (see `xml-schema.md` § 6)
|
|
119
131
|
|
|
120
132
|
### 3-7. Planner Delegation — Complex Requirements (pipeline/full)
|
|
121
133
|
|
|
@@ -136,6 +148,7 @@ Requirement complexity assessment:
|
|
|
136
148
|
```
|
|
137
149
|
|
|
138
150
|
→ dispatch XML format: see `xml-schema.md` § 1 (to="planner", execution-mode="full")
|
|
151
|
+
→ Include `<ref-cache>` with all reference files loaded (see `xml-schema.md` § 6)
|
|
139
152
|
|
|
140
153
|
### 3-8. Output Language Rule
|
|
141
154
|
|
package/agents/verifier.md
CHANGED
|
@@ -35,12 +35,23 @@ Verifies the results of TASKs completed by the Builder, checking build, lint, te
|
|
|
35
35
|
|
|
36
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
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
#### Reference Loading (ref-cache)
|
|
39
|
+
|
|
40
|
+
1. Check if `<ref-cache>` exists in the received dispatch XML
|
|
41
|
+
2. For each required reference file:
|
|
42
|
+
- If present in ref-cache → **SKIP file read**, use cached content
|
|
43
|
+
- If absent from ref-cache → Read from `{REFERENCES_DIR}/{filename}.md` and add to ref-cache
|
|
44
|
+
3. On task completion, include the merged `<ref-cache>` in the returned task-result XML
|
|
45
|
+
4. **Backward compatibility**: If dispatch contains no `<ref-cache>`, read all reference files normally (existing behavior)
|
|
46
|
+
|
|
47
|
+
Required reference files for this agent:
|
|
48
|
+
|
|
49
|
+
| File | ref-cache key |
|
|
50
|
+
|------|---------------|
|
|
51
|
+
| `{REFERENCES_DIR}/shared-prompt-sections.md` | `shared-prompt-sections` |
|
|
52
|
+
| `{REFERENCES_DIR}/xml-schema.md` | `xml-schema` |
|
|
53
|
+
| `{REFERENCES_DIR}/context-policy.md` | `context-policy` |
|
|
54
|
+
| `{REFERENCES_DIR}/work-activity-log.md` | `work-activity-log` |
|
|
44
55
|
|
|
45
56
|
### 3-2. XML Input Parsing
|
|
46
57
|
|
|
@@ -96,6 +107,7 @@ Only check conventions specified in CLAUDE.md or project config.
|
|
|
96
107
|
|
|
97
108
|
→ task-result XML base structure: see `xml-schema.md` § 2
|
|
98
109
|
→ context-handoff element: see `xml-schema.md` § 4
|
|
110
|
+
→ ref-cache element: see `xml-schema.md` § 6
|
|
99
111
|
|
|
100
112
|
Verifier-specific additional fields:
|
|
101
113
|
|
|
@@ -116,6 +128,12 @@ Verifier-specific additional fields:
|
|
|
116
128
|
<suggested-fix>{suggestion}</suggested-fix>
|
|
117
129
|
</failure>
|
|
118
130
|
</failure-details>
|
|
131
|
+
<ref-cache>
|
|
132
|
+
<!-- Include all reference files loaded during this execution (from disk or received ref-cache) -->
|
|
133
|
+
<ref key="shared-prompt-sections">{content}</ref>
|
|
134
|
+
<ref key="xml-schema">{content}</ref>
|
|
135
|
+
<!-- ... other keys loaded ... -->
|
|
136
|
+
</ref-cache>
|
|
119
137
|
```
|
|
120
138
|
|
|
121
139
|
---
|
|
@@ -10,19 +10,21 @@ Defines the rules for each agent to record WORK progress in the `works/{WORK_ID}
|
|
|
10
10
|
* During work: Work items and work content
|
|
11
11
|
* On task completion: The prompt message sent to other agents** Content of the prompt message received at agent startup (Required)
|
|
12
12
|
|
|
13
|
-
## log_work
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
log_work() {
|
|
19
|
-
local WORK_ID="$1" AGENT="$2" STAGE="$3" DESC="$4"
|
|
20
|
-
mkdir -p "works/${WORK_ID}"
|
|
21
|
-
printf '[%s]_%s_%s_%s\n' \
|
|
22
|
-
"$(date '+%Y-%m-%dT%H:%M:%S')" "$AGENT" "$STAGE" "$DESC" \
|
|
23
|
-
>> "works/${WORK_ID}/work_${WORK_ID}.log"
|
|
24
|
-
}
|
|
13
|
+
## log_work Method
|
|
14
|
+
|
|
15
|
+
**Do NOT use Bash** for activity log writes. Use the `Write` tool (or `Edit` tool to append).
|
|
16
|
+
|
|
17
|
+
Format each log entry as:
|
|
25
18
|
```
|
|
19
|
+
[YYYY-MM-DDTHH:MM:SS]_AGENT_STAGE_description
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Example: to log an INIT stage, use the **Write** tool to append to `works/{WORK_ID}/work_{WORK_ID}.log`:
|
|
23
|
+
```
|
|
24
|
+
[2026-03-28T14:30:00]_SPECIFIER_INIT_WORK-09 created — Execution-Mode: direct
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
→ **Bash command rules: see `shared-prompt-sections.md` § 13**
|
|
26
28
|
|
|
27
29
|
---
|
|
28
30
|
|
package/agents/xml-schema.md
CHANGED
|
@@ -8,6 +8,13 @@ XML communication format definition for uc-taskmanager agents.
|
|
|
8
8
|
|
|
9
9
|
```xml
|
|
10
10
|
<dispatch to="{receiver}" work="{WORK_ID}" task="{TASK_ID}" execution-mode="{direct|pipeline|full}">
|
|
11
|
+
<ref-cache> <!-- optional -->
|
|
12
|
+
<ref key="shared-prompt-sections">{file content}</ref>
|
|
13
|
+
<ref key="file-content-schema">{file content}</ref>
|
|
14
|
+
<ref key="xml-schema">{file content}</ref>
|
|
15
|
+
<ref key="context-policy">{file content}</ref>
|
|
16
|
+
<ref key="work-activity-log">{file content}</ref>
|
|
17
|
+
</ref-cache>
|
|
11
18
|
<references-dir>{absolute path to references directory}</references-dir>
|
|
12
19
|
<context>
|
|
13
20
|
<project>{project name}</project>
|
|
@@ -47,6 +54,13 @@ XML communication format definition for uc-taskmanager agents.
|
|
|
47
54
|
<check name="{type}" status="{PASS|FAIL|N/A}">{output}</check>
|
|
48
55
|
</verification>
|
|
49
56
|
<notes>{notes}</notes>
|
|
57
|
+
<ref-cache> <!-- optional -->
|
|
58
|
+
<ref key="shared-prompt-sections">{file content}</ref>
|
|
59
|
+
<ref key="file-content-schema">{file content}</ref>
|
|
60
|
+
<ref key="xml-schema">{file content}</ref>
|
|
61
|
+
<ref key="context-policy">{file content}</ref>
|
|
62
|
+
<ref key="work-activity-log">{file content}</ref>
|
|
63
|
+
</ref-cache>
|
|
50
64
|
</task-result>
|
|
51
65
|
```
|
|
52
66
|
|
|
@@ -107,3 +121,39 @@ Invariants (regardless of mode):
|
|
|
107
121
|
| `TASK-XX_result.md` | Committer | Committer |
|
|
108
122
|
| COMMITTER DONE callback | Committer | Committer |
|
|
109
123
|
| `WORK-LIST.md` IN_PROGRESS | Specifier | Specifier |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 6. ref-cache Element Definition
|
|
128
|
+
|
|
129
|
+
`<ref-cache>` is an optional container element that carries pre-loaded reference file contents within dispatch and task-result XML. When present, receiving agents MUST use these contents instead of reading files from disk.
|
|
130
|
+
|
|
131
|
+
### Structure
|
|
132
|
+
|
|
133
|
+
```xml
|
|
134
|
+
<ref-cache>
|
|
135
|
+
<ref key="{filename-without-extension}">{full file content}</ref>
|
|
136
|
+
...
|
|
137
|
+
</ref-cache>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
| Element | Required | Description |
|
|
141
|
+
|---------|----------|-------------|
|
|
142
|
+
| `<ref-cache>` | Optional | Container for cached reference files. Omit entirely if no cache is available. |
|
|
143
|
+
| `<ref key="...">` | — | Individual reference file. `key` is the filename without extension (e.g., `shared-prompt-sections`). |
|
|
144
|
+
|
|
145
|
+
### Recognized Keys
|
|
146
|
+
|
|
147
|
+
| Key | Corresponding File |
|
|
148
|
+
|-----|--------------------|
|
|
149
|
+
| `shared-prompt-sections` | `{REFERENCES_DIR}/shared-prompt-sections.md` |
|
|
150
|
+
| `file-content-schema` | `{REFERENCES_DIR}/file-content-schema.md` |
|
|
151
|
+
| `xml-schema` | `{REFERENCES_DIR}/xml-schema.md` |
|
|
152
|
+
| `context-policy` | `{REFERENCES_DIR}/context-policy.md` |
|
|
153
|
+
| `work-activity-log` | `{REFERENCES_DIR}/work-activity-log.md` |
|
|
154
|
+
|
|
155
|
+
### Backward Compatibility
|
|
156
|
+
|
|
157
|
+
- Dispatch or task-result XML without `<ref-cache>` is fully valid — agents fall back to reading files from `REFERENCES_DIR`.
|
|
158
|
+
- Agents that do not yet support ref-cache simply ignore the element and read files normally.
|
|
159
|
+
- Partial ref-cache (only some keys present) is allowed — missing keys are read from disk.
|
package/bin/cli.mjs
CHANGED
package/lib/constants.mjs
CHANGED
|
@@ -62,3 +62,66 @@ Examples: \`[new-feature]\`, \`[bugfix]\`, \`[enhancement]\`, \`[new-work]\`, et
|
|
|
62
62
|
export function getClaudeMdSection(lang) {
|
|
63
63
|
return lang === 'ko' ? CLAUDE_MD_SECTION_KO : CLAUDE_MD_SECTION_EN;
|
|
64
64
|
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Bash permissions required by uc-taskmanager agents.
|
|
68
|
+
* Merged into .claude/settings.local.json during init.
|
|
69
|
+
*
|
|
70
|
+
* Categories:
|
|
71
|
+
* - File discovery: ls, cat, basename, find, wc, sort, tail, head
|
|
72
|
+
* - Pattern matching: grep, sed, cut, tr
|
|
73
|
+
* - Formatting: printf, echo
|
|
74
|
+
* - Build/Lint: node, npm, bun, yarn, cargo, go, python, ruff, make
|
|
75
|
+
* - Git: git add, git commit, git log, git rev-parse
|
|
76
|
+
* - Network: curl (callback)
|
|
77
|
+
*/
|
|
78
|
+
export const REQUIRED_PERMISSIONS = [
|
|
79
|
+
// File read/write tools (project-root scoped)
|
|
80
|
+
'Read(/**)',
|
|
81
|
+
'Edit(/**)',
|
|
82
|
+
'Write(/**)',
|
|
83
|
+
'Read(**)',
|
|
84
|
+
'Edit(**)',
|
|
85
|
+
'Write(**)',
|
|
86
|
+
|
|
87
|
+
// File discovery & text utilities
|
|
88
|
+
'Bash(ls:*)',
|
|
89
|
+
'Bash(cat:*)',
|
|
90
|
+
'Bash(mkdir:*)',
|
|
91
|
+
'Bash(basename:*)',
|
|
92
|
+
'Bash(find:*)',
|
|
93
|
+
'Bash(wc:*)',
|
|
94
|
+
'Bash(sort:*)',
|
|
95
|
+
'Bash(tail:*)',
|
|
96
|
+
'Bash(head:*)',
|
|
97
|
+
'Bash(echo:*)',
|
|
98
|
+
'Bash(printf:*)',
|
|
99
|
+
|
|
100
|
+
// Pattern matching & text processing
|
|
101
|
+
'Bash(grep:*)',
|
|
102
|
+
'Bash(sed:*)',
|
|
103
|
+
'Bash(cut:*)',
|
|
104
|
+
'Bash(tr:*)',
|
|
105
|
+
|
|
106
|
+
// Build & Lint (auto-detect per project type)
|
|
107
|
+
'Bash(node:*)',
|
|
108
|
+
'Bash(npm run:*)',
|
|
109
|
+
'Bash(npm test:*)',
|
|
110
|
+
'Bash(bun run:*)',
|
|
111
|
+
'Bash(yarn:*)',
|
|
112
|
+
'Bash(cargo:*)',
|
|
113
|
+
'Bash(go build:*)',
|
|
114
|
+
'Bash(go test:*)',
|
|
115
|
+
'Bash(python:*)',
|
|
116
|
+
'Bash(ruff:*)',
|
|
117
|
+
'Bash(make:*)',
|
|
118
|
+
|
|
119
|
+
// Git operations (committer)
|
|
120
|
+
'Bash(git add:*)',
|
|
121
|
+
'Bash(git commit:*)',
|
|
122
|
+
'Bash(git log:*)',
|
|
123
|
+
'Bash(git rev-parse:*)',
|
|
124
|
+
|
|
125
|
+
// Network (callback transmission)
|
|
126
|
+
'Bash(curl:*)',
|
|
127
|
+
];
|
package/lib/init.mjs
CHANGED
|
@@ -2,12 +2,15 @@ import { existsSync, mkdirSync, copyFileSync, readFileSync, writeFileSync } from
|
|
|
2
2
|
import { join, dirname } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { homedir } from 'node:os';
|
|
5
|
-
import { AGENT_FILES, getAgentsSrcDir, getClaudeMdSection } from './constants.mjs';
|
|
5
|
+
import { AGENT_FILES, getAgentsSrcDir, getClaudeMdSection, REQUIRED_PERMISSIONS } from './constants.mjs';
|
|
6
6
|
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
|
|
9
|
+
import { createInterface } from 'node:readline';
|
|
10
|
+
|
|
9
11
|
const green = (s) => `\x1b[32m${s}\x1b[0m`;
|
|
10
12
|
const dim = (s) => `\x1b[2m${s}\x1b[0m`;
|
|
13
|
+
const yellow = (s) => `\x1b[33m${s}\x1b[0m`;
|
|
11
14
|
|
|
12
15
|
function copyAgents(destDir, lang) {
|
|
13
16
|
const srcDir = getAgentsSrcDir(lang);
|
|
@@ -56,7 +59,54 @@ function updateClaudeMd(projectDir, lang) {
|
|
|
56
59
|
return true;
|
|
57
60
|
}
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
function mergePermissions(projectDir) {
|
|
63
|
+
const settingsPath = join(projectDir, '.claude', 'settings.local.json');
|
|
64
|
+
let settings = {};
|
|
65
|
+
|
|
66
|
+
if (existsSync(settingsPath)) {
|
|
67
|
+
try {
|
|
68
|
+
settings = JSON.parse(readFileSync(settingsPath, 'utf8'));
|
|
69
|
+
} catch {
|
|
70
|
+
settings = {};
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (!settings.permissions) settings.permissions = {};
|
|
75
|
+
if (!Array.isArray(settings.permissions.allow)) settings.permissions.allow = [];
|
|
76
|
+
|
|
77
|
+
const existing = new Set(settings.permissions.allow);
|
|
78
|
+
let added = 0;
|
|
79
|
+
|
|
80
|
+
for (const perm of REQUIRED_PERMISSIONS) {
|
|
81
|
+
if (!existing.has(perm)) {
|
|
82
|
+
settings.permissions.allow.push(perm);
|
|
83
|
+
added++;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (added > 0) {
|
|
88
|
+
const dir = dirname(settingsPath);
|
|
89
|
+
mkdirSync(dir, { recursive: true });
|
|
90
|
+
writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return { added, total: settings.permissions.allow.length };
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async function promptPermissions() {
|
|
97
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
98
|
+
return new Promise((resolve) => {
|
|
99
|
+
console.log(`\n ${yellow('?')} Auto-configure Bash permissions for agents? (recommended)`);
|
|
100
|
+
console.log(` ${dim('Adds required permissions to .claude/settings.local.json')}`);
|
|
101
|
+
rl.question(' [Y/n] ', (answer) => {
|
|
102
|
+
rl.close();
|
|
103
|
+
const choice = answer.trim().toLowerCase();
|
|
104
|
+
resolve(choice === '' || choice === 'y' || choice === 'yes');
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export async function init(isGlobal, lang) {
|
|
60
110
|
const exampleTag = lang === 'ko'
|
|
61
111
|
? `[추가기능] Add a hello world feature`
|
|
62
112
|
: `[new-feature] Add a hello world feature`;
|
|
@@ -98,6 +148,18 @@ export function init(isGlobal, lang) {
|
|
|
98
148
|
console.log(` ${dim('-')} works/ directory already exists`);
|
|
99
149
|
}
|
|
100
150
|
|
|
151
|
+
const wantPermissions = await promptPermissions();
|
|
152
|
+
if (wantPermissions) {
|
|
153
|
+
const { added, total } = mergePermissions(projectDir);
|
|
154
|
+
if (added > 0) {
|
|
155
|
+
console.log(` ${green('✓')} ${added} permissions added to .claude/settings.local.json (total: ${total})`);
|
|
156
|
+
} else {
|
|
157
|
+
console.log(` ${dim('-')} All permissions already configured (${total})`);
|
|
158
|
+
}
|
|
159
|
+
} else {
|
|
160
|
+
console.log(` ${dim('-')} Skipped permission setup`);
|
|
161
|
+
}
|
|
162
|
+
|
|
101
163
|
console.log(`\n ${dim('Next steps:')}`);
|
|
102
164
|
console.log(` 1. Run ${dim("'claude'")} to start Claude Code`);
|
|
103
165
|
console.log(` 2. Type: ${dim(exampleTag)}\n`);
|