Database Designer
Schema analysis, ERD generation, index optimization, and migrations.
$skillfish add ~skills/database-designer Real Conversations
See how the Database Designer skill responds to actual requests. These are representative examples of what your AI agent will produce.
PostgreSQL queries on the orders table are taking 800ms. We have 2.1M rows. The main query is: SELECT * FROM orders WHERE user_id = $1 AND status IN ('pending','processing') ORDER BY created_at DESC LIMIT 20. What index do I need?
This skill includes executable scripts — I'll need your permission before running them.
The analysis script runs EXPLAIN (ANALYZE, BUFFERS) on your query. Based on what you've described, root cause is a sequential scan on 2.1M rows.
Optimal index:
-- Composite index — covers filter + sort in one index scan
CREATE INDEX CONCURRENTLY idx_orders_user_status_created
ON orders (user_id, status, created_at DESC);
Column order matters:
user_idfirst — equality filter eliminates 99.9% of rows immediatelystatussecond — IN filter on the already-small result setcreated_at DESClast — index already sorted, no extra sort step needed
Verify with EXPLAIN:
EXPLAIN (ANALYZE, BUFFERS)
SELECT * FROM orders
WHERE user_id = 'user_123'
AND status IN ('pending', 'processing')
ORDER BY created_at DESC
LIMIT 20;
Expected plan change:
Before: Seq Scan on orders (rows=2100000, actual time=800ms)
After: Index Scan using idx_orders_user_status_created (rows=20, actual time=3ms)
Also: drop the SELECT * — select only the columns your UI renders to avoid heap fetches for unused columns. Estimated improvement: 800ms → 3-8ms.
Shall I run the analyzer script to confirm and check for other slow queries in your pg_stat_statements?
Get Started
How to install and use this skill in your preferred environment.
Skills are designed for AI coding agents (Claude Code, Cursor, Windsurf) and IDE-based workflows where the agent can read files, run scripts, and act on your codebase. Web-based AI can use the knowledge and frameworks, but won't have tool access.
Models & Context
Which AI models and context windows work best with this skill.
Recommended Models
Larger models produce more detailed, production-ready outputs.
Context Window
This skill's SKILL.md is typically 3–10 KB — fits in any modern context window.
All current frontier models (Claude, GPT, Gemini) support 100K+ context. Use the full window for complex multi-service work.
Pro tips for best results
Be specific
Include numbers — users, budget, RPS — so the skill can size the architecture.
Share constraints
Compliance needs, team size, and existing stack all improve the output.
Iterate
Start with a high-level design, then ask follow-ups for IaC, cost analysis, or security review.
Combine skills
Pair with companion skills below for end-to-end coverage.
Ready to try Database Designer?
Install the skill and start getting expert-level guidance in your workflow — any agent, any IDE.
$skillfish add ~skills/database-designer