@ekkos/cli 1.3.1 → 1.3.5

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 (131) hide show
  1. package/dist/capture/jsonl-rewriter.d.ts +1 -1
  2. package/dist/capture/jsonl-rewriter.js +3 -3
  3. package/dist/capture/transcript-repair.d.ts +2 -2
  4. package/dist/capture/transcript-repair.js +2 -2
  5. package/dist/commands/claw.d.ts +13 -0
  6. package/dist/commands/claw.js +253 -0
  7. package/dist/commands/dashboard.js +742 -118
  8. package/dist/commands/doctor.d.ts +3 -3
  9. package/dist/commands/doctor.js +6 -79
  10. package/dist/commands/gemini.d.ts +19 -0
  11. package/dist/commands/gemini.js +193 -0
  12. package/dist/commands/init.d.ts +1 -0
  13. package/dist/commands/init.js +56 -41
  14. package/dist/commands/run.d.ts +0 -1
  15. package/dist/commands/run.js +288 -263
  16. package/dist/commands/scan.d.ts +21 -0
  17. package/dist/commands/scan.js +386 -0
  18. package/dist/commands/status.d.ts +4 -1
  19. package/dist/commands/status.js +165 -27
  20. package/dist/commands/swarm-dashboard.js +156 -28
  21. package/dist/commands/swarm.d.ts +1 -1
  22. package/dist/commands/swarm.js +1 -1
  23. package/dist/commands/test-claude.d.ts +2 -2
  24. package/dist/commands/test-claude.js +3 -3
  25. package/dist/deploy/index.d.ts +0 -2
  26. package/dist/deploy/index.js +0 -2
  27. package/dist/deploy/settings.d.ts +6 -5
  28. package/dist/deploy/settings.js +64 -16
  29. package/dist/deploy/skills.js +1 -2
  30. package/dist/index.js +86 -96
  31. package/dist/lib/usage-parser.d.ts +1 -1
  32. package/dist/lib/usage-parser.js +9 -6
  33. package/dist/local/index.d.ts +14 -0
  34. package/dist/local/index.js +28 -0
  35. package/dist/local/local-embeddings.d.ts +49 -0
  36. package/dist/local/local-embeddings.js +232 -0
  37. package/dist/local/offline-fallback.d.ts +44 -0
  38. package/dist/local/offline-fallback.js +159 -0
  39. package/dist/local/sqlite-store.d.ts +126 -0
  40. package/dist/local/sqlite-store.js +393 -0
  41. package/dist/local/sync-engine.d.ts +42 -0
  42. package/dist/local/sync-engine.js +223 -0
  43. package/dist/utils/platform.d.ts +5 -1
  44. package/dist/utils/platform.js +24 -4
  45. package/dist/utils/proxy-url.d.ts +21 -0
  46. package/dist/utils/proxy-url.js +34 -0
  47. package/dist/utils/state.d.ts +1 -1
  48. package/dist/utils/state.js +11 -3
  49. package/dist/utils/templates.js +1 -1
  50. package/package.json +11 -4
  51. package/templates/CLAUDE.md +49 -107
  52. package/dist/agent/daemon.d.ts +0 -130
  53. package/dist/agent/daemon.js +0 -606
  54. package/dist/agent/health-check.d.ts +0 -35
  55. package/dist/agent/health-check.js +0 -243
  56. package/dist/agent/pty-runner.d.ts +0 -53
  57. package/dist/agent/pty-runner.js +0 -190
  58. package/dist/commands/agent.d.ts +0 -50
  59. package/dist/commands/agent.js +0 -544
  60. package/dist/commands/setup-remote.d.ts +0 -20
  61. package/dist/commands/setup-remote.js +0 -582
  62. package/dist/utils/verify-remote-terminal.d.ts +0 -10
  63. package/dist/utils/verify-remote-terminal.js +0 -415
  64. package/templates/README.md +0 -378
  65. package/templates/claude-plugins/PHASE2_COMPLETION.md +0 -346
  66. package/templates/claude-plugins/PLUGIN_PROPOSALS.md +0 -1776
  67. package/templates/claude-plugins/README.md +0 -587
  68. package/templates/claude-plugins/agents/code-reviewer.json +0 -14
  69. package/templates/claude-plugins/agents/debug-detective.json +0 -15
  70. package/templates/claude-plugins/agents/git-companion.json +0 -14
  71. package/templates/claude-plugins/blog-manager/.claude-plugin/plugin.json +0 -8
  72. package/templates/claude-plugins/blog-manager/commands/blog.md +0 -691
  73. package/templates/claude-plugins/golden-loop-monitor/.claude-plugin/plugin.json +0 -8
  74. package/templates/claude-plugins/golden-loop-monitor/commands/loop-status.md +0 -434
  75. package/templates/claude-plugins/learning-tracker/.claude-plugin/plugin.json +0 -8
  76. package/templates/claude-plugins/learning-tracker/commands/my-patterns.md +0 -282
  77. package/templates/claude-plugins/memory-lens/.claude-plugin/plugin.json +0 -8
  78. package/templates/claude-plugins/memory-lens/commands/memory-search.md +0 -181
  79. package/templates/claude-plugins/pattern-coach/.claude-plugin/plugin.json +0 -8
  80. package/templates/claude-plugins/pattern-coach/commands/forge.md +0 -365
  81. package/templates/claude-plugins/project-schema-validator/.claude-plugin/plugin.json +0 -8
  82. package/templates/claude-plugins/project-schema-validator/commands/validate-schema.md +0 -582
  83. package/templates/claude-plugins-admin/AGENT_TEAM_PROPOSALS.md +0 -819
  84. package/templates/claude-plugins-admin/README.md +0 -446
  85. package/templates/claude-plugins-admin/autonomous-admin-agent/.claude-plugin/plugin.json +0 -8
  86. package/templates/claude-plugins-admin/autonomous-admin-agent/commands/agent.md +0 -595
  87. package/templates/claude-plugins-admin/backend-agent/.claude-plugin/plugin.json +0 -8
  88. package/templates/claude-plugins-admin/backend-agent/commands/backend.md +0 -798
  89. package/templates/claude-plugins-admin/deploy-guardian/.claude-plugin/plugin.json +0 -8
  90. package/templates/claude-plugins-admin/deploy-guardian/commands/deploy.md +0 -554
  91. package/templates/claude-plugins-admin/frontend-agent/.claude-plugin/plugin.json +0 -8
  92. package/templates/claude-plugins-admin/frontend-agent/commands/frontend.md +0 -881
  93. package/templates/claude-plugins-admin/mcp-server-manager/.claude-plugin/plugin.json +0 -8
  94. package/templates/claude-plugins-admin/mcp-server-manager/commands/mcp.md +0 -85
  95. package/templates/claude-plugins-admin/memory-system-monitor/.claude-plugin/plugin.json +0 -8
  96. package/templates/claude-plugins-admin/memory-system-monitor/commands/memory-health.md +0 -569
  97. package/templates/claude-plugins-admin/qa-agent/.claude-plugin/plugin.json +0 -8
  98. package/templates/claude-plugins-admin/qa-agent/commands/qa.md +0 -863
  99. package/templates/claude-plugins-admin/tech-lead-agent/.claude-plugin/plugin.json +0 -8
  100. package/templates/claude-plugins-admin/tech-lead-agent/commands/lead.md +0 -732
  101. package/templates/commands/continue.md +0 -47
  102. package/templates/cursor-rules/ekkos-memory.md +0 -127
  103. package/templates/ekkos-manifest.json +0 -223
  104. package/templates/helpers/json-parse.cjs +0 -101
  105. package/templates/hooks-node/lib/state.js +0 -187
  106. package/templates/hooks-node/stop.js +0 -416
  107. package/templates/hooks-node/user-prompt-submit.js +0 -337
  108. package/templates/plan-template.md +0 -306
  109. package/templates/rules/00-hooks-contract.mdc +0 -89
  110. package/templates/rules/30-ekkos-core.mdc +0 -188
  111. package/templates/rules/31-ekkos-messages.mdc +0 -78
  112. package/templates/shared/hooks-enabled.json +0 -22
  113. package/templates/shared/session-words.json +0 -45
  114. package/templates/skills/ekkOS_Deep_Recall/Skill.md +0 -282
  115. package/templates/skills/ekkOS_Learn/Skill.md +0 -265
  116. package/templates/skills/ekkOS_Memory_First/Skill.md +0 -206
  117. package/templates/skills/ekkOS_Plan_Assist/Skill.md +0 -302
  118. package/templates/skills/ekkOS_Preferences/Skill.md +0 -247
  119. package/templates/skills/ekkOS_Reflect/Skill.md +0 -257
  120. package/templates/skills/ekkOS_Safety/Skill.md +0 -265
  121. package/templates/skills/ekkOS_Schema/Skill.md +0 -251
  122. package/templates/skills/ekkOS_Summary/Skill.md +0 -257
  123. package/templates/spec-template.md +0 -159
  124. package/templates/windsurf-rules/ekkos-memory.md +0 -127
  125. package/templates/windsurf-skills/README.md +0 -58
  126. package/templates/windsurf-skills/ekkos-continue/SKILL.md +0 -81
  127. package/templates/windsurf-skills/ekkos-golden-loop/SKILL.md +0 -225
  128. package/templates/windsurf-skills/ekkos-insights/SKILL.md +0 -138
  129. package/templates/windsurf-skills/ekkos-recall/SKILL.md +0 -96
  130. package/templates/windsurf-skills/ekkos-safety/SKILL.md +0 -89
  131. package/templates/windsurf-skills/ekkos-vault/SKILL.md +0 -86
@@ -1,127 +0,0 @@
1
- ---
2
- trigger: always_on
3
- description: ekkOS Memory — 11-layer cognitive memory with 29 MCP tools
4
- ---
5
-
6
- # ekkOS Memory System
7
-
8
- You have access to **ekkOS memory** via 29 MCP tools. This is an 11-layer cognitive memory system that makes AI smarter over time by learning from past sessions.
9
-
10
- ## MANDATORY RULES
11
-
12
- ### RULE 1: SEARCH BEFORE ANSWERING
13
- Before answering ANY technical question, call `ekkOS_Search` first.
14
-
15
- ### RULE 2: ACKNOWLEDGE RETRIEVED PATTERNS
16
- When patterns are retrieved, acknowledge each one:
17
- ```
18
- [ekkOS_SELECT]
19
- - id: <pattern_id>
20
- reason: <why using>
21
- confidence: <0.0-1.0>
22
- [/ekkOS_SELECT]
23
-
24
- [ekkOS_SKIP]
25
- - id: <pattern_id>
26
- reason: <why not relevant>
27
- [/ekkOS_SKIP]
28
- ```
29
-
30
- Suppress SELECT/SKIP blocks for non-technical turns (acknowledgments, affirmations).
31
-
32
- ### RULE 3: FORGE WHAT YOU LEARN
33
- When you fix a bug, get corrected, or learn something new, call `ekkOS_Forge` immediately.
34
- When something DOESN'T work, forge it as an anti-pattern.
35
-
36
- ## MCP Tools — 29 Visible
37
-
38
- ### Core Memory (6)
39
- | Tool | Description |
40
- |------|-------------|
41
- | `ekkOS_Search` | Search across all 11 memory layers |
42
- | `ekkOS_Forge` | Create pattern from learned solution |
43
- | `ekkOS_Track` | Track when a pattern is applied |
44
- | `ekkOS_Outcome` | Record if pattern worked or failed |
45
- | `ekkOS_Stats` | Get statistics for all layers |
46
- | `ekkOS_Context` | Get relevant context for a task |
47
-
48
- ### Retrieval (4)
49
- | Tool | Description |
50
- |------|-------------|
51
- | `ekkOS_Codebase` | Search project code embeddings |
52
- | `ekkOS_Recall` | Recall past conversations by time |
53
- | `ekkOS_PreserveContext` | Preserve working memory before compaction |
54
- | `ekkOS_RestoreContext` | Restore context after compaction |
55
-
56
- ### Directives (4)
57
- | Tool | Description |
58
- |------|-------------|
59
- | `ekkOS_Directive` | Create MUST/NEVER/PREFER/AVOID rules |
60
- | `ekkOS_UpdateDirective` | Update an existing directive |
61
- | `ekkOS_DeleteDirective` | Remove a directive |
62
- | `ekkOS_UniversalDirectives` | Get directives that apply across all projects |
63
-
64
- ### Utility (5)
65
- | Tool | Description |
66
- |------|-------------|
67
- | `ekkOS_Summary` | Get summary of recent memory activity |
68
- | `ekkOS_Conflict` | Check for conflicts before destructive actions |
69
- | `ekkOS_Export` | Export patterns, directives, plans as JSON backup |
70
- | `ekkOS_Import` | Import memory from backup (auto-deduplication) |
71
- | `ekkOS_Health` | System health check |
72
-
73
- ### Plans (5)
74
- | Tool | Description |
75
- |------|-------------|
76
- | `ekkOS_Plan` | Create structured task plan |
77
- | `ekkOS_Plans` | List your plans |
78
- | `ekkOS_PlanStatus` | Update plan status |
79
- | `ekkOS_PlanStep` | Mark step complete/incomplete |
80
- | `ekkOS_Generate` | AI-generate plan from context |
81
-
82
- ### Secrets (5)
83
- | Tool | Description |
84
- |------|-------------|
85
- | `ekkOS_StoreSecret` | Encrypt and store sensitive data |
86
- | `ekkOS_GetSecret` | Retrieve and decrypt a secret |
87
- | `ekkOS_ListSecrets` | List secrets metadata (no values exposed) |
88
- | `ekkOS_DeleteSecret` | Permanently delete a secret |
89
- | `ekkOS_RotateSecret` | Update a secret with a new value |
90
-
91
- ## 11-Layer Architecture
92
-
93
- | # | Layer | Purpose |
94
- |---|-------|---------|
95
- | 1 | Working | Current session state |
96
- | 2 | Episodic | Past conversations |
97
- | 3 | Semantic | Embeddings & knowledge |
98
- | 4 | Patterns | Proven solutions |
99
- | 5 | Procedural | Step-by-step guides |
100
- | 6 | Collective | Cross-project wisdom |
101
- | 7 | Meta | Pattern effectiveness |
102
- | 8 | Codebase | Project-specific code |
103
- | 9 | Directives | User rules (MUST/NEVER/PREFER/AVOID) |
104
- | 10 | Conflict | Auto-resolves contradictions |
105
- | 11 | Secrets | Encrypted credentials (AES-256-GCM) |
106
-
107
- ## When To Use What
108
-
109
- | Tool | Trigger |
110
- |------|---------|
111
- | `ekkOS_Search` | Technical question, past discussion, architecture, debugging |
112
- | `ekkOS_Forge` | Bug fixed, better approach, gotcha, correction, anti-pattern |
113
- | `ekkOS_Directive` | User says "always" → MUST, "never" → NEVER, "prefer" → PREFER, "avoid" → AVOID |
114
- | `ekkOS_Conflict` | Before delete, deploy, config change, destructive commands |
115
- | Plan tools | Task has 3+ steps, complex feature request |
116
- | Secret tools | User shares API key/token/password, need stored credentials |
117
- | `ekkOS_Recall` | "yesterday", "last week", "remember when", "what did we discuss" |
118
-
119
- ## Response Format
120
-
121
- End every response with:
122
- ```
123
- ---
124
- 🧠 **ekkOS_™** · 📅 YYYY-MM-DD H:MM AM/PM TZ
125
- ```
126
-
127
- For more info: https://docs.ekkos.dev
@@ -1,58 +0,0 @@
1
- # ekkOS Windsurf Skills
2
-
3
- 6 skills following the [Agent Skills specification](https://agentskills.io/specification) for Windsurf Cascade.
4
-
5
- ## Skills
6
-
7
- | # | Skill | Golden Loop Step | Description |
8
- |---|-------|-----------------|-------------|
9
- | 1 | `ekkos-golden-loop` | All 5 steps | Core loop — Search, Apply, Forge, Outcome, Reflect |
10
- | 2 | `ekkos-recall` | Search (deep) | Time-based and semantic recall across sessions |
11
- | 3 | `ekkos-safety` | Guard | Conflict checks before destructive operations |
12
- | 4 | `ekkos-vault` | Utility | AES-256-GCM encrypted credential storage |
13
- | 5 | `ekkos-continue` | Utility | Session resumption after clear/compaction |
14
- | 6 | `ekkos-insights` | Reflect (system) | Prometheus metrics, delta scores, system health |
15
-
16
- ## Installation
17
-
18
- ### Workspace Skills (per-project)
19
-
20
- ```bash
21
- cp -r templates/windsurf-skills/* .windsurf/skills/
22
- ```
23
-
24
- ### Global Skills (all projects)
25
-
26
- ```bash
27
- cp -r templates/windsurf-skills/* ~/.codeium/windsurf/skills/
28
- ```
29
-
30
- ### Via CLI
31
-
32
- ```bash
33
- ekkos init --windsurf
34
- ```
35
-
36
- ## The Golden Loop (5 Steps)
37
-
38
- ```
39
- SEARCH → APPLY → FORGE → OUTCOME → REFLECT
40
- │ │ │ │ │
41
- │ │ │ │ └─ Quality analysis
42
- │ │ │ └─ Success/failure → Prometheus
43
- │ │ └─ Save solution as pattern
44
- │ └─ Use pattern + track usage
45
- └─ Query memory before answering
46
- ```
47
-
48
- Every step generates metrics consumed by the Prometheus Feedback Loop Worker (runs every 15 min):
49
- - **Auto-demotion**: Patterns >50% skip rate → quarantined
50
- - **Auto-promotion**: Patterns >85% success + 10 uses → collective layer (L6)
51
- - **Delta evaluation**: Δ_prometheus improvement score per interaction
52
-
53
- ## Naming Convention
54
-
55
- All skills use lowercase-hyphenated names per the Agent Skills spec:
56
- - Directory name MUST match the `name` field in SKILL.md frontmatter
57
- - Names are 1-64 characters, lowercase alphanumeric + hyphens only
58
- - No consecutive hyphens (`--`), no leading/trailing hyphens
@@ -1,81 +0,0 @@
1
- ---
2
- name: ekkos-continue
3
- description: Resume session after clear or context compaction. Activate when the user types /continue or /clear, after context compaction occurs, or when you see an ekkos-context-preserved tag. Restores working memory from local cache (1ms) with Redis/Supabase fallback.
4
- allowed-tools:
5
- - mcp__ekkos-memory__ekkOS_RestoreContext
6
- - mcp__ekkos-memory__ekkOS_Recall
7
- - mcp__ekkos-memory__ekkOS_Search
8
- ---
9
-
10
- # ekkOS Continue
11
-
12
- Resume sessions seamlessly after `/clear` or context compaction.
13
-
14
- ## When To Activate
15
-
16
- | Trigger | What Happened |
17
- |---------|--------------|
18
- | User types `/continue` | Manual resume request |
19
- | After `/clear` | Context was cleared, need to restore |
20
- | `<ekkos-context-preserved>` tag appears | Auto-compaction occurred |
21
- | Restored turns in `<system-reminder>` | Session was restored by hook |
22
-
23
- ## Instructions
24
-
25
- ### After `/clear` (Manual)
26
-
27
- If you see restored turns in a `<system-reminder>` tag (pattern: `**Turn XX**: ...`), respond with:
28
-
29
- ```
30
- ✓ **Session continued (Turn N)** - X turns preserved, context restored
31
- ```
32
-
33
- Then resume the conversation naturally.
34
-
35
- ### After Compaction (Automatic)
36
-
37
- When you see `<ekkos-context-preserved>` with a restoration token:
38
-
39
- ```
40
- ekkOS_RestoreContext({
41
- restoration_token: "<token from the tag>"
42
- })
43
- ```
44
-
45
- Then respond with:
46
- ```
47
- ✓ **Context restored** - ekkOS preserved X turns before compaction
48
- ```
49
-
50
- ### Fallback: Semantic Recall
51
-
52
- If no restoration token is available:
53
-
54
- ```
55
- ekkOS_Recall({
56
- days_ago: 1,
57
- semantic_query: "<topic from the conversation>",
58
- include_full_content: true,
59
- group_by_sessions: true,
60
- limit: 5
61
- })
62
- ```
63
-
64
- ## How It Works
65
-
66
- 1. **Local cache** (fastest, 1ms) — hooks save turns to local JSON
67
- 2. **Redis** (fast, 10ms) — working memory backed up to Redis
68
- 3. **Supabase** (reliable, 100ms) — episodic memory (L2) persists everything
69
- 4. **Semantic search** (last resort) — find relevant context by meaning
70
-
71
- ## Integration with Golden Loop
72
-
73
- Continue is a specialized SEARCH — it queries working memory (L1) and episodic memory (L2) to restore session state. After successful restoration, record it:
74
-
75
- ```
76
- ekkOS_Outcome({ success: true }) // Restoration worked
77
- ```
78
-
79
- ---
80
-
81
- **Mantra**: No context is ever lost. Every session can be resumed.
@@ -1,225 +0,0 @@
1
- ---
2
- name: ekkos-golden-loop
3
- description: The 5-step cognitive learning loop that makes AI smarter over time. Activate on every technical question, bug fix, architecture decision, debugging session, user correction, or when solving any non-trivial problem. Steps — Search, Apply, Forge, Outcome, Reflect. This is the core skill that drives all ekkOS memory operations.
4
- allowed-tools:
5
- - mcp__ekkos-memory__ekkOS_Search
6
- - mcp__ekkos-memory__ekkOS_Context
7
- - mcp__ekkos-memory__ekkOS_Codebase
8
- - mcp__ekkos-memory__ekkOS_Track
9
- - mcp__ekkos-memory__ekkOS_Forge
10
- - mcp__ekkos-memory__ekkOS_Outcome
11
- - mcp__ekkos-memory__ekkOS_Reflect
12
- - Read
13
- - Glob
14
- ---
15
-
16
- # ekkOS Golden Loop
17
-
18
- You are augmented with **ekkOS_ memory** — an 11-layer cognitive memory system. This skill defines the **5-step Golden Loop** that makes you smarter over time.
19
-
20
- ## The 5 Steps
21
-
22
- ```
23
- ┌─────────────────────────────────────────────────────────────┐
24
- │ 1. SEARCH → Query memory before answering │
25
- │ 2. APPLY → Use retrieved patterns, track usage │
26
- │ 3. FORGE → Save new solutions as patterns │
27
- │ 4. OUTCOME → Record success or failure │
28
- │ 5. REFLECT → Analyze quality, forge improvements │
29
- │ ↓ │
30
- │ Prometheus collects metrics → demotion / promotion │
31
- └─────────────────────────────────────────────────────────────┘
32
- ```
33
-
34
- **Every step feeds metrics to Prometheus** — skip rates, success rates, and delta scores that determine which patterns get promoted to collective wisdom and which get quarantined.
35
-
36
- ## Step 1: SEARCH (Before Answering)
37
-
38
- Before answering ANY technical question, search memory first.
39
-
40
- ```
41
- ekkOS_Search({
42
- query: "<specific problem description>",
43
- sources: ["patterns", "collective", "codebase"],
44
- limit: 5
45
- })
46
- ```
47
-
48
- **When to search:**
49
- - User asks a technical question
50
- - Debugging an error
51
- - Architecture or design discussion
52
- - "How do I..." questions
53
- - Configuration or deployment
54
- - Mid-response when you realize past context would help
55
-
56
- **For project-specific code:**
57
- ```
58
- ekkOS_Codebase({
59
- query: "<what you need from this project>",
60
- limit: 5
61
- })
62
- ```
63
-
64
- **For combined context (patterns + episodes):**
65
- ```
66
- ekkOS_Context({
67
- task: "<what you're trying to accomplish>"
68
- })
69
- ```
70
-
71
- ## Step 2: APPLY (Use Patterns, Track Usage)
72
-
73
- When patterns are retrieved, you MUST acknowledge every single one.
74
-
75
- **For patterns you USE:**
76
- ```
77
- [ekkOS_SELECT]
78
- - id: <pattern_id>
79
- reason: <why using>
80
- confidence: <0.0-1.0>
81
- [/ekkOS_SELECT]
82
- ```
83
-
84
- **For patterns NOT relevant:**
85
- ```
86
- [ekkOS_SKIP]
87
- - id: <pattern_id>
88
- reason: <why not relevant>
89
- [/ekkOS_SKIP]
90
- ```
91
-
92
- Track is called automatically during search when patterns are found. The Track call creates an `application_id` that links your search to the outcome — this is how Prometheus knows which patterns are actually being used vs skipped.
93
-
94
- **Why this matters:** Every SKIP increments the pattern's skip rate. Patterns with >50% skip rate get auto-demoted by the Prometheus worker. Every SELECT reinforces the pattern.
95
-
96
- ## Step 3: FORGE (Save Solutions)
97
-
98
- When you solve something non-trivial, save it immediately.
99
-
100
- ```
101
- ekkOS_Forge({
102
- title: "Descriptive, searchable title",
103
- problem: "What went wrong or what was needed",
104
- solution: "What worked and WHY it works",
105
- tags: ["relevant", "tags"],
106
- works_when: ["specific conditions"],
107
- anti_patterns: ["what NOT to do"]
108
- })
109
- ```
110
-
111
- **FORGE triggers — ask yourself after every solution:**
112
- - Was this non-trivial? → FORGE
113
- - Did the user correct me? → FORGE
114
- - Did something NOT work? → FORGE as anti-pattern
115
- - Would I want to remember this? → FORGE
116
- - Is this a gotcha or pitfall? → FORGE
117
- - Was an architecture decision made? → FORGE
118
-
119
- **Anti-patterns are equally valuable.** When something DOESN'T work:
120
- ```
121
- ekkOS_Forge({
122
- title: "Don't use setTimeout for rate limiting",
123
- problem: "Tried setTimeout to throttle API calls — doesn't work",
124
- solution: "Use proper debounce/throttle library instead",
125
- anti_patterns: ["setTimeout for throttling", "manual timer-based rate limiting"]
126
- })
127
- ```
128
-
129
- **Good titles:** Specific, searchable, actionable
130
- - "Fix CORS by setting Access-Control-Allow-Origin header"
131
- - "Use cursor pagination for tables over 100K rows"
132
-
133
- **Bad titles:** Vague, unsearchable
134
- - "Fixed the bug"
135
- - "Solution"
136
-
137
- ## Step 4: OUTCOME (Record Success/Failure)
138
-
139
- After applying a pattern and seeing the result, record the outcome.
140
-
141
- ```
142
- ekkOS_Outcome({
143
- success: true, // or false
144
- model_used: "claude-sonnet-4-6"
145
- })
146
- ```
147
-
148
- **When to record outcomes:**
149
- - User confirms solution works → `success: true`
150
- - User says "that's not right" → `success: false`
151
- - Applied pattern solved the problem → `success: true`
152
- - Pattern didn't apply well → `success: false`
153
- - After completing a complex task → record overall outcome
154
-
155
- **Why this matters:** Outcome feeds directly into Prometheus:
156
- - Success rates determine pattern quality scores
157
- - Patterns with >85% success + 10 uses → promoted to collective (L6)
158
- - Patterns with <30% success after 10 uses → quarantined
159
- - Delta scores (Δ_prometheus) track improvement over time
160
-
161
- ## Step 5: REFLECT (Analyze and Improve)
162
-
163
- After complex tasks or when receiving feedback, analyze your response.
164
-
165
- ```
166
- ekkOS_Reflect({
167
- user_query: "Original question",
168
- response: "Your response summary",
169
- context: {
170
- patterns_used: 3,
171
- model: "claude-sonnet-4-6"
172
- }
173
- })
174
- ```
175
-
176
- **Reflection feeds back into the loop:**
177
- - Identify missed patterns → better future searches
178
- - Spot over-engineering → forge simplicity preferences
179
- - Record what worked → reinforce good patterns
180
- - Find gaps → forge new patterns to fill them
181
-
182
- ## Metric Collection Summary
183
-
184
- Every step generates metrics that Prometheus uses:
185
-
186
- | Step | Metric Generated | Prometheus Impact |
187
- |------|-----------------|-------------------|
188
- | Search | retrieval count, latency | retrieval_precision |
189
- | Apply (SELECT) | application count | Reinforces pattern |
190
- | Apply (SKIP) | skip count | skip_rate → demotion risk |
191
- | Forge | new patterns | capability growth |
192
- | Outcome | success/failure | success_rate → promotion/demotion |
193
- | Reflect | quality scores | pattern_quality delta |
194
-
195
- The **Prometheus Feedback Loop Worker** (runs every 15 min) processes:
196
- 1. **Auto-demotion**: Patterns >50% skip rate → quarantined
197
- 2. **Auto-promotion**: Patterns >85% success + 10 uses → collective layer
198
- 3. **Delta evaluation**: Δ_prometheus score per interaction
199
-
200
- ## Response Format
201
-
202
- Every response MUST end with:
203
- ```
204
- ---
205
- 🧠 **ekkOS_™**
206
- ```
207
-
208
- ## Fallback Behavior
209
-
210
- If the MCP server is unavailable:
211
- 1. Proceed without memory
212
- 2. Note: "Memory unavailable — solving from first principles"
213
- 3. Solutions can still be forged when connection restores
214
-
215
- ## What NOT To Do
216
-
217
- - **Don't skip Search** — always query memory first
218
- - **Don't skip Outcome** — this is how Prometheus learns
219
- - **Don't fabricate patterns** — only reference patterns actually retrieved
220
- - **Don't over-search** — one focused search beats many broad ones
221
- - **Don't forge trivial things** — "changed a variable name" isn't worth forging
222
-
223
- ---
224
-
225
- **Mantra**: Search first. Apply what you find. Forge what you learn. Record what happened. Reflect and improve.
@@ -1,138 +0,0 @@
1
- ---
2
- name: ekkos-insights
3
- description: System introspection and improvement metrics powered by Prometheus. Activate when the user asks "how am I improving", "show my stats", "what does the system know", "ekkOS status", "memory summary", "pattern quality", "delta score", or wants to understand memory health, pattern effectiveness, or system performance.
4
- allowed-tools:
5
- - mcp__ekkos-memory__ekkOS_Stats
6
- - mcp__ekkos-memory__ekkOS_Summary
7
- - mcp__ekkos-memory__ekkOS_Search
8
- - mcp__ekkos-memory__ekkOS_Health
9
- ---
10
-
11
- # ekkOS Insights (Prometheus)
12
-
13
- System introspection — see how ekkOS is improving over time.
14
-
15
- ## When To Activate
16
-
17
- | Trigger | What To Show |
18
- |---------|-------------|
19
- | "How am I improving?" | Delta score and trends |
20
- | "Show my stats" | Layer statistics |
21
- | "What does ekkOS know?" | MetaState overview |
22
- | "ekkOS status" / "memory summary" | Activity summary |
23
- | "Pattern quality" | Success rates, skip rates |
24
- | "Is ekkOS healthy?" | System health check |
25
- | "What patterns are being used?" | Applied/skipped breakdown |
26
- | "Show me what you learned" | Recent forges and outcomes |
27
-
28
- ## Instructions
29
-
30
- ### Memory Statistics (All Layers)
31
-
32
- ```
33
- ekkOS_Stats({
34
- scope: "both" // "personal", "collective", or "both"
35
- })
36
- ```
37
-
38
- Shows counts across all 11 layers:
39
- - L1 Working — current session turns
40
- - L2 Episodic — past conversations
41
- - L3 Semantic — embedded knowledge
42
- - L4 Patterns — proven solutions
43
- - L5 Procedural — step-by-step guides
44
- - L6 Collective — cross-project wisdom
45
- - L7 Meta — pattern effectiveness
46
- - L8 Codebase — project-specific code
47
- - L9 Directives — user rules (MUST/NEVER/PREFER/AVOID)
48
- - L10 Conflict — auto-resolution
49
- - L11 Secrets — encrypted credentials
50
-
51
- ### Activity Summary
52
-
53
- ```
54
- ekkOS_Summary({
55
- time_window_seconds: 3600 // last hour (default: 5 min)
56
- })
57
- ```
58
-
59
- Shows recent activity: searches, forges, outcomes, tracks.
60
-
61
- ### System Health
62
-
63
- ```
64
- ekkOS_Health({
65
- include_stats: true
66
- })
67
- ```
68
-
69
- Checks connectivity to all services: Supabase, Redis, embeddings, etc.
70
-
71
- ## Prometheus Metrics (What Gets Tracked)
72
-
73
- The Prometheus system quantifies improvement using:
74
-
75
- ```
76
- Δ_prometheus = γ × Δ_performance + (1-γ) × Δ_ekkOS
77
- ```
78
-
79
- ### Performance Metrics (Δ_performance)
80
- | Metric | Weight | What It Measures |
81
- |--------|--------|-----------------|
82
- | Task Success | 0.4 | Are solutions working? (outcome success rate) |
83
- | Efficiency | 0.3 | Are we solving faster? (turns to solution) |
84
- | Stability | 0.2 | System reliability (1 - error_rate) |
85
- | Capability | 0.1 | New patterns forged / total patterns |
86
-
87
- ### ekkOS Metrics (Δ_ekkOS)
88
- | Metric | Weight | What It Measures |
89
- |--------|--------|-----------------|
90
- | Pattern Quality | 0.4 | Avg success rate improvement |
91
- | Retrieval Precision | 0.3 | 1 - (skip_rate / total_retrievals) |
92
- | Directive Compliance | 0.2 | Compliant actions / total actions |
93
- | Collective Contribution | 0.1 | Patterns promoted to collective / forged |
94
-
95
- ### Prometheus Worker Actions (Every 15 min)
96
- | Action | Threshold | Result |
97
- |--------|-----------|--------|
98
- | **Auto-demotion** | >50% skip rate, 5+ uses | Pattern quarantined |
99
- | **Auto-promotion** | >85% success, 10+ uses | Pattern → collective (L6) |
100
- | **Delta evaluation** | Per-interaction | Δ score stored for trending |
101
-
102
- ## Presenting Insights
103
-
104
- When the user asks for insights, present them clearly:
105
-
106
- ```
107
- 📊 **ekkOS Memory Status**
108
-
109
- **Patterns:** 142 active, 8 quarantined, 12 promoted to collective
110
- **Success Rate:** 87% (↑ 3% this week)
111
- **Retrieval Precision:** 92% (low skip rate = patterns are relevant)
112
- **Most Used Pattern:** "Handle Supabase RLS errors" (23 applications, 96% success)
113
- **Recent Forges:** 4 new patterns this session
114
-
115
- **Prometheus Δ Score:** +0.12 (improving)
116
- - Task success: +0.08
117
- - Pattern quality: +0.15
118
- - Retrieval precision: +0.11
119
- - Collective contribution: +0.04
120
-
121
- **Health:** All systems operational ✓
122
- ```
123
-
124
- ## Integration with Golden Loop
125
-
126
- Insights is Step 5 (REFLECT) at the system level — instead of reflecting on a single response, it reflects on the entire memory system's health and improvement trajectory.
127
-
128
- The metrics displayed here are collected by Steps 1-4:
129
- 1. **Search** → retrieval counts, latency
130
- 2. **Apply** → skip rates, application counts
131
- 3. **Forge** → new pattern counts, capability growth
132
- 4. **Outcome** → success rates, delta scores
133
-
134
- Without proper Outcome tracking, these metrics are incomplete. This is why the Golden Loop skill emphasizes recording outcomes — it's what feeds Prometheus.
135
-
136
- ---
137
-
138
- **Mantra**: What gets measured gets improved. Prometheus sees everything.