Token导航 LogoToken导航

Agent Skill · 研究检索

moai-domain-database(摩艾域数据库)

用于辅助数据库表结构、查询语句、迁移脚本和数据维护任务。它适合让 Agent 分析 schema、编写 SQL、排查查询问题、整理索引或生成迁移建议。使用时需要明确数据库类型、连接环境和目标表,区分只读分析与写入变更;涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护,避免误操作。

moai-domain-database 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 34,616。

总安装 2,203周安装 90GitHub Stars 964下载 706核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:moai-domain-database(摩艾域数据库)
来源仓库:https://github.com/modu-ai/moai-adk
仓库路径:skills/moai-domain-database
安装命令:
npx skills add https://github.com/modu-ai/moai-adk --skill moai-domain-database
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/modu-ai/moai-adk --skill moai-domain-database

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

moai-domain-database 用于辅助数据库表结构、查询语句和迁移脚本的编写与维护。适用于分析 schema、编写 SQL、排查查询问题或生成迁移建议的场景。使用时需明确数据库类型、连接环境和目标表,区分只读分析与写入变更。涉及删除、更新或批量导入时,应优先 dry-run 或备份以避免误操作。

适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/moai-domain-database

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/modu-ai/moai-adk --skill moai-domain-database;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

moai-domain-database 怎么安装?

在终端执行 npx skills add https://github.com/modu-ai/moai-adk --skill moai-domain-database。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

moai-domain-database 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

moai-domain-database 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

moai-domain-database 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

moai-domain-database 用的人多吗?

公开数据是累计安装 2,203 次,近一周安装 90 次,下载 706 次,GitHub 964 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

moai-domain-database 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
moai-domain-database

摩艾域数据库 · 本页

2,203964接触敏感数据MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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

Resources

For working code examples, see examples.md.

For detailed implementation patterns and database-specific optimizations, see the modules directory.

Status: Production Ready Last Updated: 2026-01-11 Maintained by: MoAI-ADK Database Team

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.

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

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

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:

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:

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:

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

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

Full platform reference: modules/cloud-database.md

Refactor Notes

R4 audit verdict (2026-04-23): REFACTOR — MERGE target (absorbs moai-platform-database-cloud) with additional restructuring needed SPEC: SPEC-V3R2-WF-001 §6.2 line 263 Refactor scope (deferred to future sub-SPEC):

  • Separate moai-domain-db-docs workflow skill from this query/schema design skill
  • Extract cloud vendor deep-dives (Neon, Supabase, Firestore) into dedicated Level-3 modules
  • Consolidate overlapping ORM pattern content across database types

This skill is retained in v3.0 but its body will be restructured in a follow-up SPEC. Cloud vendor content absorbed from moai-platform-database-cloud in Wave 1.2.

平台分布

Claude Code

26.21%
按下载量换算185

OpenCode

25.71%
按下载量换算182

Antigravity

19.36%
按下载量换算137

Codex

12.52%
按下载量换算88

Cursor

6.97%
按下载量换算49

Gemini CLI

3.61%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills