跳到正文
cccskills
免费在 GitHub 公开

database-designer

Database design with schema analysis, index optimization, and migration generation for PostgreSQL, MySQL, MongoDB, and DynamoDB. Use when designing schemas, optimizing queries, planning migrations, or analyzing database performance.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(16)

  • SKILL.md6.4 KB
  • assets/sample_query_patterns.json9.0 KB
  • assets/sample_schema.json9.1 KB
  • assets/sample_schema.sql8.1 KB
  • expected_outputs/index_optimization_sample.txt2.6 KB
  • expected_outputs/migration_sample.txt4.4 KB
  • expected_outputs/schema_analysis_sample.txt7.3 KB
  • index_optimizer.py38.0 KB
  • migration_generator.py49.2 KB
  • README.md11.7 KB
  • references/database_selection_decision_tree.md16.0 KB
  • references/index_strategy_patterns.md11.6 KB
  • references/normalization_guide.md10.4 KB
  • references/patterns-and-troubleshooting.md3.9 KB
  • references/workflows-and-tools.md7.2 KB
  • schema_analyzer.py41.0 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Database Designer

The agent analyzes SQL schemas for normalization compliance, recommends optimal indexes based on query patterns, and generates safe migration scripts with rollback procedures. It produces Mermaid ERDs, detects redundant indexes, and implements zero-downtime expand-contract migration patterns for PostgreSQL and MySQL.

Core Capabilities

  • Schema analysis — detect normalization violations (1NF-BCNF), missing constraints, naming issues, and data-type problems from DDL or JSON.
  • ERD generation — produce valid Mermaid entity-relationship diagrams from declared relationships.
  • Index optimization — recommend indexes from query patterns, order composite columns by selectivity, detect redundant/overlapping indexes, and find covering-index opportunities.
  • Migration generation — forward + rollback SQL between schema versions, with validation queries.
  • Zero-downtime migrations — expand-contract pattern with safe backfill for tables with 10M+ rows.
  • Database selection guidance — match workload requirements to PostgreSQL, MySQL, MongoDB, or DynamoDB.

When to Use

  • Designing or reviewing a new schema for normalization and constraints.
  • Optimizing queries by recommending or pruning indexes.
  • Planning a safe (optionally zero-downtime) migration between schema versions.
  • Analyzing database performance and relationship structure (ERD).
  • Choosing the right database technology for a workload.

Clarify First

Before designing or migrating, confirm these inputs. If any is unknown or vague, ASK — do not assume:

  • Task — schema analysis/ERD, index optimization, or migration generation (selects schema_analyzer.py vs index_optimizer.py vs migration_generator.py)
  • Engine — PostgreSQL, MySQL, MongoDB, or DynamoDB (drives the DDL dialect and selection guidance)
  • Schema input & query patterns — the DDL/JSON schema and the queries to optimize for (the input the tools analyze; index recommendations depend on the query patterns)

Stop rule: ask only the 2-3 that most change the output. If the user says "just draft it," proceed and list your assumptions at the top of the artifact.

References

Load the reference that matches the task — keep this file lean and pull detail on demand:

  • references/workflows-and-tools.md — the Quick Start, three core workflows (analyze/optimize, safe migration, index optimization), and the full CLI reference (flags, usage, output formats) for schema_analyzer.py, index_optimizer.py, and migration_generator.py. Read when running the tools end-to-end.
  • references/patterns-and-troubleshooting.md — index-type selection table, anti-patterns, the troubleshooting table for tool output, and the success-criteria quality bar. Read when picking an index type, avoiding mistakes, debugging output, or checking your work.
  • references/database_selection_decision_tree.md — systematic database-technology selection based on requirements, data patterns, and operational constraints. Read when choosing between SQL and NoSQL engines.
  • references/index_strategy_patterns.md — proven patterns for index design, optimization strategies, and pitfalls to avoid. Read when designing an indexing strategy in depth.
  • references/normalization_guide.md — normal forms (1NF-BCNF), decomposition to eliminate anomalies, and integrity trade-offs. Read when normalizing or deliberately denormalizing a schema.

Scope & Limitations

Covers:

  • Schema design analysis for SQL databases (PostgreSQL, MySQL) including normalization, constraints, naming, and data types
  • Index optimization with selectivity estimation, composite index ordering, covering indexes, and redundancy detection
  • Migration generation with forward/rollback scripts, zero-downtime patterns, and validation queries
  • ERD generation in Mermaid format from DDL or JSON schema definitions

Does NOT cover:

  • Runtime query performance monitoring or live database profiling (see performance-profiler skill)
  • NoSQL-specific schema design for MongoDB, DynamoDB, or Cassandra (conceptual guidance only in the reference sections)
  • Database administration tasks such as backup/restore, replication setup, or user/role management
  • Application-level ORM configuration, connection pool tuning, or driver-specific optimizations (see database-schema-designer for ORM-adjacent patterns)

Integration Points

SkillIntegrationData Flow
migration-architectMigration strategy and execution planning for large-scale schema changesDatabase Designer generates migration SQL; Migration Architect orchestrates multi-service deployment order and rollback coordination
database-schema-designerComplementary schema design with focus on application-layer patternsDatabase Designer provides normalization analysis; Schema Designer applies ORM mapping and application modeling conventions
performance-profilerRuntime validation of index and schema optimization recommendationsDatabase Designer outputs recommended indexes; Performance Profiler measures actual query plan improvements via EXPLAIN ANALYZE
api-design-reviewerAlignment between database schema and API resource contractsDatabase Designer defines table structures; API Design Reviewer validates that endpoint schemas match underlying data models
ci-cd-pipeline-builderAutomated migration execution in deployment pipelinesDatabase Designer generates migration scripts; CI/CD Pipeline Builder integrates them into deployment stages with validation gates
observability-designerDatabase performance monitoring and alerting post-optimizationDatabase Designer identifies query patterns; Observability Designer configures slow query alerts and index usage dashboards

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

This skill should be used when the user asks to "check accessibility", "audit WCAG compliance", "scan HTML for a11y issues", "check color contrast", or "find accessibility violations in web pages".

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9542026年10月7日 更新

Design and analyze A/B tests: sample size, test duration, and statistical significance for conversion experiments. Use when setting up an A/B test, calculating sample size, designing an experiment, or analyzing results.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9542026年10月7日 更新

Design and run statistically rigorous A/B tests and experiments. Use when planning experiments, calculating sample sizes, designing test variants, selecting metrics, analyzing results, or when someone says "let's test that."

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9542026年10月7日 更新

Sales execution across pipeline, discovery, demos, negotiation, and closing. Use when qualifying opportunities, running MEDDIC discovery, building account plans, handling objections, structuring proposals, or forecasting pipeline.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9542026年10月7日 更新

Design ad creative across Google, Meta, LinkedIn, Twitter/X, and TikTok with platform format specs, headline formulas, and A/B testing. Use when writing ad copy, generating headline variations, creating ad sets, or validating creative.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9542026年10月7日 更新

aeo

免费

Answer Engine Optimization (AEO): optimize content to be cited by LLMs (ChatGPT, Claude, Perplexity, Gemini) in their answers. Use when designing content for LLM citation, auditing citability, or structuring Q&A schema.

中文简介正在准备中。当前显示原文说明。

borghei/Claude-Skills9542026年10月7日 更新

查看 borghei 的全部技能

报告此技能的问题