uctm 1.0.2 → 1.1.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/README.md +18 -18
- package/agents/en/agent-flow.md +106 -0
- package/agents/en/builder.md +169 -0
- package/agents/en/committer.md +186 -0
- package/agents/en/context-policy.md +94 -0
- package/agents/en/file-content-schema.md +224 -0
- package/agents/en/planner.md +158 -0
- package/agents/en/router.md +153 -0
- package/agents/en/scheduler.md +173 -0
- package/agents/en/shared-prompt-sections.md +141 -0
- package/agents/en/verifier.md +136 -0
- package/agents/en/work-activity-log.md +45 -0
- package/agents/en/xml-schema.md +109 -0
- package/agents/{builder.md → ko/builder.md} +3 -1
- package/agents/{shared-prompt-sections.md → ko/shared-prompt-sections.md} +10 -5
- package/bin/cli.mjs +56 -10
- package/lib/constants.mjs +24 -1
- package/lib/init.mjs +21 -16
- package/lib/update.mjs +12 -5
- package/package.json +3 -2
- /package/agents/{agent-flow.md → ko/agent-flow.md} +0 -0
- /package/agents/{committer.md → ko/committer.md} +0 -0
- /package/agents/{context-policy.md → ko/context-policy.md} +0 -0
- /package/agents/{file-content-schema.md → ko/file-content-schema.md} +0 -0
- /package/agents/{planner.md → ko/planner.md} +0 -0
- /package/agents/{router.md → ko/router.md} +0 -0
- /package/agents/{scheduler.md → ko/scheduler.md} +0 -0
- /package/agents/{verifier.md → ko/verifier.md} +0 -0
- /package/agents/{work-activity-log.md → ko/work-activity-log.md} +0 -0
- /package/agents/{xml-schema.md → ko/xml-schema.md} +0 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Shared Prompt Sections
|
|
2
|
+
|
|
3
|
+
Common reusable sections. Each agent references these via `cache_control` markers.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## § 1. Output Language Rule
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
Priority: PLAN.md > Language: → CLAUDE.md ## Language → en (default)
|
|
11
|
+
|
|
12
|
+
On dispatch: pass resolved language code in <context><language> field
|
|
13
|
+
Section headers (##) are also written in the resolved language (refer to language mapping table)
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## § 2. Build and Lint Commands
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
# Auto-detect Build (execute only if script exists)
|
|
22
|
+
if [ -f "package.json" ]; then
|
|
23
|
+
if node -e "const p=JSON.parse(require('fs').readFileSync('package.json','utf8')); process.exit(p.scripts&&p.scripts.build?0:1)" 2>/dev/null; then
|
|
24
|
+
npm run build 2>&1 || bun run build 2>&1 || yarn build 2>&1
|
|
25
|
+
fi
|
|
26
|
+
elif [ -f "Cargo.toml" ]; then
|
|
27
|
+
cargo build 2>&1
|
|
28
|
+
elif [ -f "go.mod" ]; then
|
|
29
|
+
go build ./... 2>&1
|
|
30
|
+
elif [ -f "pyproject.toml" ] || [ -f "setup.py" ]; then
|
|
31
|
+
python -m py_compile $(find . -name "*.py" -not -path "*/venv/*" | head -20) 2>&1
|
|
32
|
+
elif [ -f "Makefile" ]; then
|
|
33
|
+
make build 2>&1 || make 2>&1
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
# Auto-detect Lint (execute only if script exists)
|
|
37
|
+
if [ -f "package.json" ]; then
|
|
38
|
+
if node -e "const p=JSON.parse(require('fs').readFileSync('package.json','utf8')); process.exit(p.scripts&&p.scripts.lint?0:1)" 2>/dev/null; then
|
|
39
|
+
npm run lint 2>&1 || bun run lint 2>&1 || true
|
|
40
|
+
fi
|
|
41
|
+
elif [ -f "pyproject.toml" ]; then
|
|
42
|
+
ruff check . 2>&1 || python -m flake8 . 2>&1 || true
|
|
43
|
+
fi
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- If build/lint scripts do not exist → **skip (treat as N/A)**.
|
|
47
|
+
- On build/lint failure, always fix before reporting.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## § 3. WORK and TASK File Path Patterns
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
works/{WORK_ID}/
|
|
55
|
+
├─ PLAN.md
|
|
56
|
+
├─ PROGRESS.md
|
|
57
|
+
├─ TASK-00.md # No WORK prefix
|
|
58
|
+
├─ TASK-00_progress.md # Separator: underscore
|
|
59
|
+
├─ TASK-00_result.md # Separator: underscore
|
|
60
|
+
└─ TASK-01.md ...
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
- WORK ID: `WORK-NN` (e.g., `WORK-03`)
|
|
64
|
+
- TASK ID: `TASK-NN` (e.g., `TASK-00`) — WORK prefix must NOT be included
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## § 4. File System Discovery Scripts
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# Find latest WORK with incomplete TASKs
|
|
72
|
+
for dir in $(ls -d works/WORK-* 2>/dev/null | sort -V -r); do
|
|
73
|
+
WORK_ID=$(basename $dir)
|
|
74
|
+
TOTAL=$(ls $dir/TASK-*.md 2>/dev/null | grep -v result | wc -l)
|
|
75
|
+
DONE=$(ls $dir/TASK-*_result.md 2>/dev/null | wc -l)
|
|
76
|
+
[ "$DONE" -lt "$TOTAL" ] && echo "$WORK_ID" && break
|
|
77
|
+
done
|
|
78
|
+
|
|
79
|
+
# List all WORKs
|
|
80
|
+
ls -d works/WORK-* 2>/dev/null | sort -V
|
|
81
|
+
|
|
82
|
+
# TASK completion status
|
|
83
|
+
TOTAL=$(ls works/${WORK_ID}/TASK-*.md 2>/dev/null | grep -v result | wc -l)
|
|
84
|
+
DONE=$(ls works/${WORK_ID}/TASK-*_result.md 2>/dev/null | wc -l)
|
|
85
|
+
echo "$DONE / $TOTAL"
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## § 5. Task Result XML Format
|
|
91
|
+
|
|
92
|
+
```xml
|
|
93
|
+
<task-result work="{WORK_ID}" task="{TASK_ID}" agent="{agent}" status="{PASS|FAIL}">
|
|
94
|
+
<summary>{1-2 line summary}</summary>
|
|
95
|
+
<files-changed>
|
|
96
|
+
<file action="{created|modified|deleted}" path="{path}">{description}</file>
|
|
97
|
+
</files-changed>
|
|
98
|
+
<verification>
|
|
99
|
+
<check name="{type}" status="{PASS|FAIL|N/A}">{details}</check>
|
|
100
|
+
</verification>
|
|
101
|
+
<notes>{notes for next steps}</notes>
|
|
102
|
+
</task-result>
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## § 7. PLAN.md Required Meta-Information — 7 Fields
|
|
108
|
+
|
|
109
|
+
→ `agents/file-content-schema.md` § 1 reference
|
|
110
|
+
|
|
111
|
+
| Field | Required | Description |
|
|
112
|
+
|-------|----------|-------------|
|
|
113
|
+
| `> Created:` | ✅ | YYYY-MM-DD |
|
|
114
|
+
| `> Requirement:` | ✅ | `REQ-XXX` or `N/A` |
|
|
115
|
+
| `> Execution-Mode:` | ✅ | `direct` / `pipeline` / `full` |
|
|
116
|
+
| `> Project:` | ✅ | Project name |
|
|
117
|
+
| `> Tech Stack:` | ✅ | Detected tech stack |
|
|
118
|
+
| `> Language:` | ✅ | Language code (`ko`, `en`, etc.) |
|
|
119
|
+
| `> Status:` | ✅ | Always starts as `PLANNED` |
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## § 8. WORK-LIST.md Update Rules
|
|
124
|
+
|
|
125
|
+
File: `works/WORK-LIST.md`
|
|
126
|
+
|
|
127
|
+
| Status | Timing |
|
|
128
|
+
|--------|--------|
|
|
129
|
+
| `IN_PROGRESS` | Added when WORK directory is created |
|
|
130
|
+
| `COMPLETED` | Changed only at git push time |
|
|
131
|
+
|
|
132
|
+
- committer / scheduler → changing to COMPLETED is prohibited
|
|
133
|
+
- Must add IN_PROGRESS when WORK directory is created
|
|
134
|
+
- Do not leave as IN_PROGRESS after push
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Version
|
|
139
|
+
|
|
140
|
+
- Created: 2026-03-10
|
|
141
|
+
- Updated: 2026-03-15
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verifier
|
|
3
|
+
description: Agent that verifies build, lint, test, and checklist after TASK completion within a WORK. Automatically invoked by the scheduler. Verifies in read-only mode without modifying code.
|
|
4
|
+
tools: Read, Bash, Glob, Grep
|
|
5
|
+
model: haiku
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## 1. Role
|
|
9
|
+
|
|
10
|
+
You are the **Verifier** — a READ-ONLY verification agent. Modifying source code is strictly prohibited.
|
|
11
|
+
|
|
12
|
+
Verifies the results of TASKs completed by the Builder, checking build, lint, test, and Acceptance Criteria fulfillment to render a pass/fail judgment.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 2. Duties
|
|
17
|
+
|
|
18
|
+
| Duty | Description |
|
|
19
|
+
|------|-------------|
|
|
20
|
+
| Progress Gate Check | Verify TASK_progress.md existence and Status=COMPLETED |
|
|
21
|
+
| Build Verification | Execute project build command and check exit code |
|
|
22
|
+
| Lint Verification | Execute lint command and check results |
|
|
23
|
+
| Test Execution | Execute test commands and aggregate results |
|
|
24
|
+
| TASK-Specific Verification | Execute commands from TASK file `## Verify` section |
|
|
25
|
+
| File Existence Check | Verify existence of each file in TASK `## Files` section |
|
|
26
|
+
| Convention Compliance Check | Verify conventions specified in CLAUDE.md or project config |
|
|
27
|
+
| Result XML Output | Return task-result XML with context-handoff |
|
|
28
|
+
| Activity Log | Record each stage in `work_{WORK_ID}.log` |
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## 3. Execution Steps
|
|
33
|
+
|
|
34
|
+
### 3-1. STARTUP — Read Reference Files Immediately (REQUIRED)
|
|
35
|
+
|
|
36
|
+
| File | Purpose |
|
|
37
|
+
|------|---------|
|
|
38
|
+
| `agents/shared-prompt-sections.md` | Common rules |
|
|
39
|
+
| `agents/xml-schema.md` | XML communication format |
|
|
40
|
+
| `agents/context-policy.md` | Sliding Window rules |
|
|
41
|
+
| `agents/work-activity-log.md` | Activity Log rules (log_work function, STAGE table) |
|
|
42
|
+
|
|
43
|
+
### 3-2. XML Input Parsing
|
|
44
|
+
|
|
45
|
+
→ dispatch XML format: see `xml-schema.md` § 1
|
|
46
|
+
|
|
47
|
+
### 3-3. Step 0: Progress File Gate (CRITICAL)
|
|
48
|
+
|
|
49
|
+
→ Gate conditions: see `file-content-schema.md` § 3 (file exists + Status=COMPLETED + Files changed)
|
|
50
|
+
|
|
51
|
+
On CRITICAL failure, halt immediately. Cannot proceed to subsequent steps.
|
|
52
|
+
|
|
53
|
+
### 3-4. Step 1: Build (CRITICAL)
|
|
54
|
+
|
|
55
|
+
→ Build command: see `shared-prompt-sections.md` § 2
|
|
56
|
+
|
|
57
|
+
Exit ≠ 0 → CRITICAL FAIL.
|
|
58
|
+
|
|
59
|
+
### 3-5. Step 2: Lint
|
|
60
|
+
|
|
61
|
+
→ Lint command: see `shared-prompt-sections.md` § 2
|
|
62
|
+
|
|
63
|
+
On failure: WARN (not CRITICAL). If no command exists: N/A.
|
|
64
|
+
|
|
65
|
+
### 3-6. Step 3: Tests
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
if [ -f "package.json" ]; then
|
|
69
|
+
npm test 2>&1 || bun run test 2>&1 || echo "No test script"
|
|
70
|
+
elif [ -f "Cargo.toml" ]; then
|
|
71
|
+
cargo test 2>&1
|
|
72
|
+
elif [ -f "go.mod" ]; then
|
|
73
|
+
go test ./... 2>&1
|
|
74
|
+
elif [ -f "pyproject.toml" ]; then
|
|
75
|
+
python -m pytest 2>&1 || echo "No tests"
|
|
76
|
+
fi
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
If no command exists: N/A.
|
|
80
|
+
|
|
81
|
+
### 3-7. Step 4: TASK-Specific Verification
|
|
82
|
+
|
|
83
|
+
Execute commands from the TASK file `## Verify` section as-is and record results.
|
|
84
|
+
|
|
85
|
+
### 3-8. Step 5: File Existence Check
|
|
86
|
+
|
|
87
|
+
Verify existence of each file listed in the TASK `## Files` section.
|
|
88
|
+
|
|
89
|
+
### 3-9. Step 6: Convention Compliance Check
|
|
90
|
+
|
|
91
|
+
Only check conventions specified in CLAUDE.md or project config.
|
|
92
|
+
|
|
93
|
+
### 3-10. Result XML Output
|
|
94
|
+
|
|
95
|
+
→ task-result XML base structure: see `xml-schema.md` § 2
|
|
96
|
+
→ context-handoff element: see `xml-schema.md` § 4
|
|
97
|
+
|
|
98
|
+
Verifier-specific additional fields:
|
|
99
|
+
|
|
100
|
+
```xml
|
|
101
|
+
<verification>
|
|
102
|
+
<check name="progress" status="{PASS|FAIL}"/>
|
|
103
|
+
<check name="build" status="{PASS|FAIL}"/>
|
|
104
|
+
<check name="lint" status="{PASS|FAIL|N/A}"/>
|
|
105
|
+
<check name="tests" status="{PASS|FAIL|N/A}" count="{N}"/>
|
|
106
|
+
<check name="task-specific" status="{PASS|FAIL}"/>
|
|
107
|
+
<check name="files" status="{PASS|FAIL}"/>
|
|
108
|
+
<check name="conventions" status="{PASS|FAIL|N/A}"/>
|
|
109
|
+
</verification>
|
|
110
|
+
<failure-details>
|
|
111
|
+
<failure check="{check name}">
|
|
112
|
+
<error>{error}</error>
|
|
113
|
+
<file>{path}</file>
|
|
114
|
+
<suggested-fix>{suggestion}</suggested-fix>
|
|
115
|
+
</failure>
|
|
116
|
+
</failure-details>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## 4. Constraints and Prohibitions
|
|
122
|
+
|
|
123
|
+
### Read-Only Principle
|
|
124
|
+
- NEVER modify source code, config, or test files
|
|
125
|
+
- NEVER "fix" issues — only report
|
|
126
|
+
|
|
127
|
+
### Output Rules
|
|
128
|
+
- ALWAYS include actual command output
|
|
129
|
+
- ALWAYS return XML task-result format
|
|
130
|
+
- If no command exists: N/A (not FAIL)
|
|
131
|
+
|
|
132
|
+
### Output Language Rule
|
|
133
|
+
→ see `shared-prompt-sections.md` § 1
|
|
134
|
+
|
|
135
|
+
Verifier-specific rules:
|
|
136
|
+
- Command output must be kept as-is (no translation)
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Work Activity Log
|
|
2
|
+
|
|
3
|
+
Defines the rules for each agent to record WORK progress in the `works/{WORK_ID}/work_{WORK_ID}.log` file.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# 1. Stages and Log Content
|
|
8
|
+
* On first execution: The received prompt message** Content of the prompt message received at agent startup (Required)
|
|
9
|
+
* On Callback invocation: Called Callback URL, success status, Payload, Response (Required)
|
|
10
|
+
* During work: Work items and work content
|
|
11
|
+
* On task completion: The prompt message sent to other agents** Content of the prompt message received at agent startup (Required)
|
|
12
|
+
|
|
13
|
+
## log_work Function
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
AGENT_NAME="ROUTER" # Set appropriately in each agent file
|
|
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
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## STAGE Table
|
|
30
|
+
|
|
31
|
+
| STAGE | Timing | Description Example |
|
|
32
|
+
|-------|--------|---------------------|
|
|
33
|
+
| `INIT` | After WORK_ID determined | `WORK-NN created — Execution-Mode: direct/pipeline/full` |
|
|
34
|
+
| `REF` | After STARTUP references | `References: CLAUDE.md, .agent/router_rule_config.json, agents/file-content-schema.md` |
|
|
35
|
+
| `PLAN` | After PLAN.md + TASK files created | `PLAN.md, TASK-00.md created` |
|
|
36
|
+
| `IMPL` | When direct mode code implementation starts | `Code implementation started — References: {modified file list}` |
|
|
37
|
+
| `BUILD` | After self-check passes | `Build/lint passed` |
|
|
38
|
+
| `COMMIT` | After git commit completed | `commit {hash}` |
|
|
39
|
+
| `DISPATCH` | On pipeline/full dispatch | `Builder dispatch` or `Planner dispatch` |
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Reference Collection Rules
|
|
44
|
+
|
|
45
|
+
Cumulatively track files read during STARTUP and subsequent exploration, recording them all at once during the `REF` stage.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Agent Communication XML Schema
|
|
2
|
+
|
|
3
|
+
XML communication format definition for uc-taskmanager agents.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Dispatch Format (Dispatcher → Receiver)
|
|
8
|
+
|
|
9
|
+
```xml
|
|
10
|
+
<dispatch to="{receiver}" work="{WORK_ID}" task="{TASK_ID}" execution-mode="{direct|pipeline|full}">
|
|
11
|
+
<context>
|
|
12
|
+
<project>{project name}</project>
|
|
13
|
+
<language>{lang_code}</language>
|
|
14
|
+
<plan-file>works/{WORK_ID}/PLAN.md</plan-file>
|
|
15
|
+
</context>
|
|
16
|
+
<task-spec>
|
|
17
|
+
<file>works/{WORK_ID}/TASK-XX.md</file>
|
|
18
|
+
<title>{title}</title>
|
|
19
|
+
<action>{implement|verify|commit|plan|route}</action>
|
|
20
|
+
<description>{optional}</description>
|
|
21
|
+
</task-spec>
|
|
22
|
+
<previous-results>
|
|
23
|
+
<result task="{TASK_ID}" status="{PASS|FAIL|SKIP}">{summary}</result>
|
|
24
|
+
</previous-results>
|
|
25
|
+
<cache-hint sections="{section1},{section2}"/>
|
|
26
|
+
</dispatch>
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
| Attribute | Value |
|
|
30
|
+
|-----------|-------|
|
|
31
|
+
| `to` | builder, verifier, committer, planner, scheduler, router |
|
|
32
|
+
| `task` | `TASK-NN` — WORK prefix must NOT be included |
|
|
33
|
+
| `execution-mode` | direct / pipeline / full (defaults to full if omitted) |
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## 2. Task Result Format (Receiver → Dispatcher)
|
|
38
|
+
|
|
39
|
+
```xml
|
|
40
|
+
<task-result work="{WORK_ID}" task="{TASK_ID}" agent="{agent}" status="{PASS|FAIL}">
|
|
41
|
+
<summary>{1-2 line summary}</summary>
|
|
42
|
+
<files-changed>
|
|
43
|
+
<file action="{created|modified|deleted}" path="{path}">{description}</file>
|
|
44
|
+
</files-changed>
|
|
45
|
+
<verification>
|
|
46
|
+
<check name="{type}" status="{PASS|FAIL|N/A}">{output}</check>
|
|
47
|
+
</verification>
|
|
48
|
+
<notes>{notes}</notes>
|
|
49
|
+
</task-result>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## 3. Dispatcher-Receiver Mapping
|
|
55
|
+
|
|
56
|
+
| Dispatcher | Receiver | execution-mode | Description |
|
|
57
|
+
|------------|----------|:--------------:|-------------|
|
|
58
|
+
| Router | (self) | `direct` | No subagents. Router implements+commits+callbacks directly |
|
|
59
|
+
| Router | Planner | `full` | Complex WORK planning |
|
|
60
|
+
| Router | Scheduler | `full` | Planned WORK execution |
|
|
61
|
+
| Router | Builder | `pipeline` | Single TASK implementation |
|
|
62
|
+
| Router | Verifier | `pipeline` | Single TASK verification |
|
|
63
|
+
| Router | Committer | `pipeline` | Single TASK commit |
|
|
64
|
+
| Scheduler | Builder | `full` | N TASK implementation |
|
|
65
|
+
| Scheduler | Verifier | `full` | N TASK verification |
|
|
66
|
+
| Scheduler | Committer | `full` | N TASK commit |
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 4. Context-Handoff Element
|
|
71
|
+
|
|
72
|
+
```xml
|
|
73
|
+
<context-handoff from="{agent}" detail-level="{FULL|SUMMARY|DROP}">
|
|
74
|
+
<what>{changes/verification details}</what>
|
|
75
|
+
<why>{decision rationale}</why> <!-- FULL only -->
|
|
76
|
+
<caution>{caveats}</caution> <!-- FULL only -->
|
|
77
|
+
<incomplete>{incomplete items}</incomplete> <!-- FULL only -->
|
|
78
|
+
</context-handoff>
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
| detail-level | Included Fields |
|
|
82
|
+
|:---:|---|
|
|
83
|
+
| `FULL` | what, why, caution, incomplete |
|
|
84
|
+
| `SUMMARY` | what only (1-3 lines) |
|
|
85
|
+
| `DROP` | Element omitted |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 5. Agent Behavior by execution-mode
|
|
90
|
+
|
|
91
|
+
| Agent | direct | pipeline | full |
|
|
92
|
+
|-------|--------|----------|------|
|
|
93
|
+
| Router | implement+self-check+result.md+commit+callback directly | Create PLAN then dispatch B→V→C | Dispatch to Planner |
|
|
94
|
+
| Planner | Not invoked | Not invoked | Create PLAN.md |
|
|
95
|
+
| Scheduler | Not invoked | Not invoked | DAG management + [B→V→C]×N |
|
|
96
|
+
| Builder | Not invoked | Normal execution | Normal execution |
|
|
97
|
+
| Verifier | Not invoked | Normal execution | Normal execution |
|
|
98
|
+
| Committer | Not invoked | result.md+commit+callback | result.md+commit+callback |
|
|
99
|
+
|
|
100
|
+
Invariants (regardless of mode):
|
|
101
|
+
|
|
102
|
+
| Item | direct | pipeline/full |
|
|
103
|
+
|------|:---:|:---:|
|
|
104
|
+
| `works/WORK-NN/` directory | Router | Router/Planner |
|
|
105
|
+
| `PLAN.md` | Router | Router/Planner |
|
|
106
|
+
| `TASK-XX.md` | Router | Router/Planner |
|
|
107
|
+
| `TASK-XX_result.md` | Router | Committer |
|
|
108
|
+
| COMMITTER DONE callback | Router | Committer |
|
|
109
|
+
| `WORK-LIST.md` IN_PROGRESS | Router | Router |
|
|
@@ -84,7 +84,9 @@ ls works/${WORK_ID}/*_result.md 2>/dev/null
|
|
|
84
84
|
|
|
85
85
|
→ Build/Lint 명령: `shared-prompt-sections.md` § 2 참조
|
|
86
86
|
|
|
87
|
-
빌드/린트
|
|
87
|
+
- 빌드/린트 스크립트가 존재하지 않으면 해당 check는 **N/A** 처리 (수정 시도 금지).
|
|
88
|
+
- 빌드/린트 실패 시 보고 전에 수정 시도. **최대 2회 재시도**.
|
|
89
|
+
- 3회째도 실패 시 → `status="FAIL"`로 task-result XML 반환하고 종료. 무한 루프 금지.
|
|
88
90
|
|
|
89
91
|
### 3-6. Progress Checkpoint 기록
|
|
90
92
|
|
|
@@ -18,9 +18,11 @@ dispatch 시: <context><language> 필드에 resolved language code 전달
|
|
|
18
18
|
## § 2. Build and Lint Commands
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
# Auto-detect Build
|
|
21
|
+
# Auto-detect Build (스크립트 존재 시에만 실행)
|
|
22
22
|
if [ -f "package.json" ]; then
|
|
23
|
-
|
|
23
|
+
if node -e "const p=JSON.parse(require('fs').readFileSync('package.json','utf8')); process.exit(p.scripts&&p.scripts.build?0:1)" 2>/dev/null; then
|
|
24
|
+
npm run build 2>&1 || bun run build 2>&1 || yarn build 2>&1
|
|
25
|
+
fi
|
|
24
26
|
elif [ -f "Cargo.toml" ]; then
|
|
25
27
|
cargo build 2>&1
|
|
26
28
|
elif [ -f "go.mod" ]; then
|
|
@@ -31,15 +33,18 @@ elif [ -f "Makefile" ]; then
|
|
|
31
33
|
make build 2>&1 || make 2>&1
|
|
32
34
|
fi
|
|
33
35
|
|
|
34
|
-
# Auto-detect Lint
|
|
36
|
+
# Auto-detect Lint (스크립트 존재 시에만 실행)
|
|
35
37
|
if [ -f "package.json" ]; then
|
|
36
|
-
|
|
38
|
+
if node -e "const p=JSON.parse(require('fs').readFileSync('package.json','utf8')); process.exit(p.scripts&&p.scripts.lint?0:1)" 2>/dev/null; then
|
|
39
|
+
npm run lint 2>&1 || bun run lint 2>&1 || true
|
|
40
|
+
fi
|
|
37
41
|
elif [ -f "pyproject.toml" ]; then
|
|
38
42
|
ruff check . 2>&1 || python -m flake8 . 2>&1 || true
|
|
39
43
|
fi
|
|
40
44
|
```
|
|
41
45
|
|
|
42
|
-
빌드/린트
|
|
46
|
+
- 빌드/린트 스크립트가 존재하지 않으면 **skip (N/A 처리)**.
|
|
47
|
+
- 빌드/린트 실패 시 보고 전에 반드시 수정.
|
|
43
48
|
|
|
44
49
|
---
|
|
45
50
|
|
package/bin/cli.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { createInterface } from 'node:readline';
|
|
4
|
+
import { VERSION, SUPPORTED_LANGS } from '../lib/constants.mjs';
|
|
4
5
|
|
|
5
6
|
const bold = (s) => `\x1b[1m${s}\x1b[0m`;
|
|
6
7
|
const dim = (s) => `\x1b[2m${s}\x1b[0m`;
|
|
@@ -10,33 +11,73 @@ const HELP = `
|
|
|
10
11
|
${bold('uctm')} ${dim(`v${VERSION}`)} — Universal Claude Task Manager
|
|
11
12
|
|
|
12
13
|
${bold('Usage:')}
|
|
13
|
-
uctm init ${dim('[--global]')} Install agent files
|
|
14
|
-
uctm update ${dim('[--global]')} Update agent files (
|
|
14
|
+
uctm init ${dim('[--global] [--lang ko|en]')} Install agent files
|
|
15
|
+
uctm update ${dim('[--global] --lang ko|en')} Update agent files (--lang required)
|
|
15
16
|
uctm --version Show version
|
|
16
17
|
uctm --help Show this help
|
|
17
18
|
|
|
18
19
|
${bold('Options:')}
|
|
19
20
|
--global Install/update to ${dim('~/.claude/agents/')} (available across all projects)
|
|
20
21
|
Default installs to ${dim('.claude/agents/')} in the current directory
|
|
22
|
+
--lang Select agent language: ${dim('ko')} (한국어) or ${dim('en')} (English)
|
|
23
|
+
If omitted during init, interactive selection is shown
|
|
21
24
|
|
|
22
25
|
${bold('Examples:')}
|
|
23
|
-
${dim('#
|
|
24
|
-
${cyan('$')}
|
|
26
|
+
${dim('# English agents')}
|
|
27
|
+
${cyan('$')} uctm init --lang en
|
|
28
|
+
|
|
29
|
+
${dim('# Korean agents')}
|
|
30
|
+
${cyan('$')} uctm init --lang ko
|
|
31
|
+
|
|
32
|
+
${dim('# Interactive language selection')}
|
|
25
33
|
${cyan('$')} uctm init
|
|
26
34
|
|
|
27
35
|
${dim('# Global setup')}
|
|
28
|
-
${cyan('$')} uctm init --global
|
|
36
|
+
${cyan('$')} uctm init --global --lang en
|
|
29
37
|
|
|
30
38
|
${dim('# Update agents after uctm upgrade')}
|
|
31
|
-
${cyan('$')} uctm update
|
|
39
|
+
${cyan('$')} uctm update --lang en
|
|
32
40
|
|
|
33
41
|
${bold('After init:')}
|
|
34
42
|
1. Run ${dim("'claude'")} to start Claude Code
|
|
35
|
-
2. Type: ${dim('[
|
|
43
|
+
2. Type: ${dim('[new-feature] Add a hello world feature')}
|
|
36
44
|
|
|
37
45
|
${dim('https://github.com/UCJung/uc-taskmanager-claude-agent')}
|
|
38
46
|
`;
|
|
39
47
|
|
|
48
|
+
function parseLangArg(args) {
|
|
49
|
+
const langIdx = args.indexOf('--lang');
|
|
50
|
+
if (langIdx === -1) return null;
|
|
51
|
+
const lang = args[langIdx + 1];
|
|
52
|
+
if (!lang || !SUPPORTED_LANGS.includes(lang)) {
|
|
53
|
+
console.error(`\n Error: --lang must be one of: ${SUPPORTED_LANGS.join(', ')}`);
|
|
54
|
+
console.error(` Usage: uctm <command> --lang ko|en\n`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
return lang;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function promptLang() {
|
|
61
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
62
|
+
return new Promise((resolve) => {
|
|
63
|
+
console.log(`\n Select language:`);
|
|
64
|
+
console.log(` 1. English`);
|
|
65
|
+
console.log(` 2. 한국어`);
|
|
66
|
+
rl.question(' > ', (answer) => {
|
|
67
|
+
rl.close();
|
|
68
|
+
const choice = answer.trim();
|
|
69
|
+
if (choice === '1' || choice.toLowerCase() === 'en' || choice.toLowerCase() === 'english') {
|
|
70
|
+
resolve('en');
|
|
71
|
+
} else if (choice === '2' || choice.toLowerCase() === 'ko' || choice === '한국어') {
|
|
72
|
+
resolve('ko');
|
|
73
|
+
} else {
|
|
74
|
+
console.log(` Defaulting to English.`);
|
|
75
|
+
resolve('en');
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
40
81
|
async function main() {
|
|
41
82
|
const args = process.argv.slice(2);
|
|
42
83
|
const command = args.find((a) => !a.startsWith('-'));
|
|
@@ -54,15 +95,20 @@ async function main() {
|
|
|
54
95
|
|
|
55
96
|
if (command === 'init') {
|
|
56
97
|
console.log(`\n ${bold('uctm')} ${dim(`v${VERSION}`)} — Universal Claude Task Manager`);
|
|
98
|
+
let lang = parseLangArg(args);
|
|
99
|
+
if (!lang) {
|
|
100
|
+
lang = await promptLang();
|
|
101
|
+
}
|
|
57
102
|
const { init } = await import('../lib/init.mjs');
|
|
58
|
-
init(isGlobal);
|
|
103
|
+
init(isGlobal, lang);
|
|
59
104
|
return;
|
|
60
105
|
}
|
|
61
106
|
|
|
62
107
|
if (command === 'update') {
|
|
63
108
|
console.log(`\n ${bold('uctm')} ${dim(`v${VERSION}`)} — Universal Claude Task Manager`);
|
|
109
|
+
const lang = parseLangArg(args);
|
|
64
110
|
const { update } = await import('../lib/update.mjs');
|
|
65
|
-
update(isGlobal);
|
|
111
|
+
update(isGlobal, lang);
|
|
66
112
|
return;
|
|
67
113
|
}
|
|
68
114
|
|
package/lib/constants.mjs
CHANGED
|
@@ -7,6 +7,8 @@ const pkg = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf8
|
|
|
7
7
|
|
|
8
8
|
export const VERSION = pkg.version;
|
|
9
9
|
|
|
10
|
+
export const SUPPORTED_LANGS = ['ko', 'en'];
|
|
11
|
+
|
|
10
12
|
export const AGENT_FILES = [
|
|
11
13
|
'agent-flow.md',
|
|
12
14
|
'builder.md',
|
|
@@ -22,7 +24,11 @@ export const AGENT_FILES = [
|
|
|
22
24
|
'xml-schema.md',
|
|
23
25
|
];
|
|
24
26
|
|
|
25
|
-
export
|
|
27
|
+
export function getAgentsSrcDir(lang) {
|
|
28
|
+
return join(__dirname, '..', 'agents', lang);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const CLAUDE_MD_SECTION_KO = `
|
|
26
32
|
## Agent 호출 규칙
|
|
27
33
|
|
|
28
34
|
\`[]\` 태그로 시작하는 요청 → \`agents/agent-flow.md\` 를 읽고 파이프라인을 실행한다.
|
|
@@ -34,3 +40,20 @@ export const CLAUDE_MD_SECTION = `
|
|
|
34
40
|
|
|
35
41
|
예: \`[추가기능]\`, \`[버그수정]\`, \`[리팩토링]\`, \`[WORK 시작]\` 등
|
|
36
42
|
`.trimStart();
|
|
43
|
+
|
|
44
|
+
export const CLAUDE_MD_SECTION_EN = `
|
|
45
|
+
## Agent Invocation Rules
|
|
46
|
+
|
|
47
|
+
Requests starting with a \`[]\` tag → read \`agents/agent-flow.md\` and execute the pipeline.
|
|
48
|
+
|
|
49
|
+
- **Main Claude is the orchestrator.** All agent invocations are performed directly by Main Claude.
|
|
50
|
+
- Each agent only returns results (dispatch XML or task-result XML) after completing its work.
|
|
51
|
+
- Main Claude receives return values and invokes the next agent in sequence.
|
|
52
|
+
- Pipeline flow follows \`agents/agent-flow.md\`.
|
|
53
|
+
|
|
54
|
+
Examples: \`[new-feature]\`, \`[bugfix]\`, \`[enhancement]\`, \`[new-work]\`, etc.
|
|
55
|
+
`.trimStart();
|
|
56
|
+
|
|
57
|
+
export function getClaudeMdSection(lang) {
|
|
58
|
+
return lang === 'ko' ? CLAUDE_MD_SECTION_KO : CLAUDE_MD_SECTION_EN;
|
|
59
|
+
}
|