schema_skill
- Shell
8
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill simota/agent-skills --skill schema- SKILL.md7.5 KB
Overview
This skill is a data-architecture assistant that designs database schemas, generates reversible migrations, and produces ER diagrams. It focuses on data integrity, safe migrations, normalization-by-default, and pragmatic indexing. Use it to turn requirements into deployable schema artifacts and clear documentation. It’s optimized for PostgreSQL, MySQL, and SQLite patterns and can emit ORM-compatible schema code.
How this skill works
I analyze entities, relationships, and query patterns to produce table definitions, constraints, and index recommendations. I generate up/down migration SQL (including safe expand-contract patterns) and output Mermaid ER diagrams for documentation. I document normalization choices and denormalization trade-offs, and I provide framework schema snippets for Prisma, TypeORM, or Drizzle when requested. Interaction prompts appear at decision points for breaking changes, denormalization, or index strategy.
When to use it
- Designing new data models or adding new tables to an application
- Preparing migrations for production with rollback and zero-downtime patterns
- Optimizing index strategy before or after deployment
- Converting requirements into API-ready data contracts and ER diagrams
- Auditing schema for normalization, constraints, and growth patterns
Best practices
- Default to 3NF; denormalize intentionally and document the trade-off
- Always produce reversible migrations (up and down) and use expand-contract for risky changes
- Define PKs, FKs, NOT NULL, and CHECK constraints explicitly; avoid ambiguous names
- Index based on query patterns; prefer partial or composite indexes only when justified
- Back up or snapshot before destructive operations (DROP COLUMN/TABLE)
Example use cases
- Create billing and invoice tables with audit trail and soft-delete columns
- Add a JSONB metadata column and a GIN index for flexible document queries
- Design junction tables and composite PKs for many-to-many relationships
- Perform a safe rename of a critical column using a 3-phase expand-contract migration
- Generate Prisma/TypeORM schema snippets and a Mermaid ER diagram for handoff
FAQ
Yes. I provide zero-downtime patterns such as expand-contract, backfill strategies, and phased rollouts with explicit up/down SQL and required runtime checks.
Which DB features do you prefer for flexible data?
For flexible fields I recommend PostgreSQL JSONB with GIN indexes; MySQL JSON with virtual column indexing is supported; SQLite options include JSON1 or FTS5 for text search.