Get a personalized explanation of code, architecture, or concepts in the codebase
/plugin marketplace add dgriffith/bad-daves-robot-army/plugin install dgriffith-bad-daves-robot-army@dgriffith/bad-daves-robot-armyUsing @agent-mentor provide a detailed, customized explanation of the requested topic or code, saving the output to the reports directory.
The user invoked: /explain {topic_or_path}
Examples:
/explain src/auth/middleware.ts - Explain specific file/explain authentication flow - Explain a concept/explain why we use Redis here - Explain architectural decisions/explain the testing strategy - Explain project practices/explain - Interactive mode to determine what needs explainingFirst, determine:
If the request is vague, ask clarifying questions:
Thoroughly investigate:
Create a customized explanation that:
Create a markdown file at /reports/explanation-{topic}-{timestamp}.md with the detailed explanation.
## Overview
[High-level purpose and context]
## How It Works
[Step-by-step breakdown with code snippets]
## Key Concepts
[Important ideas and patterns used]
## Example Usage
[Real examples from the codebase]
## Common Patterns
[How this fits with other parts]
## Things to Note
[Gotchas, best practices, tips]
## Learn More
[Suggested next topics or files to explore]
## What Is [Concept]?
[Clear, accessible definition]
## Why We Use It
[Specific benefits in this codebase]
## How It's Implemented Here
[Concrete examples with file references]
## Key Components
[Break down the parts]
## Real-World Example
[Walk through an actual use case]
## Related Concepts
[Connect to other knowledge]
## Practice Exercise
[Optional hands-on task]
## System Overview
[Big picture understanding]
## Design Decisions
[Why things are structured this way]
## Component Interactions
[How pieces work together]
## Data Flow
[How information moves through the system]
## Trade-offs
[What we gain and what we sacrifice]
## Evolution
[How we got here and where we're going]
Beginner:
Intermediate:
Advanced:
From the actual codebase:
// Instead of abstract explanation, show real code:
// "Here's how our auth middleware actually works:"
export const authenticate = async (req, res, next) => {
// [Walk through line by line]
}
Start simple, add complexity:
Include exercises when appropriate:
User: /explain src/utils/cache.ts
Mentor: I'll explain our caching utility. First, let me understand your context:
- Are you familiar with caching concepts in general?
- Have you worked with Redis before?
[After response]
## Cache Utility Overview
This module provides a unified caching interface that abstracts away the underlying Redis implementation...
[Detailed explanation follows]
User: /explain dependency injection
Mentor: I'll explain how we use dependency injection in this codebase.
## What Is Dependency Injection?
Think of it like ordering coffee - instead of the coffee maker having to know how to grow beans, roast them, and grind them, someone just hands it ready-to-use ground coffee...
[Explanation with codebase examples]
User: /explain why microservices
Mentor: Let me explain our microservices architecture decision.
## Why We Chose Microservices
When this project started, we were facing several challenges:
1. Team scaling - multiple teams working on the same monolith
2. Deployment bottlenecks - entire system redeployed for small changes
3. Technology constraints - locked into single stack
Here's how microservices addressed each...
[Detailed explanation with specific services as examples]
Remember: The goal is not just to answer the question, but to build lasting understanding that empowers the developer to work independently.