Explain

Förklarar en Rails-fil eller ett helt användarflöde, med utgångspunkt i git-historiken

av thoughtbot · thoughtbot/rails-consultant

Fungerar med konfiguration ★ 7.6/10

Explain — Förklarar en Rails-fil eller ett helt användarflöde, med utgångspunkt i git-historiken

Vad den gör

Two-mode code explainer för Rails codebases: point it at a file, class or method för en close reading, or name a user flow like password reset or checkout för ett box-drawing flowchart plus entry points, branching logic och side effects. It opens with the file's git log so commit messages supply the 'why' the code cannot. Invoked manually as /explain - it sets disable-model-invocation, so it never fires from plain conversation.

Testrapport

Pointed it at Clearance's real passwords_controller.rb, 115 lines with eight years of history. Explaining it cold covers the mechanics correctly but has nothing to say about why the reset mail uses deliver_now or why the actions return 202 and 303 instead of 200; the skill's mandatory opening step, git log plus the last diff, surfaced all three answers - PR 882 inlined delivery so integrators need no background worker and so send failures reach the user, and PR 965 changed the status codes because Turbo will not re-render a 200. That is the difference between a description and a working mental model. The catch is that the frontmatter sets disable-model-invocation: true, so none of the three natural phrasings I tested would load it - you have to type /explain yourself, and the README only documents the plugin and npx install paths, not the plain skills-directory copy that also works.

Testad: 2026-07-30 · Claude Code 2.x (agent harness)

Installation

git clone https://github.com/thoughtbot/rails-consultant.git
mkdir -p ~/.claude/skills
cd rails-consultant && cp -r skills/explain ~/.claude/skills/explain

Kommandon och exempelprompter

  • /explainFörklarar en Rails-fil eller ett helt användarflöde, med utgångspunkt i git-historiken

Skills triggas av vanliga förfrågningar — inga kommandon att memorera. Efter installationen aktiverar prompter som dessa skillen (på engelska):

  • /explain app/controllers/clearance/passwords_controller.rb, why deliver_now?
  • /explain the checkout flow, draw the entry points and side effects
  • /explain how password reset works in this app, starting from git history