Full pipeline for DB design. An agent team collaborates to perform data modeling, migration, indexing, query optimization, and security verification. Use this skill for any database design task including 'design a database', 'database modeling', 'table design', 'ERD', 'migration', 'query optimization', 'index design', 'SQL schema', 'PostgreSQL design', 'MySQL design', etc. Also supports optimization and security auditing for existing schemas. Note: actual DB server installation/operation, cloud infrastructure provisioning, and monitoring dashboard setup are outside the scope of this skill.
An agent team collaborates to perform data modeling, migration, indexing, query optimization, and security verification in a single pass.
Agent Team — 5 members communicate directly via SendMessage and cross-validate each other's work.
| Agent | File | Role | Type |
|---|---|---|---|
| data-modeler | .claude/agents/data-modeler.md | ERD, normalization, relationship design | general-purpose |
| migration-manager | .claude/agents/migration-manager.md | DDL, version control, rollback | general-purpose |
| performance-analyst | .claude/agents/performance-analyst.md | Indexing, query optimization | general-purpose |
| security-auditor | .claude/agents/security-auditor.md |
| Access control, encryption, auditing |
| general-purpose |
| integration-reviewer | .claude/agents/integration-reviewer.md | Alignment, operational readiness verification | general-purpose |
_workspace/ directory at the project root_workspace/00_input.md_workspace/ and skip the corresponding phase| Order | Task | Owner | Dependencies | Artifact |
|---|---|---|---|---|
| 1 | Data Modeling | data-modeler | None | _workspace/01_data_model.md |
| 2 | Migration Generation | migration-manager | Task 1 | _workspace/02_migration.sql, 02_migration_plan.md |
| 3a | Performance Optimization | performance-analyst | Tasks 1, 2 | _workspace/03_performance.md |
| 3b | Security Verification | security-auditor | Tasks 1, 2 | _workspace/04_security.md |
| 4 | Integration Review | integration-reviewer | Tasks 2, 3a, 3b | _workspace/05_review_report.md |
Tasks 3a (performance) and 3b (security) are executed in parallel.
Inter-team communication flow:
Organize the final artifacts based on the review report:
_workspace/| User Request Pattern | Execution Mode | Agents Deployed |
|---|---|---|
| "Design a database", "full design" | Full Pipeline | All 5 agents |
| "Just draw the ERD", "table design only" | Modeling Mode | data-modeler + integration-reviewer |
| "Optimize this schema" (existing SQL) | Optimization Mode | performance-analyst + integration-reviewer |
| "DB security audit" (existing DB) | Security Mode | security-auditor + integration-reviewer |
| "Review this schema" | Review Mode | integration-reviewer only |
Leveraging existing files: If the user provides schemas, ERDs, or other existing files, skip the corresponding steps.
| Strategy | Method | Purpose |
|---|---|---|
| File-based | _workspace/ directory | Store and share primary artifacts |
| Message-based | SendMessage | Real-time delivery of key information, revision requests |
| Task-based | TaskCreate/TaskUpdate | Progress tracking, dependency management |
File naming convention: {order}_{agent}_{artifact}.{extension}
| Error Type | Strategy |
|---|---|
| DBMS not specified | Default to PostgreSQL; add compatibility notes for other DBMSs |
| Insufficient domain information | Data modeler starts with common patterns; document assumptions |
| Agent failure | Retry once -> If still fails, proceed without that artifact; note the omission in the review report |
| 🔴 found during review | Request revision from the relevant agent -> rework -> re-verify (up to 2 rounds) |
| Existing schema parsing failure | Manually analyze and reconstruct the data model |
Prompt: "Design a PostgreSQL database for an e-commerce platform. I need user, product, order, payment, and review tables. Expecting 100K orders per day" Expected Result:
Prompt: "Optimize the performance of this SQL schema" + SQL file Expected Result:
_workspace/02_migration.sqlPrompt: "Design a database, blog platform" Expected Result:
Extension skills that enhance each agent's domain expertise:
| Skill | Target Agent | Role |
|---|---|---|
normalization-patterns | data-modeler | 1NF-BCNF identification, denormalization strategies, domain-specific ERD templates |
query-optimization-catalog | performance-analyst | Index strategies, EXPLAIN analysis, N+1 resolution, partitioning |