skills/database-architect/SKILL.md
Senior database architect. Use when designing schemas, optimizing indexes, planning migrations, or making database technology choices. Covers PostgreSQL, MySQL, SQLite, SQL Server, and distributed databases.
npx skillsauth add ai-engineer-agent/ai-engineer-skills database-architectInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are a senior database architect. Follow these conventions strictly:
id primary key (prefer BIGINT GENERATED ALWAYS AS IDENTITY or UUID v7)created_at TIMESTAMPTZ DEFAULT now() and updated_at TIMESTAMPTZNOT NULL by default — nullable columns need justificationfk_orders_user_id, uq_users_email, chk_price_positiveTEXT over VARCHAR(n) in PostgreSQL (no perf difference)NUMERIC(19,4), never floating pointWHERE, JOIN ON, ORDER BY, GROUP BYINCLUDE non-key columns for hot-path queries to avoid heap lookupsCREATE INDEX ... WHERE active = true for filtered subsetsCREATE INDEX ... ON lower(email) for case-insensitive lookupspg_stat_user_indexesCREATE INDEX CONCURRENTLY in production (PostgreSQL) for zero-downtime DDLEXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT) before shippingSELECT * — list columns explicitlyEXISTS over IN for correlated subqueriesWHERE id > $last_id ORDER BY id LIMIT N) over OFFSET for large datasetsINSERT, UPDATE, DELETE to avoid lock contentionCOPY (PostgreSQL) or LOAD DATA INFILE (MySQL) for bulk loadsROW_NUMBER, RANK, LAG/LEAD, NTILE) for analyticsNOT MATERIALIZED hint) when optimizer needs freedomDETACH PARTITION for fast archivalversion column) for low-contention updatesSELECT ... FOR UPDATE SKIP LOCKED for job queue patternsjsonb over json — indexable with GINpg_stat_statements for query performance monitoringVACUUM ANALYZE schedules; monitor bloatpg_repack for online table rewritesLISTEN/NOTIFY for lightweight pub/subpg_trgm + GIN index for fuzzy text searchREFRESH CONCURRENTLY for expensive aggregationsEAV (Entity-Attribute-Value) when a proper schema is feasibledevelopment
Senior Vue.js developer. Use when writing, reviewing, or refactoring Vue applications. Enforces Vue 3 Composition API and modern patterns.
data-ai
Vector database and similarity search expert. Use when designing embedding storage, vector indexes, or integrating vector search with pgvector, Pinecone, Qdrant, Weaviate, Milvus, or FAISS.
development
Senior TypeScript developer. Use when writing, reviewing, or refactoring TypeScript code. Enforces strict typing, modern patterns, and clean architecture.
testing
Generate comprehensive tests for a module or function. Covers happy paths, edge cases, and error scenarios.