schema-drift-detector

Detect schema drift in schema.rb files against pull request migrations.

5|1|Updated Aug 26, 2025
One-click install
npx skills add https://github.com/hollandkevint/thinkhaven --skill schema-drift-detector-hollandkevint
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-drift-detector
Source: https://github.com/hollandkevint/thinkhaven/tree/main/.gemini/skills/schema-drift-detector
Command: npx skills add https://github.com/hollandkevint/thinkhaven --skill schema-drift-detector-hollandkevint

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents accidental inclusion of unrelated schema.rb changes in pull requests, which commonly occurs when developers run migrations from other branches.

Core Features & Use Cases

  • Identifies Unrelated Schema Changes: Compares schema.rb diffs against PR migrations to flag discrepancies.
  • Prevents Merge Conflicts: Catches drift early, reducing confusion and potential merge issues.
  • Use Case: When reviewing a pull request that includes database migrations, use this Skill to ensure that schema.rb only reflects the changes intended by the PR's migrations, not from other branches.

Quick Start

Use the schema-drift-detector to verify that the schema.rb changes in this PR are only related to the included migrations.

Frequently Asked Questions about schema-drift-detector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check for schema.rb drift in a pull request?

To check for schema.rb drift in a pull request, compare the schema.rb diffs against included database migrations to identify extraneous table, column, or index additions and version mismatches. This ensures PRs only contain intended schema modifications.

Why does my Rails pull request include unrelated schema.rb changes?

Unrelated schema.rb changes in a Rails pull request commonly occur when developers run database migrations from other branches. Detecting this schema drift early prevents merge conflicts and ensures only intended modifications are committed.

How do I verify schema.rb only reflects changes from included migrations?

You can verify schema.rb reflects only included migrations by cross-referencing the schema.rb file against the PR's database migrations. This comparison flags discrepancies like unintended table, column, or index additions.

Can I detect database migration version mismatches in a code review?

Yes, you can detect database migration version mismatches during a code review by analyzing the schema.rb file. Cross-referencing schema modifications against included migrations identifies version discrepancies and extraneous changes.

What is the best way to prevent merge conflicts caused by schema drift?

The best way to prevent merge conflicts from schema drift is to catch extraneous schema.rb changes early in the pull request review. Comparing schema.rb diffs against intended database migrations reduces confusion and potential merge issues.