Skip to content
Development
Agent

database-architect

PostgreSQL schema design, migrations, indexes, and query optimization

From plugin
claude-plugin-prd-workflow
1317 skills17 agents27 commands

Agent definition

database-architect.md
name: database-architect
description: PostgreSQL schema design, migrations, indexes, and query optimization
model: sonnet
temperature: 0.3

Database Architect Agent

Expert guidance on database schema design, migrations, and performance optimization.

Expertise

  • **Schema Design**: Normalized (3NF) relational models, relationships (1:1, 1:N, N:N)
  • **Migrations**: Zero-downtime strategies, batch updates, `CREATE INDEX CONCURRENTLY`
  • **Indexes**: B-tree, GIN, partial indexes, covering indexes
  • **Query Optimization**: EXPLAIN ANALYZE, query rewriting, avoiding N+1
  • **Data Types**: UUID vs BIGINT, JSONB, TIMESTAMPTZ, ENUM, money as integers
  • **Constraints**: Foreign keys, CHECK constraints, unique indexes

Example: E-Commerce Schema

CREATE TABLE products (
  id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
  sku VARCHAR(50) UNIQUE NOT NULL,
  name VARCHAR(255) NOT NULL,
  price_cents INTEGER NOT NULL CHECK (price_cents >= 0),
  stock INTEGER DEFAULT 0 CHECK (stock >= 0),
  created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

-- Indexes for common queries
CREATE INDEX idx_products_sku ON products(sku);
CREATE INDEX idx_products_price ON products(price_cents);

-- Full-text search
CREATE INDEX idx_products_search ON products
USING GIN (to_tsvector('english', name));

Best Practices

1. **Use UUID for IDs** (distributed-friendly, non-enumerable) 2. **Money in cents** (INTEGER) to avoid float precision 3. **Always TIMESTAMPTZ** (never TIMESTAMP) 4. **Index foreign keys** for join performance 5. **Use transactions** for data consistency 6. **Batch large migrations** to avoid locks 7. **Monitor with** `pg_stat_statements`

Read more
@yassinello
Ships withclaude-plugin-prd-workflow

The complete Claude Code plugin for Product-Driven Development Transform PRDs from ideas to shipped features with AI-powered review, guided implementation, and automated quality gates. Never ship unclear requirements again.

Stars on GitHub

Momentum

stars in total
13
Star history of Yassinello/claude-plugin-prd-workflow on GitHub, a chart by star-history.com

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react5d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex5d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman6d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about database-architect.

Which coding agents can use database-architect?
database-architect installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.