uctm 1.5.1 → 1.5.3

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 (44) 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 +2 -1
  14. package/references/agent-flow.md +200 -0
  15. package/{agents → references}/context-policy.md +5 -6
  16. package/{skills/sdd-pipeline/references → references}/file-content-schema.md +6 -57
  17. package/references/ref-cache-protocol.md +31 -0
  18. package/{agents → references}/shared-prompt-sections.md +104 -42
  19. package/references/work-activity-log.md +26 -0
  20. package/{skills/sdd-pipeline/references → references}/xml-schema.md +2 -41
  21. package/skills/sdd-pipeline/SKILL.md +8 -6
  22. package/skills/work-pipeline/SKILL.md +31 -8
  23. package/skills/work-status/SKILL.md +2 -2
  24. package/.claude-plugin/.claude-plugin/plugin.json +0 -29
  25. package/agents/agent-flow.md +0 -279
  26. package/agents/file-content-schema.md +0 -249
  27. package/agents/ko/agent-flow.md +0 -231
  28. package/agents/ko/builder.md +0 -164
  29. package/agents/ko/committer.md +0 -202
  30. package/agents/ko/context-policy.md +0 -94
  31. package/agents/ko/file-content-schema.md +0 -249
  32. package/agents/ko/planner.md +0 -161
  33. package/agents/ko/scheduler.md +0 -189
  34. package/agents/ko/shared-prompt-sections.md +0 -250
  35. package/agents/ko/specifier.md +0 -194
  36. package/agents/ko/verifier.md +0 -149
  37. package/agents/ko/work-activity-log.md +0 -47
  38. package/agents/ko/xml-schema.md +0 -109
  39. package/agents/work-activity-log.md +0 -47
  40. package/agents/xml-schema.md +0 -159
  41. package/skills/sdd-pipeline/references/agent-flow.md +0 -279
  42. package/skills/sdd-pipeline/references/context-policy.md +0 -94
  43. package/skills/sdd-pipeline/references/shared-prompt-sections.md +0 -250
  44. package/skills/sdd-pipeline/references/work-activity-log.md +0 -47
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.3",
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,6 +10,7 @@
10
10
  "bin/",
11
11
  "lib/",
12
12
  "agents/",
13
+ "references/",
13
14
  ".agent/",
14
15
  ".claude-plugin/",
15
16
  "skills/"
@@ -0,0 +1,200 @@
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. For each TASK (ascending order):
46
+ a. Invoke builder (per-TASK dispatch XML as prompt)
47
+ b. Invoke verifier+committer (builder result as prompt) — verify then commit in one spawn
48
+ c. If incomplete TASKs remain, continue to next TASK
49
+ ```
50
+
51
+ > Specifier+Planner combined: specifier.md role first (Requirement.md), then planner.md role (PLAN.md + TASKs) in one spawn.
52
+ > Each TASK must complete the full builder → verifier+committer cycle before the next TASK starts.
53
+
54
+ ---
55
+
56
+ ## Full Mode (With Scheduler)
57
+
58
+ ```
59
+ 1. Invoke specifier+planner (single spawn) → Requirement.md + PLAN.md + TASKs + execution-mode: full
60
+ 2. ⛔ STOP — Present Requirement.md + PLAN.md + TASK list and WAIT for approval
61
+ 3. Invoke scheduler → DAG analysis + READY TASK + returns builder dispatch XML
62
+ 4. Invoke builder (dispatch XML as prompt) → implementation
63
+ 5. Invoke verifier+committer (builder result as prompt) → verify then commit in one spawn
64
+ 6. If incomplete TASKs remain, return to step 3
65
+ ```
66
+
67
+ Parallel execution: When scheduler returns multiple READY TASKs, invoke builders concurrently.
68
+
69
+ ---
70
+
71
+ ## Resuming Existing WORK
72
+
73
+ Resume pipeline for a WORK that already has PLAN.md + TASKs:
74
+
75
+ ```
76
+ 1. Read last line of works/{WORK_ID}/work_{WORK_ID}.log to determine current state
77
+ Key rule: *_START = interrupted (redo that step), *_DONE = completed (move to next)
78
+
79
+ - COMMITTER_DONE — TASK-NN → TASK-NN completed, resume from next TASK
80
+ - COMMITTER_START — TASK-NN → interrupted, redo verifier+committer for TASK-NN
81
+ - VERIFIER_DONE — TASK-NN → verified, resume with committer for TASK-NN
82
+ - VERIFIER_START — TASK-NN → interrupted, redo verifier+committer for TASK-NN
83
+ - BUILDER_DONE — TASK-NN → built, resume with verifier+committer for TASK-NN
84
+ - BUILDER_START — TASK-NN → interrupted, redo builder for TASK-NN
85
+ - PLANNER_DONE → planning done, start first TASK
86
+ - PLANNER_START → interrupted, redo specifier+planner
87
+ - SPECIFIER_DONE → specifier done, redo planner
88
+ - SPECIFIER_START → interrupted, redo specifier+planner
89
+ - No log file → start from scratch
90
+
91
+ 2. For each remaining TASK:
92
+ a. Invoke builder → implementation
93
+ b. Invoke verifier+committer → verify then commit in one spawn
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Combined Agent Invocation
99
+
100
+ ### Specifier+Planner (single spawn)
101
+
102
+ - Model: opus
103
+ - Prompt: "Role 1 — Specifier (specifier.md): create Requirement.md. Role 2 — Planner (planner.md): create PLAN.md + TASKs. Execute sequentially. Each role sends its own START/DONE callback + activity log."
104
+ - Returns: Requirement.md + PLAN.md + TASK files + execution-mode
105
+
106
+ ### Verifier+Committer (single spawn)
107
+
108
+ - Model: haiku
109
+ - Prompt: "Role 1 — Verifier (verifier.md): verify build/lint/test. Role 2 — Committer (committer.md): create result.md + git commit. If verification FAILS, skip Role 2. Each role sends its own START/DONE callback + activity log."
110
+ - On PASS: verification result + commit hash
111
+ - On FAIL: verification failure only (no commit)
112
+
113
+ ---
114
+
115
+ ## Agent Role Summary
116
+
117
+ | Agent | Role | Model | Combined With |
118
+ |-------|------|-------|---------------|
119
+ | specifier | Requirement analysis | opus | + planner (pipeline/full) |
120
+ | planner | PLAN + TASK decomposition | opus | combined into specifier spawn |
121
+ | scheduler | DAG management + dispatch | haiku | standalone |
122
+ | builder | Code implementation | sonnet | standalone |
123
+ | verifier | Build/lint/test verification | haiku | + committer |
124
+ | committer | Result report + git commit | haiku | combined into verifier spawn |
125
+
126
+ ---
127
+
128
+ ## Sub-agent Spawn Count by Mode
129
+
130
+ | Mode | Spec+Plan | Scheduler | Builder | Veri+Commit | Total |
131
+ |------|:---------:|:---------:|:-------:|:-----------:|:-----:|
132
+ | direct | 1 (assumed) | — | 1 | 1 | **3** |
133
+ | pipeline (N TASKs) | 1 (combined) | — | N | N | **1 + 2N** |
134
+ | full (N TASKs) | 1 (combined) | 1 | N | N | **2 + 2N** |
135
+
136
+ **Before vs After (6 TASKs):**
137
+
138
+ | | Before | After | Reduction |
139
+ |---|:---:|:---:|:---:|
140
+ | Spawns | 2 + 3×6 = 20 | 2 + 2×6 = 14 | **-30%** |
141
+
142
+ ---
143
+
144
+ ## Approval Gates (CRITICAL)
145
+
146
+ > **MUST STOP and wait for explicit user approval before invoking the next agent.**
147
+ > Do NOT proceed until the user says "approve", "승인", "proceed", "go ahead", or equivalent.
148
+ > The only exception is auto mode — when the user's original message contains "auto" or "자동으로".
149
+
150
+ | Mode | Approvals | Timing | What to show user |
151
+ |------|:---------:|--------|-------------------|
152
+ | direct | 1 | After Specifier completes | Requirement.md + PLAN.md + TASK-00.md summary |
153
+ | pipeline/full | 1 | After Specifier+Planner completes | Requirement.md + PLAN.md + TASK list |
154
+ | auto-approve | 0 | — | Skip all approval gates |
155
+
156
+ > Note: pipeline/full now has **1 approval** (not 2), since specifier and planner run in one spawn.
157
+
158
+ **How to request approval:**
159
+ 1. Present a summary of what the specifier+planner created (files, scope, execution-mode)
160
+ 2. Ask: "Proceed?" or equivalent
161
+ 3. **WAIT for user response** — do NOT invoke builder until approved
162
+
163
+ ---
164
+
165
+ ## References Directory Passing (REQUIRED)
166
+
167
+ Main Claude MUST pass the references directory path to every sub-agent invocation.
168
+ This allows sub-agents to locate their reference files regardless of installation method (npm or plugin).
169
+
170
+ **How to pass:**
171
+ - Prepend `REFERENCES_DIR={absolute_path}` at the top of the prompt for every Task tool call
172
+ - For npm installations: use `.claude/references` (default, resolved from project root)
173
+ - For plugin installations: derive from the skill's "Base directory" (`{base_dir}/../../references`)
174
+
175
+ **Example:**
176
+ ```
177
+ REFERENCES_DIR=C:/Users/me/.claude/plugins/cache/uc-taskmanager/abc123/references
178
+
179
+ <dispatch to="builder" ...>
180
+ ...
181
+ </dispatch>
182
+ ```
183
+
184
+ If REFERENCES_DIR is not available (e.g., npm installation without plugin), sub-agents fall back to `.claude/references/`.
185
+
186
+ ---
187
+
188
+ ## Context Handoff (Sliding Window)
189
+
190
+ | Distance | Level | Content |
191
+ |----------|-------|---------|
192
+ | Previous | FULL | what + why + caution + incomplete |
193
+ | 2 steps back | SUMMARY | what 1-2 lines |
194
+ | 3+ steps | DROP | Not passed |
195
+
196
+ ---
197
+
198
+ ## Reference Loading
199
+
200
+ Each sub-agent reads its own reference files from `{REFERENCES_DIR}/` at startup. Main Claude does NOT read reference files — only `agent-flow.md`.
@@ -49,12 +49,11 @@ Output:
49
49
 
50
50
  ### Committer
51
51
 
52
- Input: Verifier context-handoff (FULL) + Builder context-handoff (SUMMARY) + progress.md (gate)
52
+ Input: Verifier context-handoff (FULL) + Builder context-handoff (SUMMARY)
53
53
 
54
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)
55
+ 1. Verify builder completed successfully (check context-handoff status)
56
+ 2. Write result.md + git commit
58
57
 
59
58
  Output: → `{REFERENCES_DIR}/file-content-schema.md` § 4 reference
60
59
 
@@ -89,6 +88,6 @@ Output: → `{REFERENCES_DIR}/file-content-schema.md` § 4 reference
89
88
 
90
89
  ## Committer Retry
91
90
 
92
- 1. Failure cause: progress.md not found / Status≠COMPLETED / No files changed
93
- 2. Re-dispatch to builder including existing progress.md
91
+ 1. Failure cause: verification FAIL / No files changed
92
+ 2. Re-dispatch to builder
94
93
  3. Maximum 2 retries (3 attempts total). 3 failures → TASK FAILED, pipeline halted
@@ -8,10 +8,8 @@ Single source of truth for pipeline artifact file formats.
8
8
  |----------------|-------------------|----------------------|
9
9
  | `PLAN.md` | § 1 | `parsePlanMd()` parsing failure, scheduler inoperable |
10
10
  | `TASK-XX.md` | § 2 | `parseTaskFilename()` DB registration missed |
11
- | `TASK-XX_progress.md` | § 3 | committer gate FAIL |
12
- | `TASK-XX_result.md` | § 4 | context-handoff missing |
13
- | `TASK-XX_result.md` (direct) | § 5 | result.md recognition failure |
14
- | `PROGRESS.md` | § 6 | scheduler progress tracking inoperable |
11
+ | `TASK-XX_result.md` | § 3 | context-handoff missing |
12
+ | `TASK-XX_result.md` (direct) | § 4 | result.md recognition failure |
15
13
 
16
14
  ---
17
15
 
@@ -111,32 +109,7 @@ Path: `works/{WORK_ID}/TASK-XX.md`
111
109
 
112
110
  ---
113
111
 
114
- ## § 3. TASK-XX_progress.md
115
-
116
- Path: `works/{WORK_ID}/TASK-XX_progress.md`
117
-
118
- ```markdown
119
- # TASK-XX Progress
120
-
121
- - Status: {PENDING | STARTED | IN_PROGRESS | COMPLETED}
122
- - Started: {ISO 8601}
123
- - Updated: {ISO 8601}
124
- - Files changed:
125
- - `path/to/file` — {CREATE | MODIFY | DELETE}
126
- ```
127
-
128
- | Timing | Status |
129
- |--------|--------|
130
- | planner template | `PENDING` |
131
- | builder starts | `STARTED` |
132
- | file changes in progress | `IN_PROGRESS` |
133
- | completed | `COMPLETED` |
134
-
135
- committer gate: file exists + `Status: COMPLETED` + Files changed is not empty
136
-
137
- ---
138
-
139
- ## § 4. TASK-XX_result.md (full / pipeline)
112
+ ## § 3. TASK-XX_result.md (full / pipeline)
140
113
 
141
114
  Path: `works/{WORK_ID}/TASK-XX_result.md`
142
115
 
@@ -189,7 +162,7 @@ None
189
162
 
190
163
  ---
191
164
 
192
- ## § 5. TASK-XX_result.md (direct mode)
165
+ ## § 4. TASK-XX_result.md (direct mode)
193
166
 
194
167
  ```markdown
195
168
  # TASK-00 Result
@@ -212,38 +185,14 @@ None
212
185
 
213
186
  ---
214
187
 
215
- ## § 6. PROGRESS.md
216
-
217
- Path: `works/{WORK_ID}/PROGRESS.md`
218
-
219
- ```markdown
220
- # {WORK_ID} Progress
221
-
222
- > WORK: {title}
223
- > Last updated: {timestamp}
224
- > Mode: manual | auto
225
-
226
- | TASK | Title | Status | Commit | Duration |
227
- |------|-------|--------|--------|----------|
228
- | TASK-00 | {title} | ✅ Done | abc1234 | 12min |
229
- | TASK-01 | {title} | 🔄 In Progress | — | — |
230
-
231
- ## Log
232
- - [10:00] TASK-00 started
233
- - [10:12] TASK-00 verified ✅, committed abc1234
234
- ```
235
-
236
- ---
237
-
238
- ## § 7. File Naming Rules
188
+ ## § 5. File Naming Rules
239
189
 
240
190
  | Type | Format | Created By |
241
191
  |------|--------|------------|
242
192
  | Requirement | `Requirement.md` | specifier |
243
193
  | WORK plan | `PLAN.md` | planner / specifier |
244
194
  | TASK plan | `TASK-NN.md` | planner / specifier |
245
- | TASK progress | `TASK-NN_progress.md` | planner / specifier (template) / builder (update) |
246
195
  | TASK result | `TASK-NN_result.md` | committer |
247
- | WORK progress | `PROGRESS.md` | scheduler |
196
+ | Activity log | `work_WORK-NN.log` | all agents (append) |
248
197
 
249
198
  `WORK-NN-TASK-NN.md` format prohibited → `parseTaskFilename()` cannot recognize it.
@@ -0,0 +1,31 @@
1
+ # ref-cache Protocol
2
+
3
+ ## Overview
4
+
5
+ ref-cache is a mechanism to avoid redundant file reads across sub-agent invocations within a pipeline.
6
+ Reference files are passed between agents via `<ref-cache>` XML elements instead of being re-read from disk each time.
7
+
8
+ ## Protocol (4 Steps)
9
+
10
+ 1. **Check** if `<ref-cache>` exists in the received dispatch XML
11
+ 2. For each required reference file:
12
+ - If present in ref-cache → **SKIP file read**, use cached content
13
+ - If absent from ref-cache → Read from `{REFERENCES_DIR}/{filename}.md` and add to ref-cache
14
+ 3. On task completion, include the merged `<ref-cache>` in the returned task-result XML
15
+ 4. **Backward compatibility**: If dispatch contains no `<ref-cache>`, read all reference files normally (existing behavior)
16
+
17
+ ## ref-cache XML Format
18
+
19
+ See `xml-schema.md` § 4 for the full schema.
20
+
21
+ ```xml
22
+ <ref-cache>
23
+ <ref key="file-content-schema">...content...</ref>
24
+ <ref key="shared-prompt-sections">...content...</ref>
25
+ <!-- one <ref> per loaded reference file -->
26
+ </ref-cache>
27
+ ```
28
+
29
+ ## Chain Propagation
30
+
31
+ See `agent-flow.md` § ref-cache Chain Propagation for how ref-cache flows between agents in the pipeline.