Database design with schema analysis, index optimization, and migration generation for PostgreSQL, MySQL, MongoDB, and DynamoDB.
SkillScore82Maintained
Automatic
◆Data Engineer pack
Last verified 8/20/2026
What it changes
Passed 18 of 22 test cases with the skill, and 16 of 22 without it.
Without skill73%
With skill82%
Checks it passed that the model alone missed
Declines setting up database replication clusters.
Lists explicitly stated assumptions at the top of the output.
2 fixed16 passed either way4 still failing0 broke
Pass-rate lift
+9 pp
Tokens
+69%
Agent turns
0%
Response time
+8%
Model gemini-3.6-flashMeasured 8/20/2026v118 of 22 cases passed with skill
Tokens, turns and time describe resource use, not a dollar price.
See it in action
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
1 of 2
Prompt
Just draft it: I need a zero-downtime expand-contract migration for adding a non-null column `email_verified` (boolean) to a 15-million row PostgreSQL `users` table without table lock timeouts.
What was checked, without and with the skill
Checked
Without skill
With skill
Lists explicitly stated assumptions at the top of the output.
Missed
Passed
Uses an expand-contract sequence that begins by adding a nullable column.
Passed
Passed
case-03 · gemini-3.6-flash · 8/20/2026 · answers are capped and redacted
What's inside
The instructions your model reads when the skill loads.
SKILL.md65 lines9 files
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 schema_analyzer.py vs index_optimizer.py vs migration_generator.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. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.
References
Load the reference that matches the task — keep this file lean and pull detail on demand:
references/workflows-and-tools.md — the Quick Start, three core workflows (analyze/optimize, safe migration, index optimization), and the full CLI reference (flags, usage, output formats) for schema_analyzer.py, index_optimizer.py, and migration_generator.py. Read when running the tools end-to-end.
references/patterns-and-troubleshooting.md — index-type selection table, anti-patterns, the troubleshooting table for tool output, and the success-criteria quality bar. Read when picking an index type, avoiding mistakes, debugging output, or checking your work.
references/database_selection_decision_tree.md — systematic database-technology selection based on requirements, data patterns, and operational constraints. Read when choosing between SQL and NoSQL engines.
references/index_strategy_patterns.md — proven patterns for index design, optimization strategies, and pitfalls to avoid. Read when designing an indexing strategy in depth.
references/normalization_guide.md — normal forms (1NF-BCNF), decomposition to eliminate anomalies, and integrity trade-offs. Read when normalizing or deliberately denormalizing a schema.
Deal desk: reviews, approves, and structures non-standard sales deals. Use when standing up a deal desk, building approval-threshold matrices, designing deal-review packets, routing deals, or auditing deals for compliance.