Skip to content

Add reversible migrations to Rails AI rules - #807

Merged
cpytel merged 1 commit into
mainfrom
rails-ai-rules-reversible-migrations
Oct 30, 2026
Merged

cpytel merged 1 commit into
mainfrom
rails-ai-rules-reversible-migrations

Conversation

@cpytel

@cpytel cpytel commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

The database rules didn't say migrations must be reversible. This is a rule we use internally on Hub and I wanted to propose bringing it here.

The database rules never said migrations must be reversible, so agents
wrote irreversible migrations without a down path.

@jaredlt jaredlt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. We could also likely check for this deterministically with some cops, plus a script (up, down, up, compare). I haven't looked deeply into the cops to understand what they catch vs what they miss, so Claude is probably a good safety net regardless.

@JoelQ JoelQ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a past client I had a /rails-migrations skill that would be auto-invoked anytime the agent dealt with migrations. It had some process things like verifying reversible migrations via the classic migrate/rollback/migrate approach.

@cpytel
cpytel merged commit 7b53d2f into main Oct 30, 2026
2 checks passed
@cpytel
cpytel deleted the rails-ai-rules-reversible-migrations branch October 30, 2026 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants