omnilearn-workflow 1.0.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.
@@ -0,0 +1,740 @@
1
+ ---
2
+ description: Start an interactive learning session. Generates hands-on assignments with increasing difficulty, guides the user through practice, adapts to their progress, and updates the learning record.
3
+ ---
4
+
5
+ # /omnilearn-start — Start Learning a Skill
6
+
7
+ ## Usage
8
+ ```
9
+ /omnilearn-start Rust
10
+ /omnilearn-start React Continue where I left off
11
+ /omnilearn-start Python I want to work on decorators
12
+ /omnilearn-start Machine Learning Start the neural networks topic
13
+ /omnilearn-start JavaScript help me with closures
14
+ ```
15
+
16
+ ## Core Learning Philosophy
17
+
18
+ **The user learns by doing, not by reading.** Every topic produces:
19
+ 1. A **topic explanation** — concise, practical overview (just enough context)
20
+ 2. **Hands-on assignments** — increasing difficulty: basic → intermediate → real-world
21
+ 3. **Test scripts** — automated validation of the user's solution
22
+ 4. **Scaffold code** — starter files so they can jump straight into coding
23
+ 5. **Solution guides** — reference implementations with explanation
24
+
25
+ The goal metric: **Can the user apply what they learned to real-world problems they haven't seen before?**
26
+
27
+ ## Directory Structure
28
+
29
+ ```
30
+ .omnilearn/<skill>/
31
+ ├── roadmap.md
32
+ ├── SkillPreferences.md
33
+ ├── progress-index.md ← Overview index: links to topic-progress.md per topic
34
+ ├── runs/ ← Skill-level run logs (action logs only, NOT progress)
35
+ │ └── YYYY-MM-DD-HHMMSS-learning-<topic>/
36
+ │ ├── agent-log.md ← What happened this run: decisions, actions taken
37
+ │ ├── interaction-1.md ← User Q&A interaction record
38
+ │ ├── interaction-2.md
39
+ │ └── ...
40
+ └── topics/
41
+ └── <topic-name>/ ← e.g., "error-handling", "neural-networks"
42
+ ├── topic-roadmap.md ← Detailed subtopic roadmap (created on-demand)
43
+ ├── topic-progress.md ← 🔑 PROGRESS LIVES HERE: assignment status, sessions, skills demonstrated
44
+ ├── assignments/
45
+ │ ├── 01-<concept-basics>/
46
+ │ │ ├── question.md ← Real-world scenario assignment brief
47
+ │ │ ├── test.<ext> ← Automated test script
48
+ │ │ ├── scaffold/ ← Starter code (user writes solution here)
49
+ │ │ └── solution-guide.md ← Reference solution + explanation
50
+ │ ├── 02-<concept-intermediate>/
51
+ │ │ └── ...
52
+ │ └── 03-<concept-real-world>/
53
+ │ └── ...
54
+ └── runs/ ← Per-topic action logs (NOT progress state)
55
+ └── YYYY-MM-DD-HHMMSS-<activity>/
56
+ ├── agent-log.md ← Actions during this run
57
+ └── ...
58
+ ```
59
+
60
+ ## MANDATORY TOOLS
61
+
62
+ | Tool | When | Why |
63
+ |------|------|-----|
64
+ | `task(category="unspecified-high", background/poll)` | Content creation | Topic roadmaps, assignments, explanations |
65
+ | `task(category="deep", background)` | Complex autonomous | Full topic roadmap creation (sub-agents within) |
66
+ | `task(category="writing")` | Content writing | Topic explanations, solution guides |
67
+ | `task(category="unspecified-high", ["programming"])` | Technical work | Test scripts, scaffold code |
68
+ | `google_search` / `websearch_web_search_exa` | Research | Learning resources, topic best practices |
69
+ | `context7_query_docs` | Tech skills | Official docs for languages/frameworks |
70
+ | `question` tool | User interaction | Present topic choices, ask for preferences |
71
+ | `read`, `write`, `edit`, `bash`, `grep`, `glob` | Every phase | File operations |
72
+ | `bash(git ...)` | Completion | Commit progress |
73
+
74
+ ## Phase 0: INTENT GATE — Parse & Validate
75
+
76
+ ### 0.1 Parse Input
77
+
78
+ Extract the skill name and any optional topic/request from the user's message:
79
+ - "/omnilearn-start Rust" → skill: `Rust`, no specific topic
80
+ - "/omnilearn-start React Continue where I left off" → skill: `React`, action: continue
81
+ - "/omnilearn-start Python I want to learn about decorators" → skill: `Python`, topic: decorators
82
+
83
+ ### 0.2 Verify Skill Exists
84
+
85
+ ```bash
86
+ OMNILEARN_CONFIG="$HOME/.config/opencode/omnilearn.json"
87
+
88
+ if [ ! -f "$OMNILEARN_CONFIG" ]; then
89
+ echo "OmniLearn is not configured yet."
90
+ echo ""
91
+ echo "Run this first:"
92
+ echo " /omnilearn-init"
93
+ exit 1
94
+ fi
95
+
96
+ LEARNING_DIR=$(grep -o '"learningDirectory"[[:space:]]*:[[:space:]]*"[^"]*"' "$OMNILEARN_CONFIG" | sed 's/"learningDirectory"[[:space:]]*:[[:space:]]*"//' | sed 's/"$//')
97
+ OMNILEARN_DIR="$LEARNING_DIR/.omnilearn"
98
+ SKILL_DIR="$OMNILEARN_DIR/<skill>"
99
+ ROADMAP="$SKILL_DIR/roadmap.md"
100
+ PROGRESS_INDEX="$SKILL_DIR/progress-index.md"
101
+ TOPICS_DIR="$SKILL_DIR/topics"
102
+ SKILL_PREFS="$SKILL_DIR/SkillPreferences.md"
103
+ GLOBAL_PREFS="$OMNILEARN_DIR/UserPreferences.md"
104
+
105
+ if [ ! -d "$SKILL_DIR" ] || [ ! -f "$ROADMAP" ]; then
106
+ echo "No roadmap found for '{skill}'. Create one first:"
107
+ echo ""
108
+ echo " /omnilearn-roadmap {skill}"
109
+ echo ""
110
+ exit 1
111
+ fi
112
+ ```
113
+
114
+ ### 0.3 Read Progress, Preferences & Cross-Skill Inventory
115
+
116
+ Read these files to understand the current state:
117
+ - `UserPreferences.md` (if exists) — learning style, experience level, goals
118
+ - `SkillPreferences.md` — per-skill state, preferences
119
+ - `progress-index.md` — overview of topic statuses
120
+
121
+ **For any topics marked 🔵 In Progress**, read their `topic-progress.md` files to get the detailed state:
122
+ - Which assignment are they on?
123
+ - What was the last session's outcome?
124
+ - What concepts are they struggling with?
125
+
126
+ **Cross-skill inventory** — Scan the learning directory for other skills the user has learned:
127
+ ```bash
128
+ ls -d "$OMNILEARN_DIR"/*/ 2>/dev/null | while read dir; do
129
+ skill_name=$(basename "$dir")
130
+ if [ "$skill_name" != "$SKILL_NAME" ] && [ -f "$dir/progress-index.md" ]; then
131
+ echo "Related skill: $skill_name — can integrate with $SKILL_NAME"
132
+ fi
133
+ done
134
+ ```
135
+ This context helps the learning agent design assignments that reference or integrate related skills.
136
+
137
+ ### 0.4 Check Current Topic Status
138
+
139
+ From `progress-index.md` and the individual `topic-progress.md` files, determine:
140
+ - Is there a currently in-progress topic? → note it, read its topic-progress.md
141
+ - Which topics are completed? → note them
142
+ - Which topics are not started? → list them
143
+
144
+ ## Phase 1: TOPIC SELECTION — Let User Choose
145
+
146
+ ### 1.1 Present Options to the User
147
+
148
+ If there's an in-progress topic:
149
+ > "You were working on **{topic}** in {skill}. You can:
150
+ > 1. Continue **{topic}** — pick up where you left off
151
+ > 2. Start a **new topic** — choose from available topics
152
+ > 3. Specify a topic — tell me which one"
153
+
154
+ If there's a specific topic mentioned by the user, verify it exists in the roadmap:
155
+ > "I see '{user_topic}' in the {skill} roadmap. Shall we start learning that?"
156
+
157
+ If the user mentioned a specific topic that is NOT in the roadmap:
158
+ > "'{user_topic}' isn't currently in the {skill} roadmap. Would you like to:
159
+ > 1. **Add it to the roadmap** — I'll research and add it
160
+ > 2. **Pick from existing topics** — here are the available ones..."
161
+
162
+ **Use the `question` tool** to present options when there are multiple choices.
163
+
164
+ ### 1.2 If User Chooses "Continue" an In-Progress Topic
165
+
166
+ Jump to Phase 2 to check the topic roadmap.
167
+
168
+ ### 1.3 If User Chooses a Topic Without a Topic Roadmap
169
+
170
+ Proceed to Phase 1.4 to create the topic roadmap first.
171
+
172
+ ### 1.4 Create Topic Roadmap (Autonomous Subagent)
173
+
174
+ If the chosen topic doesn't have a `topic-roadmap.md`, spawn a DEEP autonomous subagent:
175
+
176
+ ```typescript
177
+ task(category="deep", run_in_background=false, timeout=600000, prompt="
178
+ 1. TASK: Create a comprehensive subtopic roadmap and initial learning materials for the topic '{topic}' within the skill '{skill}'.
179
+ 2. EXPECTED OUTCOME: A detailed topic-roadmap.md with structured learning path, AND the first assignment with question, test script, scaffold, and solution guide.
180
+
181
+ 3. REQUIRED TOOLS: google_search, websearch_web_search_exa, context7_resolve-library-id, context7_query_docs, read, write, bash, grep
182
+
183
+ 4. MUST DO — Step-by-Step:
184
+
185
+ STEP 1 — Research:
186
+ - Read the main roadmap to understand how this topic fits: {ROADMAP}
187
+ - Read user preferences: {GLOBAL_PREFS} (if exists), {SKILL_PREFS} (if exists)
188
+ - Use google_search / websearch extensively to research:
189
+ * What EXACTLY needs to be learned for this topic for real-world proficiency
190
+ * Common learning resources, tutorials, documentation
191
+ * Best practices and common pitfalls
192
+ * Prerequisites and related concepts
193
+ - If it's a tech topic, use context7 for official documentation
194
+
195
+ STEP 2 — Create topic-roadmap.md at:
196
+ {TOPICS_DIR}/{topic}/topic-roadmap.md
197
+
198
+ Structure:
199
+ # {topic} — Learning Path
200
+
201
+ ## Prerequisites
202
+ - What the user should know before starting
203
+
204
+ ## Learning Objectives
205
+ - By the end, what the user will be able to do
206
+
207
+ ## Subtopic Breakdown (ordered)
208
+ ### 1. {subtopic name}
209
+ - Core concepts
210
+ - Why it matters in real-world
211
+ - Practical skills gained
212
+
213
+ ### 2. ...
214
+
215
+ ## Assignment Structure
216
+ - 3 assignments: Basic → Intermediate → Real-World
217
+ - Each builds on the previous
218
+ - Final assignment should be a mini-project or real-world scenario
219
+
220
+ STEP 3 — Create Assignment 1 (the first one) at:
221
+ {TOPICS_DIR}/{topic}/assignments/01-{concept}/
222
+
223
+ Create these files:
224
+
225
+ a) question.md — The assignment brief:
226
+ - Clear learning objective
227
+ - Problem description (real-world scenario)
228
+ - Requirements/Specifications (numbered list)
229
+ - Hints section (hidden behind spoiler or at bottom)
230
+ - Expected output/behavior description
231
+ - References to docs/resources if helpful
232
+
233
+ b) test.{ext} — Automated test script:
234
+ - Language-appropriate test framework (pytest for Python, jest for JS/TS, etc.)
235
+ - Tests that validate the solution works correctly
236
+ - Edge case tests
237
+ - Clear error messages on failure
238
+ - Must be runnable without modification (include any needed imports)
239
+ - Use the simplest possible test setup
240
+
241
+ c) scaffold/ directory with starter files:
242
+ - Minimal code structure to get started
243
+ - Comments marking where to write code // TODO: or # TODO:
244
+ - Import/require statements already in place
245
+ - Can be empty scaffold if topic is conceptual
246
+
247
+ d) solution-guide.md:
248
+ - Complete reference solution (code)
249
+ - Explanation of the solution approach
250
+ - Why certain choices were made
251
+ - Alternative approaches
252
+ - Common mistakes and how to avoid them
253
+ - Real-world connections
254
+
255
+ STEP 4 — Create topic-progress.md at:
256
+ {TOPICS_DIR}/{topic}/topic-progress.md
257
+
258
+ This is the AUTHORITATIVE progress tracker for this topic. Structure:
259
+
260
+ # Progress: {topic}
261
+
262
+ ## Status
263
+ - Overall: 🔵 In Progress
264
+ - Started: {date}
265
+ - Last activity: {date}
266
+
267
+ ## Assignments
268
+ 1. **01-{concept}** — 🟢 Not Started
269
+ <!-- Update to 🔵 In Progress when started, ✅ Completed when done -->
270
+
271
+ ## Learning Sessions
272
+ | Date | Activity | Run Log |
273
+ |------|----------|---------|
274
+ | {date} | Topic started, first assignment created | runs/{run-id}/agent-log.md |
275
+
276
+ ## Skills Demonstrated
277
+ <!-- Record real-world skills the user has shown -->
278
+
279
+ Also update progress-index.md at the skill level to point to this topic:
280
+ - Add topic entry with status 🔵 In Progress and a link to topic-progress.md
281
+
282
+ 5. MUST NOT DO:
283
+ - Do NOT create all 3 assignments at once — only the first one
284
+ - Do NOT make assignments purely theoretical — use real-world scenarios
285
+ - Do NOT skip the scaffold — the user should be able to start coding immediately
286
+ - Do NOT use any external packages that aren't standard library without noting it
287
+ - Do NOT create assignments that are too easy (basic concept application) or too hard (leaps without foundation)
288
+ - Do NOT leave TODOs in scaffold that require making unrelated architectural decisions
289
+
290
+ 6. CONTEXT:
291
+ - Skill: {skill}
292
+ - Topic: {topic}
293
+ - Topics directory: {TOPICS_DIR}/{topic}/
294
+ - User experience level: {from preferences}
295
+ - User learning style: {from preferences}
296
+ ")
297
+ ```
298
+
299
+ After completion, verify:
300
+ - topic-roadmap.md exists with proper structure
301
+ - Assignment 1 exists with all 4 files (question.md, test, scaffold, solution-guide.md)
302
+ - Test script is syntactically valid (run a quick check)
303
+
304
+ If anything is missing, fix via session continuation: `task(task_id="<session_id>", prompt="Fix: {missing element}")`
305
+
306
+ **Then proceed to Phase 2.**
307
+
308
+ ## Phase 2: ASSIGNMENT PRESENTATION
309
+
310
+ ### 2.1 Read the Current Assignment
311
+
312
+ Read the assignment files for the current topic:
313
+ - `question.md` — to understand what to present
314
+ - Check if any work has already been done (are there user files in the assignment directory?)
315
+
316
+ ### 2.2 Present the Assignment to the User
317
+
318
+ ```markdown
319
+ ┌──────────────────────────────────────────────────────────────────┐
320
+ │ 📚 Topic: {topic} │
321
+ │ 📝 Assignment: {assignment-name} ({n}/{total}) │
322
+ ├──────────────────────────────────────────────────────────────────┤
323
+ │ │
324
+ │ {brief description of the assignment} │
325
+ │ │
326
+ │ Files: │
327
+ │ • Question: .omnilearn/{skill}/topics/{topic}/assignments/ │
328
+ │ 01-{name}/question.md │
329
+ │ • Scaffold: (same directory)/scaffold/ │
330
+ │ • Test: (same directory)/test.{ext} │
331
+ │ • Solution guide: (same directory)/solution-guide.md │
332
+ │ │
333
+ │ To work on this: │
334
+ │ 1. Read the question.md carefully │
335
+ │ 2. Use the scaffold to write your solution │
336
+ │ 3. Run the test to verify your solution │
337
+ │ 4. Ask me questions if you're stuck │
338
+ │ 5. When done, say \"I'm done\" or \"Check my solution\" │
339
+ │ │
340
+ │ Tip: Try to solve it yourself before looking at the solution │
341
+ │ guide. That's where the real learning happens. │
342
+ └──────────────────────────────────────────────────────────────────┘
343
+ ```
344
+
345
+ ## Phase 3: USER INTERACTION LOOP
346
+
347
+ This is an open-ended loop. The user will:
348
+ - Work on the assignment
349
+ - Ask questions about concepts
350
+ - Request hints
351
+ - Submit their solution for review
352
+ - Ask for clarifications or alternative approaches
353
+
354
+ ### 3.1 How to Handle User Interactions
355
+
356
+ **For concept questions** (e.g., "I don't understand how closures work"):
357
+
358
+ **Rule: Do NOT just explain. Generate a task that tests their understanding.**
359
+
360
+ The user learns by DOING. When they ask a concept question, give them a focused micro-exercise that isolates the concept they're struggling with. Understanding comes from solving it, not from reading an explanation.
361
+
362
+ 1. Spawn a subagent to generate a DIAGNOSTIC MICRO-EXERCISE:
363
+
364
+ ```typescript
365
+ task(category="unspecified-high", run_in_background=false, prompt="
366
+ 1. TASK: Create a focused micro-exercise that tests the user's understanding of '{concept}' in '{skill}'. The user is struggling with this concept during assignment '{assignment}' on topic '{topic}'.
367
+ 2. EXPECTED OUTCOME: A self-contained micro-exercise (5-15 min to solve) that isolates the specific concept and lets the user figure it out by coding.
368
+
369
+ 3. REQUIRED TOOLS: google_search, websearch_web_search_exa, context7_query_docs, read, write
370
+
371
+ 4. MUST DO:
372
+ - Read the current assignment: {ASSIGNMENT_DIR}/question.md (to understand context without giving away the solution)
373
+ - Research the concept online to find the MOST COMMON confusion points
374
+ - Design a micro-exercise that:
375
+ * ISOLATES the confusing concept — removes unrelated complexity
376
+ * Is a real-world-ish scenario (NOT 'write a function that...' — frame it as solving a problem)
377
+ * Can be solved in 5-15 minutes
378
+ * Requires the user to WRITE CODE / PRODUCE SOMETHING to complete
379
+ * Has a CLEAR RIGHT ANSWER that can be verified
380
+ - DO NOT write academic explanations. The exercise IS the explanation.
381
+ - Include in the exercise brief:
382
+ * A short scenario (1-2 sentences)
383
+ * What to build
384
+ * Success criteria (how they know it's correct)
385
+ * A hint ONLY if they get stuck (hidden section)
386
+ - Save to: {CURRENT_RUN}/interaction-{n}-diagnostic-task.md
387
+ - The file should contain: task description + any starter code + verification steps
388
+
389
+ 5. MUST NOT DO:
390
+ - Do NOT write a long explanation — the task IS the teaching tool
391
+ - Do NOT give away the main assignment solution
392
+ - Do NOT make the exercise too complex — isolate ONE concept
393
+ - Do NOT skip the hands-on component — user must write/do something
394
+
395
+ 6. CONTEXT:
396
+ - Skill: {skill}
397
+ - Topic: {topic}
398
+ - Concept: {concept}
399
+ - User's confusion: {their exact question}
400
+ - User experience level: {from preferences}
401
+ ")
402
+ ```
403
+
404
+ 2. Present the micro-exercise to the user:
405
+ > "The best way to understand {concept} is to work through it. Here's a focused exercise that isolates exactly what you're asking about:
406
+ >
407
+ > 📝 {CURRENT_RUN}/interaction-{n}-diagnostic-task.md
408
+ >
409
+ > Try solving it — it should take 5-15 minutes. Once you're done, we can discuss what clicked and get back to the main assignment. Questions while you work?"
410
+
411
+ 3. When the user completes the micro-exercise, verify their solution and discuss what they learned. THEN connect it back to the main assignment.
412
+
413
+ 4. If the user still doesn't understand after the micro-exercise, generate a SECOND one targeting a different angle. Only revert to a direct explanation after 2 failed task attempts.
414
+
415
+ **For solution review** (user says "check my solution" or "I'm done"):
416
+ 1. Read the user's solution from the scaffold directory.
417
+ 2. Do NOT use a subagent — review it yourself (it's quick).
418
+ 3. Check:
419
+ - Does it pass the tests?
420
+ - Is the code clean and idiomatic?
421
+ - Are there edge cases not handled?
422
+ - Could it be more efficient?
423
+ 4. Provide structured feedback.
424
+ 5. If it passes review:
425
+ - Mark assignment as completed in progress-index.md
426
+ - Ask if they want to proceed to the next assignment
427
+ - Generate next assignment on-demand
428
+
429
+ **For "I'm stuck" / "give me a hint"**:
430
+ 1. Read their current work (if any exists).
431
+ 2. Identify where they're stuck.
432
+ 3. Provide a hint that guides WITHOUT giving away the solution.
433
+ 4. If they're fundamentally stuck on a prerequisite concept, offer to create mini-exercises.
434
+
435
+ **For deeper practice requests** (e.g., "I need more practice with this"):
436
+ ```typescript
437
+ task(category="writing", run_in_background=false, prompt="
438
+ 1. TASK: Create 2-3 supplementary practice exercises for {topic}/{concept} to help the user build confidence.
439
+ 2. EXPECTED OUTCOME: Additional mini-exercises with varying difficulty.
440
+
441
+ 3. REQUIRED TOOLS: read, write
442
+
443
+ 4. MUST DO:
444
+ - Read the current assignment to understand what's been covered
445
+ - Create 2-3 smaller exercises that target the specific area the user is struggling with
446
+ - Each should be solvable in 5-15 minutes
447
+ - Include: brief description, expected output, hints if needed
448
+ - Save as markdown with code blocks to: {CURRENT_RUN}/interaction-{n}-practice-exercises.md
449
+
450
+ 5. MUST NOT:
451
+ - Do NOT repeat the same problems from the main assignment
452
+ ")
453
+ ```
454
+
455
+ ### 3.2 Track All Interactions
456
+
457
+ For each user interaction during the session:
458
+ 1. Create an interaction file: `{CURRENT_RUN}/interaction-{n}-{type}.md`
459
+ 2. Log the user's question, your response, and any files created
460
+ 3. This creates a searchable history for future sessions
461
+
462
+ ## Phase 4: ASSIGNMENT COMPLETION & ADVANCEMENT
463
+
464
+ ### 4.1 When User Completes an Assignment
465
+
466
+ 1. Verify the solution is correct (run tests if possible).
467
+ 2. **Update `topic-progress.md`** — this is the AUTHORITATIVE source for per-topic progress:
468
+
469
+ ```bash
470
+ # Read topic-progress.md, update assignment status from 🔵 In Progress to ✅ Completed
471
+ # Add session entry to the Learning Sessions table
472
+ # Update Skills Demonstrated with any new real-world skills the user showed
473
+ ```
474
+
475
+ 3. **Update `progress-index.md`** at the skill level to reflect the change (this is an OVERVIEW index, not the source of truth):
476
+
477
+ ```bash
478
+ # Update progress-index.md to reflect the assignment completion
479
+ # Keep it concise — just the status change, detailed tracking lives in topic-progress.md
480
+ ```
481
+
482
+ 4. Update `SkillPreferences.md` with any new insights about the user's learning.
483
+
484
+ 5. Ask if they want to:
485
+ - **Continue to the next assignment** (same topic, next difficulty level)
486
+ - **Take a break** (session ends, progress saved)
487
+ - **Request more practice** on the current concept
488
+ - **Move to a new topic**
489
+
490
+ ### 4.2 Generate Next Assignment (On-Demand)
491
+
492
+ When the user wants to proceed, generate the next assignment:
493
+
494
+ ```typescript
495
+ task(category="unspecified-high", run_in_background=false, timeout=300000, prompt="
496
+ 1. TASK: Create the next assignment ({assignment-num}) for topic '{topic}' in skill '{skill}'.
497
+ 2. EXPECTED OUTCOME: Complete assignment with question.md, test script, scaffold, and solution-guide.md at the next difficulty level.
498
+
499
+ 3. REQUIRED TOOLS: google_search, websearch_web_search_exa, context7_query_docs, read, write
500
+
501
+ 4. MUST DO:
502
+ - Read the topic-roadmap.md: {TOPICS_DIR}/{topic}/topic-roadmap.md
503
+ - Read the previous assignment(s) to ensure progression: {ASSIGNMENT_DIR}
504
+ - Read the user's learning preferences and history from {SKILL_PREFS}
505
+ - Research online for real-world applications of this topic at this difficulty level
506
+ - Create the assignment with INCREASING difficulty:
507
+ * Assignment 1: Basic understanding and application
508
+ * Assignment 2: Intermediate — combine concepts, handle edge cases
509
+ * Assignment 3: Real-world — full scenario, multiple concerns, best practices
510
+ - For each assignment, create these files in:
511
+ {TOPICS_DIR}/{topic}/assignments/0{n}-{concept-name}/
512
+
513
+ a) question.md — Include:
514
+ - Learning objectives
515
+ - Real-world scenario description
516
+ - Technical requirements
517
+ - Acceptance criteria (how to know it's done)
518
+ - Hints (separate section, user can choose to read)
519
+
520
+ b) test.{ext} — Automated validation:
521
+ - Language-appropriate test framework
522
+ - Unit tests + edge cases
523
+ - Clear failure messages
524
+ - Self-contained and runnable
525
+
526
+ c) scaffold/ — Starter code:
527
+ - Minimal boilerplate
528
+ - TODO markers for user implementation
529
+ - All necessary imports/includes set up
530
+
531
+ d) solution-guide.md:
532
+ - Complete solution
533
+ - Explanation of approach
534
+ - Alternative solutions' discussion
535
+ - Real-world production considerations
536
+ - Common mistakes
537
+
538
+ 5. MUST NOT DO:
539
+ - Do NOT make the next assignment a repetition of the previous one
540
+ - Do NOT skip difficulty progression
541
+ - Do NOT use external non-standard dependencies without noting it in scaffold setup
542
+
543
+ 6. CONTEXT:
544
+ - Skill: {skill}
545
+ - Topic: {topic}
546
+ - Assignment number: {n}/3
547
+ - Difficulty: {basic/intermediate/real-world}
548
+ - Previous assignment concepts: {summary}
549
+ - User performance on previous assignment: {observations}
550
+ ")
551
+ ```
552
+
553
+ ### 4.3 When All Assignments Are Complete
554
+
555
+ When all 3 assignments for a topic are done:
556
+
557
+ 1. **Update `topic-progress.md`** — set overall status to ✅ Completed, finalize all assignment statuses.
558
+ 2. **Update `progress-index.md`** — mark topic as ✅ Completed (this is the overview index).
559
+ 3. **Update `roadmap.md`** — change topic progress marker to ✅.
560
+ 4. Update `SkillPreferences.md` — note topic completion, record competencies demonstrated.
561
+ 5. Append to `UserPreferences.md` if the user demonstrated strong affinities or struggles.
562
+ 6. Ask the user:
563
+ > "Great work completing **{topic}**! 🎉
564
+ >
565
+ > Options:
566
+ > 1. **Next topic**: {next_recommended_topic}
567
+ > 2. **Choose your own**: pick from the roadmap
568
+ > 3. **Review & reinforce**: practice more on this topic
569
+ > 4. **Done for now**: end this session"
570
+
571
+ 5. If continuing, loop back to Phase 1 (topic selection).
572
+
573
+ ## Phase 5: UPDATE PREFERENCES & PROGRESS
574
+
575
+ ### 5.1 Update UserPreferences.md (Global)
576
+
577
+ After key learning interactions, assess if any global preferences should be updated:
578
+
579
+ - User consistently struggles with certain types of concepts → note learning style insight
580
+ - User asks for more/less depth → update preferred depth
581
+ - User shows strong aptitude in certain areas → note strengths
582
+ - User expresses time constraints or goals → update goals section
583
+
584
+ **Format for updates:**
585
+ ```markdown
586
+ ## Preference Log
587
+ ### {timestamp}: Observed during {topic} learning
588
+ - {insight}: {evidence}
589
+ ```
590
+
591
+ ### 5.2 Update SkillPreferences.md
592
+
593
+ Always update after a session:
594
+ ```markdown
595
+ ## Learning History
596
+ ### {timestamp}: {topic} — Assignment {n} completed
597
+ - Concepts covered: {list}
598
+ - Performance notes: {observations}
599
+ - User feedback: {any direct feedback}
600
+ ```
601
+
602
+ ### 5.3 Update progress-index.md (Skill-Level Overview)
603
+
604
+ `progress-index.md` is the **overview index** — it summarizes state but the authoritative per-topic progress lives in each `topic-progress.md`. Update the index after any state change:
605
+
606
+ - Assignment completions → reflect status change, link to topic-progress.md
607
+ - Topic completions → mark ✅
608
+ - New topic starts → add entry pointing to its topic-progress.md
609
+ - Session timestamps
610
+
611
+ ### 5.4 Write Session Agent Log
612
+
613
+ ```bash
614
+ mkdir -p "$CURRENT_RUN"
615
+ ```
616
+
617
+ Write to `$CURRENT_RUN/agent-log.md`:
618
+ - Session start/end time
619
+ - Topic worked on
620
+ - Assignments completed
621
+ - Concepts discussed
622
+ - Key interactions
623
+ - Decisions made about pacing, depth, focus
624
+ - Files created
625
+ - Next steps / recommendations for next session
626
+
627
+ ## Phase 6: SESSION END
628
+
629
+ ### 6.1 Present Session Summary
630
+
631
+ ```markdown
632
+ ┌──────────────────────────────────────────────────────────────────┐
633
+ │ 📋 Learning Session Summary │
634
+ ├──────────────────────────────────────────────────────────────────┤
635
+ │ Skill: {skill} │
636
+ │ Topic: {topic} │
637
+ │ Date: {date} │
638
+ │ Duration: {approx time} │
639
+ │ │
640
+ │ Progress: │
641
+ │ • Assignments completed: {n}/{total} │
642
+ │ • Concepts covered: {list} │
643
+ │ • Session log: {CURRENT_RUN}/agent-log.md │
644
+ │ │
645
+ │ Overall Progress in {skill}: {X}% │
646
+ │ • Topics completed: {n}/{total} │
647
+ │ • Topics in progress: {n} │
648
+ │ │
649
+ │ Next session recommendations: │
650
+ │ • Continue with next assignment in {topic} │
651
+ │ • Or start a new topic: {recommended_topic} │
652
+ │ │
653
+ │ To continue later: /omnilearn-start {skill} │
654
+ └──────────────────────────────────────────────────────────────────┘
655
+ ```
656
+
657
+ ### 6.2 Git Commit
658
+
659
+ ```bash
660
+ if git rev-parse --git-dir > /dev/null 2>&1; then
661
+ git add "$OMNILEARN_DIR/"
662
+ git commit -m "omnilearn: learning session — {skill}/{topic}
663
+
664
+ - Completed assignment(s): {list}
665
+ - Updated progress tracking
666
+ - Updated learning preferences based on session
667
+ "
668
+ fi
669
+ ```
670
+
671
+ If no git repo: ask if user wants to initialize one (same as /omnilearn-roadmap).
672
+
673
+ ## Quality Gates
674
+
675
+ | Check | Phase | Action if Failed |
676
+ |-------|-------|-----------------|
677
+ | Skill roadmap exists | 0 | Tell user to run /omnilearn-roadmap first |
678
+ | User preferences read | 0 | Read the files |
679
+ | Topic roadmap exists (if needed) | 1.4 | Create it via deep subagent |
680
+ | Assignment 1 exists (question, test, scaffold, solution) | 1.4 | Fix incomplete assignment |
681
+ | Assignment tests are syntactically valid | 1.4 | Quick syntax check, fix if broken |
682
+ | topic-progress.md created when topic roadmap is made | 1.4 | Create it with proper structure |
683
+ | topic-progress.md updated on each assignment completion | 4 | Update immediately — this is the source of truth |
684
+ | Interaction diagnostic task files written for user Q&A | 3 | Write task file, not just explanation |
685
+ | progress-index.md updated after each completion | 4, 5 | Update immediately |
686
+ | Agent log written for session | 5 | Write before session end |
687
+ | SkillPreferences.md updated | 5 | Update with new observations |
688
+ | Git commit made | 6 | Commit or ask user |
689
+
690
+ ## Assignment Difficulty Progression
691
+
692
+ | Level | Focus | What it Tests |
693
+ |-------|-------|---------------|
694
+ | 01-basic | Core concept application | Can the user apply the fundamental concept correctly? |
695
+ | 02-intermediate | Combined concepts + edge cases | Can the user handle complexity and edge cases? |
696
+ | 03-real-world | Full scenario + best practices | Can the user deliver production-quality code? |
697
+
698
+ Each level should feel meaningfully harder. The jump from 02 to 03 should be the biggest — that's where real learning happens.
699
+
700
+ ## Error Recovery
701
+
702
+ | Situation | Action |
703
+ |-----------|--------|
704
+ | Skill/roadmap doesn't exist | Tell user to use /omnilearn-roadmap first |
705
+ | User asks for a topic not in roadmap | Offer to add it (spawn roadmap-edit flow) |
706
+ | User's code doesn't pass tests | Guide them with hints, not the answer |
707
+ | User wants to skip to advanced | Assess readiness, warn if prerequisites missing, let them try |
708
+ | Subagent produces low-quality assignment | Fix via continuation session, ensure all 4 files exist |
709
+ | User gets frustrated | Adjust difficulty, offer more practice exercises, change approach |
710
+ | Test script has errors | Fix the test script immediately |
711
+ | Session interrupted | Next session reads progress-index.md and picks up where left off |
712
+ | User wants different language/framework | Adapt scaffold and tests accordingly |
713
+
714
+ ## What You MUST Do
715
+
716
+ - ✅ **Check roadmap exists before starting** — validate the skill is set up
717
+ - ✅ **Read progress before each session** — know where the user left off
718
+ - ✅ **Generate assignments on-demand** — only create what's needed now
719
+ - ✅ **Create topic roadmaps via deep subagent** — autonomous research + structure
720
+ - ✅ **Progress lives in topic-progress.md** — assignment status, sessions, skills demonstrated. Runs/ contains only action logs.
721
+ - ✅ **When user has a doubt, generate a diagnostic micro-task** — the user learns by doing, not by reading explanations
722
+ - ✅ **Update topic-progress.md after every state change** — never batch updates. Then sync progress-index.md (the overview)
723
+ - ✅ **Log all interactions in runs/** — create interaction task files for Q&A, agent-log.md for session actions
724
+ - ✅ **Update user preferences** — when you have clear signal
725
+ - ✅ **Provide tasks, not answers** — guide the user to discover solutions through practice
726
+ - ✅ **Generate real-world assignments** — theory-only is not enough. Every assignment must be a real-world scenario
727
+ - ✅ **Git commit after each session** — track progress over time
728
+
729
+ ## What You MUST NOT Do
730
+
731
+ - ❌ Do NOT create all assignments upfront — generate on-demand as user progresses
732
+ - ❌ Do NOT write explanations when user has a doubt — generate a diagnostic task instead
733
+ - ❌ Do NOT give away solutions when the user is stuck — give them tasks that lead to the answer
734
+ - ❌ Do NOT skip scaffold files — the user needs a starting point
735
+ - ❌ Do NOT make all 3 assignments the same difficulty — progression is critical
736
+ - ❌ Do NOT let runs/ contain progress state — runs/ is for action logs only, topic-progress.md is the source of truth
737
+ - ❌ Do NOT skip updating topic-progress.md — it's the authoritative progress record per topic
738
+ - ❌ Do NOT lose the user's work or progress — always read topic-progress.md before acting
739
+ - ❌ Do NOT push to remote without explicit user approval
740
+ - ❌ Do NOT use `as any`, `@ts-ignore`, or equivalent in any code