@ekkos/cli 1.0.31 → 1.0.33

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.
@@ -332,16 +332,28 @@ async function deployForCursor(apiKey, userId) {
332
332
  }
333
333
  }
334
334
  async function deployForWindsurf(apiKey, userId) {
335
- const spinner = (0, ora_1.default)('Deploying Windsurf MCP configuration...').start();
335
+ let success = false;
336
+ // MCP configuration
337
+ let spinner = (0, ora_1.default)('Deploying Windsurf MCP configuration...').start();
336
338
  try {
337
339
  (0, mcp_1.deployWindsurfMcp)(apiKey, userId);
338
340
  spinner.succeed('Windsurf MCP configuration');
339
- return true;
341
+ success = true;
340
342
  }
341
343
  catch (error) {
342
344
  spinner.fail('Windsurf MCP configuration failed');
343
- return false;
344
345
  }
346
+ // Skills (Agent Skills spec — 6 Golden Loop skills)
347
+ spinner = (0, ora_1.default)('Deploying Windsurf skills...').start();
348
+ try {
349
+ const result = (0, skills_1.deployWindsurfSkills)();
350
+ spinner.succeed(`Windsurf skills (${result.count} skills: ${result.skills.join(', ')})`);
351
+ success = true;
352
+ }
353
+ catch (error) {
354
+ spinner.fail('Windsurf skills deployment failed');
355
+ }
356
+ return success;
345
357
  }
346
358
  // ═══════════════════════════════════════════════════════════════════════════
347
359
  // MAIN INIT COMMAND
@@ -311,6 +311,7 @@ const isWindows = os.platform() === 'win32';
311
311
  // Core ekkOS patches (eviction, context management) work with all recent versions
312
312
  // Cosmetic patches may fail on newer versions but don't affect functionality
313
313
  const PINNED_CLAUDE_VERSION = 'latest';
314
+ const MIN_CLAUDE_VERSION_FOR_LATEST = process.env.EKKOS_MIN_CLAUDE_VERSION || '2.1.49';
314
315
  // Max output tokens for Claude responses
315
316
  // Default: 16384 (safe for Sonnet 4.5)
316
317
  // Opus 4.5 supports up to 64k - set EKKOS_MAX_OUTPUT_TOKENS=32768 or =65536 to use higher limits
@@ -388,12 +389,10 @@ function getEkkosEnv() {
388
389
  // Format: https://mcp.ekkos.dev/proxy/{userId}/{sessionName}?project={base64(cwd)}
389
390
  // Gateway extracts from URL: /proxy/{userId}/{sessionName}/v1/messages
390
391
  // Project path is base64-encoded to handle special chars safely
391
- const projectPath = process.cwd();
392
- const projectPathEncoded = Buffer.from(projectPath).toString('base64url');
392
+ const projectPath = process.cwd().replace(/\\/g, '/');
393
+ const projectPathEncoded = encodeURIComponent(Buffer.from(projectPath, 'utf-8').toString('base64'));
393
394
  const proxyUrl = `${EKKOS_PROXY_URL}/proxy/${encodeURIComponent(userId)}/${encodeURIComponent(cliSessionName)}?project=${projectPathEncoded}`;
394
395
  env.ANTHROPIC_BASE_URL = proxyUrl;
395
- // Newer Claude Code internals also read this key for API/file routes.
396
- env.CLAUDE_CODE_API_BASE_URL = proxyUrl;
397
396
  // Proxy URL contains userId + project path — don't leak to terminal
398
397
  }
399
398
  else {
@@ -452,7 +451,8 @@ function resolveNativeClaudeBin() {
452
451
  */
453
452
  function getClaudeVersion(claudePath) {
454
453
  try {
455
- const version = (0, child_process_1.execSync)(`"${claudePath}" --version 2>/dev/null`, { encoding: 'utf-8' }).trim();
454
+ const suppressStderr = isWindows ? '2>NUL' : '2>/dev/null';
455
+ const version = (0, child_process_1.execSync)(`"${claudePath}" --version ${suppressStderr}`, { encoding: 'utf-8' }).trim();
456
456
  // Look for pattern like "2.1.6 (Claude Code)" or just "2.1.6" anywhere in output
457
457
  const match = version.match(/(\d+\.\d+\.\d+)\s*\(Claude Code\)/);
458
458
  if (match)
@@ -466,6 +466,24 @@ function getClaudeVersion(claudePath) {
466
466
  return null;
467
467
  }
468
468
  }
469
+ function compareSemver(a, b) {
470
+ const parse = (v) => {
471
+ const m = v.match(/(\d+)\.(\d+)\.(\d+)/);
472
+ if (!m)
473
+ return [0, 0, 0];
474
+ return [Number(m[1]), Number(m[2]), Number(m[3])];
475
+ };
476
+ const pa = parse(a);
477
+ const pb = parse(b);
478
+ for (let i = 0; i < 3; i++) {
479
+ if (pa[i] !== pb[i])
480
+ return pa[i] - pb[i];
481
+ }
482
+ return 0;
483
+ }
484
+ function isVersionAtLeast(version, minVersion) {
485
+ return compareSemver(version, minVersion) >= 0;
486
+ }
469
487
  /**
470
488
  * Check if a Claude installation matches our required version
471
489
  * When PINNED_CLAUDE_VERSION is 'latest', any version is acceptable
@@ -475,8 +493,9 @@ function checkClaudeVersion(claudePath) {
475
493
  if (!version)
476
494
  return false;
477
495
  // 'latest' means any version is acceptable
478
- if (PINNED_CLAUDE_VERSION === 'latest')
479
- return true;
496
+ if (PINNED_CLAUDE_VERSION === 'latest') {
497
+ return isVersionAtLeast(version, MIN_CLAUDE_VERSION_FOR_LATEST);
498
+ }
480
499
  return version === PINNED_CLAUDE_VERSION;
481
500
  }
482
501
  /**
@@ -560,7 +579,12 @@ function resolveClaudePath() {
560
579
  // These binaries do not print the npm-to-native migration warning.
561
580
  const nativeBin = resolveNativeClaudeBin();
562
581
  if (nativeBin) {
563
- return nativeBin;
582
+ const nativeVersion = getClaudeVersion(nativeBin);
583
+ if (PINNED_CLAUDE_VERSION !== 'latest' ||
584
+ (nativeVersion && isVersionAtLeast(nativeVersion, MIN_CLAUDE_VERSION_FOR_LATEST))) {
585
+ return nativeBin;
586
+ }
587
+ console.log(chalk_1.default.yellow(` Native Claude ${nativeVersion || 'unknown'} is below minimum ${MIN_CLAUDE_VERSION_FOR_LATEST}; using managed latest.`));
564
588
  }
565
589
  // PRIORITY 2: ekkOS-managed npm installation (existing users before native installer)
566
590
  if (fs.existsSync(EKKOS_CLAUDE_BIN) && checkClaudeVersion(EKKOS_CLAUDE_BIN)) {
@@ -1335,7 +1359,7 @@ async function run(options) {
1335
1359
  // Claude creates the transcript file BEFORE outputting the session name
1336
1360
  // So we watch for new files rather than parsing TUI output (which is slower)
1337
1361
  // ════════════════════════════════════════════════════════════════════════════
1338
- const encodedCwd = process.cwd().replace(/\//g, '-');
1362
+ const encodedCwd = process.cwd().replace(/[\\/]/g, '-');
1339
1363
  const projectDir = path.join(os.homedir(), '.claude', 'projects', encodedCwd);
1340
1364
  const launchTime = Date.now();
1341
1365
  // Track existing jsonl files at startup
@@ -1506,8 +1530,10 @@ async function run(options) {
1506
1530
  });
1507
1531
  return false;
1508
1532
  }
1509
- // Check it starts with / or ~ (absolute path)
1510
- if (!pathToCheck.startsWith('/') && !pathToCheck.startsWith('~')) {
1533
+ // Check it's an absolute path (Unix: / or ~, Windows: C:\ or \\)
1534
+ const isAbsolutePath = pathToCheck.startsWith('/') || pathToCheck.startsWith('~') ||
1535
+ /^[A-Za-z]:[\\/]/.test(pathToCheck) || pathToCheck.startsWith('\\\\');
1536
+ if (!isAbsolutePath) {
1511
1537
  evictionDebugLog('PATH_INVALID', 'Transcript path is not absolute - clearing', {
1512
1538
  path: pathToCheck.slice(0, 100),
1513
1539
  });
@@ -2282,7 +2308,9 @@ async function run(options) {
2282
2308
  if (transcriptMatch) {
2283
2309
  const candidatePath = transcriptMatch[1];
2284
2310
  // Validate it's an actual path (not garbage from terminal output)
2285
- if (candidatePath.startsWith('/') || candidatePath.startsWith('~')) {
2311
+ const isAbsCandidate = candidatePath.startsWith('/') || candidatePath.startsWith('~') ||
2312
+ /^[A-Za-z]:[\\/]/.test(candidatePath);
2313
+ if (isAbsCandidate) {
2286
2314
  const resolvedPath = candidatePath.startsWith('~')
2287
2315
  ? path.join(os.homedir(), candidatePath.slice(1))
2288
2316
  : candidatePath;
@@ -1,4 +1,37 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
2
35
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
36
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
37
  };
@@ -351,6 +384,20 @@ async function setupWindsurf(apiKey) {
351
384
  (0, fs_1.mkdirSync)(windsurfDir, { recursive: true });
352
385
  }
353
386
  (0, fs_1.writeFileSync)((0, path_1.join)(windsurfDir, 'ekkos.json'), JSON.stringify({ apiKey }, null, 2));
387
+ // Deploy Windsurf skills (Agent Skills spec — 6 Golden Loop skills)
388
+ const skillsDir = (0, path_1.join)(codeiumDir, 'skills');
389
+ if (!(0, fs_1.existsSync)(skillsDir)) {
390
+ (0, fs_1.mkdirSync)(skillsDir, { recursive: true });
391
+ }
392
+ try {
393
+ const { deployWindsurfSkills } = await Promise.resolve().then(() => __importStar(require('../deploy/skills.js')));
394
+ const result = deployWindsurfSkills();
395
+ console.log(chalk_1.default.green(` ✓ Deployed ${result.count} skills: ${result.skills.join(', ')}`));
396
+ }
397
+ catch {
398
+ // Fallback: templates might not be available in setup path
399
+ console.log(chalk_1.default.yellow(' Note: Skills templates not found. Run `ekkos init --ide windsurf` to deploy skills.'));
400
+ }
354
401
  // Create project rules template
355
402
  const cascadeRules = generateCascadeRules();
356
403
  const cascadeRulesPath = (0, path_1.join)(process.cwd(), '.windsurfrules');
@@ -5,6 +5,14 @@ export declare function deploySkills(): {
5
5
  count: number;
6
6
  skills: string[];
7
7
  };
8
+ /**
9
+ * Deploy Windsurf skills to ~/.codeium/windsurf/skills/
10
+ * Uses Agent Skills spec format (lowercase-hyphenated names, SKILL.md)
11
+ */
12
+ export declare function deployWindsurfSkills(): {
13
+ count: number;
14
+ skills: string[];
15
+ };
8
16
  /**
9
17
  * Check if skills are deployed
10
18
  */
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deploySkills = deploySkills;
4
+ exports.deployWindsurfSkills = deployWindsurfSkills;
4
5
  exports.areSkillsDeployed = areSkillsDeployed;
5
6
  exports.countDeployedSkills = countDeployedSkills;
6
7
  exports.listExpectedSkills = listExpectedSkills;
@@ -32,6 +33,31 @@ function deploySkills() {
32
33
  skills: deployedSkills
33
34
  };
34
35
  }
36
+ /**
37
+ * Deploy Windsurf skills to ~/.codeium/windsurf/skills/
38
+ * Uses Agent Skills spec format (lowercase-hyphenated names, SKILL.md)
39
+ */
40
+ function deployWindsurfSkills() {
41
+ if (!(0, fs_1.existsSync)(platform_1.WINDSURF_SKILLS_DIR)) {
42
+ (0, fs_1.mkdirSync)(platform_1.WINDSURF_SKILLS_DIR, { recursive: true });
43
+ }
44
+ const skillNames = (0, templates_1.listTemplateDirs)('windsurf-skills');
45
+ const deployedSkills = [];
46
+ for (const skillName of skillNames) {
47
+ try {
48
+ const destPath = `${platform_1.WINDSURF_SKILLS_DIR}/${skillName}`;
49
+ (0, templates_1.copyTemplateDir)(`windsurf-skills/${skillName}`, destPath);
50
+ deployedSkills.push(skillName);
51
+ }
52
+ catch (error) {
53
+ console.warn(`Warning: Could not deploy Windsurf skill ${skillName}`);
54
+ }
55
+ }
56
+ return {
57
+ count: deployedSkills.length,
58
+ skills: deployedSkills
59
+ };
60
+ }
35
61
  /**
36
62
  * Check if skills are deployed
37
63
  */
@@ -21,6 +21,7 @@ export declare const CURSOR_DIR: string;
21
21
  export declare const CURSOR_MCP: string;
22
22
  export declare const WINDSURF_DIR: string;
23
23
  export declare const WINDSURF_MCP: string;
24
+ export declare const WINDSURF_SKILLS_DIR: string;
24
25
  /**
25
26
  * Detect which IDEs are installed on this system
26
27
  */
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WINDSURF_MCP = exports.WINDSURF_DIR = exports.CURSOR_MCP = exports.CURSOR_DIR = exports.CLAUDE_EKKOS_RULES = exports.CLAUDE_RULES_DIR = exports.CLAUDE_MD = exports.CLAUDE_STATE_DIR = exports.CLAUDE_PLUGINS_DIR = exports.CLAUDE_AGENTS_DIR = exports.CLAUDE_SKILLS_DIR = exports.CLAUDE_HOOKS_DIR = exports.CLAUDE_SETTINGS = exports.CLAUDE_CONFIG = exports.CLAUDE_DIR = exports.EKKOS_CONFIG = exports.EKKOS_DIR = exports.HOME_DIR = exports.MCP_API_URL = exports.PLATFORM_URL = exports.isLinux = exports.isMac = exports.isWindows = void 0;
3
+ exports.WINDSURF_SKILLS_DIR = exports.WINDSURF_MCP = exports.WINDSURF_DIR = exports.CURSOR_MCP = exports.CURSOR_DIR = exports.CLAUDE_EKKOS_RULES = exports.CLAUDE_RULES_DIR = exports.CLAUDE_MD = exports.CLAUDE_STATE_DIR = exports.CLAUDE_PLUGINS_DIR = exports.CLAUDE_AGENTS_DIR = exports.CLAUDE_SKILLS_DIR = exports.CLAUDE_HOOKS_DIR = exports.CLAUDE_SETTINGS = exports.CLAUDE_CONFIG = exports.CLAUDE_DIR = exports.EKKOS_CONFIG = exports.EKKOS_DIR = exports.HOME_DIR = exports.MCP_API_URL = exports.PLATFORM_URL = exports.isLinux = exports.isMac = exports.isWindows = void 0;
4
4
  exports.detectInstalledIDEs = detectInstalledIDEs;
5
5
  exports.detectCurrentIDE = detectCurrentIDE;
6
6
  const os_1 = require("os");
@@ -30,6 +30,7 @@ exports.CURSOR_DIR = (0, path_1.join)(exports.HOME_DIR, '.cursor');
30
30
  exports.CURSOR_MCP = (0, path_1.join)(exports.CURSOR_DIR, 'mcp.json');
31
31
  exports.WINDSURF_DIR = (0, path_1.join)(exports.HOME_DIR, '.codeium', 'windsurf');
32
32
  exports.WINDSURF_MCP = (0, path_1.join)(exports.WINDSURF_DIR, 'mcp_config.json');
33
+ exports.WINDSURF_SKILLS_DIR = (0, path_1.join)(exports.WINDSURF_DIR, 'skills');
33
34
  /**
34
35
  * Detect which IDEs are installed on this system
35
36
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ekkos/cli",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "description": "Setup ekkOS memory for AI coding assistants (Claude Code, Cursor, Windsurf)",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://ekkos.dev/schemas/manifest-v1.json",
3
3
  "manifestVersion": "1.0.0",
4
- "generatedAt": "2026-02-19T23:06:44.502Z",
4
+ "generatedAt": "2026-02-20T07:39:17.071Z",
5
5
  "platforms": {
6
6
  "darwin": {
7
7
  "configDir": "~/.ekkos",
@@ -98,25 +98,25 @@
98
98
  "source": "hooks/user-prompt-submit.ps1",
99
99
  "destination": "user-prompt-submit.ps1",
100
100
  "description": "User prompt submit hook (Windows)",
101
- "checksum": "6a00a23bc3865e63b1bca2702b769473cce11530adbffa4531b21bb6bbe7cc3b"
101
+ "checksum": "ba1090ed7a4e7deef1267b52474225669a9c966b9adf596b31865c2dca1dc749"
102
102
  },
103
103
  {
104
104
  "source": "hooks/stop.ps1",
105
105
  "destination": "stop.ps1",
106
106
  "description": "Session stop hook (Windows)",
107
- "checksum": "2defabb31d51e482990f0fce762a5cc12beb08eb1ac1fb4a1afd7c5375d5e0f0"
107
+ "checksum": "c4f0191ac28ced0410ea560197ab3b0a7e2de83363a789731d64620bc605564d"
108
108
  },
109
109
  {
110
110
  "source": "hooks/session-start.ps1",
111
111
  "destination": "session-start.ps1",
112
112
  "description": "Session start hook (Windows)",
113
- "checksum": "7b700bb98072efe4bd84b84b0754d0b64dc85a718f4484c6d42594d790e4cce5"
113
+ "checksum": "1930bda7c517054531ff3ad78e8cce7e60d57f5b3884728da0d7cf1cc5c54ac4"
114
114
  },
115
115
  {
116
116
  "source": "hooks/assistant-response.ps1",
117
117
  "destination": "assistant-response.ps1",
118
118
  "description": "Assistant response hook (Windows)",
119
- "checksum": "554e978190100d506a3a0c32a59013628d44d00c5e7e21dc28346ad367da60ea"
119
+ "checksum": "680e6d7c597f90fb54bc86d173f4c145093eb21352b30c7d6afbe19d1d5fdce4"
120
120
  }
121
121
  ],
122
122
  "lib": [
@@ -0,0 +1,58 @@
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
@@ -0,0 +1,81 @@
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.
@@ -0,0 +1,225 @@
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.
@@ -0,0 +1,138 @@
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.
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: ekkos-recall
3
+ description: Deep memory retrieval across sessions and projects. Activate when the user says "yesterday", "last week", "remember when", "what did we discuss", "we worked on X before", "bring context from", or asks about past decisions, fixes, or discussions. Combines time-based recall with semantic search.
4
+ allowed-tools:
5
+ - mcp__ekkos-memory__ekkOS_Recall
6
+ - mcp__ekkos-memory__ekkOS_Search
7
+ - mcp__ekkos-memory__ekkOS_Context
8
+ - mcp__ekkos-memory__ekkOS_RestoreContext
9
+ ---
10
+
11
+ # ekkOS Deep Recall
12
+
13
+ You can recall past conversations, decisions, and context from previous sessions.
14
+
15
+ ## When To Activate
16
+
17
+ | Trigger | Example |
18
+ |---------|---------|
19
+ | Time reference | "yesterday", "last week", "last month" |
20
+ | Past work | "remember when we...", "we worked on X before" |
21
+ | Decision recall | "what did we decide about...", "why did we choose..." |
22
+ | Context transfer | "bring context from the other project" |
23
+ | Session continuity | "where did we leave off", "continue from last time" |
24
+
25
+ ## Instructions
26
+
27
+ ### Time-Based Recall
28
+
29
+ ```
30
+ ekkOS_Recall({
31
+ days_ago: 1, // 1, 2, 7, 30...
32
+ semantic_query: "what we discussed about auth",
33
+ include_file_changes: true, // show files modified
34
+ include_patterns: true, // show patterns used
35
+ extract_decisions: true, // pull out decisions made
36
+ group_by_sessions: true // organize by session
37
+ })
38
+ ```
39
+
40
+ ### Semantic Recall (By Topic)
41
+
42
+ ```
43
+ ekkOS_Recall({
44
+ semantic_query: "database migration strategy",
45
+ limit: 10,
46
+ include_full_content: true
47
+ })
48
+ ```
49
+
50
+ ### Session-Based Recall
51
+
52
+ ```
53
+ ekkOS_Recall({
54
+ session_id: "<session-id>",
55
+ from_turn: 1,
56
+ to_turn: 50,
57
+ include_full_content: true
58
+ })
59
+ ```
60
+
61
+ ### Context Restoration (After Compaction)
62
+
63
+ When you see `<ekkos-context-preserved>` with a restoration token:
64
+
65
+ ```
66
+ ekkOS_RestoreContext({
67
+ restoration_token: "<token from tag>"
68
+ })
69
+ ```
70
+
71
+ ## Response Format
72
+
73
+ Present recalled information clearly:
74
+
75
+ ```
76
+ 🧠 From [date/session]:
77
+
78
+ **Topic:** [what was discussed]
79
+ **Decision:** [what was decided]
80
+ **Files changed:** [list]
81
+ **Patterns used:** [list]
82
+ **Key insight:** [the important takeaway]
83
+ ```
84
+
85
+ ## Integration with Golden Loop
86
+
87
+ Recall is an extended SEARCH — it queries episodic memory (L2) instead of pattern memory (L4). Results should still be acknowledged and tracked like any retrieval.
88
+
89
+ After recalling useful context, record the outcome:
90
+ ```
91
+ ekkOS_Outcome({ success: true })
92
+ ```
93
+
94
+ ---
95
+
96
+ **Mantra**: Nothing is forgotten. Every session is searchable. Context persists.
@@ -0,0 +1,89 @@
1
+ ---
2
+ name: ekkos-safety
3
+ description: Check for conflicts before dangerous operations. Activate before deleting files, dropping tables, deploying to production, pushing to main, running destructive commands, modifying configuration files, force-pushing, or any irreversible action. Prevents accidents by checking user directives and patterns.
4
+ allowed-tools:
5
+ - mcp__ekkos-memory__ekkOS_Conflict
6
+ - mcp__ekkos-memory__ekkOS_Search
7
+ ---
8
+
9
+ # ekkOS Safety Guard
10
+
11
+ Check for conflicts with user directives and patterns before destructive operations.
12
+
13
+ ## When To Activate
14
+
15
+ **MUST fire before:**
16
+ - `rm -rf`, `rm -r`, deleting files or directories
17
+ - `DROP TABLE`, `DELETE FROM`, `TRUNCATE`
18
+ - `git push --force`, `git reset --hard`
19
+ - Deploying to production
20
+ - Modifying CI/CD pipelines
21
+ - Changing environment variables
22
+ - Overwriting configuration files
23
+ - Killing processes
24
+ - Any command that is hard to reverse
25
+
26
+ ## Instructions
27
+
28
+ ### Step 1: Check for Conflicts
29
+
30
+ ```
31
+ ekkOS_Conflict({
32
+ proposed_action: "delete all migration files in /db/migrations",
33
+ scope: "deployment" // optional: deployment, auth, security, database
34
+ })
35
+ ```
36
+
37
+ ### Step 2: Review Response
38
+
39
+ The conflict check returns:
40
+ - **Matching directives** — user rules that may prohibit the action
41
+ - **Matching patterns** — past experiences relevant to this action
42
+ - **Risk level** — safe, caution, or blocked
43
+
44
+ ### Step 3: Act Based on Result
45
+
46
+ **If BLOCKED:** Do NOT proceed. Inform the user why.
47
+
48
+ **If CAUTION:** Present the conflict to the user and ask for confirmation before proceeding.
49
+
50
+ **If SAFE:** Proceed normally.
51
+
52
+ ## Example
53
+
54
+ ```
55
+ User: "Drop the users table and recreate it"
56
+
57
+ You: Let me check for conflicts first...
58
+
59
+ ekkOS_Conflict({
60
+ proposed_action: "DROP TABLE users and recreate",
61
+ scope: "database"
62
+ })
63
+
64
+ Result: CAUTION — Directive found: "NEVER drop tables in production without backup"
65
+
66
+ "⚠️ I found a directive: 'NEVER drop tables in production without backup.'
67
+ Should I create a backup first, or is this a development database?"
68
+ ```
69
+
70
+ ## Integration with Golden Loop
71
+
72
+ Safety checks are part of Step 1 (SEARCH) — they query the directive layer (L9) specifically. If a safety check prevents an accident, forge it:
73
+
74
+ ```
75
+ ekkOS_Forge({
76
+ title: "Always backup before DROP TABLE",
77
+ problem: "Nearly dropped production table without backup",
78
+ solution: "ekkOS_Conflict caught the directive — always check first"
79
+ })
80
+ ```
81
+
82
+ Record the outcome:
83
+ ```
84
+ ekkOS_Outcome({ success: true }) // Safety check prevented accident
85
+ ```
86
+
87
+ ---
88
+
89
+ **Mantra**: Measure twice, cut once. Check before destroying.
@@ -0,0 +1,86 @@
1
+ ---
2
+ name: ekkos-vault
3
+ description: Securely store and retrieve credentials with AES-256-GCM encryption. Activate when the user shares an API key, password, token, secret, or any sensitive credential. Also activate when you need to use a stored credential or when the user asks about their stored secrets.
4
+ allowed-tools:
5
+ - mcp__ekkos-memory__ekkOS_StoreSecret
6
+ - mcp__ekkos-memory__ekkOS_GetSecret
7
+ - mcp__ekkos-memory__ekkOS_ListSecrets
8
+ - mcp__ekkos-memory__ekkOS_DeleteSecret
9
+ - mcp__ekkos-memory__ekkOS_RotateSecret
10
+ ---
11
+
12
+ # ekkOS Secrets Vault
13
+
14
+ Securely store and retrieve credentials encrypted with AES-256-GCM.
15
+
16
+ ## When To Activate
17
+
18
+ | Trigger | Action |
19
+ |---------|--------|
20
+ | User shares API key, token, password | Store it |
21
+ | User asks "do you have my X key?" | Retrieve it |
22
+ | Need a credential for an API call | Retrieve it |
23
+ | User asks "what secrets do I have?" | List them |
24
+ | User wants to update a credential | Rotate it |
25
+ | User asks to remove a credential | Delete it |
26
+
27
+ ## Instructions
28
+
29
+ ### Store a Secret
30
+
31
+ ```
32
+ ekkOS_StoreSecret({
33
+ service: "openai",
34
+ value: "sk-...",
35
+ type: "api_key",
36
+ description: "OpenAI API key for embeddings"
37
+ })
38
+ ```
39
+
40
+ **NEVER echo the secret value back to the user.** Confirm storage without revealing it.
41
+
42
+ ### Retrieve a Secret
43
+
44
+ ```
45
+ ekkOS_GetSecret({
46
+ service: "openai",
47
+ masked: false // true = shows first/last 4 chars only
48
+ })
49
+ ```
50
+
51
+ ### List Secrets (Metadata Only)
52
+
53
+ ```
54
+ ekkOS_ListSecrets()
55
+ ```
56
+
57
+ Returns service names, types, and descriptions — never values.
58
+
59
+ ### Rotate a Secret
60
+
61
+ ```
62
+ ekkOS_RotateSecret({
63
+ service: "openai",
64
+ newValue: "sk-new-..."
65
+ })
66
+ ```
67
+
68
+ ### Delete a Secret
69
+
70
+ ```
71
+ ekkOS_DeleteSecret({
72
+ secretId: "<id from list>"
73
+ })
74
+ ```
75
+
76
+ ## Security Rules
77
+
78
+ 1. **NEVER** display raw secret values in responses unless the user explicitly asks
79
+ 2. **NEVER** log secret values
80
+ 3. Use `masked: true` when you just need to confirm a secret exists
81
+ 4. When storing, confirm success WITHOUT echoing the value
82
+ 5. Secrets are encrypted at rest with AES-256-GCM — even ekkOS cannot read them without the user's key
83
+
84
+ ---
85
+
86
+ **Mantra**: Secrets go in the vault. Never in the chat.
@@ -1,219 +0,0 @@
1
- ---
2
- title: ekkOS Memory System
3
- description: AI-native cognitive memory with 31 MCP tools for persistent learning and context continuity
4
- trigger: always_on
5
- author: ekkOS Technologies
6
- tags: [memory, patterns, learning, context]
7
- ---
8
-
9
- # ekkOS Memory System Skill
10
-
11
- This skill enables Cascade to leverage the full ekkOS 11-layer cognitive memory system for persistent learning, pattern recognition, and context continuity across sessions.
12
-
13
- ## When to Use This Skill
14
-
15
- **ALWAYS USE** for:
16
- - Technical questions (before answering, search memory)
17
- - Bug fixes (forge patterns after solving)
18
- - Architecture decisions (check for existing patterns)
19
- - Code reviews (retrieve relevant patterns)
20
- - Refactoring (find proven approaches)
21
-
22
- ## Core Workflow
23
-
24
- ### 1. Search Before Answering (MANDATORY)
25
-
26
- ```
27
- Before answering ANY technical question:
28
-
29
- 1. Call ekkOS_Search with the query
30
- 2. Review retrieved patterns
31
- 3. Acknowledge ALL patterns with [ekkOS_SELECT] or [ekkOS_SKIP]
32
- 4. THEN provide your answer
33
- ```
34
-
35
- ### 2. PatternGuard Acknowledgment
36
-
37
- For every pattern retrieved, you MUST acknowledge it:
38
-
39
- ```
40
- [ekkOS_SELECT]
41
- - id: <pattern-uuid>
42
- reason: Using this because...
43
- confidence: 0.95
44
- [/ekkOS_SELECT]
45
-
46
- [ekkOS_SKIP]
47
- - id: <pattern-uuid>
48
- reason: Not relevant because...
49
- [/ekkOS_SKIP]
50
- ```
51
-
52
- **Coverage must be 100%** - every pattern ID must be acknowledged.
53
-
54
- ### 3. Forge What You Learn
55
-
56
- After fixing bugs, solving problems, or discovering gotchas:
57
-
58
- ```
59
- Call ekkOS_Forge with:
60
- - Problem: What was broken
61
- - Solution: How you fixed it
62
- - Tags: [language, framework, error-type]
63
- ```
64
-
65
- ## MCP Tools Reference
66
-
67
- ### Core Memory (8 tools)
68
-
69
- | Tool | Purpose | When to Use |
70
- |------|---------|-------------|
71
- | `ekkOS_Search` | Search all 11 memory layers | **Before EVERY technical answer** |
72
- | `ekkOS_Context` | Get relevant task context | When starting multi-step tasks |
73
- | `ekkOS_Capture` | Capture memory events | Log significant actions |
74
- | `ekkOS_Forge` | Create patterns from solutions | After fixing bugs/discoveries |
75
- | `ekkOS_Directive` | Create MUST/NEVER/PREFER/AVOID rules | When user states preferences |
76
- | `ekkOS_Outcome` | Track success/failure | After applying patterns |
77
- | `ekkOS_Detect` | Auto-detect pattern usage | In responses |
78
- | `ekkOS_Recall` | Recall past conversations | When user asks "what did we" |
79
-
80
- ### Schema Awareness (2 tools)
81
-
82
- | Tool | Purpose | When to Use |
83
- |------|---------|-------------|
84
- | `ekkOS_IndexSchema` | Index database schemas | With Supabase/Prisma projects |
85
- | `ekkOS_GetSchema` | Get specific table schema | When writing queries |
86
-
87
- ### Plan Management (9 tools)
88
-
89
- | Tool | Purpose | When to Use |
90
- |------|---------|-------------|
91
- | `ekkOS_Plan` | Create structured plans | Multi-step features |
92
- | `ekkOS_Generate` | AI-generate plans | Complex tasks |
93
- | `ekkOS_PlanStatus` | Update plan status | Marking steps complete |
94
- | `ekkOS_PlanStep` | Mark step done | Step completion |
95
- | `ekkOS_SaveTemplate` | Save as template | Reusable workflows |
96
- | `ekkOS_Templates` | List templates | Finding existing plans |
97
- | `ekkOS_FromTemplate` | Create from template | Starting from template |
98
-
99
- ### Portability & Secrets (8 tools)
100
-
101
- | Tool | Purpose | When to Use |
102
- |------|---------|-------------|
103
- | `ekkOS_Export` | Export as backup | Before major changes |
104
- | `ekkOS_Import` | Import from backup | Restoring context |
105
- | `ekkOS_StoreSecret` | Encrypt credentials | Storing API keys |
106
- | `ekkOS_GetSecret` | Retrieve secrets | Using stored credentials |
107
- | `ekkOS_ListSecrets` | List secret metadata | Checking what's stored |
108
- | `ekkOS_RotateSecret` | Rotate secret values | Key rotation |
109
-
110
- ### System Health (4 tools)
111
-
112
- | Tool | Purpose | When to Use |
113
- |------|---------|-------------|
114
- | `ekkOS_Stats` | Get layer statistics | Health checks |
115
- | `ekkOS_Summary` | Get activity summary | Progress updates |
116
- | `ekkOS_Conflict` | Check for conflicts | Before dangerous ops |
117
- | `ekkOS_Reflect` | Analyze for improvements | Post-task review |
118
-
119
- ## 11-Layer Architecture
120
-
121
- | Layer | Purpose | Example Content |
122
- |-------|---------|-----------------|
123
- | 1 | Working | Current session context |
124
- | 2 | Episodic | Past conversation turns |
125
- | 3 | Semantic | Embeddings/vectors |
126
- | 4 | Patterns | Proven solutions |
127
- | 5 | Procedural | Step-by-step guides |
128
- | 6 | Collective | Community patterns |
129
- | 7 | Meta | Pattern effectiveness |
130
- | 8 | Codebase | Project code context |
131
- | 9 | Directives | User rules (MUST/NEVER) |
132
- | 10 | Conflict | Auto-resolution rules |
133
- | 11 | Secrets | Encrypted credentials |
134
-
135
- ## Forge Triggers
136
-
137
- **Always forge when you:**
138
- - Fix a bug (create anti-pattern from the bug)
139
- - Find a better approach (update existing pattern)
140
- - Discover a gotcha (create warning pattern)
141
- - Get corrected by user (learn from correction)
142
- - Solve auth/config issues (create setup pattern)
143
- - Make architecture decisions (document rationale)
144
- - Debug non-trivially (capture the journey)
145
-
146
- ## Response Format
147
-
148
- End EVERY response with:
149
-
150
- ```
151
- 🧠 **ekkOS_™** · 📅 YYYY-MM-DD H:MM AM/PM TZ
152
- ```
153
-
154
- ## Examples
155
-
156
- ### Example 1: Technical Question
157
-
158
- User: "How do I fix CORS in Next.js?"
159
-
160
- Your workflow:
161
- 1. Call `ekkOS_Search` with query: "Next.js CORS fix"
162
- 2. Review retrieved patterns
163
- 3. Acknowledge all patterns with SELECT/SKIP
164
- 4. Provide answer based on patterns + your knowledge
165
- 5. End with footer
166
-
167
- ### Example 2: Bug Fix
168
-
169
- User: "The build is failing with this error..."
170
-
171
- Your workflow:
172
- 1. Call `ekkOS_Search` with error message
173
- 2. Apply relevant patterns
174
- 3. Acknowledge with SELECT
175
- 4. Fix the bug
176
- 5. Call `ekkOS_Forge` with the solution
177
- 6. Call `ekkOS_Outcome` to track success
178
-
179
- ### Example 3: User Preference
180
-
181
- User: "I always want TypeScript strict mode"
182
-
183
- Your workflow:
184
- 1. Call `ekkOS_Directive`:
185
- - type: PREFER
186
- - rule: "Use TypeScript strict mode"
187
- - scope: project
188
- 2. Acknowledge in future responses
189
-
190
- ## Best Practices
191
-
192
- 1. **Search first** - Never answer without searching
193
- 2. **Acknowledge all** - 100% PatternGuard coverage required
194
- 3. **Forge immediately** - Don't wait to capture learnings
195
- 4. **Track outcomes** - Success/failure feedback improves patterns
196
- 5. **Use directives** - Convert user preferences to rules
197
- 6. **Export regularly** - Backup before major changes
198
- 7. **End with footer** - Every response needs the ekkOS footer
199
-
200
- ## Troubleshooting
201
-
202
- **"No patterns found"**
203
- → You're in new territory. Forge what you discover.
204
-
205
- **"Pattern retrieval failed"**
206
- → Check auth: `~/.ekkos/config.json` should have hookApiKey
207
-
208
- **"How do I continue from last session?"**
209
- → Ask: "recall our last conversation" or "where were we"
210
-
211
- ## Resources
212
-
213
- - Website: https://ekkos.dev
214
- - Docs: https://docs.ekkos.dev
215
- - Support: support@ekkos.dev
216
-
217
- ---
218
-
219
- 🧠 **ekkOS_™** · Built for infinite context