@cleocode/cleo 2026.3.28 → 2026.3.30

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleocode/cleo",
3
- "version": "2026.3.28",
3
+ "version": "2026.3.30",
4
4
  "description": "CLEO V2 - TypeScript task management CLI for AI coding agents",
5
5
  "mcpName": "io.github.kryptobaseddev/cleo-mcp-server",
6
6
  "type": "module",
@@ -65,6 +65,11 @@
65
65
  ],
66
66
  "author": "CLEO Development Team",
67
67
  "license": "MIT",
68
+ "workspaces": [
69
+ "packages/contracts",
70
+ "packages/shared",
71
+ "packages/adapters/*"
72
+ ],
68
73
  "files": [
69
74
  "dist",
70
75
  "migrations",
@@ -77,12 +82,11 @@
77
82
  "packages/ct-skills/skills",
78
83
  "completions",
79
84
  "server.json",
80
- "bin",
81
- ".claude-plugin"
85
+ "bin"
82
86
  ],
83
87
  "dependencies": {
84
88
  "@cleocode/caamp": "^1.7.0",
85
- "@cleocode/lafs-protocol": "^1.6.0",
89
+ "@cleocode/lafs-protocol": "^1.7.0",
86
90
  "@modelcontextprotocol/sdk": "^1.26.0",
87
91
  "ajv": "^8.18.0",
88
92
  "ajv-formats": "^3.0.1",
@@ -0,0 +1,84 @@
1
+ ---
2
+ name: ct-memory
3
+ version: 1.0.0
4
+ description: Brain memory protocol with progressive disclosure for anti-hallucination and context recall
5
+ triggers:
6
+ - memory
7
+ - brain
8
+ - recall
9
+ - remember
10
+ - anti-hallucination
11
+ ---
12
+
13
+ # ct-memory -- Brain Memory Protocol
14
+
15
+ ## Purpose
16
+
17
+ Ensures LLM agents never start conversations with amnesia. Provides structured memory access through CLEO's brain system using progressive disclosure.
18
+
19
+ ## Tier 0: Session Start (ALWAYS run on first interaction)
20
+
21
+ 1. The memory bridge (.cleo/memory-bridge.md) is already loaded via CLEO-INJECTION.md @-reference
22
+ 2. If the bridge content feels stale (>2 hours old), refresh:
23
+ - `query memory brain.search {query: "session task decision", limit: 10}`
24
+ 3. Check for anti-patterns to avoid:
25
+ - `query memory brain.search {query: "mistake error avoid warning", limit: 5}`
26
+ 4. If results are relevant, fetch details:
27
+ - `query memory brain.fetch {ids: ["O-xxx", "O-yyy"]}`
28
+
29
+ ## Tier 1: During Work (run when topic-relevant)
30
+
31
+ ### Before Making Decisions
32
+
33
+ - `query memory brain.search {query: "decision ADR architecture", limit: 5}`
34
+ - Check if a similar decision was already made
35
+
36
+ ### Before Repeating Work
37
+
38
+ - `query memory brain.search {query: "{current-topic}", limit: 10}`
39
+ - Avoid re-doing work that's already been completed
40
+
41
+ ### After Completing Significant Work
42
+
43
+ - `mutate memory brain.observe {text: "Completed X using approach Y. Key learning: Z", title: "Work completion"}`
44
+
45
+ ### Anti-Hallucination Protocol
46
+
47
+ Before stating facts about the codebase or project:
48
+
49
+ 1. Search brain: `query memory brain.search {query: "{claim-topic}", limit: 5}`
50
+ 2. If results exist, verify your claim matches stored knowledge
51
+ 3. If no results, state your uncertainty clearly
52
+
53
+ ## Tier 2: Deep Recall (run when specifically needed)
54
+
55
+ ### Full Timeline
56
+
57
+ - `query memory brain.timeline {anchor: "O-xxx", depthBefore: 5, depthAfter: 5}`
58
+ - Understand chronological context around a specific observation
59
+
60
+ ### Cross-Project Knowledge (via NEXUS)
61
+
62
+ - `query nexus search {query: "pattern", scope: "global"}`
63
+ - Search across all CLEO-managed projects
64
+
65
+ ## MCP Resources (Alternative to search)
66
+
67
+ For providers that support MCP resources:
68
+
69
+ - `ReadResource("cleo://memory/recent")` -- last 15 observations
70
+ - `ReadResource("cleo://memory/learnings")` -- active learnings with confidence
71
+ - `ReadResource("cleo://memory/patterns")` -- patterns to follow/avoid
72
+ - `ReadResource("cleo://memory/handoff")` -- last session handoff
73
+
74
+ ## Token Budget Guidelines
75
+
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 |
83
+
84
+ Stay within LAFS MVI budget: start minimal, escalate only when needed.
package/server.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "io.github.kryptobaseddev/cleo-mcp-server",
4
4
  "title": "CLEO MCP Server",
5
5
  "description": "Task management for AI coding agents — CQRS 2-gateway pattern, 200 ops across 10 domains",
6
- "version": "2026.3.27",
6
+ "version": "2026.3.30",
7
7
  "websiteUrl": "https://github.com/kryptobaseddev/cleo",
8
8
  "repository": {
9
9
  "url": "https://github.com/kryptobaseddev/cleo.git",
@@ -96,6 +96,17 @@ mutate memory brain.observe {text: "Found auth uses JWT", title: "Auth discovery
96
96
  - Fetching all entries without searching first (expensive)
97
97
  - Skipping brain.search and going straight to brain.fetch
98
98
 
99
+ ## Memory Bridge
100
+
101
+ CLEO auto-generates `.cleo/memory-bridge.md` from brain.db content. This file is `@`-referenced
102
+ in AGENTS.md so providers automatically load project memory context at session start.
103
+
104
+ **Contents**: Last session handoff, key learnings, active patterns, recent decisions, recent observations.
105
+
106
+ **Refreshes on**: `session.end`, `tasks.complete`, `memory.observe` (decisions), `cleo refresh-memory`.
107
+
108
+ If the file is missing, run `cleo init` or `cleo refresh-memory` to regenerate it.
109
+
99
110
  ## Escalation
100
111
 
101
112
  For deeper guidance beyond this minimal protocol:
@@ -1,25 +0,0 @@
1
- <cleo-brain-context>
2
- # CLEO Brain — Recent Memory
3
-
4
- - [D] 2026-03-02 Five-Wave Implementation Plan Created for Claude-Mem Replacement
5
- - [D] 2026-02-25 4-Feature Architecture Plan for Session Briefing, Bug Tracking, Planning, and Ha
6
- - [O] 2026-02-25 Session Engine Core Module Delegation Confirmed
7
- - [O] 2026-02-25 Session Domain Handler Engine Dependencies
8
- - [O] 2026-02-27 Created Agent Team "session-cleanup" for Waves 3-5
9
- - [O] 2026-03-02 Mutate Gateway Architecture for State-Modifying Operations
10
- - [O] 2026-02-25 4-Feature Architecture Plan for Session Briefing, Bug Tracking, Planning, and Ha
11
- - [O] 2026-03-01 Examined Bootstrap Brain State Loading with Speed Tiers
12
- - [O] 2026-02-27 ADR-009 Section 5 Documents BRAIN Capabilities by Domain
13
- - [O] 2026-02-28 Created Task for Phase 4 Skill Logic and Subagent Tier Integration
14
- - [O] 2026-02-28 Handoff and Debrief Implementation Architecture Revealed
15
- - [O] 2026-03-02 Five-Wave Implementation Plan Created for Claude-Mem Replacement
16
- - [O] 2026-02-28 Memory-Related Tasks Reveal Pending Consolidation Work
17
- - [O] 2026-02-28 Session CLI Commands Expose Start, Stop, and Handoff Operations
18
- - [O] 2026-02-27 claude-mem Observation Taxonomy and Mode-Based Configuration
19
- - [O] 2026-02-28 Assigned Phase 4 Task to Third Parallel Implementation Agent
20
- - [O] 2026-02-25 Wave 2-4 Engine Refactoring Tasks Reveal Increasing Complexity
21
- - [O] 2026-03-01 Epic B Phase 1 Specifications: Complete brain.db Schema with 6 Tables and FTS5 S
22
- - [O] 2026-03-02 CLEO-INJECTION v2.1.0 Minimal Template - 110 Lines Exceeds Test Constraint
23
- - [O] 2026-02-27 Validation Index Barrel Exports - Re-export Layer
24
- - [O] 2026-02-27 Drizzle Migration History - Seven Existing Migrations
25
- </cleo-brain-context>
@@ -1,315 +0,0 @@
1
- # CLEO Claude Code Plugin
2
-
3
- **Version**: 0.70.1
4
- **Status**: Optional Enhancement
5
- **Architecture**: Hybrid (Injection + Plugin)
6
-
7
- ---
8
-
9
- ## Overview
10
-
11
- CLEO uses a **hybrid approach** for multi-agent integration:
12
-
13
- | Component | Purpose | Support |
14
- |-----------|---------|---------|
15
- | **Injection System** | Multi-agent task management | 16+ agents (Claude, Cursor, Windsurf, Gemini, etc.) |
16
- | **Plugin System** | Claude Code hooks | Claude Code only |
17
-
18
- **Most users need injection only.** The plugin adds optional Claude Code-specific hooks for advanced users.
19
-
20
- ---
21
-
22
- ## Architecture
23
-
24
- ### Primary: Injection System
25
-
26
- The injection system provides CLEO task management to **all LLM agents** via registry-based auto-discovery:
27
-
28
- **Location**: `schemas/agent-registry.json`
29
- **Agents Supported**: claude-code, cursor, windsurf, gemini, copilot, roo-code, cline, continue, aider, bolt, replit, lovable, v0, devin, and more.
30
-
31
- **How it works**:
32
- 1. `cleo init` discovers installed agents automatically
33
- 2. Injects task management instructions to agent config files
34
- 3. Agents reference external docs via `@~/.cleo/docs/TODO_Task_Management.md`
35
- 4. Works with any agent that supports config file injection
36
-
37
- **Supported files**: `CLAUDE.md`, `CURSOR.md`, `.windsurfrules`, `GEMINI.md`, etc.
38
-
39
- ### Optional: Plugin System
40
-
41
- The plugin adds **Claude Code-specific hooks** for terminal integration:
42
-
43
- **Location**: `.claude-plugin/`
44
- **Capabilities**: SessionStart hook for automatic session binding
45
- **Limitation**: Claude Code only (not portable to other agents)
46
-
47
- **What the plugin provides**:
48
- - **SessionStart Hook**: Auto-binds CLEO session to Claude terminal via `CLEO_SESSION` env var
49
- - **TTY Integration**: Seamless session continuity across Claude Code restarts
50
-
51
- **What it does NOT provide**:
52
- - ❌ Slash commands (future enhancement)
53
- - ❌ Custom agents (future enhancement)
54
- - ❌ Portability to other agents (injection system handles this)
55
-
56
- ---
57
-
58
- ## When to Use Plugin
59
-
60
- ### Use Injection Only (Default) ✓
61
-
62
- **Recommended for**:
63
- - Multi-agent workflows (Cursor, Windsurf, Gemini, etc.)
64
- - Standard Claude Code usage
65
- - Users who don't need automatic session binding
66
-
67
- **What you get**:
68
- - Full CLEO task management (`cleo` CLI)
69
- - Multi-session support
70
- - Orchestration and subagents
71
- - Works in all supported agents
72
-
73
- ### Add Plugin (Advanced) ⚡
74
-
75
- **Recommended for**:
76
- - Heavy Claude Code users
77
- - Multi-session power users
78
- - Users who want automatic session binding
79
-
80
- **What you get**:
81
- - Everything from injection system
82
- - **PLUS**: SessionStart hook for automatic `CLEO_SESSION` binding
83
- - **PLUS**: TTY-aware session continuity
84
-
85
- ---
86
-
87
- ## Installation
88
-
89
- ### Default Installation (Injection Only)
90
-
91
- ```bash
92
- # Install CLEO with multi-agent support
93
- curl -fsSL https://github.com/kryptobaseddev/cleo/releases/latest/download/install.sh | bash
94
-
95
- # Setup agent configurations (auto-discovers installed agents)
96
- cleo init
97
-
98
- # Verify injection
99
- cleo doctor
100
- ```
101
-
102
- **Result**: CLEO works in all supported agents via injection system.
103
-
104
- ### Advanced Installation (Injection + Plugin)
105
-
106
- ```bash
107
- # Install CLEO with Claude Code plugin
108
- curl -fsSL https://github.com/kryptobaseddev/cleo/releases/latest/download/install.sh | bash -s -- --with-plugin
109
-
110
- # Setup agent configurations
111
- cleo init
112
-
113
- # Verify both injection and plugin
114
- cleo doctor
115
- ```
116
-
117
- **Result**: CLEO works in all agents + Claude Code gets SessionStart hook.
118
-
119
- ---
120
-
121
- ## Plugin Structure
122
-
123
- ```
124
- .claude-plugin/
125
- ├── plugin.json # Plugin manifest
126
- ├── hooks/
127
- │ ├── hooks.json # Hook configuration
128
- │ └── scripts/
129
- │ └── session-start.sh # SessionStart hook implementation
130
- └── README.md # This file
131
- ```
132
-
133
- ### plugin.json
134
-
135
- Plugin manifest defining capabilities:
136
-
137
- ```json
138
- {
139
- "name": "cleo",
140
- "version": "0.70.1",
141
- "capabilities": {
142
- "task_management": true,
143
- "multi_session": true,
144
- "orchestration": true
145
- },
146
- "hooks": {
147
- "enabled": true,
148
- "directory": "hooks",
149
- "manifest": "hooks/hooks.json"
150
- }
151
- }
152
- ```
153
-
154
- ### hooks.json
155
-
156
- Hook configuration for SessionStart event:
157
-
158
- ```json
159
- {
160
- "SessionStart": [{
161
- "matcher": "*",
162
- "hooks": [{
163
- "type": "command",
164
- "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/session-start.sh",
165
- "timeout": 10
166
- }]
167
- }]
168
- }
169
- ```
170
-
171
- ### session-start.sh
172
-
173
- Auto-binds active CLEO session to Claude terminal:
174
-
175
- **What it does**:
176
- 1. Checks for active CLEO session (`.cleo/.current-session`)
177
- 2. Verifies session is active via `cleo session status`
178
- 3. Exports `CLEO_SESSION` env var for terminal
179
- 4. Creates `.cleo/.session-env` for manual sourcing (if needed)
180
-
181
- **Exit conditions** (silent):
182
- - CLEO not installed
183
- - No `.cleo` directory (not a CLEO project)
184
- - No active session
185
- - Session inactive/ended
186
-
187
- ---
188
-
189
- ## Usage
190
-
191
- ### With Injection Only
192
-
193
- Standard CLI workflow:
194
-
195
- ```bash
196
- # Start session manually
197
- cleo session start --scope epic:T1074 --auto-focus
198
-
199
- # Use cleo commands with CLEO_SESSION env var
200
- export CLEO_SESSION="session_20260127_123456_abc123"
201
- cleo list --parent T1074
202
- cleo complete T1087
203
-
204
- # End session
205
- cleo session end --note "Completed plugin docs"
206
- ```
207
-
208
- ### With Plugin
209
-
210
- Plugin auto-binds session on Claude Code start:
211
-
212
- ```bash
213
- # Start session (manually or via orchestrator)
214
- cleo session start --scope epic:T1074 --auto-focus
215
-
216
- # Claude Code starts → plugin auto-exports CLEO_SESSION
217
- # ✓ CLEO session bound: session_20260127_123456_abc123
218
-
219
- # Use cleo commands (no manual export needed)
220
- cleo list --parent T1074
221
- cleo complete T1087
222
-
223
- # End session
224
- cleo session end --note "Completed plugin docs"
225
- ```
226
-
227
- **Key difference**: Plugin eliminates manual `export CLEO_SESSION=...` step.
228
-
229
- ---
230
-
231
- ## Hybrid Benefits
232
-
233
- | Benefit | Injection | Plugin |
234
- |---------|-----------|--------|
235
- | Multi-agent support | ✓ | ❌ |
236
- | Claude Code support | ✓ | ✓ |
237
- | Task management | ✓ | ✓ |
238
- | Multi-session | ✓ | ✓ |
239
- | Auto session binding | ❌ | ✓ |
240
- | TTY continuity | ❌ | ✓ |
241
-
242
- **Philosophy**: Injection provides portability, plugin provides polish.
243
-
244
- ---
245
-
246
- ## Decision Tree
247
-
248
- ```
249
- Do you use Claude Code exclusively?
250
- ├─ Yes
251
- │ └─ Do you want automatic session binding?
252
- │ ├─ Yes → Install with --with-plugin
253
- │ └─ No → Install default (injection only)
254
- └─ No (multi-agent workflow)
255
- └─ Install default (injection only)
256
- ```
257
-
258
- ---
259
-
260
- ## Troubleshooting
261
-
262
- ### Plugin Not Working
263
-
264
- **Symptom**: SessionStart hook not firing
265
-
266
- **Check**:
267
- 1. Plugin installed: `ls .claude-plugin/`
268
- 2. Hooks enabled: `cat .claude-plugin/plugin.json | jq '.hooks.enabled'`
269
- 3. CLEO session active: `cleo session status`
270
- 4. Claude Code version: Plugin requires Claude Code 1.0.0+
271
-
272
- ### Session Not Auto-Binding
273
-
274
- **Symptom**: `CLEO_SESSION` not set after Claude Code start
275
-
276
- **Check**:
277
- 1. Active session exists: `cat .cleo/.current-session`
278
- 2. Session is active: `cleo session status`
279
- 3. Hook script executable: `ls -l .claude-plugin/hooks/scripts/session-start.sh`
280
- 4. Manual test: `bash .claude-plugin/hooks/scripts/session-start.sh`
281
-
282
- ### Injection vs Plugin Conflict
283
-
284
- **Symptom**: Duplicate task management instructions
285
-
286
- **Resolution**: No conflict. Injection and plugin are complementary:
287
- - Injection: Provides task management docs to agent
288
- - Plugin: Provides terminal integration hooks
289
-
290
- Both can coexist safely.
291
-
292
- ---
293
-
294
- ## Future Enhancements
295
-
296
- **Planned plugin features** (not in v0.70.1):
297
- - Slash commands (`/cleo add "Task"`)
298
- - Custom agents (`ct-orchestrator`, `ct-epic-architect`)
299
- - Agent-to-agent communication (consensus protocol)
300
- - Git workflow integration
301
-
302
- **Current status**: Plugin provides SessionStart hook only. All other features use standard CLI.
303
-
304
- ---
305
-
306
- ## References
307
-
308
- - **Injection System**: `schemas/agent-registry.json`
309
- - **Setup Guide**: `docs/guides/AGENT-REGISTRATION.md`
310
- - **Subagent Architecture**: `docs/architecture/CLEO-SUBAGENT.md`
311
- - **Protocol Stack**: `src/protocols/`
312
-
313
- ---
314
-
315
- **Key Insight**: CLEO uses injection for portability, plugin for Claude Code polish. Most users need injection only.
@@ -1,56 +0,0 @@
1
- {
2
- "description": "CLEO task management and brain memory hooks",
3
- "hooks": {
4
- "SessionStart": [
5
- {
6
- "matcher": "*",
7
- "hooks": [
8
- {
9
- "type": "command",
10
- "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/session-start.sh",
11
- "timeout": 10
12
- },
13
- {
14
- "type": "command",
15
- "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/brain-start.sh",
16
- "timeout": 5
17
- }
18
- ]
19
- }
20
- ],
21
- "UserPromptSubmit": [
22
- {
23
- "hooks": [
24
- {
25
- "type": "command",
26
- "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/brain-hook.sh session-init",
27
- "timeout": 8
28
- }
29
- ]
30
- }
31
- ],
32
- "PostToolUse": [
33
- {
34
- "matcher": "*",
35
- "hooks": [
36
- {
37
- "type": "command",
38
- "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/brain-hook.sh observation",
39
- "timeout": 5
40
- }
41
- ]
42
- }
43
- ],
44
- "Stop": [
45
- {
46
- "hooks": [
47
- {
48
- "type": "command",
49
- "command": "bash ${CLAUDE_PLUGIN_ROOT}/hooks/scripts/brain-hook.sh summarize",
50
- "timeout": 30
51
- }
52
- ]
53
- }
54
- ]
55
- }
56
- }
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env bash
2
- # UserPromptSubmit: inject recent CLEO brain observations as context
3
- # Claude Code reads stdout from this hook and includes it in the session context.
4
- # Must be fast (<3s) and always exit 0.
5
-
6
- CLEO_BIN="${HOME}/.cleo/bin/cleo"
7
-
8
- # Bail fast if cleo not available or no .cleo dir
9
- [[ ! -x "$CLEO_BIN" ]] && exit 0
10
- [[ ! -d ".cleo" ]] && exit 0
11
-
12
- # Query recent brain observations — compact format
13
- CONTEXT=$("$CLEO_BIN" memory find "session task decision pattern learning" --limit 15 --json 2>/dev/null | \
14
- python3 -c "
15
- import json, sys
16
- try:
17
- d = json.loads(sys.stdin.read())
18
- hits = d.get('result', {}).get('results', [])
19
- if not hits:
20
- sys.exit(0)
21
- lines = ['## CLEO Brain Context (recent memories)\n']
22
- for h in hits:
23
- t = h.get('type', 'observation')
24
- icon = {'observation': 'O', 'decision': 'D', 'pattern': 'P', 'learning': 'L'}.get(t, 'O')
25
- title = h.get('title', '')[:90]
26
- date = h.get('date', '')[:10]
27
- lines.append(f'- [{icon}] {date} {title}')
28
- print('\n'.join(lines))
29
- print()
30
- except Exception:
31
- pass
32
- " 2>/dev/null || true)
33
-
34
- [[ -n "$CONTEXT" ]] && echo "$CONTEXT"
35
- exit 0
@@ -1,17 +0,0 @@
1
- #!/usr/bin/env bash
2
- # Fire-and-forget: send hook event to brain worker
3
- # Always exits 0 — never blocks Claude Code
4
- EVENT="$1"
5
- WORKER_PORT=37778
6
-
7
- # Read stdin
8
- INPUT=$(cat 2>/dev/null || echo '{}')
9
-
10
- # Non-blocking curl to worker
11
- curl -sf --max-time 5 \
12
- -X POST "http://127.0.0.1:${WORKER_PORT}/hook" \
13
- -H "Content-Type: application/json" \
14
- -d "{\"event\":\"${EVENT}\",\"data\":$(echo "$INPUT" | python3 -c 'import json,sys; print(json.dumps(json.load(sys.stdin)))' 2>/dev/null || echo '\"{}\"')}" \
15
- >/dev/null 2>&1 || true
16
-
17
- exit 0
@@ -1,6 +0,0 @@
1
- #!/usr/bin/env bash
2
- # SessionStart hook — starts the brain worker if not running
3
- SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
4
- node "$SCRIPT_DIR/brain-worker.cjs" start 2>/dev/null &
5
- disown 2>/dev/null || true
6
- exit 0