@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,365 @@
1
+ # Forge Pattern
2
+
3
+ Interactive assistant to capture solutions and failures as permanent patterns in your ekkOS memory.
4
+
5
+ ## Overview
6
+
7
+ **This is the LEARN phase of the Golden Loop** - turning your hard-won solutions into reusable patterns so you never have to solve the same problem twice.
8
+
9
+ Most developers forget to do this! Pattern Coach makes forging easy and ensures every lesson learned is captured.
10
+
11
+ ## What it does
12
+
13
+ 1. **Detects context** - Analyzes recent conversation for problem/solution
14
+ 2. **Asks smart questions** - Guides you through pattern creation
15
+ 3. **Validates quality** - Checks for duplicates and completeness
16
+ 4. **Forges to memory** - Saves pattern to your ekkOS substrate
17
+ 5. **Tracks success** - Future uses will update success rate
18
+ 6. **Captures failures too** - Anti-patterns are equally valuable
19
+
20
+ ## Usage
21
+
22
+ ```bash
23
+ # Interactive forging (recommended)
24
+ /forge
25
+
26
+ # Quick forge from conversation
27
+ /forge quick
28
+
29
+ # Forge a failure/anti-pattern
30
+ /forge failure
31
+
32
+ # Create a user preference rule
33
+ /forge rule
34
+ ```
35
+
36
+ ## Example - Interactive Forging
37
+
38
+ ```
39
+ ⚒️ Pattern Coach - Let's Forge This Solution!
40
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
41
+
42
+ I noticed you just fixed something! Let me help you forge this
43
+ into a pattern so ekkOS remembers it forever.
44
+
45
+ ───────────────────────────────────────────────────────────────────
46
+ 📝 Context Detected:
47
+
48
+ From recent conversation:
49
+ • You had: "TypeError: Cannot read property 'map' of undefined"
50
+ • You fixed: Added optional chaining `users?.map()`
51
+ • File: src/components/UserList.tsx
52
+
53
+ Does this look right? (yes/no) > yes
54
+
55
+ ───────────────────────────────────────────────────────────────────
56
+ 🎯 Pattern Details:
57
+
58
+ 1. Give this pattern a clear title:
59
+ (Something you'll recognize when you see it again)
60
+
61
+ Suggested: "Fix undefined map errors with optional chaining"
62
+ Use this? (yes/custom) > yes
63
+
64
+ 2. What was the problem?
65
+ (Describe the error or issue you encountered)
66
+
67
+ Auto-detected:
68
+ "TypeError: Cannot read property 'map' of undefined when
69
+ trying to iterate over array that might be null/undefined"
70
+
71
+ Looks good? (yes/edit) > yes
72
+
73
+ 3. What's the solution?
74
+ (How do you fix it?)
75
+
76
+ Auto-detected:
77
+ "Use optional chaining (?.) before calling .map():
78
+ ```typescript
79
+ // ❌ Before (crashes)
80
+ users.map(user => ...)
81
+
82
+ // ✅ After (safe)
83
+ users?.map(user => ...)
84
+ ```"
85
+
86
+ Looks good? (yes/edit) > yes
87
+
88
+ ───────────────────────────────────────────────────────────────────
89
+ 🏷️ When does this pattern apply?
90
+
91
+ Help ekkOS know when to suggest this pattern:
92
+
93
+ [✓] Array operations (map, filter, reduce)
94
+ [✓] Data that might be null/undefined
95
+ [✓] TypeScript projects
96
+ [ ] Only for React components
97
+ [ ] Only for API responses
98
+
99
+ Selected 3 conditions. Good! More specific = better matches.
100
+
101
+ ───────────────────────────────────────────────────────────────────
102
+ ⚠️ Any anti-patterns or gotchas?
103
+
104
+ Things that DON'T work or mistakes to avoid:
105
+
106
+ > Yes, don't use optional chaining in older JavaScript environments
107
+ > that don't support ES2020
108
+
109
+ Great! This prevents future mistakes.
110
+
111
+ ───────────────────────────────────────────────────────────────────
112
+ ✅ Pattern Preview:
113
+
114
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
115
+ TITLE: Fix undefined map errors with optional chaining
116
+
117
+ PROBLEM:
118
+ TypeError: Cannot read property 'map' of undefined when trying
119
+ to iterate over array that might be null/undefined.
120
+
121
+ SOLUTION:
122
+ Use optional chaining (?.) before calling .map():
123
+ ```typescript
124
+ // ❌ Before (crashes)
125
+ users.map(user => ...)
126
+
127
+ // ✅ After (safe)
128
+ users?.map(user => ...)
129
+ ```
130
+
131
+ WORKS WHEN:
132
+ • Array operations (map, filter, reduce)
133
+ • Data that might be null/undefined
134
+ • TypeScript projects
135
+
136
+ ANTI-PATTERNS:
137
+ • Don't use in older JS environments without ES2020 support
138
+
139
+ TAGS: typescript, array, null-safety, optional-chaining
140
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
141
+
142
+ Forge this pattern? (yes/no) > yes
143
+
144
+ ⚡ Forging pattern...
145
+
146
+ ✅ Pattern forged successfully!
147
+
148
+ Pattern ID: pat_abc123xyz
149
+ Stored in: Layer 4 (Patterns - Personal)
150
+ Available: Immediately
151
+
152
+ 🎉 Great job! Next time you (or Claude) encounter:
153
+ "TypeError: Cannot read property 'map'"
154
+
155
+ This pattern will be automatically retrieved and suggested!
156
+
157
+ 🔄 Golden Loop Status:
158
+ ✅ RETRIEVE - (previous problem)
159
+ ✅ APPLY - You applied optional chaining
160
+ ✅ MEASURE - Will track if this works
161
+ ✅ LEARN - Pattern now forged! ← YOU ARE HERE
162
+
163
+ Your ekkOS memory just got smarter! 🧠
164
+ ```
165
+
166
+ ## Example - Quick Forge
167
+
168
+ ```
169
+ /forge quick
170
+
171
+ ⚒️ Pattern Coach - Quick Forge
172
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
173
+
174
+ Analyzing recent conversation...
175
+
176
+ ✅ Detected solvable problem/solution:
177
+
178
+ Title: Fix undefined map errors with optional chaining
179
+ Problem: TypeError when calling .map() on undefined
180
+ Solution: Use optional chaining (users?.map())
181
+
182
+ Forge this? (yes/no/customize) > yes
183
+
184
+ ✅ Forged! Pattern ID: pat_abc123xyz
185
+ ```
186
+
187
+ ## Example - Forge Failure (Anti-pattern)
188
+
189
+ ```
190
+ /forge failure
191
+
192
+ ⚒️ Pattern Coach - Capture What DIDN'T Work
193
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
194
+
195
+ **Failures are just as valuable as successes!**
196
+
197
+ Let's capture what DIDN'T work so you never repeat the mistake.
198
+
199
+ 1. What did you try?
200
+ > Used var instead of const in TypeScript
201
+
202
+ 2. What went wrong?
203
+ > TypeScript couldn't narrow types properly, caused weird scope bugs
204
+
205
+ 3. What's the correct approach?
206
+ > Always use const/let, never var
207
+
208
+ 4. Why does this matter?
209
+ > var has function scope, const/let have block scope
210
+ > TypeScript type narrowing doesn't work with var
211
+
212
+ ───────────────────────────────────────────────────────────────────
213
+ ✅ Anti-Pattern Preview:
214
+
215
+ ANTI-PATTERN: Don't use var in TypeScript
216
+
217
+ WHAT DOESN'T WORK:
218
+ Using `var` keyword in TypeScript causes scope issues and breaks
219
+ type narrowing.
220
+
221
+ WHY IT FAILS:
222
+ • var has function scope (not block scope)
223
+ • TypeScript type narrowing doesn't work with var
224
+ • Modern ES6+ uses const/let exclusively
225
+
226
+ CORRECT APPROACH:
227
+ Always use const (preferred) or let (when reassignment needed).
228
+ Never use var.
229
+
230
+ ```typescript
231
+ // ❌ Wrong
232
+ var userId = "123";
233
+
234
+ // ✅ Correct
235
+ const userId = "123";
236
+ ```
237
+
238
+ ───────────────────────────────────────────────────────────────────
239
+
240
+ Forge this anti-pattern? (yes/no) > yes
241
+
242
+ ✅ Anti-pattern forged!
243
+ Pattern ID: pat_anti_789xyz
244
+ Type: Anti-pattern (what NOT to do)
245
+
246
+ Next time you (or Claude) try to use `var`, ekkOS will warn you!
247
+
248
+ Would you also like to create a NEVER directive?
249
+ (Makes this an unbreakable rule) (yes/no) > yes
250
+
251
+ ✅ Directive created: [NEVER] Use var in TypeScript
252
+ Priority: 90 (High)
253
+ Scope: Global (all projects)
254
+
255
+ Now ekkOS will actively PREVENT using var in TypeScript! 🛡️
256
+ ```
257
+
258
+ ## Example - Create Rule/Directive
259
+
260
+ ```
261
+ /forge rule
262
+
263
+ ⚒️ Pattern Coach - Create User Preference Rule
264
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
265
+
266
+ Directives are unbreakable rules - they override patterns.
267
+
268
+ Use for strong preferences: "ALWAYS do X", "NEVER do Y"
269
+
270
+ 1. Rule type:
271
+ [ ] MUST (always do this)
272
+ [x] NEVER (never do this)
273
+ [ ] PREFER (when possible)
274
+ [ ] AVOID (try not to)
275
+
276
+ 2. What's the rule?
277
+ > Use var in TypeScript code
278
+
279
+ 3. Why? (helps Claude understand importance)
280
+ > Causes scope issues and type narrowing problems
281
+
282
+ 4. Scope:
283
+ [x] Global (all your projects)
284
+ [ ] Project (current project only)
285
+ [ ] Specific (e.g., "backend", "frontend")
286
+
287
+ 5. Priority (1-100):
288
+ Suggested: 90 (high priority for NEVER rules)
289
+ Use this? (yes/custom) > yes
290
+
291
+ ───────────────────────────────────────────────────────────────────
292
+ ✅ Directive Preview:
293
+
294
+ [NEVER] Use var in TypeScript code
295
+
296
+ Scope: Global (all projects)
297
+ Priority: 90 (High - will override conflicting patterns)
298
+ Reason: Causes scope issues and type narrowing problems
299
+
300
+ This directive will:
301
+ • Appear in every Claude session
302
+ • Override any patterns suggesting var
303
+ • Block code that uses var
304
+ • Work across all your projects
305
+
306
+ ───────────────────────────────────────────────────────────────────
307
+
308
+ Create this directive? (yes/no) > yes
309
+
310
+ ✅ Directive created!
311
+ Directive ID: dir_never_123
312
+ Active: Immediately
313
+ Scope: Global
314
+
315
+ Claude will now follow this rule in ALL your projects! 📜
316
+ ```
317
+
318
+ ## Requirements
319
+
320
+ - ekkOS MCP server configured
321
+ - Recent conversation with problem/solution context
322
+ - (Or provide details manually in interactive mode)
323
+
324
+ ## Tips for Good Patterns
325
+
326
+ 1. **Be specific about the problem**
327
+ - ❌ "Error in code"
328
+ - ✅ "TypeError: Cannot read property 'map' of undefined"
329
+
330
+ 2. **Provide code examples**
331
+ - Show before/after
332
+ - Highlight the key change
333
+
334
+ 3. **Document when it applies**
335
+ - What conditions make this relevant?
336
+ - When should ekkOS suggest it?
337
+
338
+ 4. **Capture failures too!**
339
+ - What you tried that DIDN'T work
340
+ - Why it failed
341
+ - What to do instead
342
+
343
+ 5. **Use tags**
344
+ - typescript, react, api, database, etc.
345
+ - Helps ekkOS find patterns faster
346
+
347
+ ## Implementation Details
348
+
349
+ When this command runs, Claude will:
350
+
351
+ 1. Analyze recent conversation for problem/solution pairs
352
+ 2. Extract code changes if any
353
+ 3. In interactive mode:
354
+ - Ask clarifying questions
355
+ - Pre-fill detected information
356
+ - Validate completeness
357
+ - Check for duplicates via `ekkOS_Search`
358
+ 4. Call `ekkOS_Forge({title, problem, solution, anti_patterns, works_when, tags})`
359
+ 5. Optionally create directive via `ekkOS_Directive({type, rule, scope, priority})`
360
+ 6. Return pattern/directive ID
361
+ 7. Pattern becomes available for future retrievals immediately
362
+
363
+ This command ensures you never lose hard-won solutions and always learn from mistakes.
364
+
365
+ **The Golden Loop isn't complete until you FORGE!** ⚒️
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "ekkos-project-schema-validator",
3
+ "description": "Validate schemas in your own projects (TypeScript types, Prisma models, GraphQL schemas). Catch field name mismatches, type errors, and schema drift before runtime.",
4
+ "author": {
5
+ "name": "ekkOS",
6
+ "email": "support@ekkos.dev"
7
+ }
8
+ }