database-schema-validator

Validate database schemas, Kysely types, and migrations.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/B16B1RD/cc-craft-kit --skill database-schema-validator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: database-schema-validator
Source: https://github.com/B16B1RD/cc-craft-kit/tree/main/.claude/skills/database-schema-validator
Command: npx skills add https://github.com/B16B1RD/cc-craft-kit --skill database-schema-validator

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manual database schema validation is error-prone and time-consuming, leading to data inconsistencies, migration failures, and production bugs. This skill automates the rigorous checking of your database schema, Kysely types, and migrations, preventing costly errors before they happen.

Core Features & Use Cases

  • Schema Type Validation: Automatically verify Kysely schema type definitions, column consistency, and foreign key relationships.
  • Migration Safety Analysis: Detect unsafe migrations (e.g., data loss risks), validate file structure, and ensure rollback compatibility.
  • Best Practices Enforcement: Check for proper indexing, primary key definitions, and naming convention compliance.
  • Use Case: Before deploying a new feature, use this skill to automatically scan your entire database setup. It will flag any type mismatches, missing foreign keys, or potentially destructive migrations, allowing you to fix them proactively and avoid production outages.

Quick Start

Validate the database schema and all pending migrations for the current project.

Frequently Asked Questions about database-schema-validator

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

FAQPage Schema
How do I validate database schemas and migrations in Kysely?

Schema validation in Kysely checks type definitions, column consistency, foreign key relationships, and migration structure automatically. Run the validator on your Kysely project to detect type mismatches, unsafe migrations, and constraint violations before deployment, preventing data inconsistencies and production bugs.

Can I detect unsafe database migrations automatically?

Yes. Migration safety analysis scans for data loss risks, invalid file structure, and missing rollback compatibility. The validator flags potentially destructive migrations and ensures your migration files meet best practices, allowing you to fix issues proactively.

What database schema best practices does the validator enforce?

The validator enforces proper indexing, primary key definitions, unique constraints, timestamp columns, and naming convention compliance. It ensures your schema adheres to standards and catches common configuration errors that lead to performance issues or data integrity problems.

How do I check for schema drift between Kysely types and migrations?

Schema drift detection compares your Kysely type definitions against actual migration files to identify misalignment. The validator flags inconsistencies in column definitions, foreign keys, and constraints, ensuring your types stay synchronized with your database evolution.

Does schema validation work with TypeScript Kysely projects?

Yes. The validator is built for TypeScript-based Kysely projects and validates both your schema type definitions and migration files. It ensures type safety and migration correctness across your entire database setup.

What happens if my migrations have missing or invalid foreign keys?

Foreign key validation detects missing relationships and invalid constraint definitions in your migrations. The validator identifies these issues during schema analysis, allowing you to correct referential integrity problems before they cause runtime errors or data inconsistencies.