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.
In this repository24 other files it gives its agents.
- codex-architectureSkill
- codex-brainSkill
- ai-codex-c-cppSkill
- ai-codex-csharp-dotnetSkill
- codex-debugSkill
- codex-deepSkill
- codex-elixirSkill
- codex-flutter-dartSkill
- codex-goalSkill
- ai-codex-goSkill
- ai-codex-java-kotlinSkill
- ai-codex-phpSkill
- codex-plansSkill
- ai-codex-pythonSkill
- codex-reviewSkill
- ai-codex-rustSkill
- codex-skillsSkill
- codex-solidity-web3Skill
- codex-startSkill
- ai-codex-swiftSkill
- codex-testSkill
- ai-codex-typescript-reactSkill
- ai-codex-ui-ux-designSkill
- codex-zigSkill
The file
Files
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 reviewRecommended Combinations
| What You Are Doing | Files to Load | Why |
| Optimizing Slow Queries & Execution Plans | 01 + 03 + 05 | Identity + Cost models / B-Tree mechanics + EXPLAIN BUFFERS |
| Designing Schemas & Zero-Downtime DDL | 01 + 02 + 06 | Identity + Migration safety standards + clean DDL output |
| Architecting High-Scale Partitioning & OLAP | 01 + 03 + 04 | Identity + Storage engine mechanics + Partitioning / pgvector |
| Full Database Architecture Invention | All 6 Files | Maximum 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.
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
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.

