mcpField
D
database-schema-validator

database-schema-validator

github.com/rominiraniData & databases60752 installsUpdated 18w ago
Repository

About database-schema-validator

database-schema-validator is a skill for checking user-provided SQL files against database conventions. It runs a Python validation script and reports errors for correction.

Key features

  1. 01Blocks DROP TABLE statements
  2. 02Requires snake_case table names
  3. 03Requires an id primary key in each table
  4. 04Runs a Python validation script

Use cases

  1. 01Check a SQL schema before use
  2. 02Find naming or primary-key violations
  3. 03Review schema safety rules

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/rominirani/antigravity-skills --skill database-schema-validator

After installing, type/database-schema-validatorin Claude Code to confirm it loaded.

Bundled filesscripts/validate_schema.py

Details

From the project README

Database Schema Validator Skill

This skill ensures that all SQL files provided by the user comply with our strict database standards.

Policies Enforced

  1. Safety: No DROP TABLE statements.
  2. Naming: All tables must use snake_case.
  3. Structure: Every table must have an id column as PRIMARY KEY.

Instructions

  1. Do not read the file manually to check for errors. The rules are complex and easily missed by eye.

  2. Run the Validation Script: Use the run_command tool to execute the python script provided in the scripts/ folder against the user's file.

    python scripts/validate_schema.py <path_to_user_file>
    
  3. Interpret Output:

    • If the script returns exit code 0: Tell the user the schema looks good.
    • If the script returns exit code 1: Report the specific error messages printed by the script to the user and suggest fixes.

Comments

Markdown supported