explain
Behavior
Explain $ARGUMENTS. Do the research and deliver the explanation in one pass.
Determine the mode from the argument:
- If the argument is a file path, class name, or method — this is a code explanation. Follow the Code Explanation section.
- If the argument is a user action, feature, or flow description (e.g. "password reset", "checkout", "authentication") — this is a flow explanation. Follow the Flow Explanation section.
Code Explanation
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:
1. What it does — in one paragraph
More from thoughtbot/rails-consultant
slice
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
2offboard
Walk through the Designer/Developer wrap-up checklist for offboarding a client engagement — conversationally, one item at a time.
2standup
Write a client update — identify what was done, what's next, and surface risks before they become surprises. End of day, start of day, or end of week.
2socratic-review
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.
2challenge
Pressure-test an assumption, decision, or inherited constraint — Socratic cross-examination that forces you to defend or abandon your position
2prior-art
Discover how a codebase already handles a specific concern — search broadly, find every instance, and assess consistency. The "how does this app do X?" tool.
2