ck:databases
MongoDBやPostgreSQLのデータベース設計、SQL/NoSQLクエリ作成、データ集計、インデックス設定、移行、レプリケーション、パフォーマンス最適化などを、psql CLIも活用して効率的に行うSkill。
📜 元の英語説明(参考)
Design schemas, write queries for MongoDB and PostgreSQL. Use for database design, SQL/NoSQL queries, aggregation pipelines, indexes, migrations, replication, performance optimization, psql CLI.
🇯🇵 日本人クリエイター向け解説
MongoDBやPostgreSQLのデータベース設計、SQL/NoSQLクエリ作成、データ集計、インデックス設定、移行、レプリケーション、パフォーマンス最適化などを、psql CLIも活用して効率的に行うSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o ck-databases.zip https://jpskill.com/download/23638.zip && unzip -o ck-databases.zip && rm ck-databases.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/23638.zip -OutFile "$d\ck-databases.zip"; Expand-Archive "$d\ck-databases.zip" -DestinationPath $d -Force; ri "$d\ck-databases.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
ck-databases.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
ck-databasesフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 19
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[Skill 名] ck:databases
データベーススキル
MongoDB(ドキュメント指向)とPostgreSQL(リレーショナル)データベースを扱うための統合ガイドです。ユースケースに合ったデータベースを選択し、両方のシステムを習得してください。
このスキルを使用するタイミング
以下の状況で使用します。
- データベーススキーマとデータモデルの設計
- クエリの記述(SQLまたはMongoDBクエリ言語)
- アグリゲーションパイプラインまたは複雑な結合の構築
- インデックスとクエリパフォーマンスの最適化
- データベース移行の実装
- レプリケーション、シャーディング、またはクラスタリングのセットアップ
- バックアップと災害復旧の構成
- データベースユーザーと権限の管理
- 遅いクエリとパフォーマンス問題の分析
- 本番データベースデプロイメントの管理
リファレンスナビゲーション
データベース設計
- db-design.md - ユーザーがトランザクション(OLTP)、分析(OLAP)のためのデータベース/テーブル設計、スキーマの作成または拡張、ファクト/ディメンションテーブルの設計、テーブル作成のためのCSV/JSON/SQLファイルの分析/レビュー、またはデータストレージ構造に関するアドバイスを要求したときにアクティブ化します。
MongoDBリファレンス
- mongodb-crud.md - CRUD操作、クエリオペレーター、アトミック更新
- mongodb-aggregation.md - アグリゲーションパイプライン、ステージ、オペレーター、パターン
- mongodb-indexing.md - インデックスタイプ、複合インデックス、パフォーマンス最適化
- mongodb-atlas.md - Atlasクラウドセットアップ、クラスター、監視、検索
PostgreSQLリファレンス
- postgresql-queries.md - SELECT、JOIN、サブクエリ、CTE、ウィンドウ関数
- postgresql-psql-cli.md - psqlコマンド、メタコマンド、スクリプト
- postgresql-performance.md - EXPLAIN、クエリ最適化、VACUUM、インデックス
- postgresql-administration.md - ユーザー管理、バックアップ、レプリケーション、メンテナンス
Pythonユーティリティ
scripts/内のデータベースユーティリティスクリプトです。
- db_migrate.py - 両方のデータベース(MongoDBとPostgreSQL)の移行を生成および適用します
- db_backup.py - MongoDBとPostgreSQLのバックアップと復元を行います
- db_performance_check.py - 遅いクエリを分析し、インデックスを推奨します
# Generate migration
python scripts/db_migrate.py --db mongodb --generate "add_user_index"
# Run backup
python scripts/db_backup.py --db postgres --output /backups/
# Check performance
python scripts/db_performance_check.py --db mongodb --threshold 100ms
ベストプラクティス
MongoDB:
- 1対少数の関係には埋め込みドキュメントを使用します
- 1対多数または多対多の関係には参照ドキュメントを使用します
- 頻繁にクエリされるフィールドにインデックスを作成します
- 複雑な変換にはアグリゲーションパイプラインを使用します
- 本番環境では認証とTLSを有効にします
- マネージドホスティングにはAtlasを使用します
PostgreSQL:
- スキーマを3NFに正規化し、パフォーマンスのために非正規化します
- 参照整合性のために外部キーを使用します
- 外部キーと頻繁にフィルタリングされる列にインデックスを作成します
- クエリを最適化するためにEXPLAIN ANALYZEを使用します
- 定期的なVACUUMとANALYZEメンテナンスを行います
- Webアプリケーションには接続プーリング(pgBouncer)を使用します
リソース
- MongoDB: https://www.mongodb.com/docs/
- PostgreSQL: https://www.postgresql.org/docs/
- MongoDB University: https://learn.mongodb.com/
- PostgreSQL Tutorial: https://www.postgresqltutorial.com/
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Databases Skill
Unified guide for working with MongoDB (document-oriented) and PostgreSQL (relational) databases. Choose the right database for your use case and master both systems.
When to Use This Skill
Use when:
- Designing database schemas and data models
- Writing queries (SQL or MongoDB query language)
- Building aggregation pipelines or complex joins
- Optimizing indexes and query performance
- Implementing database migrations
- Setting up replication, sharding, or clustering
- Configuring backups and disaster recovery
- Managing database users and permissions
- Analyzing slow queries and performance issues
- Administering production database deployments
Reference Navigation
Database Design
- db-design.md - Activate when user requests: Database/table design for transactional (OLTP), analytics (OLAP), create or extend schema, design fact/dimension tables, analyze/review CSV/JSON/SQL files to create tables, or need advice on data storage structure.
MongoDB References
- mongodb-crud.md - CRUD operations, query operators, atomic updates
- mongodb-aggregation.md - Aggregation pipeline, stages, operators, patterns
- mongodb-indexing.md - Index types, compound indexes, performance optimization
- mongodb-atlas.md - Atlas cloud setup, clusters, monitoring, search
PostgreSQL References
- postgresql-queries.md - SELECT, JOINs, subqueries, CTEs, window functions
- postgresql-psql-cli.md - psql commands, meta-commands, scripting
- postgresql-performance.md - EXPLAIN, query optimization, vacuum, indexes
- postgresql-administration.md - User management, backups, replication, maintenance
Python Utilities
Database utility scripts in scripts/:
- db_migrate.py - Generate and apply migrations for both databases (MongoDB and PostgreSQL)
- db_backup.py - Backup and restore MongoDB and PostgreSQL
- db_performance_check.py - Analyze slow queries and recommend indexes
# Generate migration
python scripts/db_migrate.py --db mongodb --generate "add_user_index"
# Run backup
python scripts/db_backup.py --db postgres --output /backups/
# Check performance
python scripts/db_performance_check.py --db mongodb --threshold 100ms
Best Practices
MongoDB:
- Use embedded documents for 1-to-few relationships
- Reference documents for 1-to-many or many-to-many
- Index frequently queried fields
- Use aggregation pipeline for complex transformations
- Enable authentication and TLS in production
- Use Atlas for managed hosting
PostgreSQL:
- Normalize schema to 3NF, denormalize for performance
- Use foreign keys for referential integrity
- Index foreign keys and frequently filtered columns
- Use EXPLAIN ANALYZE to optimize queries
- Regular VACUUM and ANALYZE maintenance
- Connection pooling (pgBouncer) for web apps
Resources
- MongoDB: https://www.mongodb.com/docs/
- PostgreSQL: https://www.postgresql.org/docs/
- MongoDB University: https://learn.mongodb.com/
- PostgreSQL Tutorial: https://www.postgresqltutorial.com/
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (3,703 bytes)
- 📎 references/mongodb-aggregation.md (9,333 bytes)
- 📎 references/mongodb-atlas.md (9,284 bytes)
- 📎 references/mongodb-crud.md (8,355 bytes)
- 📎 references/mongodb-indexing.md (10,618 bytes)
- 📎 references/postgresql-administration.md (12,113 bytes)
- 📎 references/postgresql-performance.md (11,613 bytes)
- 📎 references/postgresql-psql-cli.md (10,523 bytes)
- 📎 references/postgresql-queries.md (10,091 bytes)
- 📎 scripts/.coverage (53,248 bytes)
- 📎 scripts/db_backup.py (16,765 bytes)
- 📎 scripts/db_migrate.py (14,220 bytes)
- 📎 scripts/db_performance_check.py (16,022 bytes)
- 📎 scripts/requirements.txt (558 bytes)
- 📎 scripts/tests/coverage-db.json (47,444 bytes)
- 📎 scripts/tests/requirements.txt (69 bytes)
- 📎 scripts/tests/test_db_backup.py (10,800 bytes)
- 📎 scripts/tests/test_db_migrate.py (9,529 bytes)
- 📎 scripts/tests/test_db_performance_check.py (11,933 bytes)