vibe-learning-opencode 0.1.4 → 0.1.6

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 (2) hide show
  1. package/dist/index.js +76 -31
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -70,30 +70,42 @@ After mode behavior: Ask learning questions AFTER task completion.`,
70
70
  Before mode behavior: Check understanding BEFORE implementation. Ask one question, then proceed.`,
71
71
  senior: `Execute NOW: Call mcp__vibe-learning__set_mode with mode="senior". Confirm Senior mode enabled.
72
72
 
73
- CRITICAL - FOR ALL SUBSEQUENT TASKS IN THIS SESSION, follow this EXACTLY:
73
+ CRITICAL - FOR ALL SUBSEQUENT TASKS, test understanding like a senior developer:
74
74
 
75
75
  **[VibeLearning Senior Mode]**
76
- [Round 1/3] [One short question]?
77
- _(skip: just say "skip" to proceed directly)_
76
+ [Round 1/3] [Senior-level question]?
77
+ _(skip: say "skip" to proceed)_
78
78
 
79
- Flow (MUST follow):
80
- - Round 1: Show header + question + skip hint
81
- - Round 2: ALWAYS ask "[Round 2/3] What alternatives did you consider? Tradeoffs?"
82
- - Round 3: If Round 2 vague, "[Round 3/3] Hint: [hint]. What do you think?"
83
- - After 2-3 rounds: "Good thinking! [summary]. Implementing now."
84
- - THEN: Call mcp__vibe-learning__record_learning with main concept discussed
85
- - concept_id: kebab-case (e.g., "jwt-vs-session")
86
- - level: 3 (comparison)
87
- - result: "correct"/"partial"/"skipped"
79
+ Question Style - Test understanding, not gather requirements:
80
+ \u274C WRONG: "What data will you cache?" (requirements gathering)
81
+ \u274C WRONG: "Redis or Memcached?" (tool selection)
82
+ \u2705 RIGHT: "Why do you need caching here?" (reasoning)
83
+ \u2705 RIGHT: "What is cache-aside pattern? How is it different from write-through?" (concept)
84
+ \u2705 RIGHT: "What problems can caching introduce?" (tradeoffs)
85
+
86
+ Flow:
87
+ - Round 1: Test conceptual understanding or ask WHY
88
+ - Round 2: Ask about tradeoffs, edge cases, or compare alternatives
89
+ - Round 3: (if needed) Give hint and ask again
90
+ - FINAL STEP (MANDATORY): Call record_learning tool, THEN say "Good! Implementing now."
91
+
92
+ \u26A0\uFE0F CRITICAL - After final round, IMMEDIATELY call:
93
+ mcp__vibe-learning__record_learning({
94
+ concept_id: "kebab-case-concept", // e.g., "redis-caching"
95
+ level: 3,
96
+ result: "correct" | "partial" | "skipped"
97
+ })
98
+ DO NOT say "Implementing now" until record_learning is called.
88
99
 
89
- \u26A0\uFE0F STRICT RULES:
90
- - ONE short question per message
91
- - Wait for answer before next round
92
- - Minimum 2 rounds before implementing
93
- - If user says "skip", proceed immediately and record as "skipped"
100
+ After implementation, record 1-2 unknown unknowns:
101
+ mcp__vibe-learning__record_unknown_unknown({
102
+ concept_id: "related-concept",
103
+ related_to: "main-concept",
104
+ context: "brief context",
105
+ why_important: "why important"
106
+ })
94
107
 
95
- \u274C WRONG: "What about X? And Y? Also Z?"
96
- \u2705 RIGHT: "[Round 1/3] Why JWT over session-based auth?"`,
108
+ ONE question per message. Wait for answer.`,
97
109
  "senior-light": `Execute NOW: Call mcp__vibe-learning__set_mode with mode="senior_light". Confirm mode changed.
98
110
 
99
111
  Senior Light behavior: Present counterarguments but proceed after round 1. Don't block, just give feedback.`
@@ -104,15 +116,32 @@ var MODE_BEHAVIOR_PROMPTS = {
104
116
  Format (MUST show header on Round 1):
105
117
  **[VibeLearning Senior Mode]**
106
118
  [Round 1/3] [One short question]?
119
+ _(skip: say "skip" to proceed)_
107
120
 
108
121
  Flow:
109
122
  - Round 1: MUST show header + "[Round 1/3] Why this approach?"
110
123
  - Round 2: ALWAYS ask "[Round 2/3] What alternatives did you consider? Tradeoffs?"
111
124
  (Skip only if user named 2+ alternatives with specific tradeoffs)
112
125
  - Round 3: If Round 2 vague, "[Round 3/3] Hint: [hint]. What do you think?"
113
- - After Round 2/3: "Good thinking! [tradeoff summary]. Implementing now."
126
+ - FINAL STEP (MANDATORY): Call record_learning, THEN say "Good thinking! Implementing now."
114
127
 
115
- ONE question per round, one sentence. Be strict like a real senior.`,
128
+ \u26A0\uFE0F CRITICAL - After final round, IMMEDIATELY call:
129
+ mcp__vibe-learning__record_learning({
130
+ concept_id: "kebab-case-concept",
131
+ level: 3,
132
+ result: "correct" | "partial" | "skipped"
133
+ })
134
+ DO NOT say "Implementing now" until record_learning is called.
135
+
136
+ After implementation, record 1-2 unknown unknowns:
137
+ mcp__vibe-learning__record_unknown_unknown({
138
+ concept_id: "related-concept",
139
+ related_to: "main-concept",
140
+ context: "brief context",
141
+ why_important: "why important"
142
+ })
143
+
144
+ ONE question per round. Be strict like a real senior.`,
116
145
  before: `[VibeLearning - Before Mode]
117
146
 
118
147
  Ask ONE short question: "Before implementing, [question]?"
@@ -122,18 +151,34 @@ Then proceed regardless of answer.`,
122
151
  Briefly mention one alternative while implementing.
123
152
  Example: "Using X, but Y is also an option if you need Z."`
124
153
  };
125
- var AUTO_LEARNING_PROMPT = `[VibeLearning - Learning Time]
154
+ var AUTO_LEARNING_PROMPT = `[VibeLearning - Task Completion]
155
+
156
+ Task completed. Execute these steps NOW (in order):
157
+
158
+ **STEP 1: Identify Concepts (ALWAYS DO THIS)**
159
+ Identify 1-3 key concepts used in this task. Use kebab-case (e.g., "redis-caching", "jwt-auth", "react-hooks").
160
+
161
+ **STEP 2: Record Unknown Unknowns (ALWAYS DO THIS)**
162
+ For each concept, think of 1-2 related concepts the user might not know.
163
+ Call mcp__vibe-learning__record_unknown_unknown for each:
164
+ - concept_id: the unknown concept (e.g., "cache-stampede")
165
+ - related_to: the concept from the task (e.g., "redis-caching")
166
+ - context: brief context of how it relates
167
+ - why_important: why they should learn it
168
+
169
+ Example: Task used JWT auth \u2192 record "refresh-token-rotation", "token-revocation"
126
170
 
127
- Task completed. Execute these steps NOW:
171
+ **STEP 3: Register Main Concept (ALWAYS DO THIS)**
172
+ Call mcp__vibe-learning__get_concept_level for the main concept to register it in the learning system.
128
173
 
129
- 1. Call mcp__vibe-learning__should_ask_question
130
- 2. If shouldAsk is true:
131
- - Call mcp__vibe-learning__get_concept_level with a relevant concept from this task
132
- - Ask a level-appropriate question (L1: recognition, L2: understanding, L3: comparison, L4: edge cases, L5: design)
133
- - After user answers, call mcp__vibe-learning__record_learning
134
- 3. If shouldAsk is false, briefly mention cooldown
174
+ **STEP 4: Ask Learning Question (CONDITIONAL)**
175
+ Call mcp__vibe-learning__should_ask_question to check.
176
+ - If shouldAsk is true AND mode is not "off":
177
+ - Ask a level-appropriate question (L1-L5)
178
+ - After user answers, call mcp__vibe-learning__record_learning
179
+ - If shouldAsk is false: briefly mention cooldown status
135
180
 
136
- Ask naturally, like conversation.`;
181
+ Ask naturally, like conversation. Keep it brief.`;
137
182
  function parseLearnCommand(text) {
138
183
  const lower = text.toLowerCase().trim();
139
184
  if (lower === "/learn" || lower === "/learn status")
@@ -198,7 +243,7 @@ var VibeLearningPlugin = (ctx) => {
198
243
  const concept = extractConceptFromPath(filePath);
199
244
  if (concept)
200
245
  addConcept(concept);
201
- if (toolCount >= CONFIG.TOOL_THRESHOLD && currentMode !== "off") {
246
+ if (toolCount >= CONFIG.TOOL_THRESHOLD) {
202
247
  const now = Date.now();
203
248
  if (now - lastLearningPrompt >= CONFIG.COOLDOWN_MS) {
204
249
  toolCount = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-learning-opencode",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "VibeLearning plugin for OpenCode - spaced repetition learning while coding",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",