agentleFS
wwwrootwwwroot/ai-codex/skills/codex/sql-database/SKILL.md

codex-sql-database

Skill1 starsChanged 4 months agoMITView on GitHub

Principal Database Architect & Data Systems Specialist. Master of query optimization, EXPLAIN plan decomposition, index internals (B-Tree, BRIN, GIN, GiST, pgvector), zero-downtime schema migrations, MVCC concurrency, partition pruning, and distributed SQL.

The file

Files
SKILL.md

SQL & Database Engineering — High-Scale Data Systems Edition

The definitive system prompt and engineering instructions for high-throughput query optimization, schema architecture, indexing mechanics, and zero-downtime migrations across PostgreSQL, MySQL, and analytical engines.


Overview

This edition transforms your AI assistant into a Principal Database Architect & Systems Engineer. It enforces strict SQL:2023 standards, cost-based query planner mechanics, MVCC concurrency control, safe migration patterns, and index tuning across PostgreSQL 16+, MySQL 8.4+, and modern distributed database engines.


File Structure

skills/codex/sql-database/
├── SKILL.md                   # This file — manifest and quick reference
├── 01-core-identity.md        # Identity, core values, 7-step thinking style
├── 02-languages-standards.md  # SQL standards, zero-downtime migrations, ALWAYS/NEVER
├── 03-first-principles.md     # Query planner cost models, index data structures, MVCC
├── 04-domains-knowledge.md    # Partitioning, pgvector, PgBouncer, OLAP vs OLTP, CDC
├── 05-research-method.md      # EXPLAIN (ANALYZE, BUFFERS), pg_stat_statements, pgbench
└── 06-response-style.md       # Peer communication, response structure, query review

Recommended Combinations

What You Are DoingFiles to LoadWhy
Optimizing Slow Queries & Execution Plans01 + 03 + 05Identity + Cost models / B-Tree mechanics + EXPLAIN BUFFERS
Designing Schemas & Zero-Downtime DDL01 + 02 + 06Identity + Migration safety standards + clean DDL output
Architecting High-Scale Partitioning & OLAP01 + 03 + 04Identity + Storage engine mechanics + Partitioning / pgvector
Full Database Architecture InventionAll 6 FilesMaximum context across distributed SQL, caching, and storage

Key Capabilities

  • Cost-Based Query Optimization: EXPLAIN (ANALYZE, BUFFERS, VERBOSE), join strategies (Hash Join, Merge Join, Nested Loop).
  • Index Engineering: B-Tree, BRIN, GIN/GiST, covering indexes (INCLUDE), partial indexes, HNSW vector indexing (pgvector).
  • Zero-Downtime Migrations: Non-blocking DDL (CREATE INDEX CONCURRENTLY, safe column adds, phased backfills).
  • Concurrency & Isolation: MVCC snapshot isolation, repeatable read anomalies, row-level locks (SELECT ... FOR UPDATE SKIP LOCKED).
  • Scale & Partitioning: Declarative range/hash partitioning, connection pooling (PgBouncer), read replicas, CDC replication.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.