What problem does it solve? Schema design decisions often go undocumented until implementation, leaving migrations without a traceable low-level design artifact. This Skill reads migration files, ORM models, or schema definitions and produces a Mermaid entity-relationship diagram with attributes, relationships, and index strategy before any code is written. ## Core Features & Use Cases - ERD Generation: Reads schema sources and produces a Mermaid erDiagram with crow's foot notation, PK/FK/UK annotations, and field constraints. - Index Strategy Documentation: Derives a table of required indexes from the query patterns in the spec and HLD, including composite indexes and drop conditions. - Design Decision Records: Captures non-obvious schema choices (e.g., integer cents vs. float, soft-delete patterns, ON DELETE behavior) as ADR-level rationale embedded in the LLD. - Reviewer Gate: Dispatches a database-erd-reviewer agent and iterates on Critical and Important findings before committing. - Use Case: When a feature adds a payments table with a foreign key from orders, run this Skill to produce .ai/YYYY-MM-DD-<feature-slug>/lld/lld-<feature-slug>-schema.md containing the full ERD, index plan, and design rationale linked back to the spec. ## Quick Start Ask the AI to generate a database ERD for the new feature by reading the migration files and saving the Mermaid diagram with index strategy to the LLD directory.