@ekkos/cli 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/cache/LocalSessionStore.d.ts +129 -0
  2. package/dist/cache/LocalSessionStore.js +688 -0
  3. package/dist/cache/capture.d.ts +26 -0
  4. package/dist/cache/capture.js +461 -0
  5. package/dist/cache/index.d.ts +7 -0
  6. package/dist/cache/index.js +23 -0
  7. package/dist/cache/types.d.ts +147 -0
  8. package/dist/cache/types.js +40 -0
  9. package/dist/commands/init.d.ts +9 -0
  10. package/dist/commands/init.js +478 -0
  11. package/dist/commands/run.d.ts +12 -0
  12. package/dist/commands/run.js +829 -0
  13. package/dist/commands/setup.d.ts +6 -0
  14. package/dist/commands/setup.js +658 -0
  15. package/dist/commands/status.d.ts +1 -0
  16. package/dist/commands/status.js +109 -0
  17. package/dist/commands/test.d.ts +1 -0
  18. package/dist/commands/test.js +157 -0
  19. package/dist/deploy/agents.d.ts +15 -0
  20. package/dist/deploy/agents.js +72 -0
  21. package/dist/deploy/hooks.d.ts +16 -0
  22. package/dist/deploy/hooks.js +121 -0
  23. package/dist/deploy/index.d.ts +7 -0
  24. package/dist/deploy/index.js +24 -0
  25. package/dist/deploy/instructions.d.ts +12 -0
  26. package/dist/deploy/instructions.js +36 -0
  27. package/dist/deploy/mcp.d.ts +19 -0
  28. package/dist/deploy/mcp.js +109 -0
  29. package/dist/deploy/plugins.d.ts +19 -0
  30. package/dist/deploy/plugins.js +62 -0
  31. package/dist/deploy/settings.d.ts +8 -0
  32. package/dist/deploy/settings.js +84 -0
  33. package/dist/deploy/skills.d.ts +19 -0
  34. package/dist/deploy/skills.js +60 -0
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.js +71 -0
  37. package/dist/restore/RestoreOrchestrator.d.ts +48 -0
  38. package/dist/restore/RestoreOrchestrator.js +481 -0
  39. package/dist/restore/index.d.ts +4 -0
  40. package/dist/restore/index.js +20 -0
  41. package/dist/utils/platform.d.ts +29 -0
  42. package/dist/utils/platform.js +65 -0
  43. package/dist/utils/session-words.json +119 -0
  44. package/dist/utils/state.d.ts +57 -0
  45. package/dist/utils/state.js +186 -0
  46. package/dist/utils/templates.d.ts +24 -0
  47. package/dist/utils/templates.js +118 -0
  48. package/package.json +48 -0
  49. package/templates/CLAUDE.md +287 -0
  50. package/templates/README.md +378 -0
  51. package/templates/agents/README.md +182 -0
  52. package/templates/agents/code-reviewer.md +166 -0
  53. package/templates/agents/debug-detective.md +169 -0
  54. package/templates/agents/ekkOS_Vercel.md +99 -0
  55. package/templates/agents/extension-manager.md +229 -0
  56. package/templates/agents/git-companion.md +185 -0
  57. package/templates/agents/github-test-agent.md +321 -0
  58. package/templates/agents/railway-manager.md +179 -0
  59. package/templates/claude-plugins/PHASE2_COMPLETION.md +346 -0
  60. package/templates/claude-plugins/PLUGIN_PROPOSALS.md +1776 -0
  61. package/templates/claude-plugins/README.md +587 -0
  62. package/templates/claude-plugins/agents/code-reviewer.json +14 -0
  63. package/templates/claude-plugins/agents/debug-detective.json +15 -0
  64. package/templates/claude-plugins/agents/git-companion.json +14 -0
  65. package/templates/claude-plugins/blog-manager/.claude-plugin/plugin.json +8 -0
  66. package/templates/claude-plugins/blog-manager/commands/blog.md +691 -0
  67. package/templates/claude-plugins/golden-loop-monitor/.claude-plugin/plugin.json +8 -0
  68. package/templates/claude-plugins/golden-loop-monitor/commands/loop-status.md +434 -0
  69. package/templates/claude-plugins/learning-tracker/.claude-plugin/plugin.json +8 -0
  70. package/templates/claude-plugins/learning-tracker/commands/my-patterns.md +282 -0
  71. package/templates/claude-plugins/memory-lens/.claude-plugin/plugin.json +8 -0
  72. package/templates/claude-plugins/memory-lens/commands/memory-search.md +181 -0
  73. package/templates/claude-plugins/pattern-coach/.claude-plugin/plugin.json +8 -0
  74. package/templates/claude-plugins/pattern-coach/commands/forge.md +365 -0
  75. package/templates/claude-plugins/project-schema-validator/.claude-plugin/plugin.json +8 -0
  76. package/templates/claude-plugins/project-schema-validator/commands/validate-schema.md +582 -0
  77. package/templates/claude-plugins-admin/AGENT_TEAM_PROPOSALS.md +819 -0
  78. package/templates/claude-plugins-admin/README.md +446 -0
  79. package/templates/claude-plugins-admin/autonomous-admin-agent/.claude-plugin/plugin.json +8 -0
  80. package/templates/claude-plugins-admin/autonomous-admin-agent/commands/agent.md +595 -0
  81. package/templates/claude-plugins-admin/backend-agent/.claude-plugin/plugin.json +8 -0
  82. package/templates/claude-plugins-admin/backend-agent/commands/backend.md +798 -0
  83. package/templates/claude-plugins-admin/deploy-guardian/.claude-plugin/plugin.json +8 -0
  84. package/templates/claude-plugins-admin/deploy-guardian/commands/deploy.md +554 -0
  85. package/templates/claude-plugins-admin/frontend-agent/.claude-plugin/plugin.json +8 -0
  86. package/templates/claude-plugins-admin/frontend-agent/commands/frontend.md +881 -0
  87. package/templates/claude-plugins-admin/mcp-server-manager/.claude-plugin/plugin.json +8 -0
  88. package/templates/claude-plugins-admin/mcp-server-manager/commands/mcp.md +85 -0
  89. package/templates/claude-plugins-admin/memory-system-monitor/.claude-plugin/plugin.json +8 -0
  90. package/templates/claude-plugins-admin/memory-system-monitor/commands/memory-health.md +569 -0
  91. package/templates/claude-plugins-admin/qa-agent/.claude-plugin/plugin.json +8 -0
  92. package/templates/claude-plugins-admin/qa-agent/commands/qa.md +863 -0
  93. package/templates/claude-plugins-admin/tech-lead-agent/.claude-plugin/plugin.json +8 -0
  94. package/templates/claude-plugins-admin/tech-lead-agent/commands/lead.md +732 -0
  95. package/templates/commands/continue.md +47 -0
  96. package/templates/cursor-hooks/after-agent-response.sh +117 -0
  97. package/templates/cursor-hooks/before-submit-prompt.sh +419 -0
  98. package/templates/cursor-hooks/hooks.json +20 -0
  99. package/templates/cursor-hooks/lib/contract.sh +320 -0
  100. package/templates/cursor-hooks/stop.sh +75 -0
  101. package/templates/cursor-rules/ekkos-memory.md +187 -0
  102. package/templates/hooks/assistant-response.sh +96 -0
  103. package/templates/hooks/hooks.json +28 -0
  104. package/templates/hooks/lib/contract.sh +320 -0
  105. package/templates/hooks/lib/state.sh +158 -0
  106. package/templates/hooks/session-start.ps1 +41 -0
  107. package/templates/hooks/session-start.sh +318 -0
  108. package/templates/hooks/stop.ps1 +16 -0
  109. package/templates/hooks/stop.sh +989 -0
  110. package/templates/hooks/user-prompt-submit.ps1 +174 -0
  111. package/templates/hooks/user-prompt-submit.sh +587 -0
  112. package/templates/hooks-node/lib/state.js +187 -0
  113. package/templates/hooks-node/stop.js +416 -0
  114. package/templates/hooks-node/user-prompt-submit.js +337 -0
  115. package/templates/plan-template.md +306 -0
  116. package/templates/rules/00-hooks-contract.mdc +89 -0
  117. package/templates/rules/30-ekkos-core.mdc +188 -0
  118. package/templates/rules/31-ekkos-messages.mdc +78 -0
  119. package/templates/skills/continue/SKILL.md +169 -0
  120. package/templates/skills/ekkOS_Deep_Recall/Skill.md +282 -0
  121. package/templates/skills/ekkOS_Learn/Skill.md +265 -0
  122. package/templates/skills/ekkOS_Memory_First/Skill.md +206 -0
  123. package/templates/skills/ekkOS_Plan_Assist/Skill.md +302 -0
  124. package/templates/skills/ekkOS_Preferences/Skill.md +247 -0
  125. package/templates/skills/ekkOS_Reflect/Skill.md +257 -0
  126. package/templates/skills/ekkOS_Safety/Skill.md +265 -0
  127. package/templates/skills/ekkOS_Schema/Skill.md +251 -0
  128. package/templates/skills/ekkOS_Summary/Skill.md +257 -0
  129. package/templates/skills/ekkOS_Vault/Skill.md +287 -0
  130. package/templates/skills/permissions/Skill.md +322 -0
  131. package/templates/spec-template.md +159 -0
  132. package/templates/windsurf-hooks/before-submit-prompt.sh +238 -0
  133. package/templates/windsurf-hooks/hooks.json +10 -0
  134. package/templates/windsurf-hooks/lib/contract.sh +320 -0
  135. package/templates/windsurf-rules/ekkos-memory.md +129 -0
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "ekkos-admin-mcp-manager",
3
+ "description": "ADMIN ONLY: Manage MCP server operations - restart, monitor, debug API endpoints.",
4
+ "author": {
5
+ "name": "ekkOS Internal",
6
+ "email": "dev@ekkos.dev"
7
+ }
8
+ }
@@ -0,0 +1,85 @@
1
+ # MCP Server Manager
2
+
3
+ **ADMIN ONLY** - Manage the ekkOS MCP server (apps/memory deployed to api.ekkos.dev).
4
+
5
+ ## Commands
6
+
7
+ ### `/mcp status`
8
+ Check MCP server health and all 31 tools.
9
+
10
+ ```bash
11
+ /mcp status
12
+
13
+ 🔧 MCP Server Status
14
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
+
16
+ Server: api.ekkos.dev (apps/memory)
17
+ Status: ✅ Healthy
18
+ Uptime: 15 days, 3 hours
19
+ Version: v2.45.1
20
+
21
+ Tool Health (31 total):
22
+ ✅ 31/31 tools responding
23
+ ⚡ Avg response time: 145ms
24
+
25
+ Recent Errors: 0 (last hour)
26
+ Active Connections: 1,245 users
27
+
28
+ Quick Actions:
29
+ - Restart: /mcp restart
30
+ - View logs: /mcp logs
31
+ - Test tools: /mcp test-tools
32
+ ```
33
+
34
+ ### `/mcp restart`
35
+ Restart MCP server (deploys latest from Vercel).
36
+
37
+ ### `/mcp logs`
38
+ View MCP server logs and errors.
39
+
40
+ ### `/mcp test-tools`
41
+ Test all 31 MCP tools are responding.
42
+
43
+ ```bash
44
+ /mcp test-tools
45
+
46
+ Testing 31 MCP tools...
47
+ ✅ ekkOS_Search (125ms)
48
+ ✅ ekkOS_Forge (89ms)
49
+ ✅ ekkOS_Directive (45ms)
50
+ [... all 31 tools ...]
51
+
52
+ Result: 31/31 passed ✅
53
+ ```
54
+
55
+ ### `/mcp debug`
56
+ Debug specific tool issues.
57
+
58
+ ```bash
59
+ /mcp debug ekkOS_Search
60
+
61
+ 🔍 Debugging: ekkOS_Search
62
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
63
+
64
+ Last 10 calls:
65
+ ✅ 145ms - query: "auth patterns"
66
+ ✅ 123ms - query: "deploy errors"
67
+ ❌ TIMEOUT - query: "schema validation" (> 30s)
68
+ ✅ 98ms - query: "typescript"
69
+
70
+ Error details:
71
+ - Timeout on complex query
72
+ - Database connection pool exhausted
73
+ - Recommendation: Increase pool size or optimize query
74
+ ```
75
+
76
+ ## MCP Tools Used
77
+
78
+ - `ekkOS_Summary` - Get MCP activity
79
+ - `ekkOS_Stats` - Server statistics
80
+ - `Bash` - Execute server commands
81
+ - `supabase_get_logs` - View API logs
82
+
83
+ ---
84
+
85
+ **Keep the MCP server healthy.** 🔧
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "ekkos-admin-memory-monitor",
3
+ "description": "ADMIN ONLY: Monitor and manage the 11-layer memory system. Health checks, data integrity, performance optimization.",
4
+ "author": {
5
+ "name": "ekkOS Internal",
6
+ "email": "dev@ekkos.dev"
7
+ }
8
+ }
@@ -0,0 +1,569 @@
1
+ # Memory System Monitor
2
+
3
+ **ADMIN ONLY** - Monitor and manage the 11-layer ekkOS memory architecture.
4
+
5
+ ## Overview
6
+
7
+ The Memory System Monitor provides deep visibility into ekkOS's memory layers, data integrity, performance metrics, and system health.
8
+
9
+ ## 11-Layer Architecture
10
+
11
+ | Layer | Name | Storage | Purpose |
12
+ |-------|------|---------|---------|
13
+ | L1 | Working | RAM | Current session state |
14
+ | L2 | Episodic | PostgreSQL | Past conversations |
15
+ | L3 | Semantic | Vector DB | Embeddings & knowledge |
16
+ | L4 | Patterns | PostgreSQL | Proven solutions |
17
+ | L5 | Procedural | PostgreSQL | Step-by-step guides |
18
+ | L6 | Collective | PostgreSQL | Cross-user wisdom |
19
+ | L7 | Meta | PostgreSQL | Pattern effectiveness |
20
+ | L8 | Codebase | Vector DB | Project-specific patterns |
21
+ | L9 | Directives | PostgreSQL | User preferences |
22
+ | L10 | Conflict | In-memory | Contradiction resolution |
23
+ | L11 | Secrets | PostgreSQL (encrypted) | Credentials |
24
+
25
+ ## Commands
26
+
27
+ ### `/memory-health`
28
+
29
+ Comprehensive health check of all memory layers.
30
+
31
+ ```bash
32
+ # Check all layers
33
+ /memory-health
34
+
35
+ # Check specific layer
36
+ /memory-health --layer 4
37
+
38
+ # Detailed diagnostics
39
+ /memory-health --detailed
40
+
41
+ # Check data integrity
42
+ /memory-health --integrity
43
+ ```
44
+
45
+ **Example Output:**
46
+ ```
47
+ 🧠 ekkOS Memory System Health
48
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
49
+
50
+ Overall Health: 92/100 (Excellent) ✅
51
+
52
+ ───────────────────────────────────────────────────────────────────
53
+ 📊 Layer-by-Layer Status
54
+
55
+ L1 (Working Memory)
56
+ Status: ✅ Healthy
57
+ Active Sessions: 1,245
58
+ Memory Usage: 2.3 GB / 8 GB
59
+ Performance: Excellent (< 10ms access)
60
+
61
+ L2 (Episodic Memory)
62
+ Status: ✅ Healthy
63
+ Total Episodes: 45,892
64
+ Growth: +234 this week
65
+ Oldest: 6 months ago
66
+ Performance: Good (45ms avg query)
67
+
68
+ L3 (Semantic Memory)
69
+ Status: ✅ Healthy
70
+ Total Embeddings: 123,456
71
+ Vector Dimensions: 1536
72
+ Index Size: 4.2 GB
73
+ Performance: Excellent (< 100ms search)
74
+
75
+ L4 (Patterns)
76
+ Status: ✅ Healthy
77
+ Total Patterns: 3,452
78
+ Success Rate: 84% avg
79
+ Active Patterns: 2,987 (87%)
80
+ Stale Patterns: 465 (13%)
81
+ Performance: Excellent (< 50ms query)
82
+
83
+ L5 (Procedural)
84
+ Status: ⚠️ Warning
85
+ Total Workflows: 89
86
+ Issue: 12 workflows have > 30% step failure rate
87
+ Recommendation: Review and update failing workflows
88
+ Performance: Good (80ms avg)
89
+
90
+ L6 (Collective)
91
+ Status: ✅ Healthy
92
+ Collective Patterns: 856
93
+ Contributors: 234 users
94
+ K-Anonymity: Maintained (k=5)
95
+ Performance: Good (120ms avg)
96
+
97
+ L7 (Meta)
98
+ Status: ✅ Healthy
99
+ Effectiveness Tracking: Active
100
+ Success Metrics: Updated daily
101
+ Pattern Evolution: 23 patterns evolved this week
102
+ Performance: Excellent
103
+
104
+ L8 (Codebase)
105
+ Status: ✅ Healthy
106
+ Indexed Projects: 1,456
107
+ Total Schemas: 8,923
108
+ Indexing Current: No
109
+ Performance: Good (150ms avg)
110
+
111
+ L9 (Directives)
112
+ Status: ✅ Healthy
113
+ Total Directives: 4,567
114
+ ├─ MUST: 1,234
115
+ ├─ NEVER: 892
116
+ ├─ PREFER: 1,678
117
+ └─ AVOID: 763
118
+ Conflicts Detected: 3 (auto-resolved)
119
+ Performance: Excellent (< 20ms)
120
+
121
+ L10 (Conflict Resolution)
122
+ Status: ✅ Healthy
123
+ Active Conflicts: 3
124
+ Resolved Today: 12
125
+ Resolution Rate: 98%
126
+ Performance: Immediate (in-memory)
127
+
128
+ L11 (Secrets)
129
+ Status: 🔒 Secure
130
+ Total Secrets: 892
131
+ Encryption: AES-256-GCM ✅
132
+ Stale Secrets (90+ days): 23
133
+ Recommendation: Rotate stale secrets
134
+ Performance: Excellent (< 30ms decrypt)
135
+
136
+ ───────────────────────────────────────────────────────────────────
137
+ ⚠️ Issues Requiring Attention
138
+
139
+ 1. Layer 5 (Procedural)
140
+ • 12 workflows with high failure rates
141
+ • Review with: /memory-health --layer 5 --show-failing
142
+
143
+ 2. Layer 11 (Secrets)
144
+ • 23 stale secrets (90+ days old)
145
+ • Rotate with: /memory-health --rotate-stale-secrets
146
+
147
+ ───────────────────────────────────────────────────────────────────
148
+ 📈 Performance Metrics
149
+
150
+ Query Performance:
151
+ • Fastest: L1 Working (< 10ms)
152
+ • Slowest: L8 Codebase (150ms avg)
153
+ • Overall: Excellent
154
+
155
+ Storage Efficiency:
156
+ • Total Storage: 24.5 GB
157
+ • Growth Rate: +1.2 GB/month
158
+ • Optimization: Well-indexed
159
+
160
+ Memory Growth:
161
+ • Patterns: +45/week
162
+ • Episodes: +234/week
163
+ • Embeddings: +892/week
164
+ • Trend: Healthy growth
165
+
166
+ ───────────────────────────────────────────────────────────────────
167
+ 🔧 Recommended Actions
168
+
169
+ 1. Review failing workflows in L5
170
+ 2. Rotate 23 stale secrets in L11
171
+ 3. Archive stale patterns in L4 (465 candidates)
172
+ 4. Run optimization: /memory-optimize
173
+
174
+ Next health check recommended: Tomorrow
175
+ ```
176
+
177
+ ### `/memory-stats`
178
+
179
+ Detailed statistics for specific layer.
180
+
181
+ ```bash
182
+ # Stats for patterns
183
+ /memory-stats patterns
184
+
185
+ # Stats for specific user
186
+ /memory-stats --user user_abc123
187
+
188
+ # Stats for all layers
189
+ /memory-stats --all
190
+
191
+ # Export stats to file
192
+ /memory-stats --export stats.json
193
+ ```
194
+
195
+ **Example:**
196
+ ```bash
197
+ /memory-stats patterns
198
+
199
+ 🧠 Layer 4: Patterns - Detailed Statistics
200
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
201
+
202
+ Total Patterns: 3,452
203
+
204
+ ───────────────────────────────────────────────────────────────────
205
+ 📊 By Success Rate
206
+
207
+ ⭐⭐⭐⭐⭐ (90-100%): 1,456 patterns (42%)
208
+ ⭐⭐⭐⭐☆ (80-90%): 892 patterns (26%)
209
+ ⭐⭐⭐☆☆ (70-80%): 534 patterns (15%)
210
+ ⭐⭐☆☆☆ (60-70%): 245 patterns (7%)
211
+ ⭐☆☆☆☆ (< 60%): 325 patterns (9%)
212
+
213
+ Average Success Rate: 84%
214
+
215
+ ───────────────────────────────────────────────────────────────────
216
+ 📈 By Usage
217
+
218
+ Highly Used (50+ times): 234 patterns
219
+ Moderately Used (10-50): 1,245 patterns
220
+ Low Use (1-10): 1,508 patterns
221
+ Never Used: 465 patterns (13%)
222
+
223
+ ───────────────────────────────────────────────────────────────────
224
+ 🏷️ By Category
225
+
226
+ TypeScript: 892 patterns (26%)
227
+ API/Backend: 678 patterns (20%)
228
+ React/Frontend: 534 patterns (15%)
229
+ Database: 423 patterns (12%)
230
+ DevOps: 312 patterns (9%)
231
+ Security: 289 patterns (8%)
232
+ Testing: 178 patterns (5%)
233
+ Other: 146 patterns (4%)
234
+
235
+ ───────────────────────────────────────────────────────────────────
236
+ 👥 By Contributor
237
+
238
+ Top Contributors:
239
+ 1. user_xyz123: 456 patterns (94% success)
240
+ 2. user_abc789: 389 patterns (89% success)
241
+ 3. user_def456: 312 patterns (87% success)
242
+ [... top 10 ...]
243
+
244
+ Total Contributors: 234 users
245
+
246
+ ───────────────────────────────────────────────────────────────────
247
+ 📅 By Age
248
+
249
+ This Week: 45 patterns
250
+ This Month: 189 patterns
251
+ This Quarter: 567 patterns
252
+ This Year: 2,134 patterns
253
+ Older: 1,318 patterns
254
+
255
+ ───────────────────────────────────────────────────────────────────
256
+ ⚠️ Quality Issues
257
+
258
+ Low Success Rate (< 60%): 325 patterns
259
+ Never Applied: 465 patterns
260
+ Stale (90+ days unused): 234 patterns
261
+
262
+ Recommendations:
263
+ • Archive stale patterns
264
+ • Update low-success patterns
265
+ • Promote high-success to collective
266
+ ```
267
+
268
+ ### `/memory-optimize`
269
+
270
+ Optimize memory system performance.
271
+
272
+ ```bash
273
+ # Run all optimizations
274
+ /memory-optimize
275
+
276
+ # Optimize specific layer
277
+ /memory-optimize --layer 4
278
+
279
+ # Dry run (show what would be done)
280
+ /memory-optimize --dry-run
281
+
282
+ # Force full optimization
283
+ /memory-optimize --force
284
+ ```
285
+
286
+ **What it does:**
287
+ - Archives stale patterns
288
+ - Rebuilds indexes
289
+ - Vacuums PostgreSQL tables
290
+ - Optimizes vector searches
291
+ - Removes orphaned data
292
+ - Compacts storage
293
+
294
+ **Example:**
295
+ ```bash
296
+ /memory-optimize
297
+
298
+ 🔧 Memory System Optimization
299
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
300
+
301
+ Starting optimization...
302
+
303
+ ───────────────────────────────────────────────────────────────────
304
+ L4 (Patterns)
305
+
306
+ [████████░░░░░░░░░░░░] 40% - Archiving stale patterns...
307
+ • Archived 465 stale patterns
308
+ • Freed 234 MB
309
+
310
+ [████████████░░░░░░░░] 60% - Rebuilding indexes...
311
+ • Rebuilt pattern_title_idx
312
+ • Rebuilt pattern_tags_idx
313
+ • Query performance: +15%
314
+
315
+ [████████████████░░░░] 80% - Vacuuming tables...
316
+ • Vacuumed learning_patterns
317
+ • Reclaimed 89 MB
318
+
319
+ [████████████████████] 100% - Complete!
320
+
321
+ L3 (Semantic Memory)
322
+
323
+ [████████████████████] 100% - Optimizing vector index...
324
+ • Reindexed 123,456 vectors
325
+ • Search performance: +8%
326
+
327
+ ───────────────────────────────────────────────────────────────────
328
+ ✅ Optimization Complete!
329
+
330
+ Performance Improvements:
331
+ • Pattern queries: +15% faster
332
+ • Vector searches: +8% faster
333
+ • Storage freed: 323 MB
334
+
335
+ Next optimization recommended: 1 week
336
+ ```
337
+
338
+ ### `/memory-integrity`
339
+
340
+ Check data integrity across layers.
341
+
342
+ ```bash
343
+ # Check all layers
344
+ /memory-integrity
345
+
346
+ # Check specific layer
347
+ /memory-integrity --layer 4
348
+
349
+ # Fix issues automatically
350
+ /memory-integrity --fix
351
+
352
+ # Show details
353
+ /memory-integrity --verbose
354
+ ```
355
+
356
+ **What it checks:**
357
+ - Referential integrity (foreign keys)
358
+ - Data consistency
359
+ - Orphaned records
360
+ - Missing embeddings
361
+ - Duplicate patterns
362
+ - Corrupted data
363
+
364
+ **Example:**
365
+ ```bash
366
+ /memory-integrity
367
+
368
+ 🔍 Data Integrity Check
369
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
370
+
371
+ Scanning all layers...
372
+
373
+ ───────────────────────────────────────────────────────────────────
374
+ ✅ L1 (Working): No issues
375
+
376
+ ✅ L2 (Episodic): No issues
377
+
378
+ ⚠️ L3 (Semantic): Minor issues found
379
+ • 12 embeddings without source records
380
+ • Fix: Delete orphaned embeddings
381
+ • Impact: Minimal
382
+
383
+ ✅ L4 (Patterns): No issues
384
+
385
+ ⚠️ L5 (Procedural): Minor issues found
386
+ • 3 workflows reference deleted patterns
387
+ • Fix: Update workflow references
388
+ • Impact: Low
389
+
390
+ ✅ L6-L11: No issues
391
+
392
+ ───────────────────────────────────────────────────────────────────
393
+ 📊 Summary
394
+
395
+ Total Issues: 2 minor
396
+ Critical: 0
397
+ Warnings: 2
398
+ Info: 0
399
+
400
+ Recommended: Run /memory-integrity --fix
401
+
402
+ ───────────────────────────────────────────────────────────────────
403
+ 🔧 Auto-Fix Available
404
+
405
+ Run this to fix all issues:
406
+ /memory-integrity --fix
407
+
408
+ Or fix manually:
409
+ • L3: DELETE FROM embeddings WHERE source_id NOT IN (SELECT id FROM sources)
410
+ • L5: UPDATE workflows SET pattern_ids = ... WHERE ...
411
+ ```
412
+
413
+ ### `/memory-query`
414
+
415
+ Advanced querying across memory layers.
416
+
417
+ ```bash
418
+ # Query patterns by criteria
419
+ /memory-query patterns --success-rate ">90" --usage ">50"
420
+
421
+ # Find patterns by user
422
+ /memory-query patterns --user user_xyz123
423
+
424
+ # Find secrets expiring soon
425
+ /memory-query secrets --expiring-within 30days
426
+
427
+ # Complex query
428
+ /memory-query patterns --tags "typescript,api" --created-after "2025-01-01"
429
+ ```
430
+
431
+ ### `/memory-export`
432
+
433
+ Export memory data for backup or analysis.
434
+
435
+ ```bash
436
+ # Export all layers
437
+ /memory-export --all
438
+
439
+ # Export specific layer
440
+ /memory-export --layer 4
441
+
442
+ # Export for specific user
443
+ /memory-export --user user_xyz123
444
+
445
+ # Export with encryption
446
+ /memory-export --encrypted --password "..."
447
+ ```
448
+
449
+ ### `/memory-import`
450
+
451
+ Import memory data from backup.
452
+
453
+ ```bash
454
+ # Import from file
455
+ /memory-import backup.json
456
+
457
+ # Import specific layer
458
+ /memory-import backup.json --layer 4
459
+
460
+ # Merge strategy
461
+ /memory-import backup.json --merge skip-existing
462
+ ```
463
+
464
+ ## PM2 Worker Management
465
+
466
+ ### Brain Workers (via Railway)
467
+
468
+ | Worker | Purpose | Schedule |
469
+ |--------|---------|----------|
470
+ | `brain-decay` | Pattern cleanup & decay | Daily 1 AM |
471
+ | `judge-queue` | Episode judging | Daily 2 AM |
472
+ | `pattern-stats-recalc` | Recalculate success rates | Daily 1 AM |
473
+ | `pattern-generalize-grok` | Generalize patterns | Daily 2 AM |
474
+ | `pattern-promote-collective` | Promote to collective | Weekly Sun 3 AM |
475
+ | `pattern-cluster-hdbscan` | Cluster duplicates | Weekly Sun 4 AM |
476
+
477
+ **Check worker status:**
478
+ ```bash
479
+ /memory-health --workers
480
+
481
+ # Shows:
482
+ # - Last run time
483
+ # - Success/failure
484
+ # - Next scheduled run
485
+ # - Logs/errors
486
+ ```
487
+
488
+ ## MCP Tools Used
489
+
490
+ - `ekkOS_Stats` - Get memory layer statistics
491
+ - `ekkOS_Search` - Query patterns and data
492
+ - `ekkOS_Export` - Export memory data
493
+ - `ekkOS_Import` - Import memory data
494
+ - `ekkOS_Summary` - Recent activity summary
495
+ - `Bash` - Execute database queries and PM2 commands
496
+ - `supabase_execute_sql` - Direct database access
497
+
498
+ ## Database Queries
499
+
500
+ The plugin can execute Supabase queries for deep inspection:
501
+
502
+ ```sql
503
+ -- Find stale patterns
504
+ SELECT id, title, last_used_at
505
+ FROM learning_patterns
506
+ WHERE last_used_at < NOW() - INTERVAL '90 days';
507
+
508
+ -- Pattern success rates
509
+ SELECT
510
+ title,
511
+ success_count,
512
+ failure_count,
513
+ (success_count::float / NULLIF(success_count + failure_count, 0)) * 100 as success_rate
514
+ FROM learning_patterns
515
+ ORDER BY success_rate DESC
516
+ LIMIT 20;
517
+
518
+ -- User contribution stats
519
+ SELECT
520
+ user_id,
521
+ COUNT(*) as pattern_count,
522
+ AVG(success_rate) as avg_success
523
+ FROM learning_patterns
524
+ GROUP BY user_id
525
+ ORDER BY pattern_count DESC
526
+ LIMIT 10;
527
+ ```
528
+
529
+ ## Troubleshooting
530
+
531
+ ### High Memory Usage
532
+
533
+ **Problem:** L1 (Working) using too much RAM
534
+ **Check:** /memory-health --layer 1
535
+ **Fix:**
536
+ - Reduce active sessions
537
+ - Increase RAM allocation
538
+ - Optimize session cleanup
539
+
540
+ ### Slow Pattern Queries
541
+
542
+ **Problem:** L4 queries taking > 500ms
543
+ **Check:** /memory-health --layer 4 --performance
544
+ **Fix:**
545
+ - Run optimization: /memory-optimize --layer 4
546
+ - Rebuild indexes
547
+ - Archive stale patterns
548
+
549
+ ### Missing Embeddings
550
+
551
+ **Problem:** Patterns without semantic embeddings
552
+ **Check:** /memory-integrity --layer 3
553
+ **Fix:**
554
+ - Regenerate embeddings
555
+ - Check embedding service status
556
+ - Backfill missing vectors
557
+
558
+ ### Worker Failures
559
+
560
+ **Problem:** Brain-decay worker failing
561
+ **Check:** /memory-health --workers
562
+ **Fix:**
563
+ - Check Railway logs
564
+ - Verify database connection
565
+ - Restart worker: pm2 restart brain-decay
566
+
567
+ ---
568
+
569
+ **Monitor deeply. Optimize regularly. Maintain integrity.** 🧠
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "ekkos-admin-qa",
3
+ "description": "ADMIN ONLY: AI QA Engineer specialized in testing, quality assurance, test automation, and ensuring code quality.",
4
+ "author": {
5
+ "name": "ekkOS Internal",
6
+ "email": "dev@ekkos.dev"
7
+ }
8
+ }