schema-design

Designs and reviews relational database schemas covering entities, constraints, indexes, and migration safety.

Updated Aug 5, 2026
One-click install
npx skills add https://github.com/ahsanghalib/ai-workflow --skill schema-design-ahsanghalib
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: schema-design
Source: https://github.com/ahsanghalib/ai-workflow/tree/main/skills/schema-design
Command: npx skills add https://github.com/ahsanghalib/ai-workflow --skill schema-design-ahsanghalib

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Changing persistent data structures without a deliberate design step leads to broken invariants, unsafe migrations, and tenant isolation gaps. This Skill provides a structured design gate for proposing or reviewing relational database schemas before any services, routes, or migrations are implemented. ## Core Features & Use Cases - Schema Design and Review: Defines entities, ownership, cardinality, keys, nullability, constraints, and indexes derived from concrete query patterns rather than habit. - Concurrency and Tenant Safety Checks: Identifies race conditions requiring constraints or locking, and verifies tenant isolation and authorization-relevant ownership boundaries. - Migration Impact Analysis: Assesses forward-only migration, backfill, rollback, and compatibility implications for existing rows, readers, and writers. - Use Case: Before building a new feature that adds tables, run this Skill against the approved feature SPEC to produce a reviewed schema proposal with a ready-for-planning verdict, then hand off to implementation planning. ## Quick Start Ask the assistant to review the proposed schema for the new feature against its approved SPEC and report constraints, indexes, and migration implications before any implementation.

Frequently Asked Questions about schema-design

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

FAQPage Schema
How do I design a database schema before writing migrations?▼

Define entities, ownership, cardinality, and lifecycle first, then choose keys, nullability, constraints, and indexes from concrete query patterns. This Skill walks through that sequence and returns a gated design proposal before any migration is written.

How to review a schema change for an existing feature?▼

Provide the approved feature SPEC and the current schema source of truth. The review classifies each finding as confirmed, assumed, unresolved, contradicted, or stale, and cites the relevant schema or repository path.

Does this work with any SQL database or ORM?▼

Yes, the design process is SQL and ORM agnostic unless the repository defines a specific one. It relies on the repository's own database rules, existing schema definitions, and conventions where they apply.

Can this skill write migrations or implement the schema?▼

No, it is a design gate only. It never edits schema files, migrations, services, or routes; implementation requires a separately approved plan and a dedicated execution skill.

When should I use technical-design instead of schema design?▼

Use technical-design for non-database module, API, or broader architecture decisions. Schema design is scoped strictly to data-model concerns such as entities, constraints, indexes, tenant boundaries, and migration safety.