uctm 1.4.0 → 1.5.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 +29 -0
- package/agents/agent-flow.md +88 -45
- package/agents/ko/agent-flow.md +84 -37
- package/agents/ko/planner.md +4 -3
- package/agents/ko/shared-prompt-sections.md +15 -17
- package/agents/planner.md +4 -3
- package/agents/shared-prompt-sections.md +15 -17
- package/lib/constants.mjs +1 -35
- package/lib/init.mjs +49 -24
- package/package.json +4 -2
- package/skills/init/SKILL.md +95 -0
- package/skills/sdd-pipeline/SKILL.md +16 -0
- package/skills/sdd-pipeline/references/agent-flow.md +279 -0
- package/skills/sdd-pipeline/references/context-policy.md +94 -0
- package/skills/sdd-pipeline/references/file-content-schema.md +249 -0
- package/skills/sdd-pipeline/references/shared-prompt-sections.md +250 -0
- package/skills/sdd-pipeline/references/work-activity-log.md +47 -0
- package/skills/sdd-pipeline/references/xml-schema.md +159 -0
- package/skills/work-pipeline/SKILL.md +49 -0
- package/skills/work-status/SKILL.md +35 -0
package/lib/init.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, copyFileSync, readFileSync, writeFileSync } from 'node:fs';
|
|
1
|
+
import { existsSync, mkdirSync, copyFileSync, readFileSync, writeFileSync, readdirSync, statSync } 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,
|
|
5
|
+
import { AGENT_FILES, getAgentsSrcDir, REQUIRED_PERMISSIONS } from './constants.mjs';
|
|
6
6
|
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
8
|
|
|
@@ -25,6 +25,41 @@ function copyAgents(destDir, lang) {
|
|
|
25
25
|
return count;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
function copyDirRecursive(src, dest) {
|
|
29
|
+
mkdirSync(dest, { recursive: true });
|
|
30
|
+
let count = 0;
|
|
31
|
+
for (const entry of readdirSync(src)) {
|
|
32
|
+
const srcPath = join(src, entry);
|
|
33
|
+
const destPath = join(dest, entry);
|
|
34
|
+
if (statSync(srcPath).isDirectory()) {
|
|
35
|
+
count += copyDirRecursive(srcPath, destPath);
|
|
36
|
+
} else {
|
|
37
|
+
copyFileSync(srcPath, destPath);
|
|
38
|
+
count++;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return count;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function copyPluginResources(destBaseDir) {
|
|
45
|
+
const pkgRoot = join(__dirname, '..');
|
|
46
|
+
let count = 0;
|
|
47
|
+
|
|
48
|
+
// .claude-plugin/
|
|
49
|
+
const pluginSrc = join(pkgRoot, '.claude-plugin');
|
|
50
|
+
if (existsSync(pluginSrc)) {
|
|
51
|
+
count += copyDirRecursive(pluginSrc, join(destBaseDir, '.claude-plugin'));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// skills/
|
|
55
|
+
const skillsSrc = join(pkgRoot, 'skills');
|
|
56
|
+
if (existsSync(skillsSrc)) {
|
|
57
|
+
count += copyDirRecursive(skillsSrc, join(destBaseDir, 'skills'));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return count;
|
|
61
|
+
}
|
|
62
|
+
|
|
28
63
|
function ensureRouterConfig(projectDir) {
|
|
29
64
|
const configDir = join(projectDir, '.agent');
|
|
30
65
|
const configPath = join(configDir, 'router_rule_config.json');
|
|
@@ -44,21 +79,6 @@ function ensureWorksDir(projectDir) {
|
|
|
44
79
|
return true;
|
|
45
80
|
}
|
|
46
81
|
|
|
47
|
-
function updateClaudeMd(projectDir, lang) {
|
|
48
|
-
const section = getClaudeMdSection(lang);
|
|
49
|
-
const claudeMdPath = join(projectDir, 'CLAUDE.md');
|
|
50
|
-
if (existsSync(claudeMdPath)) {
|
|
51
|
-
const content = readFileSync(claudeMdPath, 'utf8');
|
|
52
|
-
if (content.includes('Agent 호출 규칙') || content.includes('Agent Invocation Rules') || content.includes('agent-flow.md')) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
writeFileSync(claudeMdPath, content.trimEnd() + '\n\n' + section);
|
|
56
|
-
} else {
|
|
57
|
-
writeFileSync(claudeMdPath, '# CLAUDE.md\n\n' + section);
|
|
58
|
-
}
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
82
|
function mergePermissions(projectDir) {
|
|
63
83
|
const settingsPath = join(projectDir, '.claude', 'settings.local.json');
|
|
64
84
|
let settings = {};
|
|
@@ -112,10 +132,15 @@ export async function init(isGlobal, lang) {
|
|
|
112
132
|
: `[new-feature] Add a hello world feature`;
|
|
113
133
|
|
|
114
134
|
if (isGlobal) {
|
|
115
|
-
const
|
|
135
|
+
const globalClaudeDir = join(homedir(), '.claude');
|
|
136
|
+
const globalDir = join(globalClaudeDir, 'agents');
|
|
116
137
|
const count = copyAgents(globalDir, lang);
|
|
117
138
|
console.log(`\n Installing to ${dim('~/.claude/agents/')} (${lang}) ...`);
|
|
118
139
|
console.log(` ${green('✓')} ${count} agent files copied`);
|
|
140
|
+
const globalResCount = copyPluginResources(globalClaudeDir);
|
|
141
|
+
if (globalResCount > 0) {
|
|
142
|
+
console.log(` ${green('✓')} ${globalResCount} plugin resource files copied`);
|
|
143
|
+
}
|
|
119
144
|
console.log(`\n ${dim('Next steps:')}`);
|
|
120
145
|
console.log(` 1. Open any project and run ${dim("'claude'")}`);
|
|
121
146
|
console.log(` 2. Type: ${dim(exampleTag)}\n`);
|
|
@@ -130,18 +155,18 @@ export async function init(isGlobal, lang) {
|
|
|
130
155
|
const count = copyAgents(destDir, lang);
|
|
131
156
|
console.log(` ${green('✓')} ${count} agent files copied`);
|
|
132
157
|
|
|
158
|
+
const claudeDir = join(projectDir, '.claude');
|
|
159
|
+
const resCount = copyPluginResources(claudeDir);
|
|
160
|
+
if (resCount > 0) {
|
|
161
|
+
console.log(` ${green('✓')} ${resCount} plugin resource files copied (.claude-plugin, skills)`);
|
|
162
|
+
}
|
|
163
|
+
|
|
133
164
|
if (ensureRouterConfig(projectDir)) {
|
|
134
165
|
console.log(` ${green('✓')} .agent/router_rule_config.json created`);
|
|
135
166
|
} else {
|
|
136
167
|
console.log(` ${dim('-')} .agent/router_rule_config.json already exists`);
|
|
137
168
|
}
|
|
138
169
|
|
|
139
|
-
if (updateClaudeMd(projectDir, lang)) {
|
|
140
|
-
console.log(` ${green('✓')} CLAUDE.md updated`);
|
|
141
|
-
} else {
|
|
142
|
-
console.log(` ${dim('-')} CLAUDE.md already has agent rules`);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
170
|
if (ensureWorksDir(projectDir)) {
|
|
146
171
|
console.log(` ${green('✓')} works/ directory created`);
|
|
147
172
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uctm",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.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": {
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"bin/",
|
|
11
11
|
"lib/",
|
|
12
12
|
"agents/",
|
|
13
|
-
".agent/"
|
|
13
|
+
".agent/",
|
|
14
|
+
".claude-plugin/",
|
|
15
|
+
"skills/"
|
|
14
16
|
],
|
|
15
17
|
"engines": {
|
|
16
18
|
"node": ">=18"
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: uctm-init
|
|
3
|
+
description: Initialize uc-taskmanager for the current project. Creates works/ directory and configures Bash permissions in .claude/settings.local.json. Use when the user says "uctm init", "initialize uctm", "uctm 초기화", or "초기화".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# uc-taskmanager Init
|
|
7
|
+
|
|
8
|
+
Initialize the current project for uc-taskmanager pipeline execution.
|
|
9
|
+
|
|
10
|
+
## Steps
|
|
11
|
+
|
|
12
|
+
### 1. Create works/ directory
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
if works/ does not exist:
|
|
16
|
+
create works/
|
|
17
|
+
report: ✓ works/ directory created
|
|
18
|
+
else:
|
|
19
|
+
report: - works/ already exists
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### 2. Configure Bash Permissions
|
|
23
|
+
|
|
24
|
+
**Ask the user first:** "에이전트에 필요한 Bash 권한을 .claude/settings.local.json에 자동 설정할까요? (recommended) [Y/n]"
|
|
25
|
+
|
|
26
|
+
If the user approves (or says yes/Y/확인):
|
|
27
|
+
|
|
28
|
+
Read `.claude/settings.local.json` (create if not exists). Merge the following permissions into `permissions.allow` array — **skip any that already exist** (do not duplicate):
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
[
|
|
32
|
+
"Read(/**)",
|
|
33
|
+
"Edit(/**)",
|
|
34
|
+
"Write(/**)",
|
|
35
|
+
"Read(**)",
|
|
36
|
+
"Edit(**)",
|
|
37
|
+
"Write(**)",
|
|
38
|
+
"Bash(ls:*)",
|
|
39
|
+
"Bash(cat:*)",
|
|
40
|
+
"Bash(mkdir:*)",
|
|
41
|
+
"Bash(basename:*)",
|
|
42
|
+
"Bash(find:*)",
|
|
43
|
+
"Bash(wc:*)",
|
|
44
|
+
"Bash(sort:*)",
|
|
45
|
+
"Bash(tail:*)",
|
|
46
|
+
"Bash(head:*)",
|
|
47
|
+
"Bash(echo:*)",
|
|
48
|
+
"Bash(printf:*)",
|
|
49
|
+
"Bash(grep:*)",
|
|
50
|
+
"Bash(sed:*)",
|
|
51
|
+
"Bash(cut:*)",
|
|
52
|
+
"Bash(tr:*)",
|
|
53
|
+
"Bash(node:*)",
|
|
54
|
+
"Bash(npm run:*)",
|
|
55
|
+
"Bash(npm test:*)",
|
|
56
|
+
"Bash(bun run:*)",
|
|
57
|
+
"Bash(yarn:*)",
|
|
58
|
+
"Bash(cargo:*)",
|
|
59
|
+
"Bash(go build:*)",
|
|
60
|
+
"Bash(go test:*)",
|
|
61
|
+
"Bash(python:*)",
|
|
62
|
+
"Bash(ruff:*)",
|
|
63
|
+
"Bash(make:*)",
|
|
64
|
+
"Bash(git:*)",
|
|
65
|
+
"Bash(curl:*)"
|
|
66
|
+
]
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Preserve any existing entries in `permissions.allow` and `permissions.deny` — only add missing ones.
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
if permissions added:
|
|
73
|
+
report: ✓ {N} permissions added to .claude/settings.local.json (total: {T})
|
|
74
|
+
else if skipped by user:
|
|
75
|
+
report: - Skipped permission setup
|
|
76
|
+
else:
|
|
77
|
+
report: - All permissions already configured
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### 3. Summary
|
|
81
|
+
|
|
82
|
+
After all steps, show a summary:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
uc-taskmanager initialized!
|
|
86
|
+
|
|
87
|
+
✓ works/ directory ready
|
|
88
|
+
✓ Bash permissions configured
|
|
89
|
+
|
|
90
|
+
Next: Type [new-feature] Add a hello world feature
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Arguments
|
|
94
|
+
|
|
95
|
+
$ARGUMENTS
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# sdd-pipeline references
|
|
2
|
+
|
|
3
|
+
파이프라인 에이전트(specifier, planner, scheduler, builder, verifier, committer)가 참조하는 규칙/스키마 문서 모음.
|
|
4
|
+
|
|
5
|
+
직접 사용자 호출용이 아니라 에이전트 내부 참조용입니다.
|
|
6
|
+
|
|
7
|
+
## 포함 문서
|
|
8
|
+
|
|
9
|
+
| File | Description |
|
|
10
|
+
|------|-------------|
|
|
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 규칙 |
|
|
@@ -0,0 +1,279 @@
|
|
|
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.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Context Handoff Policy
|
|
2
|
+
|
|
3
|
+
Sliding window context transfer rules between agents.
|
|
4
|
+
|
|
5
|
+
## Sliding Window
|
|
6
|
+
|
|
7
|
+
| Step Distance | Detail Level | Rule |
|
|
8
|
+
|---------------|-------------|------|
|
|
9
|
+
| Immediate (1 step) | `FULL` | All 4 fields transmitted |
|
|
10
|
+
| 2 steps back | `SUMMARY` | `what` field only, 1-3 lines |
|
|
11
|
+
| 3+ steps back | `DROP` | Omitted |
|
|
12
|
+
|
|
13
|
+
## Context-Handoff 4 Fields
|
|
14
|
+
|
|
15
|
+
| Field | FULL | SUMMARY | Content |
|
|
16
|
+
|-------|:----:|:-------:|---------|
|
|
17
|
+
| `what` | ✅ | ✅ | Summary of changes/verification (2-5 lines) |
|
|
18
|
+
| `why` | ✅ | ❌ | Decision rationale (2-4 lines) |
|
|
19
|
+
| `caution` | ✅ | ❌ | Caveats, conditional completion (1-3 lines) |
|
|
20
|
+
| `incomplete` | ✅ | ❌ | Incomplete items (1-2 lines, "None" if empty) |
|
|
21
|
+
|
|
22
|
+
## Pipeline Stage Input/Output
|
|
23
|
+
|
|
24
|
+
### Builder
|
|
25
|
+
|
|
26
|
+
Input: TASK spec + dependent TASK result.md context-handoff (sliding window)
|
|
27
|
+
|
|
28
|
+
Output:
|
|
29
|
+
```xml
|
|
30
|
+
<task-result status="PASS|FAIL">
|
|
31
|
+
<context-handoff from="builder" detail-level="FULL">
|
|
32
|
+
<what>Changes made</what><why>Rationale</why><caution>Caveats</caution><incomplete>Incomplete items</incomplete>
|
|
33
|
+
</context-handoff>
|
|
34
|
+
</task-result>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Verifier
|
|
38
|
+
|
|
39
|
+
Input: TASK spec + Builder context-handoff (FULL)
|
|
40
|
+
|
|
41
|
+
Output:
|
|
42
|
+
```xml
|
|
43
|
+
<task-result status="PASS|FAIL">
|
|
44
|
+
<context-handoff from="verifier" detail-level="FULL">
|
|
45
|
+
<what>Verification results</what><why>Judgment rationale</why><caution>Manual checks needed</caution><incomplete>Items that could not be verified</incomplete>
|
|
46
|
+
</context-handoff>
|
|
47
|
+
</task-result>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Committer
|
|
51
|
+
|
|
52
|
+
Input: Verifier context-handoff (FULL) + Builder context-handoff (SUMMARY) + progress.md (gate)
|
|
53
|
+
|
|
54
|
+
Processing:
|
|
55
|
+
1. progress.md gate: exists + Status=COMPLETED + Files changed is not empty
|
|
56
|
+
2. Gate passed → write result.md + git commit
|
|
57
|
+
3. Gate failed → return FAIL (triggers scheduler retry)
|
|
58
|
+
|
|
59
|
+
Output: → `{REFERENCES_DIR}/file-content-schema.md` § 4 reference
|
|
60
|
+
|
|
61
|
+
## Inter-TASK Dependency Transfer
|
|
62
|
+
|
|
63
|
+
- Immediate dependent TASK: context-handoff **FULL** (all 4 fields)
|
|
64
|
+
- 2 steps back: **SUMMARY** (what only)
|
|
65
|
+
- 3+ steps back: **DROP**
|
|
66
|
+
|
|
67
|
+
## Scheduler Dispatch
|
|
68
|
+
|
|
69
|
+
```xml
|
|
70
|
+
<!-- Verifier: Builder FULL -->
|
|
71
|
+
<dispatch to="verifier">
|
|
72
|
+
<context-handoff from="builder" detail-level="FULL">...</context-handoff>
|
|
73
|
+
</dispatch>
|
|
74
|
+
|
|
75
|
+
<!-- Committer: Verifier FULL + Builder SUMMARY -->
|
|
76
|
+
<dispatch to="committer">
|
|
77
|
+
<context-handoff from="verifier" detail-level="FULL">...</context-handoff>
|
|
78
|
+
<context-handoff from="builder" detail-level="SUMMARY"><what>...</what></context-handoff>
|
|
79
|
+
</dispatch>
|
|
80
|
+
|
|
81
|
+
<!-- Next TASK Builder: dependency distance applied -->
|
|
82
|
+
<dispatch to="builder" task="TASK-YY">
|
|
83
|
+
<previous-results>
|
|
84
|
+
<context-handoff from="prev-task" task="TASK-XX" detail-level="FULL">...</context-handoff>
|
|
85
|
+
<context-handoff from="prev-prev-task" task="TASK-WW" detail-level="SUMMARY"><what>...</what></context-handoff>
|
|
86
|
+
</previous-results>
|
|
87
|
+
</dispatch>
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Committer Retry
|
|
91
|
+
|
|
92
|
+
1. Failure cause: progress.md not found / Status≠COMPLETED / No files changed
|
|
93
|
+
2. Re-dispatch to builder including existing progress.md
|
|
94
|
+
3. Maximum 2 retries (3 attempts total). 3 failures → TASK FAILED, pipeline halted
|