/superpowers-rails:rails-migration-conventionsfrom superpowers-rails
Guides safe Rails database migrations with reversible patterns, indexing conventions, and data-aware column changes.
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.
Migrations run against production with real data. Every migration must be safe, reversible, and data-aware.
_id column gets an index. No exceptions# WRONG - fails if table has rows
add_column :users, :role, :string, null: false
# RIGHT - handle existing data
add_column :users, :role, :string, default: 'member'
change_column_null :users, :role, false
For large tables, batch updates: Model.in_batches(of: 1000) { |b| b.update_all(...) }
add_reference :comments, :user, foreign_key: true # Auto-indexes
add_column :orders, :customer_id, :bigint
add_index :orders, :customer_id # Manual FKs need explicit index
add_index :orders, [:user_id, :status] # Composite for multi-column queries
| Data | Type | Notes |
|---|---|---|
| Money | decimal | Never float! precision: 10, scale: 2 |
| JSON | jsonb | Not json — jsonb is indexable |
| Booleans | boolean | Not string "true"/"false" |
self.ignored_columns = [:col], deploy, then removerename_column| Do | Don't |
|---|---|
| Reversible migrations | One-way migrations |
| Index all foreign keys | Forget indexes |
| Handle existing data | Assume empty tables |
| Test rollback | Skip rollback testing |
| Batch large updates | update_all on millions |
Remember: Migrations run against production. Safe, reversible, data-aware.
What SKILL.md sets; muted values are Claude Code's defaults
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