/rails-consultant:commit [optional context to fold into the messages]from rails-consultant
Creates atomic git commits with detailed messages explaining risks, tradeoffs, and alternatives. Groups related changes, separates refactors and bug fixes, and avoids committing others' work or secrets.
Ships in rails-consultant. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
The history is the audit log for what an agent did. Months from now someone runs
git blame on a line nobody remembers writing, and the commit message is the only
record of why it's there. Inside /ship it matters sooner: the /diff-explainer
step never saw the session that wrote the code. It gets the SPEC, the step reports,
and these commits, and it won't annotate a decision nobody wrote down.
So a message's job is what /diff-explainer does for a whole branch, for one
commit: the why, the risks, the tradeoffs, and what got tried and thrown away. The
diff already shows what changed.
An argument is context ("addressing review feedback", "the migration is risky"), never the literal message. Don't stop to ask for approval. Being asked to commit means make the call, then report it.
git status --porcelain -uall
git diff
git diff --staged
git log --oneline -15
Nothing to commit? Say so and stop. Never make an empty commit.
The tree can hold more than your work: a file the user was editing, a scratch
script, a .env with credentials, a log someone forgot. Commit what this session
produced. Leave the rest alone and name it in your report, so it doesn't look
like an oversight.
Can't tell if a change is yours? It isn't. Leaving it out costs a follow-up commit. Putting it in ships someone else's half-finished work under your name. Never commit anything that looks like a secret, even if you made it.
One commit is one change that stands on its own. The test: if someone reverted this commit alone, would what's left still make sense and still pass? Pass means it's atomic. Fail means it's split too fine or bundled with something unrelated.
When unsure, fewer commits. Over-split history reads worse than cohesive history.
Whole files: git add <paths>. Never git add . or git add -A, which sweeps in
everything step 2 left out.
One file holding two groups: stage only the hunks for this one. git add -p needs
a terminal you don't have, so write those hunks to a patch and
git apply --cached <patch>. Check git diff --staged before every commit, since
a wrong patch fails quietly into a commit of the wrong lines.
Hooks run. If one fails or rewrites files, surface what it said, don't route
around it. No --no-verify, no amending, no pushing. This skill only adds new
commits on top.
Subject: imperative, capitalized, no period, around 50 characters. Code
identifiers in backticks. "Cache Mitie::NER behind a mutex", not "Updated
caching".
Body: blank line, then prose wrapped at 72. Open with why: the problem, or what this makes possible. Then whichever of these the session actually turned up. Most commits have one or two. None is fine.
Write these for a teammate skimming git log, not for the code, in thoughtbot's
voice and tone:
Don't list the files you touched. Bullets are fine when there are 3 separate risks. Otherwise prose.
Never invent a why. The good reasons come from this session: what you tried, what broke, what surprised you. None of that is in the diff. If you're committing work you didn't watch get made and nothing records why, write what the change does and stop. A plausible reason that's wrong is worse than none, because the next reader trusts it. If the user or the task gave you a reason, use it.
Trivial changes (typo, version bump, formatting) get a subject and no body.
End every message with the co-author trailer this session normally appends, naming the model you're actually running, after a blank line.
Charge the card before creating the `Order`
Creating the order first left orphans whenever Stripe declined, and
the cleanup job that deleted them raced customers retrying checkout.
We tried wrapping both in a transaction, but a transaction can't roll
back a charge that already went through. Charging first means a crash
between the charge and the insert leaves a paid charge with no order.
That's rarer and visible in Stripe, so we traded one bug for a
smaller one. `ReconcileChargesJob` catching it is not built yet.
Checkout specs pass against the Stripe test double. Real declines and
network timeouts were not exercised.
Co-Authored-By: Claude <[email protected]>
Show git log --oneline for the new commits. Then one line each for anything
worth knowing: a split you made, files you left uncommitted and why, a hook that
complained.
What SKILL.md sets; muted values are Claude Code's defaults
rails-consultant@skills is listed by thoughtbot/skills — review the source before installing
npx claudepluginhub thoughtbot/skills --plugin rails-consultant15 skills in this plugin
/ask-claudeRecommend the best way to have Claude do something, checked against Anthropic's current docs, then write the prompt and run it once approved. Use when someone asks how they should prompt you, what the best way to ask for something is, or which Claude feature fits a job (CLAUDE.md, skill, hook, subagent, workflow, plan mode, /goal, MCP, headless, the API), even if they don't name a feature./diff-explainerBuilds a shareable HTML walkthrough of the current changes, highlighting risks, tradeoffs, and alternatives considered./domain-modelTurn a described business process into a domain model./eli5Explain something to someone who knows nothing about it./implement-with-tddImplement a SPEC, plan, or feature outside-in, with TDD./multi-lens-reviewReview a change for defects, then against its spec, its codebase's conventions, the domains trying to emerge from it, and whatever still depends on what it replaced.Other plugins' skills for the same job