/superpowers-rails:rails-job-conventionsfrom superpowers-rails
Guides creating thin, idempotent Rails background jobs that delegate to models and safely handle retries.
Ships in superpowers-rails. 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.
Jobs are thin dispatchers. They find a record and call a method on it — nothing more.
discard_on. Fix root causes# WRONG - doubles credits on retry
def perform(user_id)
user = User.find(user_id)
user.credits += 100
user.save!
end
# RIGHT - idempotent
def perform(credit_grant_id)
grant = CreditGrant.find(credit_grant_id)
return if grant.processed?
grant.process!
end
# WRONG - fat job with business logic
def perform(order_id)
order = Order.find(order_id)
order.items.each { |i| i.reserve_inventory! }
PaymentGateway.charge(order.total, order.payment_method)
OrderMailer.confirmation(order).deliver_now
end
# RIGHT - thin job
def perform(order_id)
Order.find(order_id).process!
end
MyJob.perform_later(user.id) not perform_later(user)find_each - Not all.each| Do | Don't |
|---|---|
| Design for multiple runs | Assume single execution |
< ApplicationJob | include Sidekiq::Job |
| Delegate to models | Business logic in jobs |
| Pass IDs as arguments | Pass serialized objects |
| Let errors raise | discard_on to hide failures |
Remember: Jobs are dispatchers, not implementers. They should be boring.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fryga-io/superpowers-rails --plugin superpowers-rails23 skills in this plugin
/brainstormingYou MUST use this before any creative work - creating features, building components, adding functionality, or modifying behavior. Explores user intent, requirements and design before implementation./diagnosing-superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness./dispatching-parallel-agentsUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies/executing-plansUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available/finishing-a-development-branchUse when implementation is complete, all tests pass, and you need to decide how to integrate the work/rails-controller-conventionsUse when creating or modifying Rails controllers, adding actions, setting up authorization, configuring routes, modeling state changes as resources, or handling Turbo responsesOther plugins' skills for the same job