database-schema

Enforces reading database schema files before writing queries to prevent column and type errors.

Updated Jan 16, 2026
One-click install
npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill database-schema-dudqks0319-cpu
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: database-schema
Source: https://github.com/dudqks0319-cpu/antigravity-skills/tree/main/database-schema
Command: npx skills add https://github.com/dudqks0319-cpu/antigravity-skills --skill database-schema-dudqks0319-cpu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? AI assistants and developers often forget schema details mid-session, producing code with wrong column names, missing fields, or incorrect types that only fail at runtime. This Skill prevents those errors by mandating schema verification before any database code is written. ## Core Features & Use Cases - Schema-First Rule: Requires reading the schema file (Drizzle, Prisma, Supabase, SQLAlchemy, TypeORM, or raw SQL) and completing a verification checklist before writing any database code. - Type Generation Guidance: Provides commands and patterns for generating TypeScript types from Drizzle, Prisma, and Supabase, plus Pydantic models for SQLAlchemy. - Schema-Aware TDD Workflow: Extends test-driven development with a schema verification step so tests fail on logic, not on schema mismatches. - Use Case: When adding an order history endpoint, the assistant first reads src/db/schema.ts, confirms columns like orders.total_cents exist, maps types to TypeScript, and only then writes type-safe queries. ## Quick Start Ask the assistant to read the project schema file and complete the schema verification checklist before writing any database query or migration.

Frequently Asked Questions about database-schema

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

FAQPage Schema
How do I prevent wrong column names in database queries?▼

Read the schema file before writing any database code and use ORM-generated types instead of raw SQL strings. TypeScript compilers then catch nonexistent columns like `userName` versus `name` at compile time rather than runtime.

How to generate TypeScript types from a Supabase database?▼

Run `supabase gen types typescript --local` or with `--project-id` for remote databases, outputting to a types file. Import the generated `Database` type to access typed Row and Insert definitions for each table.

Drizzle vs Prisma for type-safe database queries?▼

Drizzle infers TypeScript types directly from schema definitions using `$inferSelect` and `$inferInsert` with no generation step. Prisma requires running `npx prisma generate` after schema changes but offers a more traditional ORM API.

Why does raw SQL cause more schema errors than ORMs?▼

Raw SQL strings receive no compile-time type checking, so typos in column names only surface as runtime failures. ORMs like Drizzle and Prisma validate column references against the schema during type checking.

What should I do after changing a database migration?▼

Regenerate types with your ORM's command, update the schema reference document, then run the type checker to find all broken code. Fix resulting type errors and update tests before running full validation.