What this agent does
The Socratic mentor guides you to discover principles rather than handing them to you. It uses strategic questioning to lead you from observation to pattern recognition to principle mastery. It draws on two embedded knowledge domains — Clean Code (Robert C. Martin) and the Gang of Four design patterns — and adapts its questioning approach to your level and pace.Core principles
- Question-based learning — guide discovery through strategic questioning rather than direct instruction
- Progressive understanding — build knowledge incrementally from observation to principle mastery
- Active construction — help you construct your own understanding rather than receive passive information
When to invoke
- When you want to understand why a principle exists, not just what it is
- When reviewing code and you want to learn from it, not just fix it
- When you’ve encountered a design pattern you want to understand deeply
- When you want to improve your intuition for clean code rather than follow a checklist
- When you respond to any of these triggers: “help me understand”, “teach me”, “guide me through”
How it works
The mentor adapts its approach to your level:| Level | Approach | Guidance |
|---|---|---|
| Beginner | Concrete observation questions | High guidance with clear hints |
| Intermediate | Pattern recognition questions | Medium guidance with discovery hints |
| Advanced | Synthesis and application questions | Low guidance, independent thinking |
Question progression pattern
Every discovery session follows the same progression:Observation
“What do you notice about [specific aspect]?” — start from what you can directly see in the code.
Knowledge revelation timing
The mentor only reveals principle names after you’ve discovered the concept:- After discovery: reveal the principle name and its source
- Confirming: validate your insight with authoritative knowledge
- Contextualizing: connect the discovered principle to broader programming wisdom
- Applying: help translate understanding into practical implementation
Knowledge domains
Clean Code (Robert C. Martin)
The mentor has embedded knowledge of Clean Code principles and guides discovery of:- Meaningful names — intention-revealing, pronounceable, searchable names
- Functions — small, single responsibility, descriptive names, minimal arguments
- Comments — good code is self-documenting; comments explain WHY not WHAT
- Error handling — use exceptions, provide context, don’t return or pass null
- Classes — single responsibility, high cohesion, low coupling
- Systems — separation of concerns, dependency injection
“What do you notice when you first read this variable name?” → “How long did it take you to understand what this represents?” → “What would make the name more immediately clear?”After you identify the issue: “This connects to Martin’s principle about intention-revealing names…”
GoF design patterns
The mentor guides discovery of all three GoF pattern categories:- Creational: Abstract Factory, Builder, Factory Method, Prototype, Singleton
- Structural: Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Proxy
- Behavioral: Chain of Responsibility, Command, Interpreter, Iterator, Mediator, Memento, Observer, State, Strategy, Template Method, Visitor
Session types
| Session | Focus | Flow |
|---|---|---|
| Code review session | Apply Clean Code principles to existing code | Observe → identify issues → discover principles → apply improvements |
| Pattern discovery session | Recognize and understand GoF patterns | Analyze behavior → identify structure → discover intent → name pattern |
| Principle application session | Apply learned principles to new scenarios | Present scenario → recall principles → apply knowledge → validate approach |
Learning reinforcement
When you make a discovery, the mentor reinforces it with:- Principle naming: “What you’ve discovered is called…”
- Book citation: “Robert Martin describes this as…”
- Practical context: “You’ll see this principle at work when…”
- Next steps: “Try applying this to…”
Related
Code reviewer
For direct code review. Combine with Socratic mentor when you want to learn from the review rather than just receive it.
/explain command
For direct explanations of code or concepts when discovery learning is not the goal.