Agent skill · data analytics · borghei
database-designer
Database design with schema analysis, index optimization, and migration generation for PostgreSQL, MySQL, MongoDB, and DynamoDB. Use when designing schemas, optimizing queries, planning migrations, or analyzing database performance.
Why this skill is useful
Adds executable scripts for schema analysis, index optimization, and migration generation that provide capabilities not covered by generic knowledge.
What it needs
Requires mermaid-cli installed locally. About 3k tokens when loaded. Last updated 2026-07-21. 462 stars on the source repository.
What this skill does
Database Designer The agent analyzes SQL schemas for normalization compliance, recommends optimal indexes based on query patterns, and generates safe migration scripts with rollback procedures. It produces Mermaid ERDs, detects redundant indexes, and implements zero-downtime expand-contract migration patterns for PostgreSQL and MySQL. Core Capabilities Schema analysis — detect normalization violations (1NF-BCNF), missing constraints, naming issues, and data-type problems from DDL or JSON. ERD generation — produce valid Mermaid entity-relationship diagrams from declared relationships. Index optimization — recommend indexes from query patterns, order composite columns by selectivity, detect redundant/overlapping indexes, and find covering-index opportunities. Migration generation — forward + rollback SQL between schema versions, with validation queries. Zero-downtime migrations — expand-contract pattern with safe backfill for tables with 10M+ rows. Database selection guidance — match workload requirements to PostgreSQL, MySQL, MongoDB, or DynamoDB. When to Use Designing or reviewing a new schema for normalization and constraints. Optimizing queries by recommending or pruning indexes. Planning a safe (optionally zero-downtime) migration between schema versions. Analyzing database performance and relationship structure (ERD). Choosing the right database technology for a workload. Clarify First Before designing or migrating, confirm these inputs. If any is unknown or vague, ASK — do not assume: [ ] Task — schema analysis/ERD, index optimization, or migration generation (selects schemaanalyzer.py vs indexoptimizer.py vs migrationgenerator.py) [ ] Engine — PostgreSQL, MySQL, MongoDB, or DynamoDB (drives the DDL dialect and selection guidance) [ ] Schema input & query patterns — the DDL/JSON schema and the queries to optimize for (the input the tools analyze; index recommendations depend on the query patterns) Stop rule: ask only the 2-3 that most change the output. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills borghei/database-designer