Agent skill

Discover Database

by rand in rand/cc-polymath

Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection.

MITAuto-check passedDatabases

Install Discover Database

skills CLI
$ npx skills add rand/cc-polymath --skill discover-database -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install rand/cc-polymath discover-database --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/rand/cc-polymath.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/discover-database .claude/skills/discover-database && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
discover-database
GitHub stars
181
Token cost
~2k tokens
SKILL.md length
732 words
Files
1
Skills in repo
26
Repo updated
First seen
Licence
MIT

At a glance

Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection.

  • Works in 8 steps: postgres-schema-design - Schema design,… → postgres-query-optimization - EXPLAIN… → postgres-migrations - Schema changes,… → …
  • Tasks that involve Database schema design
  • SKILL.md covers When This Skill Activates, Available Skills, Common Workflows and Skill Selection Guide, plus 8 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Discover Database is an agent skill from rand/cc-polymath. 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.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Designed for Claude Code. Compatible with any agent supporting the Agent Skills format.

It sits in Databases, covering Database schema design, NoSQL databases and Query optimization. It works with PostgreSQL, MongoDB, Redis and SQL. The repository describes itself as: Claude Code skills and workflows, optimized for context-efficiency and skill quality. Skills ranging from cloud infrastructure to design to advanced maths. The licence is MIT.

When your agent uses it

  • Tasks that involve Database schema design
  • Tasks that involve NoSQL databases
  • Tasks that involve Query optimization

Example prompts

  • “/discover-database”

Requirements

  • Node.js
  • Compatibility (from SKILL.md): Designed for Claude Code. Compatible with any agent supporting the Agent Skills format.

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. postgres-schema-design - Schema design, relationships, data types, normalization
  2. postgres-query-optimization - EXPLAIN plans, indexes, slow query debugging
  3. postgres-migrations - Schema changes, zero-downtime, rollback strategies
  4. mongodb-document-design - Document modeling, embedding vs referencing
  5. redis-data-structures - Caching, sessions, rate limiting, leaderboards
  6. database-connection-pooling - Pool configuration, debugging exhaustion
  7. orm-patterns - ORM best practices, N+1 prevention, eager loading
  8. database-selection - Choosing databases, SQL vs NoSQL decisions

What it can do on your machine

Read from SKILL.md and the folder at commit baa2df1. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code. Compatible with any agent supporting the Agent Skills format.

    From compatibility in the SKILL.md frontmatter.

Context cost

Discover Database loads about 2k tokens when it runs. Until then it costs about 71 tokens; SKILL.md has 732 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from rand/cc-polymath at commit baa2df1, republished under its MIT licence (© rand). 732 words, ~1,995 tokens.

Download SKILL.mdSave it as .claude/skills/discover-database/SKILL.md (or your agent's skills folder).
name
discover-database
description
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.
compatibility
Designed for Claude Code. Compatible with any agent supporting the Agent Skills format.
license
MIT
metadata.author
rand
metadata.version
4.0

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):

  1. postgres-schema-design - Schema design, relationships, data types, normalization
  2. postgres-query-optimization - EXPLAIN plans, indexes, slow query debugging
  3. postgres-migrations - Schema changes, zero-downtime, rollback strategies
  4. mongodb-document-design - Document modeling, embedding vs referencing
  5. redis-data-structures - Caching, sessions, rate limiting, leaderboards
  6. database-connection-pooling - Pool configuration, debugging exhaustion
  7. orm-patterns - ORM best practices, N+1 prevention, eager loading
  8. 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 schemas
  • postgres-query-optimization.md - Optimize complex queries
  • postgres-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 projects
  • database-connection-pooling.md - All databases need this
  • orm-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
Show full SKILL.md (317 more words)Show less

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

  1. Auto-activation: This skill loads automatically when Claude Code detects database work
  2. Browse skills: Run Read ../database/INDEX.md for full category overview
  3. Load specific skills: Use bash commands above to load individual skills
  4. Follow workflows: Use recommended sequences for common patterns
  5. Decision support: Start with database-selection.md for new projects

Next Steps: Run Read ../database/INDEX.md to see full category details, or load specific skills using the bash commands above.

© rand, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skills/discover-database of rand/cc-polymath.

Open the folder on GitHubat commit baa2df1

Compare with similar skills

Discover Database next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Discover Database compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Discover Database this skillrand/cc-polymath181—~2kAutomated safety check: PassMIT
DB SculptorEliasOulkadi/shokunin114—~3.1kAutomated safety check: NotesMIT
DatabasesMicrock/ordinary-claude-skills403—~1.9kAutomated safety check: NotesMIT
Database FundamentalsDanielPodolsky/ownyourcode2901 repos~1.6kAutomated safety check: PassMIT
Database Expertcin12211/orca-q224—~2.8kAutomated safety check: PassMIT
Database Domain Specialistmodu-ai/moai-adk1.2k—~2.8kAutomated safety check: PassApache-2.0

Similar skills

  • DB Sculptor

    EliasOulkadi/shokunin

    Design database schemas with Prisma/Drizzle, PostgreSQL index strategy (B-tree, GIN, GiST, BRIN, Hash), query optimization (EXPLAIN ANALYZE), migration safety (expand/contract, zero-downtime), and…

    114 GitHub stars~3.1k tokensUpdated 3 days ago
    DatabasesAuto-check: notes
  • Databases

    Microck/ordinary-claude-skills

    Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin).

    403 GitHub stars~1.9k tokensUpdated 1 mo ago
    DatabasesAuto-check: notes
  • Database Fundamentals

    DanielPodolsky/ownyourcode

    Reviews schema design, SQL queries, ORM patterns. An agent skill from DanielPodolsky/ownyourcode.

    290 GitHub starsUsed in 1 repo~1.6k tokens
    DatabasesAuto-check passed
  • Database Expert

    cin12211/orca-q

    Database performance optimization, schema design, query analysis, and connection management across PostgreSQL, MySQL, MongoDB, and SQLite with ORM integration.

    224 GitHub stars~2.8k tokensUpdated 16 days ago
    DatabasesAuto-check passed
  • Database guidance for PostgreSQL, MongoDB, Redis and Oracle plus Neon, Supabase and Firestore: schema design, indexing, query tuning and cloud database choice.

    1.2k GitHub stars~2.8k tokensUpdated today
    DatabasesAuto-check passed
  • Rhctl

    saidake/rhctl

    Run and author rhctl CLI workflows and remote environment scripts under scripts/ (PostgreSQL, JetStream, Docker, Redis, MongoDB, AWS LocalStack, execute/upload/patch).

    106 GitHub stars~4k tokensUpdated 2 days ago
    DatabasesAuto-check: notes

More from rand/cc-polymath

All 26 skills in this repo
  • 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.

    181 GitHub stars~2.9k tokensUpdated 7 mo ago
    Auto-check passed
  • Typed Holes Refactor

    rand/cc-polymath

    Refactor codebases using Design by Typed Holes methodology - iterative, test-driven refactoring with formal hole resolution, constraint propagation, and continuous validation.

    181 GitHub stars~5.6k tokensUpdated 7 mo ago
    Auto-check passed
  • Discover Agentic

    rand/cc-polymath

    Automatically discover agentic workflow skills when building AI agents, implementing tool use patterns, managing context windows, decomposing complex tasks, or designing multi-step autonomous…

    181 GitHub starsUsed in 1 repo~1.4k tokens
    Auto-check passed
  • Elegant Design

    rand/cc-polymath

    Create world-class, accessible, responsive interfaces with sophisticated interactive elements including chat, terminals, code display, and streaming content.

    181 GitHub stars~2.7k tokensUpdated 7 mo ago
    Auto-check passed
  • Discover API

    rand/cc-polymath

    Automatically discover API design skills when working with REST APIs, GraphQL schemas, API authentication, OAuth, JWT, rate limiting, API versioning, error handling, or endpoint design.

    181 GitHub starsUsed in 1 repo~1.5k tokens
    Auto-check passed
  • Discover Frontend

    rand/cc-polymath

    Automatically discover frontend development skills when working with React, Next.js, UI components, state management, data fetching, forms, accessibility, performance optimization, or SEO.

    181 GitHub stars~2.4k tokensUpdated 7 mo ago
    Auto-check passed

Categories

Questions about Discover Database

What does Discover Database do?

Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection. Discover Database is an agent skill from rand/cc-polymath. Automatically discover database skills when working with SQL, PostgreSQL, MongoDB, Redis, database schema design, query optimization, migrations, connection pooling, ORMs, or database selection.

When should I use Discover Database?

Discover Database fits situations like: tasks that involve Database schema design; tasks that involve NoSQL databases; tasks that involve Query optimization.

How do I install Discover Database in Claude Code?

Run `npx skills add rand/cc-polymath --skill discover-database -a claude-code`. Or copy the skill folder (skills/discover-database in rand/cc-polymath) into .claude/skills/discover-database in your project. Claude Code loads it when a task matches its description.

How do I install Discover Database in Codex?

Run `npx skills add rand/cc-polymath --skill discover-database -a codex`. Or copy the skill folder (skills/discover-database in rand/cc-polymath) into .agents/skills/discover-database in your project. Codex loads it when a task matches its description.

Can I use Discover Database in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add rand/cc-polymath --skill discover-database -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/discover-database, .gemini/skills/discover-database, .github/skills/discover-database and .opencode/skills/discover-database in your project.

What does Discover Database need to run?

SKILL.md names no scripts, command-line tools or credentials: Discover Database is instructions for the agent only. Our summary lists: Node.js. Compatibility (from SKILL.md): Designed for Claude Code. Compatible with any agent supporting the Agent Skills format..

Does Discover Database access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Discover Database safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Discover Database use?

Discover Database is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Discover Database use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Discover Database?

Skills that share tags, products or a category with Discover Database: DB Sculptor (EliasOulkadi/shokunin, 114 stars), Databases (Microck/ordinary-claude-skills, 403 stars), Database Fundamentals (DanielPodolsky/ownyourcode, 290 stars) and Database Expert (cin12211/orca-q, 224 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Discover Database?

rand (a GitHub user) maintains it in rand/cc-polymath, which has 181 GitHub stars. The repository holds 26 skills in this directory. The repository was last updated on February 28, 2026.

Source: rand/cc-polymath on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.