legion-cc 0.18.0 → 0.19.1

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.
@@ -170,12 +170,12 @@ Cap at 10.
170
170
  Spawn Planner:
171
171
  ```
172
172
  Agent(team_name: ..., name: "planner", subagent_type: "planner",
173
- prompt: "## Assignment\n**Team**: <team-name>\n**Your task ID**: <task-4-id>\n\n## Task\n<the user's original request>\n\n## Phase 1 Bundle Section Task IDs\nRead each Bundle Section using TaskGet(taskId) — the section is in the task's `description` field. Each section starts with `## Bundle Section N:`.\n- **Architect (Bundle Section 1)**: TaskGet('<task-1-id>')\n- **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')\n- **Context Curator (Bundle Section 3)**: TaskGet('<task-3-id>')\n\nRead all three Bundle Sections, assemble the Bundle, then produce an Execution Pack with sub-tasks, pseudo-diffs, acceptance criteria, risks, and rollback. Use ToolSearch('+legion-sequential-thinking') before plan construction. Read Infrastructure Notes sections (§1.6, §2.7) from Bundle Sections. If legion-memory MCP is available, query it for cross-session context via mcp__legion-memory__read_graph. Include User Questions section (≤3) only if critical clarifications are needed.\n\n## End of Work Protocol (MANDATORY)\nTaskUpdate(taskId: '<task-4-id>', status: 'completed', description: '<your full Execution Pack>')\nIf you have user questions, also: SendMessage(type: 'message', recipient: 'legion-orchestrator', content: '<questions>', summary: 'Clarifying questions for user')\nDo NOT go idle without calling TaskUpdate.")
173
+ prompt: "## Assignment\n**Team**: <team-name>\n**Your task ID**: <task-4-id>\n\n## Task\n<the user's original request>\n\n## Phase 1 Bundle Section Task IDs\nRead each Bundle Section using TaskGet(taskId) — the section is in the task's `description` field. Each section starts with `## Bundle Section N:`.\n- **Architect (Bundle Section 1)**: TaskGet('<task-1-id>')\n- **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')\n- **Context Curator (Bundle Section 3)**: TaskGet('<task-3-id>')\n\nRead all three Bundle Sections, assemble the Bundle, then produce an Execution Pack with sub-tasks, pseudo-diffs, acceptance criteria, risks, and rollback. Use ToolSearch('+legion-sequential-thinking') and ToolSearch('+legion-memory') before plan construction. Read Infrastructure Notes sections (§1.6, §2.7) from Bundle Sections. Query mcp__legion-memory__read_graph for cross-session context. If legion-memory MCP is unavailable, proceed without. Include User Questions section (≤3) only if critical clarifications are needed.\n\n## End of Work Protocol (MANDATORY)\nTaskUpdate(taskId: '<task-4-id>', status: 'completed', description: '<your full Execution Pack>')\nIf you have user questions, also: SendMessage(type: 'message', recipient: 'legion-orchestrator', content: '<questions>', summary: 'Clarifying questions for user')\nDo NOT go idle without calling TaskUpdate.")
174
174
  ```
175
175
  Spawn Memory (fire-and-forget):
176
176
  ```
177
- Agent(team_name: ..., name: "memory", subagent_type: "memory",
178
- prompt: "## Assignment\n**Team**: <team-name>\n**Your task ID**: <task-6-id>\n\n## Phase 1 Bundle Section Task IDs\nRead Bundle Sections 1 and 2 using TaskGet(taskId) — the section is in the task's `description` field.\n- **Architect (Bundle Section 1)**: TaskGet('<task-1-id>')\n- **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')\n\nExtract key findings and store them in project memory via MCP legion-memory server. Pay special attention to Infrastructure Notes (§1.6, §2.7) — store these as separate named entities using mcp__legion-memory__create_entities and mcp__legion-memory__add_observations.\n\n## End of Work Protocol (MANDATORY)\nTaskUpdate(taskId: '<task-6-id>', status: 'completed', description: '<summary of stored memories>')\nDo NOT go idle without calling TaskUpdate.")
177
+ Agent(team_name: ..., name: "memory", subagent_type: "general-purpose",
178
+ prompt: "## Assignment\n**Team**: <team-name>\n**Your task ID**: <task-6-id>\n\n## Phase 1 Bundle Section Task IDs\nRead Bundle Sections 1 and 2 using TaskGet(taskId) — the section is in the task's `description` field.\n- **Architect (Bundle Section 1)**: TaskGet('<task-1-id>')\n- **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')\n\nLoad MCP tools first: ToolSearch(\"+legion-memory\"). Then extract key findings and store them in project memory via MCP legion-memory server. Pay special attention to Infrastructure Notes (§1.6, §2.7) — store these as separate named entities using mcp__legion-memory__create_entities and mcp__legion-memory__add_observations. If MCP is unavailable, note the error and complete anyway.\n\n## End of Work Protocol (MANDATORY)\nTaskUpdate(taskId: '<task-6-id>', status: 'completed', description: '<summary of stored memories>')\nDo NOT go idle without calling TaskUpdate.")
179
179
  ```
180
180
  6. Wait for plan — poll `TaskList` until tasks 4 and 6 are `status: "completed"`
181
181
 
@@ -386,7 +386,7 @@ while not all [t1, t2, t3] completed: check TaskList()
386
386
  // Spawn Planner AND Memory in parallel (Phase 2)
387
387
  Agent(..., name: "planner", prompt: "## Assignment\n**Your task ID**: " + t4.id + "\n\n## Task\n<the user's original request>\n\n## Phase 1 Bundle Section Task IDs\nRead each Bundle Section using TaskGet(taskId). Each starts with ## Bundle Section N:.\n- Architect (§1): TaskGet('" + t1.id + "')\n- Code Analyst (§2): TaskGet('" + t2.id + "')\n- Context Curator (§3): TaskGet('" + t3.id + "')\n\nAssemble Bundle, produce Execution Pack with optional user questions (≤3).\n\n## End of Work Protocol\nTaskUpdate(taskId: '" + t4.id + "', ...)")
388
388
 
389
- Agent(..., name: "memory", subagent_type: "memory",
389
+ Agent(..., name: "memory", subagent_type: "general-purpose",
390
390
  prompt: "## Assignment\n**Your task ID**: " + t6.id + "\n\n## Phase 1 Bundle Section Task IDs\n- Architect (§1): TaskGet('" + t1.id + "')\n- Code Analyst (§2): TaskGet('" + t2.id + "')\n\nExtract key findings and store in project memory via MCP legion-memory server.\n\n## End of Work Protocol\nTaskUpdate(taskId: '" + t6.id + "', ...)")
391
391
 
392
392
  // Phase 2.5: Check for Planner questions → AskUserQuestion if present
package/agents/memory.md CHANGED
@@ -49,6 +49,27 @@ You do NOT:
49
49
 
50
50
  If the legion-memory MCP server is unavailable, note the error in your task description and complete anyway — the pipeline must not be blocked.
51
51
 
52
+ ## Codebase Mode
53
+
54
+ When spawned by the **codebase pipeline** (`/legion:codebase`), you read analysis files instead of Bundle Sections:
55
+
56
+ 1. The spawn prompt specifies file paths in `.legion/codebase/` and `.legion/codebase/agents/`
57
+ 2. Read each file using the Read tool (not TaskGet)
58
+ 3. For each file, create a named entity (`codebase:{name}`) with type `codebase-analysis`
59
+ 4. Add condensed observations — key facts, not full file dumps
60
+ 5. Create relations between related entities
61
+ 6. Use consistent entity names so re-runs are idempotent
62
+
63
+ Entity naming convention:
64
+ - `codebase:architecture` — from `architecture.md`
65
+ - `codebase:conventions` — from `conventions.md`
66
+ - `codebase:files` — from `files.md`
67
+ - `codebase:dependencies` — from `dependencies.md`
68
+ - `codebase:api` — from `api.md`
69
+ - `codebase:architect-brief` — from `agents/architect-brief.md`
70
+ - `codebase:code-analyst-brief` — from `agents/code-analyst-brief.md`
71
+ - `codebase:context-curator-brief` — from `agents/context-curator-brief.md`
72
+
52
73
  ## MCP Tools
53
74
 
54
75
  If MCP servers are available in the project, you MUST:
package/bin/install.js CHANGED
@@ -52,6 +52,8 @@ const libTarget = path.join(legionHome, 'bin', 'lib');
52
52
  const pkgTarget = path.join(legionHome, 'package.json');
53
53
  const settingsPath = path.join(configDir, 'settings.json');
54
54
  const claudeJsonPath = path.join(os.homedir(), '.claude.json');
55
+ const memoryDataDir = path.join(os.homedir(), '.legion');
56
+ const memoryFilePath = path.join(memoryDataDir, 'memory.jsonl');
55
57
  const agentsSource = path.join(projectRoot, 'agents');
56
58
  const agentsTarget = path.join(configDir, 'agents');
57
59
  const commandsSource = path.join(projectRoot, 'commands', 'legion');
@@ -714,6 +716,7 @@ What gets installed:
714
716
  ~/.claude/legion/package.json Version metadata
715
717
  ~/.claude/settings.json Hook registrations (merged)
716
718
  ~/.claude.json MCP server registrations (merged)
719
+ ~/.legion/memory.jsonl Memory data file (preserved on uninstall)
717
720
  `);
718
721
  }
719
722
 
@@ -803,7 +806,25 @@ function install() {
803
806
  log('Registering MCP permissions...');
804
807
  registerMcpPermissions();
805
808
 
806
- // 10. Register MCP servers in ~/.claude.json
809
+ // 10. Ensure memory data file exists
810
+ log('Ensuring memory data file...');
811
+ ensureDir(memoryDataDir);
812
+ if (flags.dryRun) {
813
+ log(`${prefix}create ${memoryFilePath} (if not exists)`);
814
+ } else {
815
+ try {
816
+ fs.writeFileSync(memoryFilePath, '', { flag: 'wx', mode: 0o600 });
817
+ log(`created ${path.basename(memoryFilePath)}`);
818
+ } catch (err) {
819
+ if (err.code === 'EEXIST') {
820
+ log(`skip (exists) ${path.basename(memoryFilePath)}`);
821
+ } else {
822
+ throw err;
823
+ }
824
+ }
825
+ }
826
+
827
+ // 11. Register MCP servers in ~/.claude.json
807
828
  log('Registering MCP servers...');
808
829
  registerMcpServers();
809
830
 
@@ -870,6 +891,9 @@ function uninstall() {
870
891
  }
871
892
  } catch (_e) { /* ignore */ }
872
893
 
894
+ // 9. Note: ~/.legion/ is preserved (user data)
895
+ log('Note: ~/.legion/ preserved (contains user memory data)');
896
+
873
897
  console.log('─'.repeat(40));
874
898
  if (flags.dryRun) {
875
899
  console.log('Dry-run complete. No files were modified.\n');
@@ -125,12 +125,12 @@ Escalation: shutdown quick team → create cycle team → run full Cycle Pipelin
125
125
  Spawn Planner:
126
126
  ```
127
127
  Agent(team_name: ..., name: "planner", subagent_type: "planner",
128
- prompt: "## Assignment\n**Team**: <team-name>\n**Your task ID**: <task-4-id>\n\n## Task\n<the user's original request>\n\n## Phase 1 Bundle Section Task IDs\nRead each Bundle Section using TaskGet(taskId) — the section is in the task's `description` field. Each section starts with `## Bundle Section N:`.\n- **Architect (Bundle Section 1)**: TaskGet('<task-1-id>')\n- **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')\n- **Context Curator (Bundle Section 3)**: TaskGet('<task-3-id>')\n\nRead all three Bundle Sections, assemble the Bundle, then produce an Execution Pack with sub-tasks, pseudo-diffs, acceptance criteria, risks, and rollback. Use ToolSearch('+legion-sequential-thinking') before plan construction. Read Infrastructure Notes sections (§1.6, §2.7) from Bundle Sections. If legion-memory MCP is available, query it for cross-session context via mcp__legion-memory__read_graph. Include User Questions section (≤3) only if critical clarifications are needed.\n\n## End of Work Protocol (MANDATORY)\nTaskUpdate(taskId: '<task-4-id>', status: 'completed', description: '<your full Execution Pack>')\nIf you have user questions, also: SendMessage(type: 'message', recipient: 'legion-orchestrator', content: '<questions>', summary: 'Clarifying questions for user')\nDo NOT go idle without calling TaskUpdate.")
128
+ prompt: "## Assignment\n**Team**: <team-name>\n**Your task ID**: <task-4-id>\n\n## Task\n<the user's original request>\n\n## Phase 1 Bundle Section Task IDs\nRead each Bundle Section using TaskGet(taskId) — the section is in the task's `description` field. Each section starts with `## Bundle Section N:`.\n- **Architect (Bundle Section 1)**: TaskGet('<task-1-id>')\n- **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')\n- **Context Curator (Bundle Section 3)**: TaskGet('<task-3-id>')\n\nRead all three Bundle Sections, assemble the Bundle, then produce an Execution Pack with sub-tasks, pseudo-diffs, acceptance criteria, risks, and rollback. Use ToolSearch('+legion-sequential-thinking') and ToolSearch('+legion-memory') before plan construction. Read Infrastructure Notes sections (§1.6, §2.7) from Bundle Sections. Query mcp__legion-memory__read_graph for cross-session context. If legion-memory MCP is unavailable, proceed without. Include User Questions section (≤3) only if critical clarifications are needed.\n\n## End of Work Protocol (MANDATORY)\nTaskUpdate(taskId: '<task-4-id>', status: 'completed', description: '<your full Execution Pack>')\nIf you have user questions, also: SendMessage(type: 'message', recipient: 'legion-orchestrator', content: '<questions>', summary: 'Clarifying questions for user')\nDo NOT go idle without calling TaskUpdate.")
129
129
  ```
130
130
  Spawn Memory (fire-and-forget):
131
131
  ```
132
- Agent(team_name: ..., name: "memory", subagent_type: "memory",
133
- prompt: "## Assignment\n**Team**: <team-name>\n**Your task ID**: <task-6-id>\n\n## Phase 1 Bundle Section Task IDs\nRead Bundle Sections 1 and 2 using TaskGet(taskId) — the section is in the task's `description` field.\n- **Architect (Bundle Section 1)**: TaskGet('<task-1-id>')\n- **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')\n\nExtract key findings and store them in project memory via MCP legion-memory server. Pay special attention to Infrastructure Notes (§1.6, §2.7) — store these as separate named entities using mcp__legion-memory__create_entities and mcp__legion-memory__add_observations.\n\n## End of Work Protocol (MANDATORY)\nTaskUpdate(taskId: '<task-6-id>', status: 'completed', description: '<summary of stored memories>')\nDo NOT go idle without calling TaskUpdate.")
132
+ Agent(team_name: ..., name: "memory", subagent_type: "general-purpose",
133
+ prompt: "## Assignment\n**Team**: <team-name>\n**Your task ID**: <task-6-id>\n\n## Phase 1 Bundle Section Task IDs\nRead Bundle Sections 1 and 2 using TaskGet(taskId) — the section is in the task's `description` field.\n- **Architect (Bundle Section 1)**: TaskGet('<task-1-id>')\n- **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')\n\nLoad MCP tools first: ToolSearch(\"+legion-memory\"). Then extract key findings and store them in project memory via MCP legion-memory server. Pay special attention to Infrastructure Notes (§1.6, §2.7) — store these as separate named entities using mcp__legion-memory__create_entities and mcp__legion-memory__add_observations. If MCP is unavailable, note the error and complete anyway.\n\n## End of Work Protocol (MANDATORY)\nTaskUpdate(taskId: '<task-6-id>', status: 'completed', description: '<summary of stored memories>')\nDo NOT go idle without calling TaskUpdate.")
134
134
  ```
135
135
  6. Wait for plan — poll `TaskList` until tasks 4 and 6 are `status: "completed"`
136
136
 
@@ -11,7 +11,7 @@ $ARGUMENTS
11
11
 
12
12
  1. **Create team**: `TeamCreate(team_name: "legion-codebase-<timestamp>")`
13
13
  2. **Create output directories**: Run `mkdir -p "$PWD/.legion/codebase/agents/"` via Bash
14
- 3. **Create 8 tasks** in two phases:
14
+ 3. **Create 9 tasks** in three phases:
15
15
  **Phase 1** (all parallel, no dependencies):
16
16
  - Task 1: "Analyze architecture" → architecture-analyst
17
17
  - Task 2: "Analyze conventions" → conventions-analyst
@@ -22,6 +22,8 @@ $ARGUMENTS
22
22
  - Task 6: "Write architect brief" → architect-brief-writer (blockedBy: [1,2,3,4,5])
23
23
  - Task 7: "Write code-analyst brief" → code-analyst-brief-writer (blockedBy: [1,2,3,4,5])
24
24
  - Task 8: "Write context-curator brief" → context-curator-brief-writer (blockedBy: [1,2,3,4,5])
25
+ **Phase 3** (blockedBy Phase 1+2):
26
+ - Task 9: "Store codebase analysis in MCP memory" → memory-agent (blockedBy: [1,2,3,4,5,6,7,8])
25
27
  4. **Phase 1 — Spawn 5 teammates in parallel**:
26
28
  - `architecture-analyst` (subagent_type: "architect") — analyze project architecture: modules, data flow, key design decisions, component relationships. Write results to `.legion/codebase/architecture.md` via Write tool.
27
29
  - `conventions-analyst` (subagent_type: "context-curator") — analyze code style, naming conventions, patterns, project rules, formatting. Write results to `.legion/codebase/conventions.md` via Write tool.
@@ -34,7 +36,47 @@ $ARGUMENTS
34
36
  - `code-analyst-brief-writer` (subagent_type: "code-analyst") — read `.legion/codebase/files.md`, `.legion/codebase/dependencies.md`, `.legion/codebase/api.md`. Write a concise code-analyst brief (plain markdown, no YAML frontmatter, ~50-100 lines) to `.legion/codebase/agents/code-analyst-brief.md` via Write tool. Structure: `# Code Analyst Brief` → Quick Reference table → File Map (directory tree with purposes) → Entry Points (CLI, hooks, libs) → Import Graph (condensed require() chains) → Key Callsites (settings.json registrations, HOOK_FILES/AGENT_FILES arrays) → Runtime File Paths (/tmp/legion-* with reader/writer) → Test Status (none, manual validation). Dense facts, minimal prose.
35
37
  - `context-curator-brief-writer` (subagent_type: "context-curator") — read `.legion/codebase/conventions.md`, `.legion/codebase/architecture.md`, `.legion/codebase/files.md`. Write a concise context-curator brief (plain markdown, no YAML frontmatter, ~50-100 lines) to `.legion/codebase/agents/context-curator-brief.md` via Write tool. Structure: `# Context Curator Brief` → Quick Reference table → Project Identity (name, type, language, no frameworks) → Rules & Conventions (module format, zero deps, atomic writes, silent fail, naming) → Build/Run/Test table (install, force, dry-run, uninstall — no lint/test) → Config Files (config.json, package.json, settings.json) → Environment (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1, Node >= 18) → Project-specific Patterns → Key Files table. Dense facts, minimal prose.
36
38
  7. **Wait** for Phase 2 (all 3) to complete
37
- 8. **Verify** all 8 output files exist:
39
+ 8. **Phase 3 Spawn memory agent**:
40
+ - `memory-agent` (subagent_type: "general-purpose") — read all generated files from `.legion/codebase/` and `.legion/codebase/agents/`, extract key findings, store in MCP legion-memory as named entities.
41
+
42
+ Spawn prompt:
43
+ ```
44
+ ## Assignment
45
+ **Team**: <team-name>
46
+ **Your task ID**: <Task 9 id>
47
+ **Mode**: Codebase analysis storage
48
+
49
+ ## Source Files
50
+ Read each file using Read tool:
51
+ - `.legion/codebase/architecture.md` — project architecture, modules, data flow
52
+ - `.legion/codebase/conventions.md` — code style, naming, patterns
53
+ - `.legion/codebase/files.md` — file map with descriptions
54
+ - `.legion/codebase/dependencies.md` — module dependencies, import graph
55
+ - `.legion/codebase/api.md` — public interfaces, CLI, hooks protocol
56
+ - `.legion/codebase/agents/architect-brief.md` — architect quick-reference
57
+ - `.legion/codebase/agents/code-analyst-brief.md` — code-analyst quick-reference
58
+ - `.legion/codebase/agents/context-curator-brief.md` — context-curator quick-reference
59
+
60
+ ## Instructions
61
+ 1. Load MCP tools: `ToolSearch("+legion-memory")`
62
+ 2. Read all 8 files listed above
63
+ 3. For each file, create a named entity using `mcp__legion-memory__create_entities`:
64
+ - Entity name: `codebase:{filename}` (e.g., `codebase:architecture`, `codebase:conventions`)
65
+ - Entity type: `codebase-analysis`
66
+ 4. For each entity, add key observations (condensed summaries, not full file content) using `mcp__legion-memory__add_observations`
67
+ 5. Create relations between entities using `mcp__legion-memory__create_relations`:
68
+ - `codebase:architecture` → `relates_to` → `codebase:dependencies`
69
+ - `codebase:api` → `relates_to` → `codebase:files`
70
+ - `codebase:conventions` → `relates_to` → `codebase:architecture`
71
+ - Brief entities → `summarizes` → their source entities
72
+ 6. If MCP is unavailable, note the error and complete anyway
73
+
74
+ ## End of Work Protocol (MANDATORY)
75
+ TaskUpdate(taskId: "<task-9-id>", status: "completed", description: "<summary of entities stored>")
76
+ Do NOT go idle without calling TaskUpdate.
77
+ ```
78
+ 9. **Wait** for Phase 3 (Task 9) to complete
79
+ 10. **Verify** all 8 output files exist:
38
80
  In `.legion/codebase/`:
39
81
  - `architecture.md`
40
82
  - `conventions.md`
@@ -45,8 +87,8 @@ $ARGUMENTS
45
87
  - `architect-brief.md`
46
88
  - `code-analyst-brief.md`
47
89
  - `context-curator-brief.md`
48
- 9. **Clean shutdown** — shutdown all teammates, TeamDelete
49
- 10. **Report** — summarize what was generated: 5 codebase analysis files in `.legion/codebase/` and 3 agent briefs in `.legion/codebase/agents/`
90
+ 11. **Clean shutdown** — shutdown all teammates, TeamDelete
91
+ 12. **Report** — summarize what was generated: 5 codebase analysis files in `.legion/codebase/`, 3 agent briefs in `.legion/codebase/agents/`, and key findings stored in MCP memory
50
92
 
51
93
  ## Rules
52
94
 
@@ -46,7 +46,7 @@ $ARGUMENTS
46
46
 
47
47
  5. **Spawn Planner AND Memory in parallel**:
48
48
  - **Planner** (subagent_type: "planner") with Phase 1 Bundle Section task IDs and Task 4's ID:
49
- - **Memory** (subagent_type: "memory") with Phase 1 Bundle Section task IDs (1, 2) and Task 6's ID — fire-and-forget, does NOT block Implementer
49
+ - **Memory** (subagent_type: "general-purpose") with Phase 1 Bundle Section task IDs (1, 2) and Task 6's ID — fire-and-forget, does NOT block Implementer
50
50
 
51
51
  Spawn Planner:
52
52
  ```
@@ -63,7 +63,7 @@ $ARGUMENTS
63
63
  - **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')
64
64
  - **Context Curator (Bundle Section 3)**: TaskGet('<task-3-id>')
65
65
 
66
- Read all three Bundle Sections, assemble the Bundle, then produce an Execution Pack with sub-tasks, pseudo-diffs, acceptance criteria, risks, and rollback. Use ToolSearch('+legion-sequential-thinking') before plan construction. Read Infrastructure Notes sections (§1.6, §2.7) from Bundle Sections. If legion-memory MCP is available, query it for cross-session context via mcp__legion-memory__read_graph. Include User Questions section (≤3) only if critical clarifications are needed.
66
+ Read all three Bundle Sections, assemble the Bundle, then produce an Execution Pack with sub-tasks, pseudo-diffs, acceptance criteria, risks, and rollback. Use ToolSearch('+legion-sequential-thinking') and ToolSearch('+legion-memory') before plan construction. Read Infrastructure Notes sections (§1.6, §2.7) from Bundle Sections. Query mcp__legion-memory__read_graph for cross-session context. If legion-memory MCP is unavailable, proceed without. Include User Questions section (≤3) only if critical clarifications are needed.
67
67
 
68
68
  ## End of Work Protocol (MANDATORY)
69
69
  TaskUpdate(taskId: "<your-task-id>", status: "completed", description: "<your full Execution Pack>")
@@ -72,8 +72,8 @@ $ARGUMENTS
72
72
  ```
73
73
  Spawn Memory (fire-and-forget):
74
74
  ```
75
- Agent(team_name: ..., name: "memory", subagent_type: "memory",
76
- prompt: "## Assignment\n**Team**: <team-name>\n**Your task ID**: <Task 6 id>\n\n## Phase 1 Bundle Section Task IDs\nRead Bundle Sections 1 and 2 using TaskGet(taskId) — the section is in the task's `description` field.\n- **Architect (Bundle Section 1)**: TaskGet('<task-1-id>')\n- **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')\n\nExtract key findings and store them in project memory via MCP legion-memory server. Pay special attention to Infrastructure Notes (§1.6, §2.7) — store these as separate named entities using mcp__legion-memory__create_entities and mcp__legion-memory__add_observations.\n\n## End of Work Protocol (MANDATORY)\nTaskUpdate(taskId: '<task-6-id>', status: 'completed', description: '<summary of stored memories>')\nDo NOT go idle without calling TaskUpdate.")
75
+ Agent(team_name: ..., name: "memory", subagent_type: "general-purpose",
76
+ prompt: "## Assignment\n**Team**: <team-name>\n**Your task ID**: <Task 6 id>\n\n## Phase 1 Bundle Section Task IDs\nRead Bundle Sections 1 and 2 using TaskGet(taskId) — the section is in the task's `description` field.\n- **Architect (Bundle Section 1)**: TaskGet('<task-1-id>')\n- **Code Analyst (Bundle Section 2)**: TaskGet('<task-2-id>')\n\nLoad MCP tools first: ToolSearch(\"+legion-memory\"). Then extract key findings and store them in project memory via MCP legion-memory server. Pay special attention to Infrastructure Notes (§1.6, §2.7) — store these as separate named entities using mcp__legion-memory__create_entities and mcp__legion-memory__add_observations. If MCP is unavailable, note the error and complete anyway.\n\n## End of Work Protocol (MANDATORY)\nTaskUpdate(taskId: '<task-6-id>', status: 'completed', description: '<summary of stored memories>')\nDo NOT go idle without calling TaskUpdate.")
77
77
  ```
78
78
  6. **Wait** for plan — poll `TaskList` until tasks 4 and 6 are `status: "completed"`
79
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "legion-cc",
3
- "version": "0.18.0",
3
+ "version": "0.19.1",
4
4
  "description": "Legion — context monitoring hooks and agent teams for Claude Code",
5
5
  "type": "commonjs",
6
6
  "bin": {