@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.
- package/dist/cache/LocalSessionStore.d.ts +129 -0
- package/dist/cache/LocalSessionStore.js +688 -0
- package/dist/cache/capture.d.ts +26 -0
- package/dist/cache/capture.js +461 -0
- package/dist/cache/index.d.ts +7 -0
- package/dist/cache/index.js +23 -0
- package/dist/cache/types.d.ts +147 -0
- package/dist/cache/types.js +40 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.js +478 -0
- package/dist/commands/run.d.ts +12 -0
- package/dist/commands/run.js +829 -0
- package/dist/commands/setup.d.ts +6 -0
- package/dist/commands/setup.js +658 -0
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.js +109 -0
- package/dist/commands/test.d.ts +1 -0
- package/dist/commands/test.js +157 -0
- package/dist/deploy/agents.d.ts +15 -0
- package/dist/deploy/agents.js +72 -0
- package/dist/deploy/hooks.d.ts +16 -0
- package/dist/deploy/hooks.js +121 -0
- package/dist/deploy/index.d.ts +7 -0
- package/dist/deploy/index.js +24 -0
- package/dist/deploy/instructions.d.ts +12 -0
- package/dist/deploy/instructions.js +36 -0
- package/dist/deploy/mcp.d.ts +19 -0
- package/dist/deploy/mcp.js +109 -0
- package/dist/deploy/plugins.d.ts +19 -0
- package/dist/deploy/plugins.js +62 -0
- package/dist/deploy/settings.d.ts +8 -0
- package/dist/deploy/settings.js +84 -0
- package/dist/deploy/skills.d.ts +19 -0
- package/dist/deploy/skills.js +60 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +71 -0
- package/dist/restore/RestoreOrchestrator.d.ts +48 -0
- package/dist/restore/RestoreOrchestrator.js +481 -0
- package/dist/restore/index.d.ts +4 -0
- package/dist/restore/index.js +20 -0
- package/dist/utils/platform.d.ts +29 -0
- package/dist/utils/platform.js +65 -0
- package/dist/utils/session-words.json +119 -0
- package/dist/utils/state.d.ts +57 -0
- package/dist/utils/state.js +186 -0
- package/dist/utils/templates.d.ts +24 -0
- package/dist/utils/templates.js +118 -0
- package/package.json +48 -0
- package/templates/CLAUDE.md +287 -0
- package/templates/README.md +378 -0
- package/templates/agents/README.md +182 -0
- package/templates/agents/code-reviewer.md +166 -0
- package/templates/agents/debug-detective.md +169 -0
- package/templates/agents/ekkOS_Vercel.md +99 -0
- package/templates/agents/extension-manager.md +229 -0
- package/templates/agents/git-companion.md +185 -0
- package/templates/agents/github-test-agent.md +321 -0
- package/templates/agents/railway-manager.md +179 -0
- package/templates/claude-plugins/PHASE2_COMPLETION.md +346 -0
- package/templates/claude-plugins/PLUGIN_PROPOSALS.md +1776 -0
- package/templates/claude-plugins/README.md +587 -0
- package/templates/claude-plugins/agents/code-reviewer.json +14 -0
- package/templates/claude-plugins/agents/debug-detective.json +15 -0
- package/templates/claude-plugins/agents/git-companion.json +14 -0
- package/templates/claude-plugins/blog-manager/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/blog-manager/commands/blog.md +691 -0
- package/templates/claude-plugins/golden-loop-monitor/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/golden-loop-monitor/commands/loop-status.md +434 -0
- package/templates/claude-plugins/learning-tracker/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/learning-tracker/commands/my-patterns.md +282 -0
- package/templates/claude-plugins/memory-lens/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/memory-lens/commands/memory-search.md +181 -0
- package/templates/claude-plugins/pattern-coach/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/pattern-coach/commands/forge.md +365 -0
- package/templates/claude-plugins/project-schema-validator/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/project-schema-validator/commands/validate-schema.md +582 -0
- package/templates/claude-plugins-admin/AGENT_TEAM_PROPOSALS.md +819 -0
- package/templates/claude-plugins-admin/README.md +446 -0
- package/templates/claude-plugins-admin/autonomous-admin-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/autonomous-admin-agent/commands/agent.md +595 -0
- package/templates/claude-plugins-admin/backend-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/backend-agent/commands/backend.md +798 -0
- package/templates/claude-plugins-admin/deploy-guardian/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/deploy-guardian/commands/deploy.md +554 -0
- package/templates/claude-plugins-admin/frontend-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/frontend-agent/commands/frontend.md +881 -0
- package/templates/claude-plugins-admin/mcp-server-manager/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/mcp-server-manager/commands/mcp.md +85 -0
- package/templates/claude-plugins-admin/memory-system-monitor/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/memory-system-monitor/commands/memory-health.md +569 -0
- package/templates/claude-plugins-admin/qa-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/qa-agent/commands/qa.md +863 -0
- package/templates/claude-plugins-admin/tech-lead-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/tech-lead-agent/commands/lead.md +732 -0
- package/templates/commands/continue.md +47 -0
- package/templates/cursor-hooks/after-agent-response.sh +117 -0
- package/templates/cursor-hooks/before-submit-prompt.sh +419 -0
- package/templates/cursor-hooks/hooks.json +20 -0
- package/templates/cursor-hooks/lib/contract.sh +320 -0
- package/templates/cursor-hooks/stop.sh +75 -0
- package/templates/cursor-rules/ekkos-memory.md +187 -0
- package/templates/hooks/assistant-response.sh +96 -0
- package/templates/hooks/hooks.json +28 -0
- package/templates/hooks/lib/contract.sh +320 -0
- package/templates/hooks/lib/state.sh +158 -0
- package/templates/hooks/session-start.ps1 +41 -0
- package/templates/hooks/session-start.sh +318 -0
- package/templates/hooks/stop.ps1 +16 -0
- package/templates/hooks/stop.sh +989 -0
- package/templates/hooks/user-prompt-submit.ps1 +174 -0
- package/templates/hooks/user-prompt-submit.sh +587 -0
- package/templates/hooks-node/lib/state.js +187 -0
- package/templates/hooks-node/stop.js +416 -0
- package/templates/hooks-node/user-prompt-submit.js +337 -0
- package/templates/plan-template.md +306 -0
- package/templates/rules/00-hooks-contract.mdc +89 -0
- package/templates/rules/30-ekkos-core.mdc +188 -0
- package/templates/rules/31-ekkos-messages.mdc +78 -0
- package/templates/skills/continue/SKILL.md +169 -0
- package/templates/skills/ekkOS_Deep_Recall/Skill.md +282 -0
- package/templates/skills/ekkOS_Learn/Skill.md +265 -0
- package/templates/skills/ekkOS_Memory_First/Skill.md +206 -0
- package/templates/skills/ekkOS_Plan_Assist/Skill.md +302 -0
- package/templates/skills/ekkOS_Preferences/Skill.md +247 -0
- package/templates/skills/ekkOS_Reflect/Skill.md +257 -0
- package/templates/skills/ekkOS_Safety/Skill.md +265 -0
- package/templates/skills/ekkOS_Schema/Skill.md +251 -0
- package/templates/skills/ekkOS_Summary/Skill.md +257 -0
- package/templates/skills/ekkOS_Vault/Skill.md +287 -0
- package/templates/skills/permissions/Skill.md +322 -0
- package/templates/spec-template.md +159 -0
- package/templates/windsurf-hooks/before-submit-prompt.sh +238 -0
- package/templates/windsurf-hooks/hooks.json +10 -0
- package/templates/windsurf-hooks/lib/contract.sh +320 -0
- package/templates/windsurf-rules/ekkos-memory.md +129 -0
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ekkOS_Deep_Recall
|
|
3
|
+
description: Deep memory retrieval across sessions and projects. Activate when user says "yesterday", "last week", "remember when", "what did we discuss", "we worked on X before", "bring context from [project]", 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
|
+
---
|
|
9
|
+
|
|
10
|
+
# ekkOS_Deep_Recall
|
|
11
|
+
|
|
12
|
+
You are augmented with **ekkOS_ memory** - and you can recall conversations, decisions, and solutions from any point in history.
|
|
13
|
+
|
|
14
|
+
## Why This Skill Exists
|
|
15
|
+
|
|
16
|
+
Users reference past work in many ways:
|
|
17
|
+
- By time: "yesterday", "last week", "a month ago"
|
|
18
|
+
- By topic: "remember when we fixed the auth bug?"
|
|
19
|
+
- By project: "bring context from the API project"
|
|
20
|
+
- By outcome: "what solution did we use for caching?"
|
|
21
|
+
|
|
22
|
+
This skill searches across all memory layers to find what they need.
|
|
23
|
+
|
|
24
|
+
## When To Activate
|
|
25
|
+
|
|
26
|
+
| Trigger | Action |
|
|
27
|
+
|---------|--------|
|
|
28
|
+
| "yesterday", "last week", "recently" | Time-based recall |
|
|
29
|
+
| "remember when we...", "we discussed..." | Semantic search |
|
|
30
|
+
| "what did we decide about X" | Decision search |
|
|
31
|
+
| "we fixed this before" | Solution/pattern search |
|
|
32
|
+
| "bring context from [project]" | Cross-project recall |
|
|
33
|
+
| "what do you know about X" | Full memory search |
|
|
34
|
+
|
|
35
|
+
## Instructions
|
|
36
|
+
|
|
37
|
+
### For Time-Based Queries
|
|
38
|
+
|
|
39
|
+
Parse the time reference and call recall:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
"yesterday" → ekkOS_Recall({ days_ago: 1 })
|
|
43
|
+
"last week" → ekkOS_Recall({ days_ago: 7 })
|
|
44
|
+
"a few days ago" → ekkOS_Recall({ days_ago: 3 })
|
|
45
|
+
"last month" → ekkOS_Recall({ days_ago: 30 })
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Options:
|
|
49
|
+
```javascript
|
|
50
|
+
ekkOS_Recall({
|
|
51
|
+
days_ago: 1, // How far back
|
|
52
|
+
limit: 20, // Max results
|
|
53
|
+
llm_summarize: true, // AI summary
|
|
54
|
+
include_patterns: true, // Include forged patterns
|
|
55
|
+
include_file_changes: true, // Include files touched
|
|
56
|
+
group_by_sessions: true // Group by session
|
|
57
|
+
})
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### For Topic-Based Queries
|
|
61
|
+
|
|
62
|
+
Use semantic search:
|
|
63
|
+
|
|
64
|
+
```javascript
|
|
65
|
+
ekkOS_Search({
|
|
66
|
+
query: "authentication token refresh implementation",
|
|
67
|
+
sources: ["episodic", "patterns", "semantic"]
|
|
68
|
+
})
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### For Decision Queries
|
|
72
|
+
|
|
73
|
+
Search with decision extraction:
|
|
74
|
+
|
|
75
|
+
```javascript
|
|
76
|
+
ekkOS_Recall({
|
|
77
|
+
semantic_query: "decision about caching strategy",
|
|
78
|
+
extract_decisions: true
|
|
79
|
+
})
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### For Cross-Project Context
|
|
83
|
+
|
|
84
|
+
Search codebase layer:
|
|
85
|
+
|
|
86
|
+
```javascript
|
|
87
|
+
ekkOS_Search({
|
|
88
|
+
query: "rate limiting implementation",
|
|
89
|
+
sources: ["codebase", "patterns"]
|
|
90
|
+
})
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Response Format
|
|
94
|
+
|
|
95
|
+
### Time-Based Results
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
🧠 **Yesterday's Sessions**
|
|
99
|
+
|
|
100
|
+
**Session 1** (10:30 AM - 12:15 PM)
|
|
101
|
+
- Working on: CI/CD pipeline setup
|
|
102
|
+
- Completed: GitHub Actions configuration
|
|
103
|
+
- Left off: Fixing failing auth test
|
|
104
|
+
|
|
105
|
+
**Session 2** (3:00 PM - 5:00 PM)
|
|
106
|
+
- Working on: User service refactoring
|
|
107
|
+
- Decision: Use Redis over Memcached
|
|
108
|
+
- Files: src/services/user.ts, src/cache/redis.ts
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
Would you like to continue any of these?
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Topic-Based Results
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
🧠 **Found: Caching Bug Fix** (2 weeks ago)
|
|
118
|
+
|
|
119
|
+
**The Problem**: Cache not invalidating on updates
|
|
120
|
+
**Root Cause**: Object reference used as key instead of ID
|
|
121
|
+
**Solution**: Changed to immutable entity ID as cache key
|
|
122
|
+
|
|
123
|
+
**Pattern Forged**: "Always use immutable IDs as cache keys"
|
|
124
|
+
Confidence: 0.95 | Applied 12 times successfully
|
|
125
|
+
|
|
126
|
+
Want me to apply this pattern to your current issue?
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Decision Results
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
🧠 **Decision: Caching Strategy** (January 5th)
|
|
133
|
+
|
|
134
|
+
**Context**: Choosing between Redis and Memcached
|
|
135
|
+
**Decision**: Redis
|
|
136
|
+
**Reasons**:
|
|
137
|
+
- Persistence for cache warmth
|
|
138
|
+
- Pub/sub for invalidation
|
|
139
|
+
- Lua scripting for atomic operations
|
|
140
|
+
|
|
141
|
+
**Who decided**: You, after weighing trade-offs
|
|
142
|
+
**Outcome**: Working well, no regrets mentioned
|
|
143
|
+
|
|
144
|
+
Is this the decision you were looking for?
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## Example Scenarios
|
|
148
|
+
|
|
149
|
+
### Scenario 1: Yesterday's Work
|
|
150
|
+
```
|
|
151
|
+
User: "What were we working on yesterday?"
|
|
152
|
+
|
|
153
|
+
You: ekkOS_Recall({ days_ago: 1, group_by_sessions: true })
|
|
154
|
+
|
|
155
|
+
🧠 Yesterday (January 10th):
|
|
156
|
+
|
|
157
|
+
**Session 1** (10:30 AM)
|
|
158
|
+
- API rate limiting implementation
|
|
159
|
+
- Sliding window algorithm complete
|
|
160
|
+
- Left off: Edge case testing
|
|
161
|
+
|
|
162
|
+
**Session 2** (3:00 PM)
|
|
163
|
+
- Dashboard component refactoring
|
|
164
|
+
- Split into smaller components
|
|
165
|
+
- Forged: "Component composition pattern"
|
|
166
|
+
|
|
167
|
+
Continue where you left off?
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Scenario 2: Remember When
|
|
171
|
+
```
|
|
172
|
+
User: "Remember when we fixed that weird auth bug?"
|
|
173
|
+
|
|
174
|
+
You: ekkOS_Search({
|
|
175
|
+
query: "authentication bug fix",
|
|
176
|
+
sources: ["episodic", "patterns"]
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
🧠 Found it! (3 weeks ago)
|
|
180
|
+
|
|
181
|
+
**Bug**: JWT tokens expiring early
|
|
182
|
+
**Cause**: Timezone mismatch in expiry calculation
|
|
183
|
+
**Fix**: Use UTC consistently across all time ops
|
|
184
|
+
|
|
185
|
+
Pattern: "auth-jwt-timezone-fix"
|
|
186
|
+
Applied successfully 5 times since
|
|
187
|
+
|
|
188
|
+
Is this what you were thinking of?
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Scenario 3: Past Decision
|
|
192
|
+
```
|
|
193
|
+
User: "What did we decide about the database schema?"
|
|
194
|
+
|
|
195
|
+
You: ekkOS_Recall({
|
|
196
|
+
semantic_query: "database schema decision",
|
|
197
|
+
extract_decisions: true
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
🧠 **Schema Decisions** (found 3)
|
|
201
|
+
|
|
202
|
+
1. **Users table** (Jan 5)
|
|
203
|
+
- Soft deletes with deleted_at
|
|
204
|
+
- UUID primary keys
|
|
205
|
+
- Email unique constraint
|
|
206
|
+
|
|
207
|
+
2. **Orders table** (Jan 8)
|
|
208
|
+
- Denormalized totals for performance
|
|
209
|
+
- Status enum, not string
|
|
210
|
+
- Foreign key to users
|
|
211
|
+
|
|
212
|
+
3. **Products table** (Jan 10)
|
|
213
|
+
- JSON column for attributes
|
|
214
|
+
- Full-text search enabled
|
|
215
|
+
|
|
216
|
+
Want details on any of these?
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Scenario 4: Cross-Project
|
|
220
|
+
```
|
|
221
|
+
User: "How did we implement rate limiting in the API project?"
|
|
222
|
+
|
|
223
|
+
You: ekkOS_Search({
|
|
224
|
+
query: "rate limiting implementation",
|
|
225
|
+
sources: ["codebase", "patterns"]
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
🧠 **Rate Limiting** (from api-project)
|
|
229
|
+
|
|
230
|
+
**Approach**: Token bucket algorithm
|
|
231
|
+
**Storage**: Redis with TTL
|
|
232
|
+
**Limits**: 100 req/min per API key
|
|
233
|
+
|
|
234
|
+
**Files**:
|
|
235
|
+
- src/middleware/rateLimit.ts
|
|
236
|
+
- src/redis/tokenBucket.ts
|
|
237
|
+
|
|
238
|
+
**Pattern**: "rate-limit-token-bucket"
|
|
239
|
+
Works in: api-project, dashboard-api
|
|
240
|
+
|
|
241
|
+
Want me to apply this pattern here?
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## When No Results Found
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
🧠 I couldn't find anything about [topic].
|
|
248
|
+
|
|
249
|
+
Possible reasons:
|
|
250
|
+
- We haven't discussed this before
|
|
251
|
+
- It was before ekkOS was set up
|
|
252
|
+
- The search terms didn't match
|
|
253
|
+
|
|
254
|
+
Try:
|
|
255
|
+
1. Different keywords?
|
|
256
|
+
2. Broader time range?
|
|
257
|
+
3. Check a specific project?
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Combining with Current Context
|
|
261
|
+
|
|
262
|
+
After recall, offer to load full context:
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
"Would you like me to load the full session context?
|
|
266
|
+
This brings back all the details from that conversation."
|
|
267
|
+
|
|
268
|
+
→ ekkOS_Context({ task: "continue X from recalled session" })
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## Success Metrics
|
|
272
|
+
|
|
273
|
+
You're using this skill well when:
|
|
274
|
+
- Time references trigger automatic recall
|
|
275
|
+
- Topic searches find relevant past work
|
|
276
|
+
- Decisions are surfaced with context
|
|
277
|
+
- Users feel like you "remember everything"
|
|
278
|
+
- Cross-project patterns are reusable
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
**Mantra**: The past is never lost - search for it, find it, use it.
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ekkOS_Learn
|
|
3
|
+
description: Capture solutions as patterns for future use. Activate when you fix a bug, solve a non-trivial problem, get corrected by the user, discover something that works (or doesn't work), find a better approach, or complete any solution worth remembering. Failures are just as valuable as successes - forge anti-patterns too.
|
|
4
|
+
allowed-tools:
|
|
5
|
+
- mcp__ekkos-memory__ekkOS_Forge
|
|
6
|
+
- mcp__ekkos-memory__ekkOS_Outcome
|
|
7
|
+
- mcp__ekkos-memory__ekkOS_Track
|
|
8
|
+
- mcp__ekkos-memory__ekkOS_Search
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# ekkOS_Learn
|
|
12
|
+
|
|
13
|
+
You are augmented with **ekkOS_ memory** - and your job is to make it SMARTER over time by forging what you learn.
|
|
14
|
+
|
|
15
|
+
## Why This Skill Exists
|
|
16
|
+
|
|
17
|
+
The Stop hook detects `[ekkOS_LEARN]` markers in your responses and auto-forges patterns. This skill teaches you **WHEN** to add those markers and **HOW** to forge patterns directly.
|
|
18
|
+
|
|
19
|
+
**The Golden Rule**: If you solved something non-trivial, FORGE IT. If something didn't work, FORGE IT AS AN ANTI-PATTERN. Every forged pattern makes future sessions smarter.
|
|
20
|
+
|
|
21
|
+
## When To Activate
|
|
22
|
+
|
|
23
|
+
This skill should trigger when you detect:
|
|
24
|
+
|
|
25
|
+
| Trigger | What To Forge |
|
|
26
|
+
|---------|---------------|
|
|
27
|
+
| **Bug fixed** | Problem + root cause + solution |
|
|
28
|
+
| **Non-trivial solution** | The approach that worked |
|
|
29
|
+
| **User corrected you** | What you got wrong + the correct way |
|
|
30
|
+
| **Unexpected success** | Why it worked (capture the insight) |
|
|
31
|
+
| **Unexpected failure** | Why it didn't work (anti-pattern) |
|
|
32
|
+
| **Better approach found** | The improvement over first attempt |
|
|
33
|
+
| **Configuration solved** | Setup steps that worked |
|
|
34
|
+
| **Architecture decision** | The decision + rationale |
|
|
35
|
+
| **Gotcha discovered** | The pitfall + how to avoid it |
|
|
36
|
+
|
|
37
|
+
## Pattern vs Anti-Pattern
|
|
38
|
+
|
|
39
|
+
**Patterns** = Things that WORK
|
|
40
|
+
```
|
|
41
|
+
Title: "Fix JWT expiration errors with clock tolerance"
|
|
42
|
+
Problem: "JWT tokens rejected as expired due to clock skew"
|
|
43
|
+
Solution: "Add clockTolerance: 30 to jwt.verify options"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Anti-Patterns** = Things that DON'T WORK
|
|
47
|
+
```
|
|
48
|
+
Title: "Don't use setTimeout for rate limiting"
|
|
49
|
+
Problem: "Tried setTimeout to throttle API calls"
|
|
50
|
+
Solution: "This doesn't work because... Use debounce instead"
|
|
51
|
+
anti_patterns: ["setTimeout for throttling"]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
**BOTH ARE VALUABLE.** Anti-patterns prevent repeating mistakes.
|
|
55
|
+
|
|
56
|
+
## Instructions
|
|
57
|
+
|
|
58
|
+
### Method 1: Marker-Based (Recommended)
|
|
59
|
+
|
|
60
|
+
Add a marker in your response that the Stop hook will detect:
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
[ekkOS_LEARN] Forging: "Your Pattern Title"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
The hook extracts:
|
|
67
|
+
- Title from the marker
|
|
68
|
+
- Problem from user's question
|
|
69
|
+
- Solution from your response
|
|
70
|
+
|
|
71
|
+
**Example:**
|
|
72
|
+
```
|
|
73
|
+
The issue was that the database connection wasn't being released.
|
|
74
|
+
Here's the fix:
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
finally {
|
|
78
|
+
await connection.release();
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
[ekkOS_LEARN] Forging: "Always release database connections in finally block"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Method 2: Direct Forge (For Complex Patterns)
|
|
86
|
+
|
|
87
|
+
For patterns that need specific structure:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
ekkOS_Forge({
|
|
91
|
+
title: "Handle race conditions in React useEffect",
|
|
92
|
+
problem: "Multiple rapid state updates cause stale closures",
|
|
93
|
+
solution: "Use cleanup function with cancelled flag: let cancelled = false; return () => { cancelled = true; }",
|
|
94
|
+
tags: ["react", "useEffect", "race-condition", "hooks"],
|
|
95
|
+
works_when: ["async operations in useEffect", "rapid re-renders"],
|
|
96
|
+
anti_patterns: ["ignoring cleanup", "not checking cancelled flag"]
|
|
97
|
+
})
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Method 3: Report Outcome (After Applying Patterns)
|
|
101
|
+
|
|
102
|
+
When you apply a pattern from search, report if it worked:
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
ekkOS_Outcome({
|
|
106
|
+
success: true, // or false if it didn't work
|
|
107
|
+
model_used: "claude-opus-4-5"
|
|
108
|
+
})
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
This helps the system learn which patterns are reliable.
|
|
112
|
+
|
|
113
|
+
## What Makes a Good Pattern
|
|
114
|
+
|
|
115
|
+
### Good Pattern Titles
|
|
116
|
+
- "Fix CORS errors by setting correct headers"
|
|
117
|
+
- "Prevent memory leaks in event listeners"
|
|
118
|
+
- "Handle null values in JSON parsing"
|
|
119
|
+
|
|
120
|
+
### Bad Pattern Titles
|
|
121
|
+
- "Fixed the bug" (too vague)
|
|
122
|
+
- "Solution" (no context)
|
|
123
|
+
- "Code change" (not descriptive)
|
|
124
|
+
|
|
125
|
+
### Good Problem Descriptions
|
|
126
|
+
- Specific error message or symptom
|
|
127
|
+
- Context where it occurred
|
|
128
|
+
- What was expected vs what happened
|
|
129
|
+
|
|
130
|
+
### Good Solutions
|
|
131
|
+
- The specific fix or approach
|
|
132
|
+
- Why it works (the insight)
|
|
133
|
+
- Any caveats or edge cases
|
|
134
|
+
|
|
135
|
+
## Forge Triggers Checklist
|
|
136
|
+
|
|
137
|
+
Ask yourself after solving anything:
|
|
138
|
+
|
|
139
|
+
- [ ] Was this non-trivial? → FORGE
|
|
140
|
+
- [ ] Did the user teach me something? → FORGE (they corrected me)
|
|
141
|
+
- [ ] Would I want to remember this? → FORGE
|
|
142
|
+
- [ ] Did something NOT work? → FORGE AS ANTI-PATTERN
|
|
143
|
+
- [ ] Is this project-specific? → FORGE with project tags
|
|
144
|
+
- [ ] Is this universal? → FORGE for collective layer
|
|
145
|
+
|
|
146
|
+
## Integration with Hooks
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
┌─────────────────────────────────────────────────────────────────┐
|
|
150
|
+
│ YOUR RESPONSE │
|
|
151
|
+
│ └── Include [ekkOS_LEARN] marker if you solved something │
|
|
152
|
+
│ ↓ │
|
|
153
|
+
│ STOP HOOK │
|
|
154
|
+
│ └── Detects marker, extracts title │
|
|
155
|
+
│ └── Calls ekkOS_Forge with problem/solution │
|
|
156
|
+
│ ↓ │
|
|
157
|
+
│ MEMORY SUBSTRATE │
|
|
158
|
+
│ └── Pattern saved to Layer 4 │
|
|
159
|
+
│ └── Indexed for future retrieval │
|
|
160
|
+
│ ↓ │
|
|
161
|
+
│ NEXT SESSION │
|
|
162
|
+
│ └── Pattern retrieved when similar problem arises │
|
|
163
|
+
└─────────────────────────────────────────────────────────────────┘
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Example Scenarios
|
|
167
|
+
|
|
168
|
+
### Scenario 1: Bug Fix
|
|
169
|
+
```
|
|
170
|
+
User: "My API keeps timing out"
|
|
171
|
+
|
|
172
|
+
You: *investigate*
|
|
173
|
+
*find the issue*
|
|
174
|
+
|
|
175
|
+
"The problem is connection pooling. Your pool was set to
|
|
176
|
+
max 5 connections but you have 20 concurrent requests.
|
|
177
|
+
|
|
178
|
+
Fix: Increase pool size to match expected concurrency:
|
|
179
|
+
```
|
|
180
|
+
pool: { max: 25, min: 5, idle: 10000 }
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
[ekkOS_LEARN] Forging: "Match connection pool size to concurrent request volume"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Scenario 2: User Correction
|
|
187
|
+
```
|
|
188
|
+
User: "No, that's wrong. You should use useCallback, not useMemo"
|
|
189
|
+
|
|
190
|
+
You: "You're right, I apologize for the confusion.
|
|
191
|
+
|
|
192
|
+
- useMemo: Memoizes a VALUE (result of computation)
|
|
193
|
+
- useCallback: Memoizes a FUNCTION (prevents recreation)
|
|
194
|
+
|
|
195
|
+
For passing callbacks to child components, useCallback is correct.
|
|
196
|
+
|
|
197
|
+
[ekkOS_LEARN] Forging: "useCallback for functions, useMemo for values"
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### Scenario 3: Anti-Pattern Discovery
|
|
201
|
+
```
|
|
202
|
+
User: "I tried your suggestion but it made things worse"
|
|
203
|
+
|
|
204
|
+
You: "I see what went wrong. Using synchronous file reads in the
|
|
205
|
+
request handler blocks the event loop.
|
|
206
|
+
|
|
207
|
+
This is an ANTI-PATTERN:
|
|
208
|
+
```javascript
|
|
209
|
+
// DON'T DO THIS
|
|
210
|
+
const data = fs.readFileSync(path);
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
Instead, use async:
|
|
214
|
+
```javascript
|
|
215
|
+
const data = await fs.promises.readFile(path);
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
ekkOS_Forge({
|
|
219
|
+
title: "Never use sync file operations in request handlers",
|
|
220
|
+
problem: "Synchronous file reads block Node.js event loop",
|
|
221
|
+
solution: "Always use fs.promises or callback-based async operations",
|
|
222
|
+
anti_patterns: ["fs.readFileSync in handlers", "blocking I/O in async context"]
|
|
223
|
+
})
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Scenario 4: Configuration Success
|
|
227
|
+
```
|
|
228
|
+
User: "Finally got Tailwind working with the monorepo!"
|
|
229
|
+
|
|
230
|
+
You: "Great! Let me capture that configuration for future reference.
|
|
231
|
+
|
|
232
|
+
ekkOS_Forge({
|
|
233
|
+
title: "Tailwind CSS in Turborepo monorepo setup",
|
|
234
|
+
problem: "Tailwind not detecting classes across workspace packages",
|
|
235
|
+
solution: "Add all workspace paths to content array: content: ['./src/**/*.{ts,tsx}', '../../packages/ui/**/*.{ts,tsx}']",
|
|
236
|
+
tags: ["tailwind", "turborepo", "monorepo", "css"],
|
|
237
|
+
works_when: ["monorepo with shared UI package", "Turborepo setup"]
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
This is now saved for next time you set up a similar project.
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## Success Metrics
|
|
244
|
+
|
|
245
|
+
You're using this skill correctly when:
|
|
246
|
+
- You forge after EVERY non-trivial solution
|
|
247
|
+
- You capture anti-patterns when things fail
|
|
248
|
+
- You acknowledge user corrections as learning moments
|
|
249
|
+
- Your forge titles are specific and searchable
|
|
250
|
+
- You include both WHAT worked and WHY
|
|
251
|
+
|
|
252
|
+
## Remember
|
|
253
|
+
|
|
254
|
+
**The memory only gets smarter if you teach it.**
|
|
255
|
+
|
|
256
|
+
Every pattern you forge helps:
|
|
257
|
+
- Future you (in the next session)
|
|
258
|
+
- This user (across all their projects)
|
|
259
|
+
- Other users (via collective layer)
|
|
260
|
+
|
|
261
|
+
Don't be stingy with forging. If in doubt, FORGE.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
**Mantra**: Solved it? Forge it. Broke it? Forge the anti-pattern. Learned something? Forge it.
|