uctm 1.5.1 → 1.5.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.
Files changed (41) hide show
  1. package/.claude-plugin/plugin.json +6 -0
  2. package/README.md +16 -14
  3. package/agents/builder.md +28 -59
  4. package/agents/committer.md +41 -73
  5. package/agents/planner.md +30 -31
  6. package/agents/scheduler.md +40 -58
  7. package/agents/specifier.md +29 -31
  8. package/agents/verifier.md +31 -56
  9. package/bin/cli.mjs +11 -58
  10. package/lib/constants.mjs +14 -11
  11. package/lib/init.mjs +29 -16
  12. package/lib/update.mjs +28 -22
  13. package/package.json +1 -1
  14. package/skills/sdd-pipeline/SKILL.md +8 -6
  15. package/skills/work-pipeline/SKILL.md +31 -8
  16. package/skills/work-status/SKILL.md +2 -2
  17. package/.claude-plugin/.claude-plugin/plugin.json +0 -29
  18. package/agents/agent-flow.md +0 -279
  19. package/agents/context-policy.md +0 -94
  20. package/agents/file-content-schema.md +0 -249
  21. package/agents/ko/agent-flow.md +0 -231
  22. package/agents/ko/builder.md +0 -164
  23. package/agents/ko/committer.md +0 -202
  24. package/agents/ko/context-policy.md +0 -94
  25. package/agents/ko/file-content-schema.md +0 -249
  26. package/agents/ko/planner.md +0 -161
  27. package/agents/ko/scheduler.md +0 -189
  28. package/agents/ko/shared-prompt-sections.md +0 -250
  29. package/agents/ko/specifier.md +0 -194
  30. package/agents/ko/verifier.md +0 -149
  31. package/agents/ko/work-activity-log.md +0 -47
  32. package/agents/ko/xml-schema.md +0 -109
  33. package/agents/shared-prompt-sections.md +0 -250
  34. package/agents/work-activity-log.md +0 -47
  35. package/agents/xml-schema.md +0 -159
  36. package/skills/sdd-pipeline/references/agent-flow.md +0 -279
  37. package/skills/sdd-pipeline/references/context-policy.md +0 -94
  38. package/skills/sdd-pipeline/references/file-content-schema.md +0 -249
  39. package/skills/sdd-pipeline/references/shared-prompt-sections.md +0 -250
  40. package/skills/sdd-pipeline/references/work-activity-log.md +0 -47
  41. package/skills/sdd-pipeline/references/xml-schema.md +0 -159
package/lib/init.mjs CHANGED
@@ -2,7 +2,7 @@ import { existsSync, mkdirSync, copyFileSync, readFileSync, writeFileSync, readd
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, REQUIRED_PERMISSIONS } from './constants.mjs';
5
+ import { AGENT_FILES, REFERENCE_FILES, getAgentsSrcDir, getReferencesSrcDir, REQUIRED_PERMISSIONS } from './constants.mjs';
6
6
 
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
8
 
@@ -12,8 +12,8 @@ const green = (s) => `\x1b[32m${s}\x1b[0m`;
12
12
  const dim = (s) => `\x1b[2m${s}\x1b[0m`;
13
13
  const yellow = (s) => `\x1b[33m${s}\x1b[0m`;
14
14
 
15
- function copyAgents(destDir, lang) {
16
- const srcDir = getAgentsSrcDir(lang);
15
+ function copyAgents(destDir) {
16
+ const srcDir = getAgentsSrcDir();
17
17
  mkdirSync(destDir, { recursive: true });
18
18
  let count = 0;
19
19
  for (const file of AGENT_FILES) {
@@ -25,6 +25,19 @@ function copyAgents(destDir, lang) {
25
25
  return count;
26
26
  }
27
27
 
28
+ function copyReferences(destDir) {
29
+ const srcDir = getReferencesSrcDir();
30
+ mkdirSync(destDir, { recursive: true });
31
+ let count = 0;
32
+ for (const file of REFERENCE_FILES) {
33
+ const src = join(srcDir, file);
34
+ if (!existsSync(src)) continue;
35
+ copyFileSync(src, join(destDir, file));
36
+ count++;
37
+ }
38
+ return count;
39
+ }
40
+
28
41
  function copyDirRecursive(src, dest) {
29
42
  mkdirSync(dest, { recursive: true });
30
43
  let count = 0;
@@ -126,17 +139,16 @@ async function promptPermissions() {
126
139
  });
127
140
  }
128
141
 
129
- export async function init(isGlobal, lang) {
130
- const exampleTag = lang === 'ko'
131
- ? `[추가기능] Add a hello world feature`
132
- : `[new-feature] Add a hello world feature`;
142
+ export async function init(isGlobal) {
143
+ const exampleTag = `[new-feature] Add a hello world feature`;
133
144
 
134
145
  if (isGlobal) {
135
146
  const globalClaudeDir = join(homedir(), '.claude');
136
- const globalDir = join(globalClaudeDir, 'agents');
137
- const count = copyAgents(globalDir, lang);
138
- console.log(`\n Installing to ${dim('~/.claude/agents/')} (${lang}) ...`);
139
- console.log(` ${green('✓')} ${count} agent files copied`);
147
+ const agentCount = copyAgents(join(globalClaudeDir, 'agents'));
148
+ const refCount = copyReferences(join(globalClaudeDir, 'references'));
149
+ console.log(`\n Installing to ${dim('~/.claude/')} ...`);
150
+ console.log(` ${green('✓')} ${agentCount} agent files copied to agents/`);
151
+ console.log(` ${green('✓')} ${refCount} reference files copied to references/`);
140
152
  const globalResCount = copyPluginResources(globalClaudeDir);
141
153
  if (globalResCount > 0) {
142
154
  console.log(` ${green('✓')} ${globalResCount} plugin resource files copied`);
@@ -148,14 +160,15 @@ export async function init(isGlobal, lang) {
148
160
  }
149
161
 
150
162
  const projectDir = process.cwd();
151
- const destDir = join(projectDir, '.claude', 'agents');
163
+ const claudeDir = join(projectDir, '.claude');
152
164
 
153
- console.log(`\n Installing to ${dim('.claude/agents/')} (${lang}) ...`);
165
+ console.log(`\n Installing to ${dim('.claude/')} ...`);
154
166
 
155
- const count = copyAgents(destDir, lang);
156
- console.log(` ${green('✓')} ${count} agent files copied`);
167
+ const agentCount = copyAgents(join(claudeDir, 'agents'));
168
+ console.log(` ${green('✓')} ${agentCount} agent files copied to agents/`);
169
+ const refCount = copyReferences(join(claudeDir, 'references'));
170
+ console.log(` ${green('✓')} ${refCount} reference files copied to references/`);
157
171
 
158
- const claudeDir = join(projectDir, '.claude');
159
172
  const resCount = copyPluginResources(claudeDir);
160
173
  if (resCount > 0) {
161
174
  console.log(` ${green('✓')} ${resCount} plugin resource files copied (.claude-plugin, skills)`);
package/lib/update.mjs CHANGED
@@ -2,41 +2,47 @@ import { existsSync, copyFileSync, mkdirSync } from 'node:fs';
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 } from './constants.mjs';
5
+ import { AGENT_FILES, REFERENCE_FILES, getAgentsSrcDir, getReferencesSrcDir } from './constants.mjs';
6
6
 
7
7
  const __dirname = dirname(fileURLToPath(import.meta.url));
8
8
 
9
9
  const green = (s) => `\x1b[32m${s}\x1b[0m`;
10
10
  const dim = (s) => `\x1b[2m${s}\x1b[0m`;
11
- const red = (s) => `\x1b[31m${s}\x1b[0m`;
12
11
 
13
- export function update(isGlobal, lang) {
14
- if (!lang) {
15
- console.error(`\n ${red('Error:')} --lang is required for update.`);
16
- console.error(` Usage: uctm update --lang ko|en ${isGlobal ? '--global' : ''}\n`);
17
- process.exit(1);
18
- }
19
-
20
- const srcDir = getAgentsSrcDir(lang);
21
- const destDir = isGlobal
22
- ? join(homedir(), '.claude', 'agents')
23
- : join(process.cwd(), '.claude', 'agents');
12
+ export function update(isGlobal) {
13
+ const baseDir = isGlobal
14
+ ? join(homedir(), '.claude')
15
+ : join(process.cwd(), '.claude');
16
+ const agentDestDir = join(baseDir, 'agents');
17
+ const refDestDir = join(baseDir, 'references');
24
18
 
25
- if (!existsSync(destDir)) {
26
- console.error(`\n Error: ${destDir} not found. Run ${dim("'uctm init'")} first.\n`);
19
+ if (!existsSync(agentDestDir)) {
20
+ console.error(`\n Error: ${agentDestDir} not found. Run ${dim("'uctm init'")} first.\n`);
27
21
  process.exit(1);
28
22
  }
29
23
 
30
- let count = 0;
24
+ const agentSrcDir = getAgentsSrcDir();
25
+ let agentCount = 0;
31
26
  for (const file of AGENT_FILES) {
32
- const src = join(srcDir, file);
27
+ const src = join(agentSrcDir, file);
28
+ if (!existsSync(src)) continue;
29
+ copyFileSync(src, join(agentDestDir, file));
30
+ agentCount++;
31
+ }
32
+
33
+ mkdirSync(refDestDir, { recursive: true });
34
+ const refSrcDir = getReferencesSrcDir();
35
+ let refCount = 0;
36
+ for (const file of REFERENCE_FILES) {
37
+ const src = join(refSrcDir, file);
33
38
  if (!existsSync(src)) continue;
34
- copyFileSync(src, join(destDir, file));
35
- count++;
39
+ copyFileSync(src, join(refDestDir, file));
40
+ refCount++;
36
41
  }
37
42
 
38
- const label = isGlobal ? '~/.claude/agents/' : '.claude/agents/';
39
- console.log(`\n Updating ${dim(label)} (${lang}) ...`);
40
- console.log(` ${green('✓')} ${count} agent files updated`);
43
+ const label = isGlobal ? '~/.claude/' : '.claude/';
44
+ console.log(`\n Updating ${dim(label)} ...`);
45
+ console.log(` ${green('✓')} ${agentCount} agent files updated`);
46
+ console.log(` ${green('✓')} ${refCount} reference files updated`);
41
47
  console.log(` ${dim('-')} CLAUDE.md, router_rule_config.json untouched\n`);
42
48
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uctm",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Universal Claude Task Manager — SDD-based task pipeline subagent system for Claude Code CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -4,13 +4,15 @@
4
4
 
5
5
  직접 사용자 호출용이 아니라 에이전트 내부 참조용입니다.
6
6
 
7
+ 참조 문서 위치: `../../references/`
8
+
7
9
  ## 포함 문서
8
10
 
9
11
  | File | Description |
10
12
  |------|-------------|
11
- | `references/agent-flow.md` | 파이프라인 흐름 정의 |
12
- | `references/file-content-schema.md` | 파일 포맷 스키마 |
13
- | `references/shared-prompt-sections.md` | 공통 규칙 (TASK ID, PLAN.md 7 fields, WORK-LIST) |
14
- | `references/context-policy.md` | 슬라이딩 윈도우 규칙 |
15
- | `references/xml-schema.md` | XML 통신 포맷 |
16
- | `references/work-activity-log.md` | Activity Log 규칙 |
13
+ | `../../references/agent-flow.md` | 파이프라인 흐름 정의 |
14
+ | `../../references/file-content-schema.md` | 파일 포맷 스키마 |
15
+ | `../../references/shared-prompt-sections.md` | 공통 규칙 (TASK ID, PLAN.md 7 fields, WORK-LIST) |
16
+ | `../../references/context-policy.md` | 슬라이딩 윈도우 규칙 |
17
+ | `../../references/xml-schema.md` | XML 통신 포맷 |
18
+ | `../../references/work-activity-log.md` | Activity Log 규칙 |
@@ -1,25 +1,30 @@
1
1
  ---
2
2
  name: work-pipeline
3
- description: Triggers the WORK-PIPELINE when a user request starts with a [] tag (e.g., [new-feature], [bugfix], [WORK start]). Use this skill whenever you detect a [] tag at the beginning of a user message.
3
+ description: Triggers the WORK-PIPELINE. Use this skill when (1) user request starts with a [] tag (e.g., [new-feature], [bugfix]), or (2) user asks to resume/continue a WORK (e.g., "WORK-01 계속실행", "resume WORK-01", "WORK-01 실행", "continue WORK-01").
4
4
  ---
5
5
 
6
6
  # WORK-PIPELINE Trigger
7
7
 
8
- When the user's message starts with a `[]` tag, start the WORK-PIPELINE by reading `../skills/sdd-pipeline/references/agent-flow.md` and following the orchestration flow.
8
+ Read `../../references/agent-flow.md` and follow the orchestration flow.
9
9
 
10
10
  ## Trigger Detection
11
11
 
12
- Any message starting with `[...]` triggers this pipeline:
12
+ **New WORK** — message starts with `[...]` tag:
13
13
  - `[new-feature]`, `[enhancement]`, `[bugfix]`, `[new-work]`, `[WORK start]`
14
14
  - Or any custom tag in square brackets
15
15
 
16
+ **Resume WORK** — message mentions existing WORK-ID with execution intent:
17
+ - "WORK-XX 계속실행", "WORK-XX 실행", "resume WORK-XX", "continue WORK-XX"
18
+ - "파이프라인 재개", "WORK 계속"
19
+ - → Follow agent-flow.md § Resuming Existing WORK
20
+
16
21
  ## References Directory (CRITICAL)
17
22
 
18
23
  When this skill is triggered, Claude Code provides the "Base directory for this skill" as an absolute path.
19
24
  Derive the **REFERENCES_DIR** from it:
20
25
 
21
26
  ```
22
- REFERENCES_DIR = {Base directory}/../sdd-pipeline/references
27
+ REFERENCES_DIR = {Base directory}/../../references
23
28
  ```
24
29
 
25
30
  You MUST pass this absolute path to **every sub-agent invocation** (specifier, planner, scheduler, builder, verifier, committer).
@@ -31,14 +36,32 @@ REFERENCES_DIR={absolute_path}
31
36
 
32
37
  Sub-agents need this path to read their reference files. Without it, they cannot find the files and will loop.
33
38
 
39
+ ## Callback Info Passthrough
40
+
41
+ If the user's prompt contains `CALLBACK_URL=...` and `CALLBACK_TOKEN=...`, extract these values and pass them to **every sub-agent invocation** alongside REFERENCES_DIR:
42
+
43
+ ```
44
+ CALLBACK_URL={url}
45
+ CALLBACK_TOKEN={token}
46
+ ```
47
+
48
+ **Main Claude (this skill) must NEVER send callbacks itself.** Only sub-agents send callbacks.
49
+
34
50
  ## Pipeline Flow
35
51
 
36
- 1. **Call specifier agent** — analyzes the requirement, creates `works/WORK-NN/Requirement.md`, determines execution-mode (direct/pipeline/full)
52
+ 1. **Spawn specifier agent** (via Agent tool) — analyzes the requirement, creates `works/WORK-NN/Requirement.md`, determines execution-mode (direct/pipeline/full)
37
53
  2. **⛔ STOP — Present the specifier's output summary to the user and WAIT for explicit approval.** Do NOT call the next agent until the user approves. Show what was created (Requirement.md, PLAN.md if direct mode, TASK files) and ask "Proceed?"
38
54
  3. **Follow the execution-mode** returned by specifier:
39
- - `direct`: call builder → committer
40
- - `pipeline`: call builderverifier → committer in sequence
41
- - `full`: call planner → **⛔ STOP for 2nd approval** → scheduler → [builder → verifiercommitter] × N
55
+ - `direct`: spawn builder (Agent tool) spawn verifier+committer (single Agent tool, see agent-flow.md § Combined Agent Invocation)
56
+ - `pipeline`: for each TASK spawn builder spawn verifier+committer (repeat per TASK)
57
+ - `full`: spawn planner → **⛔ STOP for 2nd approval** → spawn scheduler → scheduler handles [builder → verifier+committer] × N
58
+
59
+ ## ⚠️ CRITICAL: Agent Spawn Rules
60
+
61
+ - **EVERY agent MUST be spawned via the Agent tool.** Main Claude must NEVER implement code, create files, run git commands, or perform any agent's work directly.
62
+ - In direct mode: spawn specifier → spawn builder → spawn verifier+committer (**3 Agent tool calls**).
63
+ - verifier+committer is a **single spawn** that performs both roles in sequence (see agent-flow.md).
64
+ - If specifier returns builder dispatch XML, pass it to the builder agent — do NOT execute it yourself.
42
65
 
43
66
  ## Auto Mode
44
67
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: work-status
3
- description: Shows WORK progress and TASK status. Use when the user asks about WORK list, WORK progress, TASK status, or pipeline status (e.g., "WORK list", "WORK-01 progress", "show status").
3
+ description: Shows WORK status (read-only). Use ONLY when the user asks to VIEW status not to execute or resume. Matches queries like "WORK 목록", "상태 확인", "WORK-01 상태", "show status". Do NOT use for "실행", "계속", "resume" — those go to work-pipeline.
4
4
  ---
5
5
 
6
6
  # WORK Status
@@ -10,7 +10,7 @@ Check and report the current status of WORKs and TASKs.
10
10
  ## How to Check
11
11
 
12
12
  1. Read `works/WORK-LIST.md` for the master index of all WORKs
13
- 2. For a specific WORK, read `works/WORK-NN/PROGRESS.md` for TASK-level progress
13
+ 2. For a specific WORK, read last line of `works/WORK-NN/work_WORK-NN.log` for current progress
14
14
  3. For a specific TASK, read `works/WORK-NN/TASK-NN_result.md` for completion details
15
15
 
16
16
  ## Status Values
@@ -1,29 +0,0 @@
1
- {
2
- "name": "uc-taskmanager",
3
- "version": "1.4.0",
4
- "agents": [
5
- "./agents/specifier.md",
6
- "./agents/planner.md",
7
- "./agents/scheduler.md",
8
- "./agents/builder.md",
9
- "./agents/verifier.md",
10
- "./agents/committer.md"
11
- ],
12
- "description": "SDD WORK-PIPELINE Agent — Requirements analysis & development 6-agent full pipeline with DAG-based orchestration and sliding window context management",
13
- "author": {
14
- "name": "UCJung",
15
- "url": "https://github.com/UCJung"
16
- },
17
- "homepage": "https://github.com/UCJung/uc-taskmanager-claude-agent",
18
- "repository": "https://github.com/UCJung/uc-taskmanager-claude-agent",
19
- "license": "GPL-3.0",
20
- "keywords": [
21
- "task-manager",
22
- "pipeline",
23
- "sub-agents",
24
- "sdd",
25
- "dag-orchestration",
26
- "work-pipeline",
27
- "automation"
28
- ]
29
- }
@@ -1,279 +0,0 @@
1
- # Agent Flow — Main Claude Orchestration Guide
2
-
3
- > **All agent invocations are performed by Main Claude.**
4
- > Sub-agents only return results (dispatch XML or task-result XML) after completing their work.
5
- > Main Claude receives return values and invokes the next agent.
6
-
7
- ---
8
-
9
- ## Pipeline Flow
10
-
11
- ```
12
- [] tag detected → invoke specifier
13
-
14
- Check specifier return value
15
-
16
- ├─ Assumed (direct) → specifier creates Requirement.md + PLAN.md + TASK-00
17
- │ → returns builder dispatch XML
18
- │ → execute § direct procedure
19
-
20
- └─ Delegated (pipeline/full) → specifier creates Requirement.md only
21
- → returns planner dispatch XML
22
- → execute § planner-driven procedure
23
- ```
24
-
25
- ---
26
-
27
- ## Direct Mode (Specifier Assumes Planner)
28
-
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
- ```
35
-
36
- > Verifier+Committer combined: single spawn performs verification, then creates result.md and git commit.
37
-
38
- ---
39
-
40
- ## Pipeline Mode (Separate Planner Invocation)
41
-
42
- ```
43
- 1. Invoke specifier+planner (single spawn) → creates Requirement.md + PLAN.md + TASK-NN + determines execution-mode
44
- 2. ⛔ STOP — Present Requirement.md + PLAN.md + TASK list and WAIT for approval
45
- 3. Invoke builder (per-TASK dispatch XML as prompt)
46
- 4. Invoke verifier+committer (builder result as prompt) — verify then commit in one spawn
47
- ```
48
-
49
- > Specifier+Planner combined: specifier.md role first (Requirement.md), then planner.md role (PLAN.md + TASKs) in one spawn.
50
-
51
- ---
52
-
53
- ## Full Mode (With Scheduler)
54
-
55
- ```
56
- 1. Invoke specifier+planner (single spawn) → Requirement.md + PLAN.md + TASKs + execution-mode: full
57
- 2. ⛔ STOP — Present Requirement.md + PLAN.md + TASK list and WAIT for approval
58
- 3. Invoke scheduler → DAG analysis + READY TASK + returns builder dispatch XML
59
- 4. Invoke builder (dispatch XML as prompt) → implementation
60
- 5. Invoke verifier+committer (builder result as prompt) → verify then commit in one spawn
61
- 6. If incomplete TASKs remain, return to step 3
62
- ```
63
-
64
- Parallel execution: When scheduler returns multiple READY TASKs, invoke builders concurrently.
65
-
66
- ---
67
-
68
- ## Resuming Existing WORK
69
-
70
- Resume pipeline for a WORK that already has PLAN.md + TASKs:
71
-
72
- ```
73
- 1. Invoke scheduler → check READY TASKs + return builder dispatch XML
74
- 2. Invoke builder → implementation
75
- 3. Invoke verifier+committer → verify then commit in one spawn
76
- 4. If incomplete TASKs remain, return to step 1
77
- ```
78
-
79
- ---
80
-
81
- ## Combined Agent Invocation
82
-
83
- ### Specifier+Planner (single spawn)
84
-
85
- When invoking specifier in pipeline/full mode, include both agent definitions:
86
-
87
- ```
88
- Prompt to agent:
89
- "You will perform two roles in sequence.
90
-
91
- Role 1 — Specifier: Read specifier.md and create Requirement.md.
92
- Role 2 — Planner: Read planner.md and create PLAN.md + TASK files.
93
-
94
- Execute Role 1 first, then Role 2. Return the combined result."
95
- ```
96
-
97
- - Use specifier's model (opus) for the spawn
98
- - Agent reads both specifier.md and planner.md from REFERENCES_DIR
99
- - Returns: Requirement.md + PLAN.md + TASK files + execution-mode
100
-
101
- ### Verifier+Committer (single spawn)
102
-
103
- When invoking verification after builder completes:
104
-
105
- ```
106
- Prompt to agent:
107
- "You will perform two roles in sequence.
108
-
109
- Role 1 — Verifier: Read verifier.md and verify build/lint/test.
110
- Role 2 — Committer: Read committer.md and create result.md + git commit.
111
-
112
- Execute Role 1 first. If verification PASSES, execute Role 2.
113
- If verification FAILS, skip Role 2 and return FAIL result."
114
- ```
115
-
116
- - Use verifier's model (haiku) for the spawn
117
- - Agent reads both verifier.md and committer.md from REFERENCES_DIR
118
- - On PASS: returns verification result + commit hash
119
- - On FAIL: returns verification failure only (no commit)
120
-
121
- ---
122
-
123
- ## Agent Role Summary
124
-
125
- | Agent | Role | Model | Combined With |
126
- |-------|------|-------|---------------|
127
- | specifier | Requirement analysis | opus | + planner (pipeline/full) |
128
- | planner | PLAN + TASK decomposition | opus | combined into specifier spawn |
129
- | scheduler | DAG management + dispatch | haiku | standalone |
130
- | builder | Code implementation | sonnet | standalone |
131
- | verifier | Build/lint/test verification | haiku | + committer |
132
- | committer | Result report + git commit | haiku | combined into verifier spawn |
133
-
134
- ---
135
-
136
- ## Sub-agent Spawn Count by Mode
137
-
138
- | Mode | Spec+Plan | Scheduler | Builder | Veri+Commit | Total |
139
- |------|:---------:|:---------:|:-------:|:-----------:|:-----:|
140
- | direct | 1 (assumed) | — | 1 | 1 | **3** |
141
- | pipeline | 1 (combined) | — | 1 | 1 | **3** |
142
- | full (N TASKs) | 1 (combined) | 1 | N | N | **2 + 2N** |
143
-
144
- **Before vs After (6 TASKs):**
145
-
146
- | | Before | After | Reduction |
147
- |---|:---:|:---:|:---:|
148
- | Spawns | 2 + 3×6 = 20 | 2 + 2×6 = 14 | **-30%** |
149
-
150
- ---
151
-
152
- ## Approval Gates (CRITICAL)
153
-
154
- > **MUST STOP and wait for explicit user approval before invoking the next agent.**
155
- > Do NOT proceed until the user says "approve", "승인", "proceed", "go ahead", or equivalent.
156
- > The only exception is auto mode — when the user's original message contains "auto" or "자동으로".
157
-
158
- | Mode | Approvals | Timing | What to show user |
159
- |------|:---------:|--------|-------------------|
160
- | direct | 1 | After Specifier completes | Requirement.md + PLAN.md + TASK-00.md summary |
161
- | pipeline/full | 1 | After Specifier+Planner completes | Requirement.md + PLAN.md + TASK list |
162
- | auto-approve | 0 | — | Skip all approval gates |
163
-
164
- > Note: pipeline/full now has **1 approval** (not 2), since specifier and planner run in one spawn.
165
-
166
- **How to request approval:**
167
- 1. Present a summary of what the specifier+planner created (files, scope, execution-mode)
168
- 2. Ask: "Proceed?" or equivalent
169
- 3. **WAIT for user response** — do NOT invoke builder until approved
170
-
171
- ---
172
-
173
- ## Bash CLI Execution (Server Automation)
174
-
175
- Run the pipeline independently without a conversation session. `claude -p` acts as Main Claude.
176
-
177
- ```bash
178
- env -u CLAUDECODE -u ANTHROPIC_API_KEY claude -p \
179
- "[new-work] {task description}" \
180
- --dangerously-skip-permissions \
181
- --output-format stream-json \
182
- --verbose \
183
- 2>&1 | tee /tmp/pipeline.log
184
- ```
185
-
186
- | Option | Purpose |
187
- |--------|---------|
188
- | `env -u CLAUDECODE` | Bypass nested execution block |
189
- | `env -u ANTHROPIC_API_KEY` | Use subscription auth (Max) instead of API key |
190
- | `--dangerously-skip-permissions` | Skip permission prompts for unattended execution |
191
- | `--output-format stream-json --verbose` | Streaming for real-time monitoring |
192
-
193
- Resume interrupted pipeline:
194
- ```bash
195
- env -u CLAUDECODE -u ANTHROPIC_API_KEY claude -p \
196
- "Resume WORK-XX pipeline." \
197
- --dangerously-skip-permissions
198
- ```
199
-
200
- ---
201
-
202
- ## References Directory Passing (REQUIRED)
203
-
204
- Main Claude MUST pass the references directory path to every sub-agent invocation.
205
- This allows sub-agents to locate their reference files regardless of installation method (npm or plugin).
206
-
207
- **How to pass:**
208
- - Prepend `REFERENCES_DIR={absolute_path}` at the top of the prompt for every Task tool call
209
- - For npm installations: use `.claude/agents` (default, resolved from project root)
210
- - For plugin installations: derive from the skill's "Base directory" (`{base_dir}/../sdd-pipeline/references`)
211
-
212
- **Example:**
213
- ```
214
- REFERENCES_DIR=C:/Users/me/.claude/plugins/cache/uc-taskmanager/abc123/skills/sdd-pipeline/references
215
-
216
- <dispatch to="builder" ...>
217
- ...
218
- </dispatch>
219
- ```
220
-
221
- If REFERENCES_DIR is not available (e.g., npm installation without plugin), sub-agents fall back to `.claude/agents/`.
222
-
223
- ---
224
-
225
- ## Context Handoff (Sliding Window)
226
-
227
- | Distance | Level | Content |
228
- |----------|-------|---------|
229
- | Previous | FULL | what + why + caution + incomplete |
230
- | 2 steps back | SUMMARY | what 1-2 lines |
231
- | 3+ steps | DROP | Not passed |
232
-
233
- ---
234
-
235
- ## ref-cache Chain Propagation
236
-
237
- `<ref-cache>` carries pre-loaded reference file contents through the pipeline, eliminating redundant disk reads in each sub-agent.
238
-
239
- ### Rules
240
-
241
- 1. **First agent (typically specifier)** — no ref-cache available on dispatch. Reads reference files from `REFERENCES_DIR` normally.
242
-
243
- 2. **Agent returns task-result** — if the agent supports ref-cache, it includes `<ref-cache>` in its task-result XML containing all reference files it loaded.
244
-
245
- 3. **Main Claude propagates ref-cache** — when dispatching the next agent, copy the `<ref-cache>` block from the previous task-result into the new dispatch XML unchanged.
246
-
247
- 4. **Receiving agent skips file reads** — when `<ref-cache>` is present in the dispatch XML, the agent reads reference content from `<ref>` elements instead of reading files from disk.
248
-
249
- 5. **Missing ref-cache** — if a task-result does not contain `<ref-cache>` (agent does not support it yet), omit `<ref-cache>` from the next dispatch. The receiving agent falls back to reading files from disk.
250
-
251
- ### Flow Example
252
-
253
- ```
254
- specifier+planner (no ref-cache in) → reads files → returns task-result with <ref-cache>
255
- ↓ Main Claude copies <ref-cache> into dispatch
256
- builder (ref-cache in) → skips file reads → returns task-result with <ref-cache>
257
- ↓ Main Claude copies <ref-cache> into dispatch
258
- verifier+committer (ref-cache in) → skips file reads → commit
259
- ```
260
-
261
- ### Phase 2: Selective Section Delivery
262
-
263
- Instead of passing full reference files, Main Claude extracts only the sections each agent needs. This reduces dispatch token size by 50-70%.
264
-
265
- **Main Claude reads reference files once at pipeline start**, then delivers condensed `<ref-cache>` per agent using this mapping:
266
-
267
- | Agent | shared-prompt-sections | file-content-schema | xml-schema | context-policy | work-activity-log |
268
- |-------|:---:|:---:|:---:|:---:|:---:|
269
- | **specifier+planner** | §1,§2,§7,§8,§9,§11 | §0,§1,§2,§3 | §1,§3 | — | full |
270
- | **scheduler** | §4,§8,§10 | §1,§6 | §1,§3,§4,§5 | full | full |
271
- | **builder** | §1,§2,§10,§12 | §2,§3 | §1,§2,§4 | Builder section | full |
272
- | **verifier+committer** | §1,§2,§8,§10,§12 | §3,§4,§5,§6,§7 | §1,§2,§4 | Verifier+Committer | full |
273
-
274
- **Delivery format**: Condense each `<ref key="">` to contain only the needed sections, not the full file. Use one-line summaries for simple rules, keep full content only for templates and code blocks.
275
-
276
- ### Constraints
277
-
278
- - **ref-cache does not replace REFERENCES_DIR** — always pass `REFERENCES_DIR` (or `<references-dir>`) in every dispatch regardless of ref-cache presence, for backward compatibility.
279
- - **Agents may still read files** — if ref-cache content is insufficient, agents fall back to reading from disk.