oh-my-claude-sisyphus 3.4.3 → 3.5.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 (52) hide show
  1. package/README.md +45 -0
  2. package/dist/__tests__/learner/auto-learner.test.d.ts +7 -0
  3. package/dist/__tests__/learner/auto-learner.test.d.ts.map +1 -0
  4. package/dist/__tests__/learner/auto-learner.test.js +507 -0
  5. package/dist/__tests__/learner/auto-learner.test.js.map +1 -0
  6. package/dist/__tests__/learner/matcher.test.d.ts +2 -0
  7. package/dist/__tests__/learner/matcher.test.d.ts.map +1 -0
  8. package/dist/__tests__/learner/matcher.test.js +330 -0
  9. package/dist/__tests__/learner/matcher.test.js.map +1 -0
  10. package/dist/analytics/analytics-summary.d.ts.map +1 -1
  11. package/dist/analytics/analytics-summary.js +12 -11
  12. package/dist/analytics/analytics-summary.js.map +1 -1
  13. package/dist/analytics/backfill-dedup.d.ts.map +1 -1
  14. package/dist/analytics/backfill-dedup.js +8 -11
  15. package/dist/analytics/backfill-dedup.js.map +1 -1
  16. package/dist/analytics/backfill-engine.d.ts.map +1 -1
  17. package/dist/analytics/backfill-engine.js +12 -3
  18. package/dist/analytics/backfill-engine.js.map +1 -1
  19. package/dist/analytics/query-engine.d.ts.map +1 -1
  20. package/dist/analytics/query-engine.js +3 -2
  21. package/dist/analytics/query-engine.js.map +1 -1
  22. package/dist/analytics/token-tracker.d.ts.map +1 -1
  23. package/dist/analytics/token-tracker.js +22 -27
  24. package/dist/analytics/token-tracker.js.map +1 -1
  25. package/dist/analytics/transcript-token-extractor.d.ts +17 -1
  26. package/dist/analytics/transcript-token-extractor.d.ts.map +1 -1
  27. package/dist/analytics/transcript-token-extractor.js +66 -19
  28. package/dist/analytics/transcript-token-extractor.js.map +1 -1
  29. package/dist/analytics/types.d.ts +13 -0
  30. package/dist/analytics/types.d.ts.map +1 -1
  31. package/dist/analytics/types.js.map +1 -1
  32. package/dist/cli/index.js +2 -2
  33. package/dist/cli/index.js.map +1 -1
  34. package/dist/hooks/learner/auto-invoke.d.ts +82 -0
  35. package/dist/hooks/learner/auto-invoke.d.ts.map +1 -0
  36. package/dist/hooks/learner/auto-invoke.js +234 -0
  37. package/dist/hooks/learner/auto-invoke.js.map +1 -0
  38. package/dist/hooks/learner/auto-learner.d.ts +55 -0
  39. package/dist/hooks/learner/auto-learner.d.ts.map +1 -0
  40. package/dist/hooks/learner/auto-learner.js +361 -0
  41. package/dist/hooks/learner/auto-learner.js.map +1 -0
  42. package/dist/hooks/learner/index.d.ts +3 -0
  43. package/dist/hooks/learner/index.d.ts.map +1 -1
  44. package/dist/hooks/learner/index.js +4 -0
  45. package/dist/hooks/learner/index.js.map +1 -1
  46. package/dist/hooks/learner/matcher.d.ts +40 -0
  47. package/dist/hooks/learner/matcher.d.ts.map +1 -0
  48. package/dist/hooks/learner/matcher.js +230 -0
  49. package/dist/hooks/learner/matcher.js.map +1 -0
  50. package/package.json +1 -1
  51. package/skills/local-skills-setup/SKILL.md +465 -0
  52. package/skills/skill/SKILL.md +406 -0
@@ -0,0 +1,465 @@
1
+ ---
2
+ name: local-skills-setup
3
+ description: Set up and manage local skills for automatic matching and invocation
4
+ argument-hint: "[list|add|scan]"
5
+ ---
6
+
7
+ # Local Skills Setup
8
+
9
+ This skill provides a guided wizard for setting up and managing your local learned skills. Skills are reusable problem-solving patterns that Claude automatically applies when it detects matching triggers.
10
+
11
+ ## Why Local Skills?
12
+
13
+ Local skills allow you to capture hard-won insights and solutions that are specific to your codebase or workflow:
14
+ - **Project-level skills** (.omc/skills/) - Version-controlled with your repo
15
+ - **User-level skills** (~/.claude/skills/omc-learned/) - Portable across all your projects
16
+
17
+ When you solve a tricky bug or discover a non-obvious workaround, you can extract it as a skill. Claude will automatically detect and apply these skills in future conversations when it sees matching triggers.
18
+
19
+ ## Interactive Workflow
20
+
21
+ ### Step 1: Directory Check and Setup
22
+
23
+ First, check if skill directories exist and create them if needed:
24
+
25
+ ```bash
26
+ # Check and create user-level skills directory
27
+ USER_SKILLS_DIR="$HOME/.claude/skills/omc-learned"
28
+ if [ -d "$USER_SKILLS_DIR" ]; then
29
+ echo "User skills directory exists: $USER_SKILLS_DIR"
30
+ else
31
+ mkdir -p "$USER_SKILLS_DIR"
32
+ echo "Created user skills directory: $USER_SKILLS_DIR"
33
+ fi
34
+
35
+ # Check and create project-level skills directory
36
+ PROJECT_SKILLS_DIR=".omc/skills"
37
+ if [ -d "$PROJECT_SKILLS_DIR" ]; then
38
+ echo "Project skills directory exists: $PROJECT_SKILLS_DIR"
39
+ else
40
+ mkdir -p "$PROJECT_SKILLS_DIR"
41
+ echo "Created project skills directory: $PROJECT_SKILLS_DIR"
42
+ fi
43
+ ```
44
+
45
+ ### Step 2: Skill Scan and Inventory
46
+
47
+ Scan both directories and show a comprehensive inventory:
48
+
49
+ ```bash
50
+ # Scan user-level skills
51
+ echo "=== USER-LEVEL SKILLS (~/.claude/skills/omc-learned/) ==="
52
+ if [ -d "$HOME/.claude/skills/omc-learned" ]; then
53
+ USER_COUNT=$(find "$HOME/.claude/skills/omc-learned" -name "*.md" 2>/dev/null | wc -l)
54
+ echo "Total skills: $USER_COUNT"
55
+
56
+ if [ $USER_COUNT -gt 0 ]; then
57
+ echo ""
58
+ echo "Skills found:"
59
+ find "$HOME/.claude/skills/omc-learned" -name "*.md" -type f -exec sh -c '
60
+ FILE="$1"
61
+ NAME=$(grep -m1 "^name:" "$FILE" 2>/dev/null | sed "s/name: //")
62
+ DESC=$(grep -m1 "^description:" "$FILE" 2>/dev/null | sed "s/description: //")
63
+ MODIFIED=$(stat -c "%y" "$FILE" 2>/dev/null || stat -f "%Sm" "$FILE" 2>/dev/null)
64
+ echo " - $NAME"
65
+ [ -n "$DESC" ] && echo " Description: $DESC"
66
+ echo " Modified: $MODIFIED"
67
+ echo ""
68
+ ' sh {} \;
69
+ fi
70
+ else
71
+ echo "Directory not found"
72
+ fi
73
+
74
+ echo ""
75
+ echo "=== PROJECT-LEVEL SKILLS (.omc/skills/) ==="
76
+ if [ -d ".omc/skills" ]; then
77
+ PROJECT_COUNT=$(find ".omc/skills" -name "*.md" 2>/dev/null | wc -l)
78
+ echo "Total skills: $PROJECT_COUNT"
79
+
80
+ if [ $PROJECT_COUNT -gt 0 ]; then
81
+ echo ""
82
+ echo "Skills found:"
83
+ find ".omc/skills" -name "*.md" -type f -exec sh -c '
84
+ FILE="$1"
85
+ NAME=$(grep -m1 "^name:" "$FILE" 2>/dev/null | sed "s/name: //")
86
+ DESC=$(grep -m1 "^description:" "$FILE" 2>/dev/null | sed "s/description: //")
87
+ MODIFIED=$(stat -c "%y" "$FILE" 2>/dev/null || stat -f "%Sm" "$FILE" 2>/dev/null)
88
+ echo " - $NAME"
89
+ [ -n "$DESC" ] && echo " Description: $DESC"
90
+ echo " Modified: $MODIFIED"
91
+ echo ""
92
+ ' sh {} \;
93
+ fi
94
+ else
95
+ echo "Directory not found"
96
+ fi
97
+
98
+ # Summary
99
+ TOTAL=$((USER_COUNT + PROJECT_COUNT))
100
+ echo "=== SUMMARY ==="
101
+ echo "Total skills across all directories: $TOTAL"
102
+ ```
103
+
104
+ ### Step 3: Quick Actions Menu
105
+
106
+ After scanning, use the AskUserQuestion tool to offer these options:
107
+
108
+ **Question:** "What would you like to do with your local skills?"
109
+
110
+ **Options:**
111
+ 1. **Add new skill** - Start the skill creation wizard
112
+ 2. **List all skills with details** - Show comprehensive skill inventory with triggers
113
+ 3. **Scan conversation for patterns** - Analyze current conversation for skill-worthy patterns
114
+ 4. **Import skill** - Import a skill from URL or paste content
115
+ 5. **Done** - Exit the wizard
116
+
117
+ #### Option 1: Add New Skill
118
+
119
+ If user chooses "Add new skill", invoke the learner skill:
120
+
121
+ ```
122
+ Use the Skill tool to invoke: learner
123
+ ```
124
+
125
+ This will guide them through the extraction process with quality validation.
126
+
127
+ #### Option 2: List All Skills with Details
128
+
129
+ Show detailed information including trigger keywords:
130
+
131
+ ```bash
132
+ echo "=== DETAILED SKILL INVENTORY ==="
133
+ echo ""
134
+
135
+ # Function to show skill details
136
+ show_skill_details() {
137
+ FILE="$1"
138
+ LOCATION="$2"
139
+
140
+ echo "---"
141
+ echo "Location: $LOCATION"
142
+ echo "File: $(basename "$FILE")"
143
+
144
+ # Extract frontmatter
145
+ NAME=$(grep -m1 "^name:" "$FILE" 2>/dev/null | sed "s/name: //")
146
+ DESC=$(grep -m1 "^description:" "$FILE" 2>/dev/null | sed "s/description: //")
147
+ TRIGGERS=$(grep -m1 "^triggers:" "$FILE" 2>/dev/null | sed "s/triggers: //")
148
+ QUALITY=$(grep -m1 "^quality:" "$FILE" 2>/dev/null | sed "s/quality: //")
149
+
150
+ [ -n "$NAME" ] && echo "Name: $NAME"
151
+ [ -n "$DESC" ] && echo "Description: $DESC"
152
+ [ -n "$TRIGGERS" ] && echo "Triggers: $TRIGGERS"
153
+ [ -n "$QUALITY" ] && echo "Quality: $QUALITY"
154
+
155
+ # Last modified
156
+ MODIFIED=$(stat -c "%y" "$FILE" 2>/dev/null | cut -d. -f1 || stat -f "%Sm" "$FILE" 2>/dev/null)
157
+ echo "Last modified: $MODIFIED"
158
+ echo ""
159
+ }
160
+
161
+ # Export function for subshell
162
+ export -f show_skill_details
163
+
164
+ # Show user-level skills
165
+ if [ -d "$HOME/.claude/skills/omc-learned" ]; then
166
+ echo "USER-LEVEL SKILLS:"
167
+ find "$HOME/.claude/skills/omc-learned" -name "*.md" -type f -exec bash -c 'show_skill_details "$0" "user-level"' {} \;
168
+ fi
169
+
170
+ # Show project-level skills
171
+ if [ -d ".omc/skills" ]; then
172
+ echo "PROJECT-LEVEL SKILLS:"
173
+ find ".omc/skills" -name "*.md" -type f -exec bash -c 'show_skill_details "$0" "project-level"' {} \;
174
+ fi
175
+ ```
176
+
177
+ #### Option 3: Scan Conversation for Patterns
178
+
179
+ Analyze the current conversation context to identify potential skill-worthy patterns. Look for:
180
+ - Recent debugging sessions with non-obvious solutions
181
+ - Tricky bugs that required investigation
182
+ - Codebase-specific workarounds discovered
183
+ - Error patterns that took time to resolve
184
+
185
+ Report findings and ask if user wants to extract any as skills.
186
+
187
+ #### Option 4: Import Skill
188
+
189
+ Ask user to provide either:
190
+ - **URL**: Download skill from a URL (e.g., GitHub gist)
191
+ - **Paste content**: Paste skill markdown content directly
192
+
193
+ Then ask for scope:
194
+ - **User-level** (~/.claude/skills/omc-learned/) - Available across all projects
195
+ - **Project-level** (.omc/skills/) - Only for this project
196
+
197
+ Validate the skill format and save to the chosen location.
198
+
199
+ ### Step 4: Skill Templates
200
+
201
+ Provide quick templates for common skill types. When user wants to create a skill, offer these starting points:
202
+
203
+ #### Error Solution Template
204
+
205
+ ```markdown
206
+ ---
207
+ id: error-[unique-id]
208
+ name: [Error Name]
209
+ description: Solution for [specific error in specific context]
210
+ source: conversation
211
+ triggers: ["error message fragment", "file path", "symptom"]
212
+ quality: high
213
+ ---
214
+
215
+ # [Error Name]
216
+
217
+ ## The Insight
218
+ What is the underlying cause of this error? What principle did you discover?
219
+
220
+ ## Why This Matters
221
+ What goes wrong if you don't know this? What symptom led here?
222
+
223
+ ## Recognition Pattern
224
+ How do you know when this applies? What are the signs?
225
+ - Error message: "[exact error]"
226
+ - File: [specific file path]
227
+ - Context: [when does this occur]
228
+
229
+ ## The Approach
230
+ Step-by-step solution:
231
+ 1. [Specific action with file/line reference]
232
+ 2. [Specific action with file/line reference]
233
+ 3. [Verification step]
234
+
235
+ ## Example
236
+ \`\`\`typescript
237
+ // Before (broken)
238
+ [problematic code]
239
+
240
+ // After (fixed)
241
+ [corrected code]
242
+ \`\`\`
243
+ ```
244
+
245
+ #### Workflow Skill Template
246
+
247
+ ```markdown
248
+ ---
249
+ id: workflow-[unique-id]
250
+ name: [Workflow Name]
251
+ description: Process for [specific task in this codebase]
252
+ source: conversation
253
+ triggers: ["task description", "file pattern", "goal keyword"]
254
+ quality: high
255
+ ---
256
+
257
+ # [Workflow Name]
258
+
259
+ ## The Insight
260
+ What makes this workflow different from the obvious approach?
261
+
262
+ ## Why This Matters
263
+ What fails if you don't follow this process?
264
+
265
+ ## Recognition Pattern
266
+ When should you use this workflow?
267
+ - Task type: [specific task]
268
+ - Files involved: [specific patterns]
269
+ - Indicators: [how to recognize]
270
+
271
+ ## The Approach
272
+ 1. [Step with specific commands/files]
273
+ 2. [Step with specific commands/files]
274
+ 3. [Verification]
275
+
276
+ ## Gotchas
277
+ - [Common mistake and how to avoid it]
278
+ - [Edge case and how to handle it]
279
+ ```
280
+
281
+ #### Code Pattern Template
282
+
283
+ ```markdown
284
+ ---
285
+ id: pattern-[unique-id]
286
+ name: [Pattern Name]
287
+ description: Pattern for [specific use case in this codebase]
288
+ source: conversation
289
+ triggers: ["code pattern", "file type", "problem domain"]
290
+ quality: high
291
+ ---
292
+
293
+ # [Pattern Name]
294
+
295
+ ## The Insight
296
+ What's the key principle behind this pattern?
297
+
298
+ ## Why This Matters
299
+ What problems does this pattern solve in THIS codebase?
300
+
301
+ ## Recognition Pattern
302
+ When do you apply this pattern?
303
+ - File types: [specific files]
304
+ - Problem: [specific problem]
305
+ - Context: [codebase-specific context]
306
+
307
+ ## The Approach
308
+ Decision-making heuristic, not just code:
309
+ 1. [Principle-based step]
310
+ 2. [Principle-based step]
311
+
312
+ ## Example
313
+ \`\`\`typescript
314
+ [Illustrative example showing the principle]
315
+ \`\`\`
316
+
317
+ ## Anti-Pattern
318
+ What NOT to do and why:
319
+ \`\`\`typescript
320
+ [Common mistake to avoid]
321
+ \`\`\`
322
+ ```
323
+
324
+ #### Integration Skill Template
325
+
326
+ ```markdown
327
+ ---
328
+ id: integration-[unique-id]
329
+ name: [Integration Name]
330
+ description: How [system A] integrates with [system B] in this codebase
331
+ source: conversation
332
+ triggers: ["system name", "integration point", "config file"]
333
+ quality: high
334
+ ---
335
+
336
+ # [Integration Name]
337
+
338
+ ## The Insight
339
+ What's non-obvious about how these systems connect?
340
+
341
+ ## Why This Matters
342
+ What breaks if you don't understand this integration?
343
+
344
+ ## Recognition Pattern
345
+ When are you working with this integration?
346
+ - Files: [specific integration files]
347
+ - Config: [specific config locations]
348
+ - Symptoms: [what indicates integration issues]
349
+
350
+ ## The Approach
351
+ How to work with this integration correctly:
352
+ 1. [Configuration step with file paths]
353
+ 2. [Setup step with specific details]
354
+ 3. [Verification step]
355
+
356
+ ## Gotchas
357
+ - [Integration-specific pitfall #1]
358
+ - [Integration-specific pitfall #2]
359
+ ```
360
+
361
+ ## Usage Modes
362
+
363
+ ### Direct Command Mode
364
+
365
+ When invoked with an argument, skip the interactive wizard:
366
+
367
+ - `/oh-my-claudecode:local-skills-setup list` - Show detailed skill inventory
368
+ - `/oh-my-claudecode:local-skills-setup add` - Start skill creation (invoke learner)
369
+ - `/oh-my-claudecode:local-skills-setup scan` - Scan both skill directories
370
+
371
+ ### Interactive Mode
372
+
373
+ When invoked without arguments, run the full guided wizard (Steps 1-4).
374
+
375
+ ## Skill Quality Guidelines
376
+
377
+ Remind users that good skills are:
378
+
379
+ 1. **Non-Googleable** - Can't easily find via search
380
+ - BAD: "How to read files in TypeScript" ❌
381
+ - GOOD: "This codebase uses custom path resolution requiring fileURLToPath" ✓
382
+
383
+ 2. **Context-Specific** - References actual files/errors from THIS codebase
384
+ - BAD: "Use try/catch for error handling" ❌
385
+ - GOOD: "The aiohttp proxy in server.py:42 crashes on ClientDisconnectedError" ✓
386
+
387
+ 3. **Actionable with Precision** - Tells exactly WHAT to do and WHERE
388
+ - BAD: "Handle edge cases" ❌
389
+ - GOOD: "When seeing 'Cannot find module' in dist/, check tsconfig.json moduleResolution" ✓
390
+
391
+ 4. **Hard-Won** - Required significant debugging effort
392
+ - BAD: Generic programming patterns ❌
393
+ - GOOD: "Race condition in worker.ts - Promise.all at line 89 needs await" ✓
394
+
395
+ ## Benefits of Local Skills
396
+
397
+ When introducing the skill system, explain these benefits:
398
+
399
+ **Automatic Application**: Claude detects triggers and applies skills automatically - no need to remember or search for solutions.
400
+
401
+ **Version Control**: Project-level skills (.omc/skills/) are committed with your code, so the whole team benefits.
402
+
403
+ **Evolving Knowledge**: Skills improve over time as you discover better approaches and refine triggers.
404
+
405
+ **Reduced Token Usage**: Instead of re-solving the same problems, Claude applies known patterns efficiently.
406
+
407
+ **Codebase Memory**: Preserves institutional knowledge that would otherwise be lost in conversation history.
408
+
409
+ ## Related Skills
410
+
411
+ - `/oh-my-claudecode:learner` - Extract a skill from current conversation
412
+ - `/oh-my-claudecode:note` - Save quick notes (less formal than skills)
413
+ - `/oh-my-claudecode:deepinit` - Generate AGENTS.md codebase hierarchy
414
+
415
+ ## Example Session
416
+
417
+ Show users what a typical session looks like:
418
+
419
+ ```
420
+ > /oh-my-claudecode:local-skills-setup
421
+
422
+ Checking skill directories...
423
+ ✓ User skills directory exists: ~/.claude/skills/omc-learned/
424
+ ✓ Project skills directory exists: .omc/skills/
425
+
426
+ Scanning for skills...
427
+
428
+ === USER-LEVEL SKILLS ===
429
+ Total skills: 3
430
+ - async-network-error-handling
431
+ Description: Pattern for handling independent I/O failures in async network code
432
+ Modified: 2026-01-20 14:32:15
433
+
434
+ - esm-path-resolution
435
+ Description: Custom path resolution in ESM requiring fileURLToPath
436
+ Modified: 2026-01-19 09:15:42
437
+
438
+ === PROJECT-LEVEL SKILLS ===
439
+ Total skills: 5
440
+ - session-timeout-fix
441
+ Description: Fix for sessionId undefined after restart in session.ts
442
+ Modified: 2026-01-22 16:45:23
443
+
444
+ - build-cache-invalidation
445
+ Description: When to clear TypeScript build cache to fix phantom errors
446
+ Modified: 2026-01-21 11:28:37
447
+
448
+ === SUMMARY ===
449
+ Total skills: 8
450
+
451
+ What would you like to do?
452
+ 1. Add new skill
453
+ 2. List all skills with details
454
+ 3. Scan conversation for patterns
455
+ 4. Import skill
456
+ 5. Done
457
+ ```
458
+
459
+ ## Tips for Users
460
+
461
+ - Run `/oh-my-claudecode:local-skills-setup scan` periodically to review your skill library
462
+ - After solving a tricky bug, immediately run learner to capture it
463
+ - Use project-level skills for codebase-specific knowledge
464
+ - Use user-level skills for general patterns that apply everywhere
465
+ - Review and refine triggers over time to improve matching accuracy