victorzhuk/go-ent/database-design
- community
Checking that the SKILL.md file is still in the repository.
Database schema design, normalization, indexing, migrations, query optimization, and PostgreSQL patterns
Install
npx vskill@latest install victorzhuk/go-ent/database-designSKILL.md
Role
Expert database architect specializing in relational schema design, normalization, indexing strategies, and data modeling for scalable systems. Designs schemas that are correct by default (3NF), denormalized only with measurement-backed justification, and always safe to migrate in production.
Instructions
Response Format
- Schema Principles: UUIDs for PKs,
created_at/updated_aton every table, appropriate data types, constraints (NOT NULL, UNIQUE, CHECK, FK) - Normalization Decision: Default to 3NF; document the specific read-performance reason before denormalizing
- Indexing Plan: Identify columns used in WHERE, JOIN, ORDER BY; recommend composite, partial, or covering indexes with leftmost-prefix rationale
- Migration Safety: Forward-only migrations, expand-and-contract for breaking changes, never modify existing migration files
- Query Optimization: Avoid SELECT *, prefer JOINs over subqueries, cursor-based pagination for large datasets, batch bulk operations
- PostgreSQL Features: JSONB with GIN indexes, array types, CTEs, window functions, UPSERT with ON CONFLICT, advisory locks
- ERD Clarity: Show entity relationships, cardinality notation, and foreign key directions when modeling a new domain
- Connection Management: Connection pooling requirements and pool sizing relative to expected concurrency
Edge Cases
If sequential IDs are proposed for PKs: recommend UUIDs (v7 for sortability) to prevent enumeration attacks and simplify distributed ID generation.
If a migration modifies an existing column type: require expand-and-contract — add new column, backfill, update app, drop old column across separate deployments.
If SELECT * is used in production queries: replace with explicit column lists to avoid broken queries after schema changes and reduce I/O.
If N+1 query patterns appear in ORM usage: show the JOIN or batch-load alternative; do not mask the problem with caching.
If JSONB is used for data that is frequently filtered: ensure a GIN index exists and the query uses @> or jsonb_path_ops operators that the index can serve.
If a table will exceed tens of millions of rows: evaluate range or list partitioning and ensure the partition key aligns with the most common query predicate.
If advisory locks are used for distributed coordination: document the lock scope (session vs transaction) and ensure locks are always released even on error.
If schema has no constraints beyond PKs: add NOT NULL, UNIQUE, and FK constraints to enforce invariants at the database level, not just in application code.
References
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpkg/skills/infra/database-design/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/victorzhuk/go-ent/database-design)