schema-comparator

Compare database schemas between source and target environments for migration planning

509 stars

Best use case

schema-comparator is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Compare database schemas between source and target environments for migration planning

Teams using schema-comparator should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/schema-comparator/SKILL.md --create-dirs "https://raw.githubusercontent.com/a5c-ai/babysitter/main/library/specializations/code-migration-modernization/skills/schema-comparator/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/schema-comparator/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How schema-comparator Compares

Feature / Agentschema-comparatorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Compare database schemas between source and target environments for migration planning

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Schema Comparator Skill

Compares database schemas between source and target environments to identify differences and generate migration scripts.

## Purpose

Enable database migration planning for:
- Schema diff generation
- Data type mapping
- Constraint comparison
- Index analysis
- Migration script generation

## Capabilities

### 1. Schema Diff Generation
- Compare table structures
- Identify column differences
- Detect missing objects
- Generate change reports

### 2. Data Type Mapping
- Map types across databases
- Handle type conversions
- Identify precision changes
- Document compatibility

### 3. Constraint Comparison
- Compare primary keys
- Analyze foreign keys
- Check unique constraints
- Verify check constraints

### 4. Index Analysis
- Compare index definitions
- Identify missing indexes
- Analyze index usage
- Recommend optimizations

### 5. Stored Procedure Comparison
- Compare procedure signatures
- Identify logic differences
- Detect parameter changes
- Flag deprecated procedures

### 6. Migration Script Generation
- Generate DDL scripts
- Create rollback scripts
- Handle dependencies
- Order changes correctly

## Tool Integrations

| Tool | Databases | Integration Method |
|------|-----------|-------------------|
| Flyway | Multi | CLI |
| Liquibase | Multi | CLI |
| Redgate SQL Compare | SQL Server | CLI |
| SchemaHero | Kubernetes | CLI |
| pgdiff | PostgreSQL | CLI |
| mysqldiff | MySQL | CLI |

## Output Schema

```json
{
  "comparisonId": "string",
  "timestamp": "ISO8601",
  "source": {
    "type": "string",
    "connection": "string"
  },
  "target": {
    "type": "string",
    "connection": "string"
  },
  "differences": {
    "tables": {
      "added": [],
      "removed": [],
      "modified": []
    },
    "columns": [],
    "constraints": [],
    "indexes": [],
    "procedures": []
  },
  "migration": {
    "scripts": [],
    "order": [],
    "rollback": []
  }
}
```

## Integration with Migration Processes

- **database-schema-migration**: Primary comparison tool
- **data-format-migration**: Schema analysis

## Related Skills

- `data-migration-validator`: Post-migration validation
- `query-translator`: SQL conversion

## Related Agents

- `database-migration-orchestrator`: Uses for planning
- `data-architect-agent`: Schema design review

Related Skills

json-schema

509
from a5c-ai/babysitter

JSON Schema validation and API contract design.

tracing-schema-generator

509
from a5c-ai/babysitter

Generate distributed tracing schemas for OpenTelemetry with Jaeger/Zipkin integration

metrics-schema-generator

509
from a5c-ai/babysitter

Generate metrics schemas for Prometheus, OpenTelemetry, and Grafana dashboards

log-schema-generator

509
from a5c-ai/babysitter

Generate structured logging schemas with correlation ID patterns and ELK/Splunk integration

graphql-schema-generator

509
from a5c-ai/babysitter

Generate GraphQL schemas from data models with resolver stubs and federation support

graphql-schema-designer

509
from a5c-ai/babysitter

GraphQL schema design and optimization with federation support

term-comparator

509
from a5c-ai/babysitter

Compares term sheets against market standards, identifies outliers

electre-comparator

509
from a5c-ai/babysitter

ELECTRE family methods skill for outranking-based decision support with concordance and discordance analysis

Schema Evolution Manager

509
from a5c-ai/babysitter

Manages schema evolution and compatibility across data systems

plugin-manifest-schema

509
from a5c-ai/babysitter

Define plugin manifest schema with versioning and dependency declarations.

mcp-tool-schema-generator

509
from a5c-ai/babysitter

Generate JSON Schema definitions for MCP tool input parameters. Creates well-documented, AI-consumable schemas with proper types, descriptions, and validation rules.

config-schema-validator

509
from a5c-ai/babysitter

Generate Zod/JSON Schema configuration validators with defaults and error messages.