Vibe-Learn: Guided Mastery While Vibe Coding
Use this skill to help a developer ship their ticket quickly and deeply understand every protocol concept, architectural boundary, and concurrency primitive the LLM writes—while indexing every lesson in a portable Learning Hub (<LEARNING_HUB_DIR>).
Step 0: Resolve & Initialize the Portable <LEARNING_HUB_DIR>
Never hardcode a machine-specific path. Run the helper script resolve-hub.sh (or resolve manually) to locate and auto-bootstrap the user's Learning Hub:
$VIBE_LEARN_HUB(if set in environment)~/.config/vibe-learn/hub_path(written byinstall.shwhen the user or teammate installsvibe-learn)<workspace-root>/.vibe-learn/learnings(when a team shares learnings inside a project repo)~/.vibe-learn/learnings(zero-config personal fallback)
If <LEARNING_HUB_DIR>/index.html or INDEX.md do not exist yet, resolve-hub.sh automatically copies dashboard-template.html into <LEARNING_HUB_DIR>/index.html and creates INDEX.md.
The 4-Phase Agentic Workflow (+ Portable Learning Hub Archival)
You can execute all 4 phases end-to-end when tackling a ticket, or jump directly to the phase the user asks for.
Phase 1: The Pre-Flight Concept Brief (Before Coding)
Before writing the fix, orient the developer in under 90 seconds of reading:
- 60-Second Protocol / Domain Primer: Explain only the slice of the protocol (e.g., WireGuard/Tailscale NAT traversal, STUN/DERP fallback, keepalives) needed for this ticket. Use a Mermaid sequence or state diagram.
- Codebase Mini-Map: Identify the 2–4 key files/structs involved with clickable
file://links and explain who calls whom. - Interactive Concept Sandbox (Generative UI):
- Read the
generative_uiskill if available in your environment. - Build a compact (<480px tall) interactive HTML widget in the artifact directory and embed it inline with
<agent-embed src="file:///<artifact_path>/<widget>.html"></agent-embed>. - Also save a copy to
<LEARNING_HUB_DIR>/<YYYY-MM-DD>-<topic-slug>/sandbox.htmlso it lives permanently in the user's Learning Hub.
- Read the
Phase 2: Glass-Box Vibe Coding (Writing the Code)
When implementing the ticket:
- Write clean, well-tested code that solves the ticket and run tests to verify.
- Add Educational Micro-Comments only where non-obvious concurrency or protocol invariants exist.
- Include a Learning Anchor summary in chat:
- Why this concurrency pattern? (e.g.,
sync.RWMutexvssync.Mutex, channel-close broadcast vs point-to-point send,selectwithtime.NewTimer). - The "Delete-This-Line" Bomb: Explicitly name one line in the diff and explain what race condition, deadlock, or protocol bug happens if a developer deletes it.
- Why this concurrency pattern? (e.g.,
Phase 3: The Background shadow-tutor Subagent & Learning Hub Update
To keep the main coding conversation fast while building a permanent library of lessons:
- Invoke
shadow-tutorviainvoke_subagentin the background (or generate directly if the subagent is read-only) to produce a comprehensiveLEARNING_GUIDE.mdcontaining:- Layer 1: Protocol / Domain Mental Model
- Layer 2: Codebase Call-Graph & State Transitions
- Layer 3: Concurrency & Systems Mechanics anchored to exact code lines
- 3 "What-If" mutation experiments
- 3 Expandable
<details><summary>PR review flashcards
- Persist & Index in
<LEARNING_HUB_DIR>Using Relative Links:- Save the guide to
<LEARNING_HUB_DIR>/<YYYY-MM-DD>-<topic-slug>/LEARNING_GUIDE.md(as well as the conversation artifact directory). - Register the new entry using relative paths (
./<YYYY-MM-DD>-<topic-slug>/LEARNING_GUIDE.mdand./<YYYY-MM-DD>-<topic-slug>/sandbox.html) in both:<LEARNING_HUB_DIR>/INDEX.md<LEARNING_HUB_DIR>/index.html(add the new entry to theLEARNINGSJavaScript array so it immediately appears in the searchable browser dashboard).
- Save the guide to
Phase 4: The PR Defense Check (Mock Senior Reviewer)
Once the code passes tests, switch into Supportive Senior Reviewer Mode:
- Use
ask_question(or ask 2–3 targeted questions in chat) simulating a real PR review on the exact lines just written:- Question 1 (Protocol Layer): Why the protocol behaves a specific way in an edge case.
- Question 2 (Concurrency Layer): What happens under concurrent load or different lock ordering.
- Question 3 (State / Architecture Layer): How state transitions or callers react under race conditions.
- After the developer answers, confirm what they nailed, fill in any blind spots referencing the exact code lines, and link them to their updated Learning Hub dashboard (
<LEARNING_HUB_DIR>/index.html).