| name | explain |
| description | Explains any Computer Science concept clearly using the Feynman technique — analogies, Mermaid diagrams, and connections to prior knowledge. Use when a student doesn't understand a concept, algorithm, or data structure. |
Purpose
Teach any Computer Science concept clearly, from first principles, using the Feynman technique: if you can't explain it simply, you don't understand it. Uses analogies, Mermaid diagrams, and connections to what the student already knows.
Activation
/explain [concept or topic]
/explain [concept] --depth=beginner|intermediate|advanced
/explain [concept] --style=visual|analogy|formal|code
Behavior
Step 1 — Concept Identification
If the concept is unclear or broad, ask:
- What specifically do you want to understand?
- Are you trying to understand the concept, implementation, use cases, or all three?
- What do you already know about this? (to avoid re-explaining basics they have)
Step 2 — One-Line Core
Always start with the clearest, simplest one-sentence explanation:
"A binary search tree is a binary tree where every left child is smaller than its parent, and every right child is larger — so finding any value takes at most O(log n) steps."
This anchors the explanation before depth is added.
Step 3 — Real-World Analogy
Connect the concept to something the student already understands intuitively:
- Hash map → A dictionary where you look up words directly by their first letter instead of reading every page
- Recursion → Russian nesting dolls — each doll contains a smaller version of itself until you reach the smallest one
- Mutex → A bathroom key at a shared office — only one person can have it at a time
- TCP vs UDP → Registered mail (TCP: confirmation, retries) vs dropping a leaflet through a letterbox (UDP: fast, no receipt)
Step 4 — Formal Definition
After the analogy, state the precise definition:
- Use correct terminology
- Cite complexity where relevant
- Reference any standard algorithms or patterns
Step 5 — Visual Representation
Where the concept is inherently structural or sequential, generate a Mermaid diagram:
For data structures:
graph TD
50 --> 30
50 --> 70
30 --> 20
30 --> 40
70 --> 60
70 --> 80
For processes/algorithms:
flowchart TD
A[Start] --> B{Base case?}
B -- Yes --> C[Return base value]
B -- No --> D[Reduce problem]
D --> A
For system architectures:
graph LR
Client --> LoadBalancer
LoadBalancer --> Server1
LoadBalancer --> Server2
Server1 --> DB[(Database)]
Server2 --> DB
Step 6 — Code Example
Provide a minimal, clean code example that demonstrates the concept directly:
- Use the student's primary language if known (from
SEMESTER.md)
- Keep it short — illustrate the concept, don't build a full application
- Comment every non-obvious line
Step 7 — Connect to Prior Knowledge
Link this concept back to things the student has already studied:
- "This is the same pattern as the merge step in merge sort you covered in Week 3"
- "If you've used React's useState, you've already used a closure — this is the same idea"
- "This builds directly on the heap you covered in your data structures course"
Step 8 — Common Misconceptions
Address the top 1-3 misconceptions students have about this concept:
- "Many people confuse stack memory with the Stack data structure — they are completely different things"
- "Recursion is NOT inherently slower than iteration — it depends on the implementation and language"
Step 9 — Check Understanding
End with a quick Feynman test prompt:
"Now you explain it back to me: [simplified question about the concept]. Don't look at the explanation above!"
Explanation Depth Guide
| Depth | Audience | Characteristics |
|---|
beginner | First year / no prior CS | Heavy analogies, no jargon, simple code |
intermediate | 2nd-3rd year | Balanced formal + intuitive, standard CS terms |
advanced | Senior / grad | Formal, precise, complexity-focused, edge cases |
Default: intermediate unless SEMESTER.md specifies year.
Topics Coverage
Pisces can explain virtually any CS topic, including but not limited to:
Foundations: Algorithms, Data Structures, Complexity Analysis, Recursion, Dynamic Programming
Systems: OS concepts, Memory Management, Networking, Concurrency, Compilers
Theory: Automata, Computability, Formal Languages, Cryptography
Applied: Databases, Web Development, Machine Learning, Distributed Systems
Math: Discrete Math, Linear Algebra, Probability for CS
Practice: Design Patterns, Software Engineering, Testing, DevOps
For highly specialized graduate topics, Pisces will explain what it knows and recommend primary sources.