/engineering-advanced-skills:database-designerfrom engineering-advanced-skills
Analyzes SQL schemas for normalization and constraint gaps, recommends indexes from query patterns, and generates forward/rollback migrations. Use when reviewing DDL, tuning indexes, or diffing schema versions.
Ships in engineering-advanced-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The agent analyses an existing relational schema for normalization, constraint, naming and type problems, recommends indexes for the queries that actually run, and generates forward and rollback migrations between two schema versions. To design a new schema from product requirements (ERDs, RLS, ORM models), use engineering/database-schema-designer instead.
Before designing or migrating, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.
schema_analyzer.py vs index_optimizer.py vs migration_generator.py).Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.
schema_analyzer.py (DDL or JSON). Read the findings as candidates: the transitive-dependency check matches column-name prefixes (user_id, user_email) and can flag unrelated columns, so confirm each before proposing a split.index_optimizer.py, which needs the schema as JSON plus the query patterns (assets/sample_query_patterns.json shows the shape). Columns already covered by a primary key, a unique constraint or an existing index prefix are not recommended again. Validate each recommendation with EXPLAIN on real data before creating it.migration_generator.py --current old.json --target new.json. Review every HIGH-risk step (drops, type changes) and use --zero-downtime for large or busy tables. Run the migration on a copy, then run the rollback, before it goes near production.python3 scripts/schema_analyzer.py --input assets/sample_schema.sql --output-format text # 11 tables, 14 FKs
python3 scripts/schema_analyzer.py --input assets/sample_schema.sql --erd-only # Mermaid ERD
python3 scripts/index_optimizer.py --schema assets/sample_schema.json --queries assets/sample_query_patterns.json --analyze-existing
python3 scripts/migration_generator.py --current assets/sample_schema.json --target assets/sample_schema_target.json --format sql
| Tool | What it does | Key flags |
|---|---|---|
scripts/schema_analyzer.py | Parse DDL (CREATE TABLE, inline and table-level REFERENCES, CREATE INDEX) or JSON; report 1NF-BCNF smells, missing PK/FK/NOT NULL/CHECK, VARCHAR(255) defaults, naming; Mermaid ERD | --input, `--output-format json |
scripts/index_optimizer.py | Recommend single, composite and covering indexes from query patterns; order composite columns by selectivity; flag redundant and overlapping indexes | --schema, --queries, --analyze-existing, --min-priority 1-4, `--format json |
scripts/migration_generator.py | Diff two JSON schemas into ordered steps with forward and rollback SQL, risk level and validation queries | --current, --target, `--format json |
Exit codes: 0 report produced, 2 bad input (missing file, invalid JSON, no tables found).
Mistake: Creating every index the optimizer suggests.
Why it happens: Each recommendation looks reasonable on its own.
Instead: Indexes cost write throughput and storage. Create the ones that serve frequent or slow queries, confirm with EXPLAIN, and drop the redundant ones --analyze-existing finds.
Mistake: Running a generated DROP COLUMN or type change directly on a large production table.
Why it happens: The SQL is ready to paste.
Instead: Use expand-contract (--zero-downtime): add, backfill, switch reads, then drop in a later release. Rehearse the rollback first.
Mistake: Normalising everything the analyzer flags. Why it happens: Normal forms look like correctness. Instead: Denormalised columns can be deliberate (snapshots of a price at order time, read models). Keep them when they are intentional and say why.
scripts/schema_analyzer.py, scripts/index_optimizer.py, scripts/migration_generator.py — the tools above.assets/sample_schema.sql (DDL, 11 tables), assets/sample_schema.json (same schema as JSON), assets/sample_schema_target.json (adds users.phone and an index, drops products.brand), assets/sample_query_patterns.json.expected_outputs/ — reference outputs; README.md — longer walkthrough.Load the reference that matches the task — keep this file lean and pull detail on demand:
schema_analyzer.py, index_optimizer.py, and migration_generator.py. Read when running the tools end-to-end.Covers PostgreSQL and MySQL schemas: analysis, indexing and migrations. MongoDB, DynamoDB and other NoSQL stores get only the selection guidance in the references. Does not cover live query profiling (engineering/performance-profiler), multi-service migration rollout (engineering/migration-architect), or database administration (backups, replication, roles).
README.md (opens in a new tab)assets/sample_query_patterns.json (opens in a new tab)assets/sample_schema.json (opens in a new tab)assets/sample_schema.sql (opens in a new tab)assets/sample_schema_target.json (opens in a new tab)expected_outputs/index_optimization_sample.txt (opens in a new tab)expected_outputs/migration_sample.txt (opens in a new tab)expected_outputs/schema_analysis_sample.txt (opens in a new tab)references/database_selection_decision_tree.md (opens in a new tab)references/index_strategy_patterns.md (opens in a new tab)references/normalization_guide.md (opens in a new tab)references/patterns-and-troubleshooting.md (opens in a new tab)references/workflows-and-tools.md (opens in a new tab)scripts/index_optimizer.py (opens in a new tab)scripts/migration_generator.py (opens in a new tab)scripts/schema_analyzer.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub borghei/claude-skills --plugin engineering-advanced-skills100 skills in this plugin
/a11y-auditStatic WCAG scan of HTML files (alt text, headings, labels, ARIA, lang, landmarks) and colour contrast checks for colour pairs or CSS. Use when auditing templates for accessibility, checking contrast, or adding an a11y gate to CI.
/agent-designerDesigns multi-agent system architectures with orchestration patterns, tool schemas, and performance evaluation. Use when building AI agent systems, designing agent workflows, creating tool schemas, or evaluating agent performance.
/agent-harnessTest and evaluation harness for AI agents — scenario suites, deterministic replay, regression diffing, cost and latency budgets. Use when agent quality is vibe-checked, before shipping a prompt or model change, or when evals drift.
Other plugins' skills for the same job