con un clic
explain
// Explain what a piece of code does — a specific file, class, or method in close detail, or a user-facing flow as a concise system overview. What it does and why, not whether it's good.
// Explain what a piece of code does — a specific file, class, or method in close detail, or a user-facing flow as a concise system overview. What it does and why, not whether it's good.
Think out loud about a problem, decision, or approach — Socratic friction to help you find clarity, not sympathy
Socratic code review and refactoring session — whether it's your own code, a teammate's PR, or something you inherited. Leads you to see the issues through questions, names smells and moves precisely, then closes with a concrete plan.
Turn a feature into well-defined, independently shippable slices — whether it's an epic that needs breaking apart or a single story that needs sharpening into a job story
Walk through the Designer/Developer wrap-up checklist for offboarding a client engagement — conversationally, one item at a time.
Pressure-test an assumption, decision, or inherited constraint — Socratic cross-examination that forces you to defend or abandon your position
Strict red-green-refactor TDD workflow for implementing features, fixing bugs, or changing behavior in Rails applications. Enforces the discipline of writing a failing test before any production code. Use whenever you want to implement with TDD — whether a new feature, a bugfix, a refactor, or any behavior change.
| name | explain |
| description | Explain what a piece of code does — a specific file, class, or method in close detail, or a user-facing flow as a concise system overview. What it does and why, not whether it's good. |
| argument-hint | [file path, class name, method, or flow description] |
| disable-model-invocation | true |
| context | fork |
| agent | Explore |
Explain $ARGUMENTS. Do the research and deliver the explanation in one pass.
Determine the mode from the argument:
Start by checking the git history for the file: git log --oneline -15 <file> and git log -1 -p <file> for the most recent change. Commit messages often reveal the "why" that the code itself doesn't — a bug that was fixed, a refactor that simplified something, a workaround for an external constraint. Note anything that reframes the code before diving into it.
Then read the code carefully and explain in this order:
Plain English. No jargon, no code. Describe what this code accomplishes from the outside — what goes in, what comes out, what changes as a result. Write it the way you'd explain it to the client who asked for the feature.
Narrate the code path in plain English, step by step. For each meaningful chunk:
Don't narrate every line — skip the obvious. Focus on the parts that require interpretation.
Name the Rails, Ruby, or design patterns this code is using — and why they appear here. Examples:
call method, one responsibility"delegate to avoid Law of Demeter violations"If the code is using a pattern poorly or unexpectedly, name that too — neutrally. This isn't a review, but understanding requires knowing when something is off-label.
Any non-obvious behaviour, implicit dependencies, or things that would surprise someone maintaining this code. Not a critique — just "here's what you'd need to know to work safely in this area."
Start with the Rails router. Locate the route(s) that correspond to the described flow. From each entry point, trace the execution path through the codebase — controllers, service objects, models, callbacks, jobs, mailers. Follow both success and failure paths.
Then deliver the explanation in two parts: a diagram and a summary.
Render a concise visual flowchart of the system using box-drawing characters. The diagram should show:
Conventions:
┌─┐, │, ├──, └──, ▼, ◄YES / NOThe goal is to outline the system concisely — show how it behaves, not how the code is structured. A reader should be able to understand the full lifecycle from the diagram alone.
See the example in example.md for the expected style and level of detail.
After the diagram, add three sections in plain English:
Entry points — every way this flow can be triggered. For each, one sentence describing what triggers it and what it does.
Branching logic — the conditions that shape the flow. Feature flags, state checks, validations, guard clauses — anything that determines which path is taken.
Side effects — everything with consequences outside the immediate flow. Jobs, mailers, external API calls, broadcasts, cache writes, state transitions. The things you'd need to know about before touching this code.
Clear and direct. You're translating, not teaching and not judging. The goal is that they finish with a working mental model of what this code does and how to navigate it. Skip all hedging — if something is unclear in the code itself, say so plainly.