vibelearn 0.1.1

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 (57) hide show
  1. package/LICENSE +630 -0
  2. package/README.md +287 -0
  3. package/package.json +129 -0
  4. package/plugin/.claude-plugin/CLAUDE.md +4 -0
  5. package/plugin/.claude-plugin/plugin.json +23 -0
  6. package/plugin/.cli-installed +1 -0
  7. package/plugin/CLAUDE.md +6 -0
  8. package/plugin/hooks/CLAUDE.md +6 -0
  9. package/plugin/hooks/bugfixes-2026-01-10.md +92 -0
  10. package/plugin/hooks/hooks.json +79 -0
  11. package/plugin/modes/code--ar.json +24 -0
  12. package/plugin/modes/code--bn.json +24 -0
  13. package/plugin/modes/code--chill.json +8 -0
  14. package/plugin/modes/code--cs.json +24 -0
  15. package/plugin/modes/code--da.json +24 -0
  16. package/plugin/modes/code--de.json +24 -0
  17. package/plugin/modes/code--el.json +24 -0
  18. package/plugin/modes/code--es.json +24 -0
  19. package/plugin/modes/code--fi.json +24 -0
  20. package/plugin/modes/code--fr.json +24 -0
  21. package/plugin/modes/code--he.json +24 -0
  22. package/plugin/modes/code--hi.json +24 -0
  23. package/plugin/modes/code--hu.json +24 -0
  24. package/plugin/modes/code--id.json +24 -0
  25. package/plugin/modes/code--it.json +24 -0
  26. package/plugin/modes/code--ja.json +24 -0
  27. package/plugin/modes/code--ko.json +24 -0
  28. package/plugin/modes/code--nl.json +24 -0
  29. package/plugin/modes/code--no.json +24 -0
  30. package/plugin/modes/code--pl.json +24 -0
  31. package/plugin/modes/code--pt-br.json +24 -0
  32. package/plugin/modes/code--ro.json +24 -0
  33. package/plugin/modes/code--ru.json +24 -0
  34. package/plugin/modes/code--sv.json +24 -0
  35. package/plugin/modes/code--th.json +24 -0
  36. package/plugin/modes/code--tr.json +24 -0
  37. package/plugin/modes/code--uk.json +24 -0
  38. package/plugin/modes/code--ur.json +25 -0
  39. package/plugin/modes/code--vi.json +24 -0
  40. package/plugin/modes/code--zh.json +24 -0
  41. package/plugin/modes/code.json +125 -0
  42. package/plugin/modes/email-investigation.json +120 -0
  43. package/plugin/modes/law-study--chill.json +7 -0
  44. package/plugin/modes/law-study-CLAUDE.md +85 -0
  45. package/plugin/modes/law-study.json +120 -0
  46. package/plugin/package.json +23 -0
  47. package/plugin/scripts/CLAUDE.md +5 -0
  48. package/plugin/scripts/bun-runner.js +176 -0
  49. package/plugin/scripts/mcp-server.cjs +141 -0
  50. package/plugin/scripts/smart-install.js +592 -0
  51. package/plugin/scripts/statusline-counts.js +61 -0
  52. package/plugin/scripts/vl-cli.cjs +104 -0
  53. package/plugin/scripts/worker-cli.js +19 -0
  54. package/plugin/scripts/worker-service.cjs +1919 -0
  55. package/plugin/scripts/worker-wrapper.cjs +2 -0
  56. package/plugin/skills/smart-explore/SKILL.md +145 -0
  57. package/plugin/skills/timeline-report/SKILL.md +91 -0
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ "use strict";var m=Object.create;var w=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var f=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty;var g=(e,i,n,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(let s of I(i))!x.call(e,s)&&s!==n&&w(e,s,{get:()=>i[s],enumerable:!(o=u(i,s))||o.enumerable});return e};var k=(e,i,n)=>(n=e!=null?m(f(e)):{},g(i||!e||!e.__esModule?w(n,"default",{value:e,enumerable:!0}):n,e));var c=require("child_process"),p=k(require("path"),1),y=process.platform==="win32",P=__dirname,l=p.default.join(P,"worker-service.cjs"),t=null,a=!1;function r(e){let i=new Date().toISOString();console.log(`[${i}] [wrapper] ${e}`)}function h(){r(`Spawning inner worker: ${l}`),t=(0,c.spawn)(process.execPath,[l],{stdio:["inherit","inherit","inherit","ipc"],env:{...process.env,VIBELEARN_MANAGED:"true"},cwd:p.default.dirname(l)}),t.on("message",async e=>{(e.type==="restart"||e.type==="shutdown")&&(r(`${e.type} requested by inner`),a=!0,await d(),r("Exiting wrapper"),process.exit(0))}),t.on("exit",(e,i)=>{r(`Inner exited with code=${e}, signal=${i}`),t=null,a||(r("Inner exited unexpectedly, wrapper exiting (hooks will restart if needed)"),process.exit(e??0))}),t.on("error",e=>{r(`Inner error: ${e.message}`)})}async function d(){if(!t||!t.pid){r("No inner process to kill");return}let e=t.pid;if(r(`Killing inner process tree (pid=${e})`),y)try{(0,c.execSync)(`taskkill /PID ${e} /T /F`,{timeout:1e4,stdio:"ignore"}),r(`taskkill completed for pid=${e}`)}catch(i){r(`taskkill failed (process may be dead): ${i}`)}else{t.kill("SIGTERM");let i=new Promise(o=>{if(!t){o();return}t.on("exit",()=>o())}),n=new Promise(o=>setTimeout(()=>o(),5e3));await Promise.race([i,n]),t&&!t.killed&&(r("Inner did not exit gracefully, force killing"),t.kill("SIGKILL"))}await S(e,5e3),t=null,r("Inner process terminated")}async function S(e,i){let n=Date.now();for(;Date.now()-n<i;)try{process.kill(e,0),await new Promise(o=>setTimeout(o,100))}catch{return}r(`Timeout waiting for process ${e} to exit`)}process.on("SIGTERM",async()=>{r("Wrapper received SIGTERM"),a=!0,await d(),process.exit(0)});process.on("SIGINT",async()=>{r("Wrapper received SIGINT"),a=!0,await d(),process.exit(0)});r("Wrapper starting");h();
@@ -0,0 +1,145 @@
1
+ ---
2
+ name: smart-explore
3
+ description: Token-optimized structural code search using tree-sitter AST parsing. Use instead of reading full files when you need to understand code structure, find functions, or explore a codebase efficiently.
4
+ ---
5
+
6
+ # Smart Explore
7
+
8
+ Structural code exploration using AST parsing. **This skill overrides your default exploration behavior.** While this skill is active, use smart_search/smart_outline/smart_unfold as your primary tools instead of Read, Grep, and Glob.
9
+
10
+ **Core principle:** Index first, fetch on demand. Give yourself a map of the code before loading implementation details. The question before every file read should be: "do I need to see all of this, or can I get a structural overview first?" The answer is almost always: get the map.
11
+
12
+ ## Your Next Tool Call
13
+
14
+ This skill only loads instructions. You must call the MCP tools yourself. Your next action should be one of:
15
+
16
+ ```
17
+ smart_search(query="<topic>", path="./src") -- discover files + symbols across a directory
18
+ smart_outline(file_path="<file>") -- structural skeleton of one file
19
+ smart_unfold(file_path="<file>", symbol_name="<name>") -- full source of one symbol
20
+ ```
21
+
22
+ Do NOT run Grep, Glob, Read, or find to discover files first. `smart_search` walks directories, parses all code files, and returns ranked symbols in one call. It replaces the Glob → Grep → Read discovery cycle.
23
+
24
+ ## 3-Layer Workflow
25
+
26
+ ### Step 1: Search -- Discover Files and Symbols
27
+
28
+ ```
29
+ smart_search(query="shutdown", path="./src", max_results=15)
30
+ ```
31
+
32
+ **Returns:** Ranked symbols with signatures, line numbers, match reasons, plus folded file views (~2-6k tokens)
33
+
34
+ ```
35
+ -- Matching Symbols --
36
+ function performGracefulShutdown (services/infrastructure/GracefulShutdown.ts:56)
37
+ function httpShutdown (services/infrastructure/HealthMonitor.ts:92)
38
+ method WorkerService.shutdown (services/worker-service.ts:846)
39
+
40
+ -- Folded File Views --
41
+ services/infrastructure/GracefulShutdown.ts (7 symbols)
42
+ services/worker-service.ts (12 symbols)
43
+ ```
44
+
45
+ This is your discovery tool. It finds relevant files AND shows their structure. No Glob/find pre-scan needed.
46
+
47
+ **Parameters:**
48
+
49
+ - `query` (string, required) -- What to search for (function name, concept, class name)
50
+ - `path` (string) -- Root directory to search (defaults to cwd)
51
+ - `max_results` (number) -- Max matching symbols, default 20, max 50
52
+ - `file_pattern` (string, optional) -- Filter to specific files/paths
53
+
54
+ ### Step 2: Outline -- Get File Structure
55
+
56
+ ```
57
+ smart_outline(file_path="services/worker-service.ts")
58
+ ```
59
+
60
+ **Returns:** Complete structural skeleton -- all functions, classes, methods, properties, imports (~1-2k tokens per file)
61
+
62
+ **Skip this step** when Step 1's folded file views already provide enough structure. Most useful for files not covered by the search results.
63
+
64
+ **Parameters:**
65
+
66
+ - `file_path` (string, required) -- Path to the file
67
+
68
+ ### Step 3: Unfold -- See Implementation
69
+
70
+ Review symbols from Steps 1-2. Pick the ones you need. Unfold only those:
71
+
72
+ ```
73
+ smart_unfold(file_path="services/worker-service.ts", symbol_name="shutdown")
74
+ ```
75
+
76
+ **Returns:** Full source code of the specified symbol including JSDoc, decorators, and complete implementation (~400-2,100 tokens depending on symbol size). AST node boundaries guarantee completeness regardless of symbol size — unlike Read + agent summarization, which may truncate long methods.
77
+
78
+ **Parameters:**
79
+
80
+ - `file_path` (string, required) -- Path to the file (as returned by search/outline)
81
+ - `symbol_name` (string, required) -- Name of the function/class/method to expand
82
+
83
+ ## When to Use Standard Tools Instead
84
+
85
+ Use these only when smart_* tools are the wrong fit:
86
+
87
+ - **Grep:** Exact string/regex search ("find all TODO comments", "where is `ensureWorkerStarted` defined?")
88
+ - **Read:** Small files under ~100 lines, non-code files (JSON, markdown, config)
89
+ - **Glob:** File path patterns ("find all test files")
90
+ - **Explore agent:** When you need synthesized understanding across 6+ files, architecture narratives, or answers to open-ended questions like "how does this entire system work end-to-end?" Smart-explore is a scalpel — it answers "where is this?" and "show me that." It doesn't synthesize cross-file data flows, design decisions, or edge cases across an entire feature.
91
+
92
+ For code files over ~100 lines, prefer smart_outline + smart_unfold over Read.
93
+
94
+ ## Workflow Examples
95
+
96
+ **Discover how a feature works (cross-cutting):**
97
+
98
+ ```
99
+ 1. smart_search(query="shutdown", path="./src")
100
+ -> 14 symbols across 7 files, full picture in one call
101
+ 2. smart_unfold(file_path="services/infrastructure/GracefulShutdown.ts", symbol_name="performGracefulShutdown")
102
+ -> See the core implementation
103
+ ```
104
+
105
+ **Navigate a large file:**
106
+
107
+ ```
108
+ 1. smart_outline(file_path="services/worker-service.ts")
109
+ -> 1,466 tokens: 12 functions, WorkerService class with 24 members
110
+ 2. smart_unfold(file_path="services/worker-service.ts", symbol_name="startSessionProcessor")
111
+ -> 1,610 tokens: the specific method you need
112
+ Total: ~3,076 tokens vs ~12,000 to Read the full file
113
+ ```
114
+
115
+ **Write documentation about code (hybrid workflow):**
116
+
117
+ ```
118
+ 1. smart_search(query="feature name", path="./src") -- discover all relevant files and symbols
119
+ 2. smart_outline on key files -- understand structure
120
+ 3. smart_unfold on important functions -- get implementation details
121
+ 4. Read on small config/markdown/plan files -- get non-code context
122
+ ```
123
+
124
+ Use smart_* tools for code exploration, Read for non-code files. Mix freely.
125
+
126
+ **Exploration then precision:**
127
+
128
+ ```
129
+ 1. smart_search(query="session", path="./src", max_results=10)
130
+ -> 10 ranked symbols: SessionMetadata, SessionQueueProcessor, SessionSummary...
131
+ 2. Pick the relevant one, unfold it
132
+ ```
133
+
134
+ ## Token Economics
135
+
136
+ | Approach | Tokens | Use Case |
137
+ |----------|--------|----------|
138
+ | smart_outline | ~1,000-2,000 | "What's in this file?" |
139
+ | smart_unfold | ~400-2,100 | "Show me this function" |
140
+ | smart_search | ~2,000-6,000 | "Find all X across the codebase" |
141
+ | search + unfold | ~3,000-8,000 | End-to-end: find and read (the primary workflow) |
142
+ | Read (full file) | ~12,000+ | When you truly need everything |
143
+ | Explore agent | ~39,000-59,000 | Cross-file synthesis with narrative |
144
+
145
+ **4-8x savings** on file understanding (outline + unfold vs Read). **11-18x savings** on codebase exploration vs Explore agent. The narrower the query, the wider the gap — a 27-line function costs 55x less to read via unfold than via an Explore agent, because the agent still reads the entire file.
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: timeline-report
3
+ description: Generate a learning summary report analyzing a project's VibeLearn sessions, concepts, and mastery progress. Use when asked for a learning report, concept summary, or quiz progress overview.
4
+ ---
5
+
6
+ # Learning Summary Report
7
+
8
+ Generate a comprehensive report of your learning progress from VibeLearn's captured sessions.
9
+
10
+ ## When to Use
11
+
12
+ Use when users ask for:
13
+ - "Show my learning report"
14
+ - "Summarize what I've learned"
15
+ - "What concepts have I encountered?"
16
+ - "Show my quiz progress"
17
+ - "What are my learning gaps?"
18
+
19
+ ## Workflow
20
+
21
+ ### Step 1: Check Worker Status
22
+
23
+ ```bash
24
+ curl -s http://127.0.0.1:37778/api/health | jq .
25
+ ```
26
+
27
+ If the worker isn't running, prompt the user to start it.
28
+
29
+ ### Step 2: Fetch Learning Data
30
+
31
+ ```bash
32
+ # Developer profile (mastery per concept)
33
+ curl -s http://127.0.0.1:37778/api/vibelearn/profile | jq .
34
+
35
+ # Pending quiz questions
36
+ curl -s http://127.0.0.1:37778/api/vibelearn/questions/pending | jq .
37
+ ```
38
+
39
+ Or query the database directly for richer data:
40
+
41
+ ```bash
42
+ sqlite3 ~/.vibelearn/vibelearn.db << 'SQL'
43
+ -- Session summary
44
+ SELECT COUNT(*) as sessions FROM vibelearn_session_summaries;
45
+
46
+ -- Top concept categories
47
+ SELECT category, COUNT(*) as count
48
+ FROM vl_concepts
49
+ GROUP BY category
50
+ ORDER BY count DESC
51
+ LIMIT 10;
52
+
53
+ -- Mastery overview
54
+ SELECT
55
+ COUNT(*) as total_concepts,
56
+ AVG(mastery_score) as avg_mastery,
57
+ SUM(CASE WHEN mastery_score >= 0.85 THEN 1 ELSE 0 END) as mastered,
58
+ SUM(CASE WHEN mastery_score < 0.5 THEN 1 ELSE 0 END) as needs_work
59
+ FROM vl_developer_profile;
60
+
61
+ -- Recent sessions
62
+ SELECT what_was_built, created_at
63
+ FROM vibelearn_session_summaries
64
+ ORDER BY created_at DESC
65
+ LIMIT 5;
66
+ SQL
67
+ ```
68
+
69
+ ### Step 3: Generate the Report
70
+
71
+ Write a report covering:
72
+
73
+ 1. **Sessions Overview** — total sessions analyzed, date range
74
+ 2. **Tech Stack** — frameworks and tools detected (from `vl_stack_profiles`)
75
+ 3. **Concepts Encountered** — top categories and specific concepts
76
+ 4. **Mastery Progress** — how many concepts mastered vs in progress
77
+ 5. **Learning Gaps** — concepts with mastery_score < 0.5
78
+ 6. **Quiz Stats** — questions answered, correct rate
79
+
80
+ ### Step 4: Recommend Next Actions
81
+
82
+ Based on the data, suggest:
83
+ - `vl quiz` if pending questions exist
84
+ - `vl gaps` to focus on weak areas
85
+ - `vl login` if not connected to vibelearn.dev
86
+
87
+ ## Notes
88
+
89
+ - All data is in `~/.vibelearn/vibelearn.db`
90
+ - The `vl` CLI provides interactive access: `vl quiz`, `vl status`, `vl gaps`
91
+ - Worker must be running on port **37778** (not 37777)