@cleocode/skills 2026.3.45 → 2026.3.47

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.
@@ -1,8 +1,8 @@
1
1
  # Subagent Protocol Base Reference
2
2
 
3
3
  **Provenance**: @task T3155, @epic T3147
4
- **Version**: 1.0.1
5
- **Updated**: 2026-02-07
4
+ **Version**: 1.1.0
5
+ **Updated**: 2026-03-20
6
6
 
7
7
  This reference defines the RFC 2119 protocol for subagent output and handoff.
8
8
  All subagents operating under an orchestrator MUST follow this protocol.
@@ -17,8 +17,13 @@ All subagents operating under an orchestrator MUST follow this protocol.
17
17
  |----|------|------------|
18
18
  | OUT-001 | MUST write findings to `{{OUTPUT_DIR}}/{{DATE}}_{{TOPIC_SLUG}}.md` | Required |
19
19
  | OUT-002 | MUST append ONE line to `{{MANIFEST_PATH}}` | Required |
20
- | OUT-003 | MUST return ONLY: "Research complete. See MANIFEST.jsonl for summary." | Required |
21
- | OUT-004 | MUST NOT return research content in response | Required |
20
+ | OUT-003 | MUST return ONLY: "[Type] complete. See MANIFEST.jsonl for summary." | Required |
21
+ | OUT-004 | MUST NOT return output content in response | Required |
22
+
23
+ Valid return messages:
24
+ - `"[Type] complete. See MANIFEST.jsonl for summary."`
25
+ - `"[Type] partial. See MANIFEST.jsonl for details."`
26
+ - `"[Type] blocked. See MANIFEST.jsonl for blocker details."`
22
27
 
23
28
  ### Rationale
24
29
 
@@ -75,13 +80,10 @@ Use `cleo research add` to create manifest entries instead of manual JSONL appen
75
80
  **Quick Reference**:
76
81
  ```bash
77
82
  cleo research add \
78
- --title "{{TITLE}}" \
79
- --file "{{DATE}}_{{TOPIC_SLUG}}.md" \
80
- --topics "topic1,topic2,topic3" \
81
- --findings "Finding 1,Finding 2,Finding 3" \
82
- --status complete \
83
83
  --task {{TASK_ID}} \
84
- --agent-type research
84
+ --topic "{{TOPIC_SLUG}}" \
85
+ --findings "Finding 1,Finding 2,Finding 3" \
86
+ --sources "Source 1,Source 2"
85
87
  ```
86
88
 
87
89
  See the reference above for:
@@ -108,7 +110,7 @@ Reference: @skills/_shared/task-system-integration.md
108
110
  4. Write output: {{OUTPUT_DIR}}/{{DATE}}_{{TOPIC_SLUG}}.md
109
111
  5. Create manifest entry: cleo research add [flags]
110
112
  6. Complete: {{TASK_COMPLETE_CMD}} {{TASK_ID}}
111
- 7. Return: "Research complete. See MANIFEST.jsonl for summary."
113
+ 7. Return: "[Type] complete. See MANIFEST.jsonl for summary."
112
114
  ```
113
115
 
114
116
  ---
@@ -118,12 +120,12 @@ Reference: @skills/_shared/task-system-integration.md
118
120
  ### Link Research to Task
119
121
 
120
122
  ```bash
121
- {{TASK_LINK_CMD}} {{TASK_ID}} {{RESEARCH_ID}}
123
+ {{TASK_LINK_CMD}} {{RESEARCH_ID}} {{TASK_ID}}
122
124
  ```
123
125
 
124
126
  **Purpose**: Associate research output with originating task for bidirectional discovery.
125
127
 
126
- **CLEO Default**: `cleo research link {{TASK_ID}} {{RESEARCH_ID}}`
128
+ **CLEO Default**: `cleo research link {{RESEARCH_ID}} {{TASK_ID}}`
127
129
 
128
130
  **When to Link**:
129
131
  - SHOULD link after writing research output to manifest
@@ -199,7 +201,7 @@ If work cannot complete fully:
199
201
  2. Set manifest `"status": "partial"`
200
202
  3. Add blocking reason to `needs_followup`
201
203
  4. Complete task (partial work is still progress)
202
- 5. Return: "Research partial. See MANIFEST.jsonl for details."
204
+ 5. Return: "[Type] partial. See MANIFEST.jsonl for details."
203
205
 
204
206
  ### Blocked Status
205
207
 
@@ -209,7 +211,7 @@ If work cannot proceed:
209
211
  2. Set manifest `"status": "blocked"`
210
212
  3. Add blocker details to `needs_followup`
211
213
  4. Do NOT complete task (leave for orchestrator decision)
212
- 5. Return: "Research blocked. See MANIFEST.jsonl for blocker details."
214
+ 5. Return: "[Type] blocked. See MANIFEST.jsonl for blocker details."
213
215
 
214
216
  ---
215
217
 
@@ -220,4 +222,5 @@ If work cannot proceed:
220
222
  | Returning full content | Bloats orchestrator context | Return only summary message |
221
223
  | Manual JSONL append | No validation, race conditions | Use `cleo research add` |
222
224
  | Missing manifest entry | Orchestrator can't find findings | Always create manifest entry |
225
+ | Skipping task start | Protocol violation | Always `cleo start` before work |
223
226
  | Incomplete checklist | Protocol violation | Verify all items before return |
@@ -40,12 +40,12 @@ Skills and templates SHOULD reference this file instead of hardcoding CLEO comma
40
40
  ### Link Research
41
41
 
42
42
  ```bash
43
- {{TASK_LINK_CMD}} {{TASK_ID}} {{RESEARCH_ID}}
43
+ {{TASK_LINK_CMD}} {{RESEARCH_ID}} {{TASK_ID}}
44
44
  ```
45
45
 
46
46
  **Purpose**: Associate research output with task.
47
47
 
48
- **CLEO Default**: `cleo research link {{TASK_ID}} {{RESEARCH_ID}}`
48
+ **CLEO Default**: `cleo research link {{RESEARCH_ID}} {{TASK_ID}}`
49
49
 
50
50
  ---
51
51
 
@@ -122,8 +122,8 @@ When the task system is CLEO, these additional commands are available:
122
122
  | `cleo session start` | Begin work session |
123
123
  | `cleo session end` | End work session |
124
124
  | `cleo analyze` | Task triage with scoring |
125
- | `cleo deps {{TASK_ID}}` | Check task dependencies |
126
- | `cleo tree --parent {{EPIC_ID}}` | Visualize hierarchy |
125
+ | `cleo deps show {{TASK_ID}}` | Check task dependencies |
126
+ | `cleo tree {{EPIC_ID}}` | Visualize hierarchy rooted at epic |
127
127
 
128
128
  ### Session Lifecycle
129
129
 
@@ -200,7 +200,7 @@ Include task lifecycle section in templates:
200
200
  1. MUST read task details: `{{TASK_SHOW_CMD}} {{TASK_ID}}`
201
201
  2. MUST start task: `{{TASK_START_CMD}} {{TASK_ID}}`
202
202
  3. MUST complete task: `{{TASK_COMPLETE_CMD}} {{TASK_ID}}`
203
- 4. SHOULD link research: `{{TASK_LINK_CMD}} {{TASK_ID}} {{RESEARCH_ID}}`
203
+ 4. SHOULD link research: `{{TASK_LINK_CMD}} {{RESEARCH_ID}} {{TASK_ID}}`
204
204
  ```
205
205
 
206
206
  ---
@@ -1,5 +1,8 @@
1
1
  # Testing Framework Configuration
2
2
 
3
+ > **Reference status**: Not directly `@`-referenced by any ct-* skill SKILL.md. Used by ct-validator
4
+ > and other skills that need testing configuration guidance. Available for skill authors to link.
5
+
3
6
  CLEO supports 16 testing frameworks. Configure your project's testing setup in `.cleo/config.json`:
4
7
 
5
8
  ## Framework Examples
@@ -9,9 +9,9 @@ CLEO is the task management protocol for AI coding agents. It provides structure
9
9
 
10
10
  **Operation set**: 164 operations (97 query + 67 mutate) across 10 canonical domains.
11
11
 
12
- ## MCP-First Workflow
12
+ ## CLI-First Workflow
13
13
 
14
- MCP is the **primary** entry point. Use `query` for reads and `mutate` for writes.
14
+ CLI (`cleo` / `ct`) is the **primary** entry point. MCP (`query` / `mutate`) is the fallback when CLI is unavailable.
15
15
 
16
16
  ### Tier-0 Read Operations (`query`) — Always Available
17
17
 
@@ -303,9 +303,9 @@ I need system or configuration info
303
303
 
304
304
  ---
305
305
 
306
- ## CLI Fallback
306
+ ## CLI Reference (Primary)
307
307
 
308
- When MCP tools are unavailable, use `ct` (alias for `cleo`).
308
+ Use `ct` (alias for `cleo`) as the primary interface. MCP (`query` / `mutate`) is the fallback when CLI is unavailable.
309
309
 
310
310
  ```bash
311
311
  ct find "query" # Search (99% less context than list)
@@ -414,7 +414,7 @@ ct complete <id>
414
414
  ct session end
415
415
  ```
416
416
 
417
- ### MCP Session Operations
417
+ ### MCP Session Operations (Fallback)
418
418
 
419
419
  ```javascript
420
420
  query({ domain: "session", operation: "status" })
@@ -122,8 +122,8 @@ Skills are **context injections, NOT agents**. The orchestrator selects and inje
122
122
  ### Discovery
123
123
 
124
124
  ```
125
- query({ domain: "skills", operation: "list" })
126
- query({ domain: "skills", operation: "show", params: { name: "ct-orchestrator" }})
125
+ query({ domain: "tools", operation: "skill.list" })
126
+ query({ domain: "tools", operation: "skill.show", params: { name: "ct-orchestrator" }})
127
127
  ```
128
128
 
129
129
  ### Key Skills
@@ -166,7 +166,7 @@ cleo list --tree --parent {{EPIC_ID}} # Show epic subtree
166
166
  | `{{TASK_SESSION_END_CMD}}` | `cleo session end` |
167
167
  | `{{TASK_SESSION_SUSPEND_CMD}}` | `cleo session suspend` |
168
168
  | `{{TASK_SESSION_RESUME_CMD}}` | `cleo session resume` |
169
- | `{{TASK_SESSION_CLOSE_CMD}}` | `cleo session close` |
169
+ | `{{TASK_SESSION_CLOSE_CMD}}` | `cleo session end` |
170
170
  | `{{TASK_SESSION_LIST_CMD}}` | `cleo session list` |
171
171
 
172
172
  ### Start/Stop/Current Tokens
@@ -60,7 +60,7 @@ Tests whether the agent checks existing sessions and tasks before starting work.
60
60
  Tests whether task creation follows protocol: descriptions provided, parent existence verified before subtask creation, no duplicate tasks.
61
61
 
62
62
  ### 3. Error Recovery
63
- Tests whether the agent handles errors correctly: follows up `E_NOT_FOUND` with recovery lookups (`tasks.find` or `tasks.exists`), avoids duplicate creates after failures.
63
+ Tests whether the agent handles errors correctly: follows up `E_NOT_FOUND` with recovery lookups (`tasks.find`), avoids duplicate creates after failures.
64
64
 
65
65
  ### 4. Full Lifecycle
66
66
  Tests session discipline end-to-end: session listed before task ops, session properly ended, MCP-first usage patterns.
@@ -91,8 +91,8 @@ query({ domain: "check", operation: "grade",
91
91
  # List past grades
92
92
  query({ domain: "check", operation: "grade.list" })
93
93
 
94
- # Compatibility aliases still work at runtime
95
- query({ domain: "admin", operation: "grade",
94
+ # Use canonical surface (check domain)
95
+ query({ domain: "check", operation: "grade",
96
96
  params: { sessionId: "abc-123" }})
97
97
  ```
98
98
 
@@ -125,7 +125,7 @@ Starts at 20 and deducts for violations:
125
125
  | Deduction | Violation |
126
126
  |-----------|-----------|
127
127
  | -5 each | `tasks.add` without a description |
128
- | -3 | Subtasks created without `tasks.exists` parent check |
128
+ | -3 | Subtasks created without `tasks.find {exact:true}` parent check |
129
129
 
130
130
  **What it measures**: Does the agent create well-formed tasks with descriptions and verify parents before creating subtasks?
131
131
 
@@ -179,8 +179,8 @@ Flags are actionable diagnostic messages. Each flag identifies a specific behavi
179
179
  - `session.end never called` -- Always end sessions when done
180
180
  - `tasks.list used Nx` -- Prefer `tasks.find` for discovery
181
181
  - `tasks.add without description` -- Always provide task descriptions
182
- - `Subtasks created without tasks.exists parent check` -- Verify parent exists first
183
- - `E_NOT_FOUND not followed by recovery lookup` -- Follow errors with `tasks.find` or `tasks.exists`
182
+ - `Subtasks created without parent existence check` -- Verify parent exists first
183
+ - `E_NOT_FOUND not followed by recovery lookup` -- Follow errors with `tasks.find`
184
184
  - `No admin.help or skill lookup calls` -- Load `ct-cleo` for protocol guidance
185
185
  - `No MCP query calls` -- Prefer `query` over CLI
186
186
 
@@ -217,14 +217,14 @@ Grade results are stored in `.cleo/metrics/GRADES.jsonl` as append-only JSONL. E
217
217
  |---------|--------|-----------|-------------|
218
218
  | `query` | `check` | `grade` | Canonical grade read (`params: { sessionId }`) |
219
219
  | `query` | `check` | `grade.list` | Canonical grade history read |
220
- | `query` | `admin` | `grade` | Compatibility alias for runtime handlers |
221
- | `query` | `admin` | `grade.list` | Compatibility alias for runtime handlers |
220
+ | `query` | `check` | `grade` | Canonical grade read (preferred) |
221
+ | `query` | `check` | `grade.list` | Canonical grade history read (preferred) |
222
222
  | `query` | `admin` | `token` | Canonical token telemetry read (`action=summary|list|show`) |
223
223
 
224
224
 
225
225
  ## API Update Notes
226
226
 
227
227
  - Prefer the canonical registry surface from `docs/specs/CLEO-API.md`: `check.grade`, `check.grade.list`, and `admin.token` with an `action` param.
228
- - `admin.grade*` and split `admin.token.*` paths remain compatibility handlers and may still appear in existing automation.
228
+ - Use `check.grade` and `check.grade.list` as the canonical surface; legacy handlers may still appear in existing automation.
229
229
  - Browser clients should target `POST /api/query` and `POST /api/mutate`; LAFS metadata is carried in `X-Cleo-*` headers by default.
230
230
  - Treat persisted token transport values `api` and `http` as equivalent during the compatibility window described in `docs/specs/CLEO-WEB-API.md`.
@@ -67,7 +67,7 @@ Record every operation you executed as a JSONL file. Each line:
67
67
 
68
68
  Write to `<OUTPUT_DIR>/<SCENARIO>/arm-<INTERFACE>/`:
69
69
 
70
- **grade.json** — The GradeResult from the canonical `check.grade` read (or legacy `admin.grade` alias):
70
+ **grade.json** — The GradeResult from the canonical `check.grade` read:
71
71
  ```json
72
72
  {
73
73
  "sessionId": "...",
@@ -103,7 +103,7 @@ Note: `total_tokens` and `duration_ms` are filled by the orchestrator from the t
103
103
  | Scenario | Key Operations | S1 | S2 | S3 | S4 | S5 |
104
104
  |---|---|---|---|---|---|---|
105
105
  | s1 | session.list, tasks.find, tasks.show, session.end | ✓ | ✓ | — | — | partial |
106
- | s2 | session.list, tasks.exists, tasks.add×2, session.end | ✓ | — | ✓ | — | — |
106
+ | s2 | session.list, tasks.find, tasks.add×2, session.end | ✓ | — | ✓ | — | — |
107
107
  | s3 | session.list, tasks.show (E_NOT_FOUND), tasks.find (recover), tasks.add, session.end | ✓ | — | ✓ | ✓ | — |
108
108
  | s4 | session.list, admin.help, tasks.find, tasks.show, tasks.update, tasks.complete, session.end | ✓ | ✓ | ✓ | ✓ | ✓ |
109
109
  | s5 | session.list, admin.help, tasks.find (parent filter), tasks.show, session.context.drift, session.decision.log, session.record.decision, tasks.update, tasks.complete, session.end | ✓ | ✓ | ✓ | ✓ | ✓ |
@@ -135,7 +135,7 @@ duplicates = titles.length - new Set(titles).size
135
135
 
136
136
  | Deduction | Condition |
137
137
  |-----------|-----------|
138
- | -5 per error | E_NOT_FOUND not followed by `tasks.find` or `tasks.exists` within 4 entries |
138
+ | -5 per error | E_NOT_FOUND not followed by `tasks.find` within 4 entries |
139
139
  | -5 | Any duplicate task creates detected (title collision within session) |
140
140
 
141
141
  **Floor**: `Math.max(0, score)`
@@ -231,6 +231,6 @@ This is why A/B tests between MCP and CLI interfaces will reliably show S5 diffe
231
231
  ## API Surface Update
232
232
 
233
233
  - Canonical reads now live under `check.grade` and `check.grade.list`.
234
- - `admin.grade` and `admin.grade.list` remain compatibility handlers during the registry transition.
234
+ - Use `check.grade` and `check.grade.list` as the canonical surface; legacy handlers may still appear in existing automation.
235
235
  - Token telemetry should be read through `admin.token` with `action=summary|list|show` rather than inferring split legacy operations.
236
236
  - Web clients should use `POST /api/query` and `POST /api/mutate`; default HTTP responses carry LAFS metadata in `X-Cleo-*` headers.
@@ -64,7 +64,7 @@ The coarse estimation layer uses the following lookup table (`OP_TOKEN_AVERAGES`
64
64
  | tasks.find | ~750 | Depends on result count |
65
65
  | tasks.list | ~3,000 | Heavy — prefer tasks.find |
66
66
  | tasks.show | ~600 | Single task with full details |
67
- | tasks.exists | ~300 | Boolean + minimal data |
67
+ | tasks.find | ~300 | Use with exact:true for existence check |
68
68
  | tasks.tree | ~800 | Hierarchy view |
69
69
  | tasks.plan | ~900 | Next task recommendations |
70
70
  | session.status | ~350 | Quick status check |
@@ -171,7 +171,7 @@ If running without task notifications (no total_tokens available):
171
171
  token-summary.json # aggregated token stats across all runs
172
172
  <scenario-or-domain>/
173
173
  arm-A/
174
- grade.json # GradeResult (from admin.grade)
174
+ grade.json # GradeResult (from check.grade)
175
175
  timing.json # token + duration data
176
176
  operations.jsonl # operations executed (one per line)
177
177
  arm-B/
@@ -72,7 +72,7 @@ Record every operation you executed as a JSONL file. Each line:
72
72
 
73
73
  Write to `<OUTPUT_DIR>/<SCENARIO>/arm-<INTERFACE>/`:
74
74
 
75
- **grade.json** — The GradeResult from admin.grade:
75
+ **grade.json** — The GradeResult from check.grade:
76
76
  ```json
77
77
  {
78
78
  "sessionId": "...",
@@ -97,7 +97,7 @@ Write to `<OUTPUT_DIR>/<SCENARIO>/arm-<INTERFACE>/`:
97
97
  "executor_start": "<ISO>",
98
98
  "executor_end": "<ISO>",
99
99
  "executor_duration_seconds": 0,
100
- "token_usage_id": "<id from admin.token.record response>",
100
+ "token_usage_id": "<id from admin.token response>",
101
101
  "total_tokens": null,
102
102
  "duration_ms": null
103
103
  }
@@ -110,7 +110,8 @@ Note: `total_tokens` and `duration_ms` are filled by the orchestrator from the t
110
110
  After receiving the grade result, record the exchange to persist token measurements:
111
111
 
112
112
  ```
113
- mutate admin token.record {
113
+ mutate admin token {
114
+ "action": "record",
114
115
  "sessionId": "<session-id>",
115
116
  "transport": "mcp",
116
117
  "domain": "admin",
@@ -145,15 +146,15 @@ Save the returned `id` as `token_usage_id` in timing.json.
145
146
  | Scenario | Key Operations | S1 | S2 | S3 | S4 | S5 |
146
147
  |---|---|---|---|---|---|---|
147
148
  | s1 | session.list, tasks.find, tasks.show, session.end | ✓ | ✓ | — | — | partial |
148
- | s2 | session.list, tasks.exists, tasks.add×2, session.end | ✓ | — | ✓ | — | — |
149
+ | s2 | session.list, tasks.find, tasks.add×2, session.end | ✓ | — | ✓ | — | — |
149
150
  | s3 | session.list, tasks.show (E_NOT_FOUND), tasks.find (recover), tasks.add, session.end | ✓ | — | ✓ | ✓ | — |
150
151
  | s4 | session.list, admin.help, tasks.find, tasks.show, tasks.update, tasks.complete, session.end | ✓ | ✓ | ✓ | ✓ | ✓ |
151
152
  | s5 | session.list, admin.help, tasks.find (parent filter), tasks.show, session.context.drift, session.decision.log, session.record.decision, tasks.update, tasks.complete, session.end | ✓ | ✓ | ✓ | ✓ | ✓ |
152
153
  | s6 | memory.observe, memory.find, memory.timeline, memory.fetch, session.end | ✓ | ✓ | — | — | ✓ |
153
- | s7 | memory.decision.store, memory.decision.find, memory.find, memory.stats, session.end | ✓ | — | — | — | ✓ |
154
+ | s7 | memory.decision.store, memory.decision.find, memory.find, memory.fetch, session.end | ✓ | — | — | — | ✓ |
154
155
  | s8 | memory.pattern.store, memory.learning.store, memory.pattern.find, memory.learning.find, session.end | — | ✓ | — | — | ✓ |
155
156
  | s9 | nexus.status, nexus.list, nexus.show, admin.dash, session.end | ✓ | — | — | — | ✓ |
156
- | s10 | session.list, admin.help, tasks.find, memory.find, nexus.status, pipeline.stage.status, check.health, tools.skill.list, memory.observe, session.end | ✓ | ✓ | — | — | ✓ |
157
+ | s10 | session.list, admin.help, tasks.find, memory.find, nexus.status, pipeline.stage.status, admin.health, tools.skill.list, memory.observe, session.end | ✓ | ✓ | — | — | ✓ |
157
158
 
158
159
  ## Anti-patterns to Avoid
159
160
 
@@ -132,7 +132,7 @@ tasks.find, tasks.show, session.status, admin.dash, admin.health
132
132
  tasks.find, tasks.show, tasks.list, tasks.tree, tasks.plan,
133
133
  session.status, session.list, session.briefing.show,
134
134
  admin.dash, admin.health, admin.help, admin.stats,
135
- tools.skill.list, tools.provider.list, admin.doctor
135
+ tools.skill.list, tools.provider.list, admin.health
136
136
  ```
137
137
 
138
138
  **Full tier-0 sweep (all tier-0 query ops across all domains):**
@@ -149,8 +149,8 @@ Ordered by typical output size (most expensive first):
149
149
  3. `memory.find` — FTS5 results
150
150
  4. `tasks.plan` — composite view
151
151
  5. `admin.dash` — multi-domain overview
152
- 6. `admin.doctor` — comprehensive health
152
+ 6. `admin.health` — comprehensive health
153
153
  7. `tasks.tree` — hierarchy visualization
154
- 8. `session.history` — session log
154
+ 8. `session.show` — session log
155
155
  9. `tasks.find` (10 results) — standard discovery
156
156
  10. `admin.stats` — aggregate counts
@@ -49,13 +49,13 @@ Measures whether tasks are created with proper descriptions and subtask parent v
49
49
  | Points | Condition | Evidence string |
50
50
  |--------|-----------|-----------------|
51
51
  | -5 each | `tasks.add` succeeded without a description | flag per violation |
52
- | -3 | Subtasks created (with `parent` param) but no preceding `tasks.exists` | `Subtasks created without tasks.exists parent check` |
52
+ | -3 | Subtasks created (with `parent` param) but no preceding `tasks.find {exact:true}` | `Subtasks created without parent existence check` |
53
53
  | (none) | All adds have descriptions | `All N tasks.add calls had descriptions` |
54
- | (none) | Subtasks preceded by `tasks.exists` | `Parent existence verified before subtask creation` |
54
+ | (none) | Subtasks preceded by `tasks.find {exact:true}` | `Parent existence verified before subtask creation` |
55
55
 
56
56
  **Flags:**
57
57
  - `tasks.add without description (taskId: <id>)`
58
- - `Subtasks created without tasks.exists parent check`
58
+ - `Subtasks created without parent existence check`
59
59
 
60
60
  **Scoring:** Starts at 20, deducts penalties. Floor: 0.
61
61
 
@@ -67,12 +67,12 @@ Measures whether the agent recovers from `E_NOT_FOUND` (exit code 4) and avoids
67
67
 
68
68
  | Points | Condition | Evidence string |
69
69
  |--------|-----------|-----------------|
70
- | -5 each | `E_NOT_FOUND` not followed by `tasks.find` or `tasks.exists` within next 4 entries | flag per violation |
70
+ | -5 each | `E_NOT_FOUND` not followed by `tasks.find` within next 4 entries | flag per violation |
71
71
  | -5 | Duplicate task creates (same title, case-insensitive) in session | `N potentially duplicate task create(s) detected` |
72
72
  | (none) | Error followed by recovery | `E_NOT_FOUND followed by recovery lookup` |
73
73
  | (none) | No violations | `No error protocol violations` |
74
74
 
75
- **Recovery window:** Checks `entries[errIdx+1 : errIdx+5]` for `tasks.find` or `tasks.exists`.
75
+ **Recovery window:** Checks `entries[errIdx+1 : errIdx+5]` for `tasks.find`.
76
76
 
77
77
  **Duplicate detection:** Compares lowercased trimmed titles of all successful `tasks.add` calls.
78
78
 
@@ -221,7 +221,7 @@ Skip step 2 (`admin.help`). Earns MCP gateway +10 but not help/skill +10.
221
221
  | `admin.health` | `query { domain: "admin", operation: "health" }` | `cleo-dev admin health --json` |
222
222
  | `admin.help` | `query { domain: "admin", operation: "help" }` | `cleo-dev admin help --json` |
223
223
  | `admin.stats` | `query { domain: "admin", operation: "stats" }` | `cleo-dev admin stats --json` |
224
- | `admin.doctor` | `query { domain: "admin", operation: "doctor" }` | `cleo-dev admin doctor --json` |
224
+ | `admin.health` | `query { domain: "admin", operation: "health" }` | `cleo-dev admin health --json` |
225
225
 
226
226
  ---
227
227
 
@@ -18,35 +18,45 @@ Ensures LLM agents never start conversations with amnesia. Provides structured m
18
18
 
19
19
  ## Tier 0: Session Start (ALWAYS run on first interaction)
20
20
 
21
+ Use CLI (`cleo`) as the primary interface. MCP (`query` / `mutate`) is the fallback when CLI is unavailable.
22
+
21
23
  1. The memory bridge (.cleo/memory-bridge.md) is already loaded via CLEO-INJECTION.md @-reference
22
24
  2. If the bridge content feels stale (>2 hours old), refresh:
23
- - `query memory brain.search {query: "session task decision", limit: 10}`
25
+ - CLI (Primary): `cleo memory find "session task decision" --limit 10`
26
+ - MCP (Fallback): `query memory find {query: "session task decision", limit: 10}`
24
27
  3. Check for anti-patterns to avoid:
25
- - `query memory brain.search {query: "mistake error avoid warning", limit: 5}`
28
+ - CLI (Primary): `cleo memory find "mistake error avoid warning" --limit 5`
29
+ - MCP (Fallback): `query memory find {query: "mistake error avoid warning", limit: 5}`
26
30
  4. If results are relevant, fetch details:
27
- - `query memory brain.fetch {ids: ["O-xxx", "O-yyy"]}`
31
+ - CLI (Primary): `cleo memory fetch O-xxx O-yyy`
32
+ - MCP (Fallback): `query memory fetch {ids: ["O-xxx", "O-yyy"]}`
28
33
 
29
34
  ## Tier 1: During Work (run when topic-relevant)
30
35
 
31
36
  ### Before Making Decisions
32
37
 
33
- - `query memory brain.search {query: "decision ADR architecture", limit: 5}`
38
+ - CLI (Primary): `cleo memory find "decision ADR architecture" --limit 5`
39
+ - MCP (Fallback): `query memory find {query: "decision ADR architecture", limit: 5}`
34
40
  - Check if a similar decision was already made
35
41
 
36
42
  ### Before Repeating Work
37
43
 
38
- - `query memory brain.search {query: "{current-topic}", limit: 10}`
44
+ - CLI (Primary): `cleo memory find "{current-topic}" --limit 10`
45
+ - MCP (Fallback): `query memory find {query: "{current-topic}", limit: 10}`
39
46
  - Avoid re-doing work that's already been completed
40
47
 
41
48
  ### After Completing Significant Work
42
49
 
43
- - `mutate memory brain.observe {text: "Completed X using approach Y. Key learning: Z", title: "Work completion"}`
50
+ - CLI (Primary): `cleo memory observe "Completed X using approach Y. Key learning: Z" --title "Work completion"`
51
+ - MCP (Fallback): `mutate memory observe {text: "Completed X using approach Y. Key learning: Z", title: "Work completion"}`
44
52
 
45
53
  ### Anti-Hallucination Protocol
46
54
 
47
55
  Before stating facts about the codebase or project:
48
56
 
49
- 1. Search brain: `query memory brain.search {query: "{claim-topic}", limit: 5}`
57
+ 1. Search brain:
58
+ - CLI (Primary): `cleo memory find "{claim-topic}" --limit 5`
59
+ - MCP (Fallback): `query memory find {query: "{claim-topic}", limit: 5}`
50
60
  2. If results exist, verify your claim matches stored knowledge
51
61
  3. If no results, state your uncertainty clearly
52
62
 
@@ -54,17 +64,19 @@ Before stating facts about the codebase or project:
54
64
 
55
65
  ### Full Timeline
56
66
 
57
- - `query memory brain.timeline {anchor: "O-xxx", depthBefore: 5, depthAfter: 5}`
67
+ - CLI (Primary): `cleo memory timeline O-xxx --before 5 --after 5`
68
+ - MCP (Fallback): `query memory timeline {anchor: "O-xxx", depthBefore: 5, depthAfter: 5}`
58
69
  - Understand chronological context around a specific observation
59
70
 
60
71
  ### Cross-Project Knowledge (via NEXUS)
61
72
 
62
- - `query nexus search {query: "pattern", scope: "global"}`
73
+ - CLI (Primary): `cleo nexus search "pattern" --scope global`
74
+ - MCP (Fallback): `query nexus search {query: "pattern", scope: "global"}`
63
75
  - Search across all CLEO-managed projects
64
76
 
65
- ## MCP Resources (Alternative to search)
77
+ ## MCP Resources (Fallback for providers that support MCP resources)
66
78
 
67
- For providers that support MCP resources:
79
+ When CLI is unavailable and the provider supports MCP resources:
68
80
 
69
81
  - `ReadResource("cleo://memory/recent")` -- last 15 observations
70
82
  - `ReadResource("cleo://memory/learnings")` -- active learnings with confidence
@@ -73,12 +85,12 @@ For providers that support MCP resources:
73
85
 
74
86
  ## Token Budget Guidelines
75
87
 
76
- | Operation | ~Tokens | When |
77
- |-----------|---------|------|
78
- | memory-bridge.md (auto-loaded) | 200-400 | Always (free) |
79
- | brain.search | 50/hit | Discovery |
80
- | brain.fetch | 500/entry | Details |
81
- | brain.timeline | 200-500 | Context |
82
- | MCP resources | 200-500 | On-demand |
88
+ | Operation | ~Tokens | Interface | When |
89
+ |-----------|---------|-----------|------|
90
+ | memory-bridge.md (auto-loaded) | 200-400 | — | Always (free) |
91
+ | `cleo memory find` | 50/hit | CLI (Primary) | Discovery |
92
+ | `cleo memory fetch` | 500/entry | CLI (Primary) | Details |
93
+ | `cleo memory timeline` | 200-500 | CLI (Primary) | Context |
94
+ | MCP resources | 200-500 | MCP (Fallback) | On-demand |
83
95
 
84
96
  Stay within LAFS MVI budget: start minimal, escalate only when needed.