Works with the AI Agents you already use

    Database Schema ERD & Index Optimizer

    by Saran Boddu

    1

    Turn raw SQL DDL or plain English into 5-notation ERD diagrams, AI index optimizations, query plan breakdowns, and mock seed data.

    Free

    Security scanned

    What it does

    • Turns your SQL tables or plain English ideas into clear entity-relationship diagrams
    • Switches between Crow's Foot, Peter Chen, UML, Bachman, and Star Schema views
    • Finds missing database indexes and writes ready-to-run speedup scripts
    • Explains slow database queries step by step with cost and bottleneck fixes
    • Converts table schemas across PostgreSQL, MySQL, SQLite, Oracle, and Snowflake
    • Generates realistic test rows in the right table order without breaking links

    Who it's for

    Backend engineers designing APIs

    Turns rough table ideas into indexed schemas and diagrams in seconds.

    Try asking: “Design a multi-tenant SaaS billing schema and show a Crow's Foot diagram”

    Database architects auditing slow queries

    Spots missing indexes and explains query plans with ready-to-run fixes.

    Try asking: “Audit this PostgreSQL DDL for missing indexes and explain my slow JOIN query”

    Analytics teams building warehouses

    Models Star and Kimball fact-dimension schemas and converts SQL dialects.

    Try asking: “Convert this MySQL order schema into a Snowflake Star Schema”

    Founders and teams documenting apps

    Generates clean ERDs, Prisma/DBML docs, and realistic mock seed data.

    Try asking: “Generate 10 rows of referentially valid SQL seed data for these tables”

    Database Schema ERD & Index Optimizer

    Database Schema ERD & Index Optimizer

    Example session with this skill installed

    Visualize this PostgreSQL schema in Crow's Foot notation, audit it for missing indexes, and explain how to speed up fetching recent paid orders per customer:

    CREATE TABLE customers (
    id UUID PRIMARY KEY,
    email VARCHAR(255) UNIQUE NOT NULL,
    created_at TIMESTAMPTZ DEFAULT NOW()
    );

    CREATE TABLE orders (
    id UUID PRIMARY KEY,
    customer_id UUID NOT NULL REFERENCES customers(id),
    status VARCHAR(32) NOT NULL,
    total_cents INT NOT NULL,
    created_at TIMESTAMPTZ DEFAULT NOW()

    );
    
    SELECT * FROM orders WHERE customer_id = $1 AND status = 'paid' ORDER BY created_at DESC LIMIT 20;
    
    • Read your context and instructions
    • Compiled the database schema erd

    Summary

    Parsed 2 tables (customers, orders) with a 1-to-many relationship and identified a missing composite covering index on orders that currently forces a sequential scan and in-memory sort.

    Crow's Foot ERD

    erDiagram
        customers ||--o{ orders : "places"
        customers {
            uuid id PK
            varchar email UK
            timestamptz created_at
        }
        orders {
            uuid id PK
            uuid customer_id FK
            varchar status
            int total_cents
            timestamptz created_at
        }
    

    Index & Query Audit

    SeverityTargetFindingRecommended Fix
    Highorders(customer_id, status, created_at)Missing composite index causes Seq Scan + Sort on LIMIT 20Add composite B-Tree index with created_at DESC
    Mediumorders(status)Low-cardinality filter alone is inefficient; combine with customer_idCovered by composite index above

    Executable Migration SQL

    -- Run outside a transaction block in PostgreSQL
    CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_orders_customer_status_created
    ON orders (customer_id, status, created_at DESC);
    

    Next steps

    • Run EXPLAIN (ANALYZE, BUFFERS) before and after creating idx_orders_customer_status_created to confirm the plan switches from Seq Scan to Index Scan Backward.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The Problem

    Designing, auditing, and documenting relational databases usually means juggling separate ERD tools, slow query analyzers, and manual dialect migrations. Raw SQL DDL is hard to visualize, and missing foreign-key or composite indexes often go unnoticed until production slows down.

    How It Works

    Database Schema ERD & Index Optimizer turns your AI agent into a senior database architect. Paste your CREATE TABLE SQL, describe a new feature in plain English, or share a slow query:

    1. Parses & Normalizes: Extracts tables, columns, primary/foreign keys, unique constraints, and existing indexes.
    2. Visualizes in 5 Notations: Renders clean Mermaid diagrams in Crow's Foot, Peter Chen, UML Class / IDEF1X, Bachman DSD, or Star / Kimball Dimensional format.
    3. Audits & Optimizes: Flags missing indexes, redundant indexes, and normalization gaps, outputting ready-to-run CREATE INDEX migration scripts.
    4. Explains Queries & Transpiles: Breaks down execution plans (Seq Scan vs. Index Scan, Hash vs. Nested Loop joins) and converts DDL across PostgreSQL, MySQL, SQLite, SQL Server, Oracle, and Snowflake.

    Why This Beats Prompting It Yourself

    • Enforces Topological Order: Parent tables and seed rows are always ordered before child dependencies.
    • Multi-Notation Rigor: Uses dedicated notation rules (references/notations-guide.md) and dialect type mappings (references/dialect-reference.md) so cardinality symbols and data types stay accurate.
    • Production-Safe Output: Reminds you about non-blocking index creation (CONCURRENTLY) and non-sargable query anti-patterns.

    Known Limitations

    • Connects to your pasted DDL and queries in-context; it does not connect directly to live production database servers.

    Universal SKILL.md package containing SKILL.md plus references/notations-guide.md (Crow's Foot, Peter Chen, UML/IDEF1X, Bachman DSD, Star/Kimball) and references/dialect-reference.md (PostgreSQL, MySQL, SQLite, T-SQL, Oracle, Snowflake). Compatible with Claude Code, Cursor, Codex CLI, Gemini CLI, and VS Code Copilot. No local runtime or API keys required.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed today

    • Free with an Agensi account

    Requires

    Nothing to install.

    Permissions

    No special permissions declared or detected

    Listedtoday

    What's inside

    Frequently Asked Questions

    No. Everything runs inside your AI agent using the included skill instructions and reference guides—no local CLI tools, database connections, or external API keys are needed.

    It supports PostgreSQL, MySQL / MariaDB, SQLite, Microsoft SQL Server (T-SQL), Oracle Database, and Snowflake SQL.

    Yes. You can request Crow's Foot, Peter Chen, UML Class / IDEF1X, Bachman Data Structure Diagram, or Star / Kimball Dimensional Schema at any time.

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse All Claude Skills.

    Free