database-designer
できること
スキーマを、正規化、インデックス、データ型、命名の観点で分析し、安全なマイグレーションを計画する手助けをします。データベースを設計または改善するアーキテクトと開発者向けです。
使う場面
- ✓新しい機能のテーブル定義を書く前に、スキーマを設計したいとき。
- ✓プロジェクトでSQLとNoSQLのどちらを選ぶか決めたいとき。
- ✓データベースが遅く、インデックスを確認したいとき。
スキルのリンク
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/skills/database-designer/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私のスキーマの正規化の問題を確認し、追加すべきインデックスを提案してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは正規化、不足しているインデックス、データ型を確認する分析ツールを実行し、問題と修正案(マイグレーション手順を含む)を報告します。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Database Designer - POWERFUL Tier Skill
Overview
A comprehensive database design skill that provides expert-level analysis, optimization, and migration capabilities for modern database systems. This skill combines theoretical principles with practical tools to help architects and developers create scalable, performant, and maintainable database schemas.
Core Competencies
Schema Design & Analysis
- Normalization Analysis: Automated detection of normalization levels (1NF through BCNF)
- Denormalization Strategy: Smart recommendations for performance optimization
- Data Type Optimization: Identification of inappropriate types and size issues
- Constraint Analysis: Missing foreign keys, unique constraints, and null checks
- Naming Convention Validation: Consistent table and column naming patterns
- ERD Generation: Automatic Mermaid diagram creation from DDL
Index Optimization
- Index Gap Analysis: Identification of missing indexes on foreign keys and query patterns
- Composite Index Strategy: Optimal column ordering for multi-column indexes
- Index Redundancy Detection: Elimination of overlapping and unused indexes
- Performance Impact Modeling: Selectivity estimation and query cost analysis
- Index Type Selection: B-tree, hash, partial, covering, and specialized indexes
Migration Management
- Zero-Downtime Migrations: Expand-contract pattern implementation
- Schema Evolution: Safe column additions, deletions, and type changes
- Data Migration Scripts: Automated data transformation and validation
- Rollback Strategy: Complete reversal capabilities with validation
- Execution Planning: Ordered migration steps with dependency resolution
Tool Workflow (run these — do not analyze schemas by hand)
All paths relative to this skill folder; sample inputs in assets/.
1. Analyze the schema
python3 schema_analyzer.py --input schema.sql --generate-erd --output-format json -o analysis.json
Accepts SQL DDL or JSON schema (assets/sample_schema.sql / sample_schema.json). Output includes normalization findings, missing constraints, naming issues, and a Mermaid ERD — show the ERD to the user and fix flagged issues before optimizing.
2. Optimize indexes against real query patterns
python3 index_optimizer.py --schema assets/sample_schema.json --queries assets/sample_query_patterns.json --analyze-existing --format json -o indexes.json
Write the user's hot queries into a query-patterns JSON first (copy assets/sample_query_patterns.json). Output is a priority-ordered list of CREATE INDEX recommendations plus redundant-index removals.
3. Generate the migration
python3 migration_generator.py --current current_schema.json --target target_schema.json --zero-downtime --format sql -o migration.sql
--zero-downtime emits an expand-contract plan; --validate-only checks feasibility without generating SQL.
4. Verification loop
Re-run step 1 on the target schema and assert the issues found in the first pass are gone; run migration_generator.py --validate-only before handing over the migration.
Database Design Principles
→ See references/database-design-reference.md for details
Best Practices
Schema Design
- Use meaningful names: Clear, consistent naming conventions
- Choose appropriate data types: Right-sized columns for storage efficiency
- Define proper constraints: Foreign keys, check constraints, unique indexes
- Consider future growth: Plan for scale from the beginning
- Document relationships: Clear foreign key relationships and business rules
Performance Optimization
- Index strategically: Cover common query patterns without over-indexing
- Monitor query performance: Regular analysis of slow queries
- Partition large tables: Improve query performance and maintenance
- Use appropriate isolation levels: Balance consistency with performance
- Implement connection pooling: Efficient resource utilization
Security Considerations
- Principle of least privilege: Grant minimal necessary permissions
- Encrypt sensitive data: At rest and in transit
- Audit access patterns: Monitor and log database access
- Validate inputs: Prevent SQL injection attacks
- Regular security updates: Keep database software current
Query Generation Patterns
SELECT with JOINs
-- INNER JOIN: only ma
よくある質問
既存のスキーマを確認しますか?
はい。正規化の問題、インデックスの不足、冗長なインデックスを見つけます。
マイグレーションの計画も立てられますか?
はい。ダウンタイムのないマイグレーションの計画を扱います。
図も描けますか?
はい。スキーマからエンティティ関連図を生成できます。
詳細
作者による元の説明
Use when designing a database schema, choosing SQL vs NoSQL, modeling relationships or planning a data migration, before writing DDL. Applies normalization, index strategy and a database selection decision tree.
人気
- GitHubのスター
- 29k
- ランキング
- #9581
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
agent-launcher-orchestrator
29kひとつの明確な目標から始めて、自分のアカウントでClaudeのマネージドエージェントを計画し、作成し、テストし、スケジュールするまでを段階的に支援します。
grade-iterate
29kマネージドエージェントの作業をルーブリックに照らして採点し、固定された回数だけ改善させることで、終わりなく繰り返さないようにします。
interview
29kAIエージェントのアイデアについてインタビューし、回答をもとに、何かを起動する前の構築計画にまとめます。
run-without-you
29kマネージドエージェントを、スケジュールまたはイベントの発生によってあなたがいなくても動くように設定します。起動の前にcronの時刻を確認します。
似ているスキル
discrawl
394k保存済みのローカルなDiscordメッセージのアーカイブを検索して要約し、その新しさを確認し、ダイレクトメッセージを読めるようエージェントを支援します。
clickhouse-io
280kエージェントがClickHouseデータベースのクエリとスキーマを最適化できるようにします。高性能な分析処理向けのベストプラクティスを適用します。分析クエリが遅すぎるときに使います。
scientific-db-pubmed-database
280kエージェントが生物医学分野の科学論文を検索するのに役立ちます。特定の医療情報が必要な研究に便利です。