Agent skill

Database Domain Specialist

by modu-ai in modu-ai/moai-adk

Database guidance for PostgreSQL, MongoDB, Redis and Oracle plus Neon, Supabase and Firestore: schema design, indexing, query tuning and cloud database choice.

Apache-2.0Auto-check passedDatabases

Install Database Domain Specialist

skills CLI
$ npx skills add modu-ai/moai-adk --skill moai-domain-database -a claude-code

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

GitHub CLI
$ gh skill install modu-ai/moai-adk moai-domain-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/modu-ai/moai-adk.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/moai-domain-database .claude/skills/moai-domain-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
moai-domain-database
GitHub stars
1.2k
Token cost
~2.8k tokens
SKILL.md length
1,145 words
Files
1
Skills in repo
48
Repo updated
First seen
Licence
Apache-2.0

At a glance

Database guidance for PostgreSQL, MongoDB, Redis and Oracle plus Neon, Supabase and Firestore: schema design, indexing, query tuning and cloud database choice.

  • Designing a schema or data model
  • SKILL.md covers Quick Reference, Implementation Guide, Advanced Patterns and Works Well With, plus 6 more sections
  • Calls npm
  • Choosing indexes and tuning slow queries

What it does

Covers relational, document and in-memory databases in one skill. PostgreSQL topics include schema constraints, window functions, CTEs, partitioning and materialized views; MongoDB covers document modeling, aggregation pipelines and sharding; Redis covers caching layers, locking, pub/sub and streams; Oracle covers PL/SQL, partitioning and hierarchical queries.

Further sections cover connection pooling, migrations, monitoring and hybrid setups that combine several databases. A cloud vendor guide on Neon, Supabase and Firestore, merged in from another skill, helps with picking a platform. Tool permissions allow only specific database command line clients such as psql, mongosh and redis-cli.

When your agent uses it

  • Designing a schema or data model
  • Choosing indexes and tuning slow queries
  • Planning a Redis caching layer
  • Picking a cloud database for a new project

Example prompts

  • “Design a PostgreSQL schema for a multi-tenant invoicing app.”
  • “Add indexes to speed up the slow orders query.”
  • “Compare Neon, Supabase and Firestore for a small SaaS.”

Requirements

  • Database CLIs such as psql, mongosh or redis-cli for hands-on work
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(psql:*), Bash(mysql:*), Bash(sqlite3:*), Bash(mongosh:*), Bash(redis-cli:*), Bash(npm:*), Bash(npx:*), Bash(prisma:*), Bash(neonctl:*), Bash(firebase:*), Bash(supabase:*), Grep, Glob

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(psql:*)
    • Bash(mysql:*)
    • Bash(sqlite3:*)
    • Bash(mongosh:*)
    • Bash(redis-cli:*)
    • Bash(npm:*)
    • Bash(npx:*)

    …and 6 more on the same allowed-tools line.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

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

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    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

    From compatibility in the SKILL.md frontmatter.

Context cost

Database Domain Specialist loads about 2.8k tokens when it runs. Until then it costs about 79 tokens; SKILL.md has 1,145 words of instructions outside code blocks.

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

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 modu-ai/moai-adk at commit 2aab5f7, republished under its Apache-2.0 licence (© modu-ai). 1,145 words, ~2,835 tokens.

Download SKILL.mdSave it as .claude/skills/moai-domain-database/SKILL.md (or your agent's skills folder).
name
moai-domain-database
description
Database specialist covering PostgreSQL, MongoDB, Redis, Oracle, and cloud database platforms (Neon, Supabase, Firestore). Use for schema design, query optimization, indexing strategies, data modeling, or cloud database selection. Cloud vendor guide absorbed from moai-platform-database-cloud.
allowed-tools
Read, Write, Edit, Bash(psql:*), Bash(mysql:*), Bash(sqlite3:*), Bash(mongosh:*), Bash(redis-cli:*), Bash(npm:*), Bash(npx:*), Bash(prisma:*), Bash(neonctl:*), Bash(firebase:*), Bash(supabase:*), Grep, Glob
compatibility
Designed for Claude Code
when_to_use
Use for schema design, query optimization, indexing strategies, and ORMs/ODMs (Prisma, Mongoose, SQLAlchemy, Drizzle). Covers PostgreSQL, MongoDB, Redis…
license
Apache-2.0
user-invocable
false
metadata.version
2.0.0
metadata.category
domain
metadata.status
active
metadata.updated
2026-04-25
metadata.tags
database, postgresql, mongodb, redis, oracle, data-patterns, performance, neon, supabase, firestore, cloud-database, serverless
metadata.author
MoAI-ADK Team
metadata.related-skills
moai-platform-database-cloud

Database Domain Specialist

Quick Reference

Enterprise Database Expertise - Comprehensive database patterns and implementations covering PostgreSQL, MongoDB, Redis, Oracle, and advanced data management for scalable modern applications.

Core Capabilities:

  • PostgreSQL: Advanced relational patterns, optimization, and scaling
  • MongoDB: Document modeling, aggregation, and NoSQL performance tuning
  • Redis: In-memory caching, real-time analytics, and distributed systems
  • Oracle: Enterprise patterns, PL/SQL, partitioning, and hierarchical queries
  • Multi-Database: Hybrid architectures and data integration patterns
  • Performance: Query optimization, indexing strategies, and scaling
  • Operations: Connection management, migrations, and monitoring

When to Use:

  • Designing database schemas and data models
  • Implementing caching strategies and performance optimization
  • Building scalable data architectures
  • Working with multi-database systems
  • Optimizing database queries and performance

Implementation Guide

Quick Start Workflow

Database Stack Initialization:

Create a DatabaseManager instance and configure multiple database connections. Set up PostgreSQL with connection string, pool size of 20, and query logging enabled. Configure MongoDB with connection string, database name, and sharding enabled. Configure Redis with connection string, max connections of 50, and clustering enabled. Use the unified interface to query user data with profile and analytics across all database types.

Single Database Operations:

Run PostgreSQL schema migrations using the migration command with the database type and migration file path. Execute MongoDB aggregation pipelines by specifying the collection name and pipeline JSON file. Warm Redis cache by specifying key patterns and TTL values.

Core Components

PostgreSQL Module:

  • Advanced schema design and constraints
  • Complex query optimization and indexing
  • Window functions and CTEs
  • Partitioning and materialized views
  • Connection pooling and performance tuning

MongoDB Module:

  • Document modeling and schema design
  • Aggregation pipelines for analytics
  • Indexing strategies and performance
  • Sharding and scaling patterns
  • Data consistency and validation

Redis Module:

  • Multi-layer caching strategies
  • Real-time analytics and counting
  • Distributed locking and coordination
  • Pub/sub messaging and streams
  • Advanced data structures including HyperLogLog and Geo

Oracle Module:

  • Hierarchical and recursive query patterns (CONNECT BY)
  • PL/SQL procedures, packages, and batch operations
  • Partitioning strategies (range, list, hash, composite)
  • Enterprise features and statement caching
  • LOB handling and large data processing

Advanced Patterns

Multi-Database Architecture

Polyglot Persistence Pattern:

Create a DataRouter class that initializes connections to PostgreSQL, MongoDB, Redis, and Oracle. Implement get_user_profile method that retrieves structured user data from PostgreSQL or Oracle, flexible profile data from MongoDB, and real-time status from Redis, then merges all data sources. Implement update_user_data method that routes structured data updates to PostgreSQL/Oracle, profile data updates to MongoDB, and real-time data updates to Redis, followed by cache invalidation.

Data Synchronization:

Create a DataSyncManager class that synchronizes user data across databases. Implement sync_user_data method that retrieves user from PostgreSQL, creates a search document for MongoDB, upserts to the MongoDB search collection, creates cache data, and updates Redis cache with TTL.

Performance Optimization

Query Performance Analysis:

For PostgreSQL, execute EXPLAIN ANALYZE BUFFERS on queries and use a QueryAnalyzer to generate optimization suggestions. For MongoDB, create an AggregationOptimizer to analyze and optimize aggregation pipelines. For Redis, retrieve info metrics and use a PerformanceAnalyzer to generate recommendations.

Scaling Strategies:

Configure PostgreSQL read replicas by providing replica connection URLs. Set up MongoDB sharding with shard key and number of shards. Configure Redis clustering by providing node URLs for the cluster.


Works Well With

Complementary Skills:

  • moai-domain-backend - API integration and business logic
  • moai-foundation-core - Database migration and schema management
  • moai-workflow-project - Database project setup and configuration
  • moai-platform-supabase - Supabase database integration patterns
  • moai-platform-neon - Neon database integration patterns
  • moai-platform-firestore - Firestore database integration patterns

Technology Integration:

  • ORMs and ODMs including SQLAlchemy, Mongoose, and TypeORM
  • Connection pooling with PgBouncer and connection pools
  • Migration tools including Alembic, Flyway, and Data Pump
  • Monitoring with pg_stat_statements, MongoDB Atlas, and Oracle AWR
  • python-oracledb for Oracle connectivity and PL/SQL execution
  • Cache invalidation and synchronization

Technology Stack

Relational Database:

  • PostgreSQL 14+ as primary database
  • MySQL 8.0+ as alternative
  • Connection pooling with PgBouncer and SQLAlchemy

NoSQL Database:

  • MongoDB 6.0+ as primary document store
  • Document modeling and validation
  • Aggregation framework
  • Sharding and replication

In-Memory Database:

  • Redis 7.0+ as primary cache
  • Redis Stack for advanced features
  • Clustering and high availability
  • Advanced data structures

Enterprise Database:

  • Oracle 19c+ / 21c+ for enterprise workloads
  • python-oracledb (successor to cx_Oracle)
  • PL/SQL procedures and packages
  • Partitioning and advanced analytics

Supporting Tools:

  • Migration tools including Alembic and Flyway
  • Monitoring with Prometheus and Grafana
  • ORMs and ODMs including SQLAlchemy and Mongoose
  • Connection management utilities

Performance Features:

  • Query optimization and analysis
  • Index management and strategies
  • Caching layers and invalidation
  • Load balancing and failover

Show full SKILL.md (443 more words)Show less

Resources

Status: Production Ready Maintained by: MoAI-ADK Database Team

<!-- moai:evolvable-start id="rationalizations" -->

Common Rationalizations

RationalizationReality
"I do not need an index, the table is small"Tables grow. The missing index that is invisible at 1K rows becomes a production incident at 1M rows.
"I will add the migration later"Schema changes without migrations are unreproducible. Every change must have a reversible migration script.
"This query works fine in development"Development databases have tiny datasets. Production query plans differ dramatically at scale. Explain analyze first.
"NoSQL does not need schema design"Schemaless does not mean designless. Document structure decisions affect every query and index.
"I will just add a column, it is non-breaking"Adding a NOT NULL column without a default breaks existing inserts. Column additions need default values or migration backfills.
"Connection pooling is handled by the framework"Framework defaults are generic. Pool size, timeout, and idle limits must be tuned to the workload.
<!-- moai:evolvable-end -->
<!-- moai:evolvable-start id="red-flags" -->

Red Flags

  • Schema change committed without a corresponding migration file
  • Query uses SELECT * in production code instead of explicit column list
  • No index exists for columns used in WHERE, JOIN, or ORDER BY clauses
  • Connection string hardcoded in source instead of environment variable
  • Transaction scope spans user-facing HTTP request duration (long-held locks)
  • No EXPLAIN ANALYZE output for new queries touching large tables
<!-- moai:evolvable-end -->
<!-- moai:evolvable-start id="verification" -->

Verification

  • Migration file exists for every schema change (show migration file list)
  • Indexes exist for frequently queried columns (show index definitions)
  • EXPLAIN ANALYZE run for new queries on representative data (show output)
  • Connection credentials sourced from environment variables
  • Transaction scopes are minimal and do not span I/O waits
  • Backup and restore procedure documented and tested
  • Connection pool settings configured with explicit size and timeout
<!-- moai:evolvable-end -->

Cloud Vendor Guide (absorbed from moai-platform-database-cloud)

Cloud database platform selection and configuration for Neon, Supabase, and Firebase Firestore.

Quick Decision Guide
NeedPlatform
Serverless PostgreSQL with auto-scalingNeon
Database branching for CI/CD previewsNeon branching
Edge-compatible connection poolingNeon + Neon Proxy
Vector search (pgvector) for AI/MLSupabase
Row-Level Security for multi-tenant appsSupabase RLS
Real-time subscriptions + full-stackSupabase
Mobile-first with offline syncFirebase Firestore
Cross-platform (iOS/Android/Web)Firebase Firestore
Neon (Serverless PostgreSQL)

Key features: Auto-scaling compute, scale-to-zero, database branching, pg_bouncer pooling.

Setup:

bash
npm install @neondatabase/serverless
# Connection string: postgresql://user:pass@ep-xxx.neon.tech/dbname?sslmode=require

Branch workflow: Create a branch per PR (neonctl branches create --name pr-123), run migrations, test, delete on merge. Zero cost during idle periods.

Supabase (PostgreSQL 16)

Key features: pgvector, Row-Level Security, real-time subscriptions, built-in auth/storage.

RLS policy pattern:

sql
CREATE POLICY "users_own_data" ON items
  FOR ALL USING (auth.uid() = user_id);

pgvector search: SELECT * FROM embeddings ORDER BY embedding <-> $1 LIMIT 10;

Firebase Firestore (NoSQL)

Key features: Real-time sync, offline caching, Security Rules, mobile SDKs.

Security Rules pattern:

javascript
match /users/{userId} {
  allow read, write: if request.auth.uid == userId;
}

Offline persistence: Enable via enableIndexedDbPersistence(db) (web) or SDK default (mobile).

© modu-ai, Apache-2.0. 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 .claude/skills/moai-domain-database of modu-ai/moai-adk.

Open the folder on GitHubat commit 2aab5f7

Compare with similar skills

Database Domain Specialist 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.

Database Domain Specialist compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Database Domain Specialist this skillmodu-ai/moai-adk1.2k—~2.8kAutomated safety check: PassApache-2.0
Discover Databaserand/cc-polymath181—~2kAutomated safety check: PassMIT
DB SculptorEliasOulkadi/shokunin114—~3.1kAutomated safety check: NotesMIT
Firebaseericrisco/rsc-harness174—~3.3kAutomated safety check: PassMIT
Database Schema DesignerOneWave-AI/claude-skills328—~1.6kAutomated safety check: PassMIT
DatabasesMicrock/ordinary-claude-skills404—~1.9kAutomated safety check: NotesMIT

Similar skills

  • Discover Database

    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.

    181 GitHub stars~2k tokensUpdated 7 mo ago
    DatabasesAuto-check passed
  • 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 4 days ago
    DatabasesAuto-check: notes
  • Firebase

    ericrisco/rsc-harness

    A skill your agent uses when building on Firebase — Firestore data modeling, Security Rules, Auth and custom claims, Cloud Functions, Storage, modular Web/Admin SDK imports — including symptoms like…

    174 GitHub stars~3.3k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Database Schema Designer

    OneWave-AI/claude-skills

    Designs relational and document database schemas from requirements or an existing app - tables and collections, keys, relationships, constraints, indexes driven by real query patterns, ERDs, and…

    328 GitHub stars~1.6k tokensUpdated 7 days ago
    DatabasesAuto-check passed
  • 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).

    404 GitHub stars~1.9k tokensUpdated 1 mo ago
    DatabasesAuto-check: notes
  • Official

    Gives the agent Postgres rules to consult before writing or changing tables, queries, indexes, RLS policies or migrations, and when diagnosing slow queries.

    2.7k GitHub starsUsed in 24 repos~808 tokens
    DatabasesAuto-check passed

More from modu-ai/moai-adk

All 48 skills in this repo
  • Builds hand-editable SVG diagrams from computed layout coordinates, lints the source and renders a 2x PNG, with rules for when mermaid is the better choice.

    1.2k GitHub stars~5.2k tokensUpdated today
    Auto-check: notes
  • MoAI Foundation Core

    modu-ai/moai-adk

    Reference for MoAI-ADK's core development principles: TRUST 5 quality gates, SPEC-first domain-driven workflow, agent delegation and token budgeting.

    1.2k GitHub stars~5k tokensUpdated today
    Auto-check passed
  • MoAI SPEC Workflow

    modu-ai/moai-adk

    Manages SPEC documents for MoAI-ADK development, with GEARS or EARS requirement notation, acceptance criteria and a link into the Plan-Run-Sync workflow.

    1.2k GitHub stars~5.1k tokensUpdated today
    Auto-check passed
  • MoAI TDD Workflow

    modu-ai/moai-adk

    Drives test-first development through the RED, GREEN, REFACTOR cycle, with a config switch that selects between TDD and a DDD workflow for existing code.

    1.2k GitHub stars~3.1k tokensUpdated today
    Auto-check passed
  • MoAI Worktree Management

    modu-ai/moai-adk

    Gives each SPEC its own Git worktree with a registry of active workspaces, base-branch sync and cleanup of merged ones, inside the MoAI-ADK workflow.

    1.2k GitHub stars~3.9k tokensUpdated today
    Auto-check passed
  • Watches a pull request's CI checks after creation, separates required from auxiliary failures, applies limited safe fixes and escalates anything semantic to you.

    1.2k GitHub stars~2.4k tokensUpdated today
    Auto-check: notes

Categories

Questions about Database Domain Specialist

What does Database Domain Specialist do?

Database guidance for PostgreSQL, MongoDB, Redis and Oracle plus Neon, Supabase and Firestore: schema design, indexing, query tuning and cloud database choice. Covers relational, document and in-memory databases in one skill. PostgreSQL topics include schema constraints, window functions, CTEs, partitioning and materialized views; MongoDB covers document modeling, aggregation pipelines and sharding; Redis covers caching layers, locking, pub/sub and streams; Oracle covers PL/SQL, partitioning and hierarchical queries.

When should I use Database Domain Specialist?

Database Domain Specialist fits situations like: designing a schema or data model; choosing indexes and tuning slow queries; planning a Redis caching layer; picking a cloud database for a new project.

How do I install Database Domain Specialist in Claude Code?

Run `npx skills add modu-ai/moai-adk --skill moai-domain-database -a claude-code`. Or copy the skill folder (.claude/skills/moai-domain-database in modu-ai/moai-adk) into .claude/skills/moai-domain-database in your project. Claude Code loads it when a task matches its description.

How do I install Database Domain Specialist in Codex?

Run `npx skills add modu-ai/moai-adk --skill moai-domain-database -a codex`. Or copy the skill folder (.claude/skills/moai-domain-database in modu-ai/moai-adk) into .agents/skills/moai-domain-database in your project. Codex loads it when a task matches its description.

Can I use Database Domain Specialist 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 modu-ai/moai-adk --skill moai-domain-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/moai-domain-database, .gemini/skills/moai-domain-database, .github/skills/moai-domain-database and .opencode/skills/moai-domain-database in your project.

What does Database Domain Specialist need to run?

Going by SKILL.md and its folder, Database Domain Specialist needs the command-line tools its instructions call (npm). Our summary lists: Database CLIs such as psql, mongosh or redis-cli for hands-on work. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(psql:*), Bash(mysql:*), Bash(sqlite3:*), Bash(mongosh:*), Bash(redis-cli:*), Bash(npm:*), Bash(npx:*), Bash(prisma:*), Bash(neonctl:*), Bash(firebase:*), Bash(supabase:*), Grep, Glob. Compatibility (from SKILL.md): Designed for Claude Code.

Does Database Domain Specialist access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Database Domain Specialist 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 Database Domain Specialist use?

Database Domain Specialist is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Database Domain Specialist use?

About 2.8k tokens (SKILL.md is roughly 11k 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 Database Domain Specialist?

Skills that share tags, products or a category with Database Domain Specialist: Discover Database (rand/cc-polymath, 181 stars), DB Sculptor (EliasOulkadi/shokunin, 114 stars), Firebase (ericrisco/rsc-harness, 174 stars) and Database Schema Designer (OneWave-AI/claude-skills, 328 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Database Domain Specialist?

modu-ai (a GitHub organization) maintains it in modu-ai/moai-adk, which has 1,232 GitHub stars. The repository holds 48 skills in this directory. The repository was last updated on October 9, 2026.

Source: modu-ai/moai-adk on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.