discover-database
About
This skill automatically activates Claude's database expertise when working with SQL, NoSQL, schema design, or query optimization. It provides comprehensive assistance for database architecture, performance tuning, migrations, and ORM patterns. Use it for any database-related implementation, design, or optimization tasks across PostgreSQL, MongoDB, Redis and other database technologies.
Quick Install
Claude Code
Recommended/plugin add https://github.com/rand/cc-polymathgit clone https://github.com/rand/cc-polymath.git ~/.claude/skills/discover-databaseCopy and paste this command in Claude Code to install this skill
Documentation
Database Skills Discovery
Provides automatic access to comprehensive database design, optimization, and implementation skills.
When This Skill Activates
This skill auto-activates when you're working with:
- SQL databases (PostgreSQL, MySQL)
- NoSQL databases (MongoDB, Redis)
- Database schema design and modeling
- Query optimization and performance tuning
- Database migrations and schema evolution
- Connection pooling configuration
- ORM usage and patterns
- Database selection and architecture decisions
Available Skills
Quick Reference
The Database category contains 8 core skills:
- postgres-schema-design - Schema design, relationships, data types, normalization
- postgres-query-optimization - EXPLAIN plans, indexes, slow query debugging
- postgres-migrations - Schema changes, zero-downtime, rollback strategies
- mongodb-document-design - Document modeling, embedding vs referencing
- redis-data-structures - Caching, sessions, rate limiting, leaderboards
- database-connection-pooling - Pool configuration, debugging exhaustion
- orm-patterns - ORM best practices, N+1 prevention, eager loading
- database-selection - Choosing databases, SQL vs NoSQL decisions
Load Full Category Details
For complete descriptions and workflows:
cat skills/database/INDEX.md
This loads the full Database category index with:
- Detailed skill descriptions
- Usage triggers for each skill
- Common workflow combinations
- Cross-references to related skills
Load Specific Skills
Load individual skills as needed:
# PostgreSQL skills
cat skills/database/postgres-schema-design.md
cat skills/database/postgres-query-optimization.md
cat skills/database/postgres-migrations.md
# NoSQL skills
cat skills/database/mongodb-document-design.md
cat skills/database/redis-data-structures.md
# Cross-database skills
cat skills/database/database-connection-pooling.md
cat skills/database/orm-patterns.md
cat skills/database/database-selection.md
Common Workflows
New Database Project
Sequence: Selection → Schema design → Connection pooling
cat skills/database/database-selection.md # Choose database
cat skills/database/postgres-schema-design.md # or mongodb-document-design.md
cat skills/database/database-connection-pooling.md
Query Performance Debugging
Sequence: Optimization → Connection pooling → ORM patterns
cat skills/database/postgres-query-optimization.md # Debug slow queries
cat skills/database/database-connection-pooling.md # Check pool settings
cat skills/database/orm-patterns.md # Fix N+1 queries
Schema Evolution
Sequence: Schema design → Migrations
cat skills/database/postgres-schema-design.md # Design changes
cat skills/database/postgres-migrations.md # Implement safely
Caching Layer
Sequence: Redis structures → Cache patterns
cat skills/database/redis-data-structures.md # Redis patterns
# Then load caching skills via discover-caching gateway
Skill Selection Guide
PostgreSQL skills (relational, ACID, complex queries):
postgres-schema-design.md- Design relational schemaspostgres-query-optimization.md- Optimize complex queriespostgres-migrations.md- Evolve schema over time
MongoDB skills (document-oriented, flexible schema):
mongodb-document-design.md- Design document structures- Choose when: Flexible schema, nested data, rapid iteration
Redis skills (in-memory, key-value, caching):
redis-data-structures.md- Caching, sessions, rate limiting- Choose when: Speed critical, caching layer, real-time features
Cross-database skills:
database-selection.md- Start here for new projectsdatabase-connection-pooling.md- All databases need thisorm-patterns.md- When using ORMs (SQLAlchemy, Prisma, Mongoose)
Integration with Other Skills
Database skills commonly combine with:
API skills (discover-api):
- API endpoints → Database queries
- Connection pooling for API servers
- Query optimization for API performance
- Migrations alongside API versioning
Backend language skills (discover-backend):
- Python: SQLAlchemy, psycopg2, PyMongo
- Zig: PostgreSQL C bindings
- Rust: SQLx, Diesel
- Go: database/sql, GORM
Testing skills (discover-testing):
- Integration tests with test databases
- Migration testing
- Query performance testing
- Data fixture management
Data pipeline skills (discover-data):
- ETL from databases
- Database as data source
- Bulk data operations
- Streaming database changes (CDC)
Observability skills (discover-observability):
- Query metrics and slow query logs
- Connection pool metrics
- Database performance monitoring
- Alert configuration
Progressive Loading
This gateway skill (~200 lines, ~2K tokens) enables progressive loading:
- Level 1: Gateway loads automatically (you're here now)
- Level 2: Load category INDEX.md (~3K tokens) for full overview
- Level 3: Load specific skills (~2-4K tokens each) as needed
Total context: 2K + 3K + skill(s) = 5-10K tokens vs 25K+ for entire index.
Quick Start Examples
"Design a PostgreSQL schema for an e-commerce app":
cat skills/database/postgres-schema-design.md
"Why is my query slow?":
cat skills/database/postgres-query-optimization.md
"How do I safely change my database schema?":
cat skills/database/postgres-migrations.md
"Should I use MongoDB or PostgreSQL?":
cat skills/database/database-selection.md
"Implement caching with Redis":
cat skills/database/redis-data-structures.md
"Fix N+1 queries in my ORM":
cat skills/database/orm-patterns.md
Database Type Decision Tree
Need ACID transactions? YES → PostgreSQL
Need complex queries/joins? YES → PostgreSQL
Need flexible schema? YES → MongoDB
Need real-time caching? YES → Redis
Need full-text search? YES → PostgreSQL (with extensions) or Elasticsearch
Need graph relationships? YES → Neo4j or PostgreSQL (with extensions)
Need analytics? YES → DuckDB or Redpanda + Iceberg
For detailed decision-making:
cat skills/database/database-selection.md
PostgreSQL Focus Areas
Schema design → postgres-schema-design.md:
- Tables, columns, data types
- Primary keys, foreign keys, constraints
- Normalization vs denormalization
- Indexing strategies
Query optimization → postgres-query-optimization.md:
- EXPLAIN and EXPLAIN ANALYZE
- Index selection and creation
- Query plan analysis
- Performance tuning
Migrations → postgres-migrations.md:
- Schema change strategies
- Zero-downtime deployments
- Rollback procedures
- Migration tools (Alembic, Flyway, migrate)
NoSQL Focus Areas
MongoDB → mongodb-document-design.md:
- Document structure and embedding
- References vs embedding tradeoffs
- Schema versioning
- Index design for documents
Redis → redis-data-structures.md:
- Strings, hashes, lists, sets, sorted sets
- Caching patterns and TTLs
- Session storage
- Rate limiting implementations
- Leaderboards and counters
ORM Considerations
Before using ORMs, load:
cat skills/database/orm-patterns.md
Common ORM pitfalls:
- N+1 query problems
- Lazy vs eager loading confusion
- Transaction management
- Raw SQL when necessary
- Migration generation
Supported ORMs:
- SQLAlchemy (Python)
- Prisma (TypeScript/Node.js)
- Diesel (Rust)
- GORM (Go)
- ActiveRecord (Ruby)
- Entity Framework (C#)
Usage Instructions
- Auto-activation: This skill loads automatically when Claude Code detects database work
- Browse skills: Run
cat skills/database/INDEX.mdfor full category overview - Load specific skills: Use bash commands above to load individual skills
- Follow workflows: Use recommended sequences for common patterns
- Decision support: Start with
database-selection.mdfor new projects
Next Steps: Run cat skills/database/INDEX.md to see full category details, or load specific skills using the bash commands above.
GitHub Repository
Related Skills
sglang
MetaSGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.
langchain
MetaLangChain is a framework for building LLM applications using agents, chains, and RAG pipelines. It supports multiple LLM providers, offers 500+ integrations, and includes features like tool calling and memory management. Use it for rapid prototyping and deploying production systems like chatbots, autonomous agents, and question-answering services.
Algorithmic Art Generation
MetaThis skill helps developers create algorithmic art using p5.js, focusing on generative art, computational aesthetics, and interactive visualizations. It automatically activates for topics like "generative art" or "p5.js visualization" and guides you through creating unique algorithms with features like seeded randomness, flow fields, and particle systems. Use it when you need to build reproducible, code-driven artistic patterns.
webapp-testing
TestingThis Claude Skill provides a Playwright-based toolkit for testing local web applications through Python scripts. It enables frontend verification, UI debugging, screenshot capture, and log viewing while managing server lifecycles. Use it for browser automation tasks but run scripts directly rather than reading their source code to avoid context pollution.
