
discover-database
Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection. Activates for database design, optimization, and implementation tasks.
- Installs
- 121
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/rand/cc-polymath --skill discover-database- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads discover-database automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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
- caching
- cache
- Redis
- CDN
- HTTP caching
- cache invalidation
- performance
- Service Workers
Available Skills
Quick Reference
The Database category contains 19 skills across 2 subcategories:
Database (12 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
Plus 4 more in ../database/INDEX.md
Caching (7 skills): See ../caching/INDEX.md
Load Full Category Details
Read ../database/INDEX.md Read ../caching/INDEX.md
Common Workflows
New Database Project
Sequence: Selection → Schema design → Connection pooling
Read ../database/database-selection.md # Choose database Read ../database/postgres-schema-design.md # or mongodb-document-design.md Read ../database/database-connection-pooling.md
Query Performance Debugging
Sequence: Optimization → Connection pooling → ORM patterns
Read ../database/postgres-query-optimization.md # Debug slow queries Read ../database/database-connection-pooling.md # Check pool settings Read ../database/orm-patterns.md # Fix N+1 queries
Schema Evolution
Sequence: Schema design → Migrations
Read ../database/postgres-schema-design.md # Design changes Read ../database/postgres-migrations.md # Implement safely
Caching Layer
Sequence: Redis structures → Cache patterns
Read ../database/redis-data-structures.md # Redis patterns Read ../caching/INDEX.md # Cache patterns
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": Read ../database/postgres-schema-design.md
"Why is my query slow?": Read ../database/postgres-query-optimization.md
"How do I safely change my database schema?": Read ../database/postgres-migrations.md
"Should I use MongoDB or PostgreSQL?": Read ../database/database-selection.md
"Implement caching with Redis": Read ../database/redis-data-structures.md
"Fix N+1 queries in my ORM": Read ../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: Read ../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: Read ../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
Read ../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 Read ../database/INDEX.md to see full category details, or load specific skills using the bash commands above.
FAQ
What does the discover-database skill do?
Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection. Activates for database design, optimization, and implementation tasks.
How do I install discover-database?
Run npx skills add https://github.com/rand/cc-polymath --skill discover-database in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/discover-database/ (personal) or .claude/skills/discover-database/ (project).
Which AI agents can use discover-database?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is discover-database safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains discover-database?
It is published by rand in rand/cc-polymath. It has 121 recorded installs.
More from rand/cc-polymath
anti-slop
rand/cc-polymath
Comprehensive toolkit for detecting and eliminating "AI slop" - generic, low-quality AI-generated patterns in natural language, code, and design. Use when reviewing or improving content quality, preventing generic AI patterns, cleaning up existing content, or enforcing quality standards in writing, code, or design work.
discover-frontend
rand/cc-polymath
Open the skill to read its SKILL.md instructions.
discover-research
rand/cc-polymath
Open the skill to read its SKILL.md instructions.
discover-math
rand/cc-polymath
Open the skill to read its SKILL.md instructions.
Popular data & databases skills
supabase-postgres-best-practices
supabase/agent-skills
Postgres best practices maintained by Supabase, for Postgres running anywhere. Load this skill BEFORE writing or changing anything that lives in a Postgres database: creating or altering tables and columns (including choosing column types), schema design, migrations and declarative schema files, RLS policies and the tests that verify them, indexes, triggers, database functions, queues and scheduled jobs (pgcron, pgmq), vector/semantic search (pgvector), and restoring dumps (pgrestore) or importing data. Also load it when diagnosing slow queries, high CPU, timeouts, EXPLAIN plans, connection exhaustion, locking, bloat, or rows visible to the wrong user or tenant. This is not just a performance guide — schema, migration, security, and SQL authoring tasks need these rules too, even for a one-column change or a single query.
prisma-client-api
prisma/skills
Prisma Client API reference covering model queries, filters, operators, and client methods. Use when writing database queries, using CRUD operations, filtering data, or configuring Prisma Client. Triggers on "prisma query", "findMany", "create", "update", "delete", "$transaction".
prisma-database-setup
prisma/skills
Deprecated compatibility name for prisma-orm-setup. Use only when a user or existing integration explicitly invokes prisma-database-setup; otherwise select prisma-orm-setup.
prisma-cli
prisma/skills
Prisma ORM 7 CLI reference for existing Prisma 7 applications or explicitly selected Prisma 7 workflows. Covers prisma init, generate, migrate, db, dev, studio, and mcp. For setup, connection repair, or Prisma 8, use prisma-orm-setup; not the Prisma Platform CLI.
prisma-postgres
prisma/skills
Deprecated compatibility name for prisma-postgres-setup. Use only when a user or existing integration explicitly invokes prisma-postgres; otherwise select prisma-postgres-setup.
prisma-driver-adapter-implementation
prisma/skills
Required reference for Prisma ORM 7 SQL driver adapter work. Use when implementing or modifying adapters, adding database drivers, or touching SqlDriverAdapter, Transaction, savepoint, result mapping, or DriverAdapterError behavior. Covers current transaction lifecycle, optional savepoint hooks, original database-error preservation, and verification.