Token导航 LogoToken导航

Agent Skill · 研究检索

database-designer(数据库设计师)

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

database-designer 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 33,239。

总安装 2,396周安装 96GitHub Stars 103下载 776核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/borghei/claude-skills --skill database-designer

这个 Skill 是做什么的

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

database-designer 用于数据库 schema 规范化检查、索引优化与安全迁移脚本生成。适合在 Codex、Claude、Cursor、Gemini CLI 中分析冗余索引、生成 Mermaid ERD 与 dry-run 变更。支持 PostgreSQL/MySQL 的零停机扩缩容模式与回滚保护机制。

安装命令:npx skills add https://github.com/borghei/claude-skills --skill database-designer。使用前需明确数据库类型与环境,区分只读分析与写入变更操作。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

database-designer 怎么安装?

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

database-designer 支持哪些 AI 工具?

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

database-designer 需要什么权限?

权限级别是需要联网。该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

database-designer 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

database-designer 用的人多吗?

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

database-designer 安全吗?

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

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 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调用外部服务未明确有提醒
database-designer

数据库设计师 · 本页

2,396103需要联网未明确通过

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

SKILL.md 原文

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.

Quick Start

# Analyze a schema for normalization issues and generate ERD
python schema_analyzer.py --input schema.sql --generate-erd --output-format json

# Recommend indexes based on query patterns
python index_optimizer.py --schema schema.json --queries queries.json --analyze-existing

# Generate migration scripts between schema versions
python migration_generator.py --current current.json --target target.json --zero-downtime

Core Workflows

Workflow 1: Analyze and Optimize a Schema

  1. Provide DDL (SQL) or JSON schema definition
  2. Run schema_analyzer.py to detect normalization violations (1NF-BCNF), missing constraints, and naming issues
  3. Review generated Mermaid ERD for relationship visualization
  4. Run index_optimizer.py with query patterns to get index recommendations
  5. Validation checkpoint: All 1NF-3NF violations addressed; foreign keys declared; no redundant indexes
python schema_analyzer.py -i schema.sql -f json -e -o report.json
python index_optimizer.py -s schema.json -q queries.json -e -p 2 -o index_report.json

Workflow 2: Generate a Safe Migration

  1. Export current and target schemas as JSON
  2. Run migration_generator.py to produce forward and rollback SQL
  3. For large tables (10M+ rows), add --zero-downtime for expand-contract pattern
  4. Review validation queries that confirm migration success
  5. Validation checkpoint: Every forward step has a rollback counterpart; validation queries pass on test data
python migration_generator.py -c current.json -t target.json -z --include-validations -f json -o plan.json

Workflow 3: Index Optimization for Query Patterns

  1. Document top 10 query patterns as JSON (WHERE clauses, JOINs, ORDER BY)
  2. Run index_optimizer.py with --analyze-existing to find redundancies
  3. Review composite index column ordering (most selective first)
  4. Check for covering index opportunities
  5. Validation checkpoint: Query patterns covered; no overlapping indexes; estimated 40%+ query time reduction

Index Type Selection

Index TypeBest ForExample
B-treeRange queries, sorting, equalityCREATE INDEX idx ON tasks (status, created_date)
PartialSubset queries on hot dataCREATE INDEX idx ON users (email) WHERE status = 'active'
CoveringAvoiding table lookupsCREATE INDEX idx ON users (email) INCLUDE (name, status)
HashExact match onlyPrimary keys, cache keys
GINJSONB, array, full-textCREATE INDEX idx ON docs USING GIN (data)

Anti-Patterns

  • Over-indexing -- every column indexed wastes write performance and storage; index only columns appearing in WHERE, JOIN, and ORDER BY
  • Missing foreign keys -- relying on application-layer referential integrity leads to orphaned records; always declare FK constraints
  • VARCHAR(255) everywhere -- oversized columns waste memory in indexes; right-size columns based on actual data
  • Premature denormalization -- denormalize only when EXPLAIN ANALYZE shows join-related bottlenecks, not preemptively
  • Direct ALTER on large tables -- ALTER TABLE... SET NOT NULL on a 100M-row table locks the table; use expand-contract pattern
  • No validation queries in migrations -- migrations without post-step validation risk silent data corruption

Troubleshooting

ProblemCauseSolution
Schema analyzer reports false 1NF violationsJSON or array columns detected as multi-valued fieldsReview flagged columns; intentional JSONB/array usage is valid for document-style storage patterns
Index optimizer recommends indexes on low-selectivity columnsBoolean or status columns appear in frequent WHERE clausesUse partial indexes (WHERE status = 'active') instead of full-column indexes to reduce overhead
Migration generator produces high-risk steps for column type changesDirect ALTER COLUMN... TYPE can lock tables and fail on incompatible dataUse the --zero-downtime flag to generate expand-contract migration patterns with safe backfill steps
ERD output missing relationshipsForeign key constraints not declared in DDL or JSON inputEnsure all FK relationships are explicitly defined; the analyzer only detects declared constraints
Composite index column order seems wrongOptimizer orders by estimated selectivity, not query clause orderVerify cardinality estimates in the schema JSON; provide cardinality_estimate per column for accurate ordering
Redundancy analysis flags covering indexes as overlappingOverlap ratio calculation uses Jaccard similarity on column setsReview flagged pairs manually; covering indexes with INCLUDE columns serve a different purpose than their subsets
Validation queries fail after migrationTarget schema JSON does not match actual post-migration stateRun --validate-only before and after migration; ensure the target JSON reflects all intended changes precisely

Success Criteria

  • Schema analysis detects 90%+ of normalization violations (1NF through BCNF) when provided complete DDL input
  • Index recommendations reduce query execution time by 40%+ for analyzed query patterns (measured via EXPLAIN ANALYZE before/after)
  • Migration scripts execute with zero data loss and include verified rollback for every forward step
  • ERD generation produces valid Mermaid diagrams that render correctly for schemas with up to 50 tables
  • Redundant index detection identifies 95%+ of duplicate and overlapping indexes with less than 5% false positive rate
  • Zero-downtime migrations maintain full application availability during schema changes on tables with 10M+ rows
  • Generated SQL statements are syntactically valid and compatible with PostgreSQL 14+ and MySQL 8.0+

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

Tool Reference

schema_analyzer.py

Purpose: Analyzes SQL DDL statements and JSON schema definitions for normalization compliance, missing constraints, data type issues, naming convention violations, and relationship mapping. Generates Mermaid ERD diagrams.

Usage:

python schema_analyzer.py --input schema.sql --output-format json
python schema_analyzer.py --input schema.json --output-format text
python schema_analyzer.py --input schema.sql --generate-erd --output analysis.json
python schema_analyzer.py --input schema.sql --erd-only

Flags/Parameters:

FlagShortRequiredDescription
--input-iYesInput file path (SQL DDL or JSON schema)
--output-oNoOutput file path (default: stdout)
--output-format-fNoOutput format: json or text (default: text)
--generate-erd-eNoInclude Mermaid ERD diagram in output
--erd-onlyNoOutput only the Mermaid ERD diagram

Example:

python schema_analyzer.py -i my_schema.sql -f json -e -o report.json

Output Formats:

  • text -- Human-readable report with normalization findings, constraint issues, data type recommendations, and naming violations
  • json -- Structured JSON with normalization_issues, constraint_issues, data_type_issues, naming_issues, relationships, and optional erd_diagram fields

index_optimizer.py

Purpose: Analyzes schema definitions and query patterns to recommend optimal indexes. Identifies missing indexes, detects redundant and overlapping indexes, suggests composite index column ordering, estimates selectivity, and generates CREATE INDEX statements.

Usage:

python index_optimizer.py --schema schema.json --queries queries.json --format text
python index_optimizer.py --schema schema.json --queries queries.json --output recommendations.json --format json
python index_optimizer.py --schema schema.json --queries queries.json --analyze-existing
python index_optimizer.py --schema schema.json --queries queries.json --min-priority 2

Flags/Parameters:

FlagShortRequiredDescription
--schema-sYesSchema definition JSON file
--queries-qYesQuery patterns JSON file
--output-oNoOutput file path (default: stdout)
--format-fNoOutput format: json or text (default: text)
--analyze-existing-eNoInclude analysis of existing indexes for redundancy
--min-priority-pNoMinimum priority level to include: 1=highest, 4=lowest (default: 4)

Example:

python index_optimizer.py -s schema.json -q queries.json -f json -e -p 2 -o index_report.json

Output Formats:

  • text -- Human-readable report with analysis summary, high-priority recommendations, redundancy issues, performance impact analysis, and CREATE INDEX statements
  • json -- Structured JSON with analysis_summary, index_recommendations (by priority), redundancy_analysis, size_estimates, sql_statements, and performance_impact fields

migration_generator.py

Purpose: Generates safe migration scripts between schema versions. Compares current and target schemas, produces ALTER TABLE statements, implements zero-downtime expand-contract patterns, creates rollback scripts, and generates validation queries.

Usage:

python migration_generator.py --current current.json --target target.json --format text
python migration_generator.py --current current.json --target target.json --output migration.sql --format sql
python migration_generator.py --current current.json --target target.json --zero-downtime --format json
python migration_generator.py --current current.json --target target.json --validate-only

Flags/Parameters:

FlagShortRequiredDescription
--current-cYesCurrent schema JSON file
--target-tYesTarget schema JSON file
--output-oNoOutput file path (default: stdout)
--format-fNoOutput format: json, text, or sql (default: text)
--zero-downtime-zNoGenerate zero-downtime migration using expand-contract pattern
--validate-only-vNoOnly generate validation queries, skip migration steps
--include-validationsNoInclude validation queries in migration output

Example:

python migration_generator.py -c current.json -t target.json -z --include-validations -f json -o migration_plan.json

Output Formats:

  • text -- Human-readable migration plan with ordered steps, forward SQL, rollback SQL, risk levels, and execution timeline
  • json -- Structured JSON with migration_id, steps (each with sql_forward, sql_rollback, validation_sql, risk_level, zero_downtime_phase), summary, execution_order, and rollback_order
  • sql -- Raw SQL output with forward migration statements, suitable for direct execution or piping into a database client

平台分布

Codex

33.76%
按下载量换算262

Claude

30.6%
按下载量换算237

Cursor

17.93%
按下载量换算139

Gemini CLI

9.55%
按下载量换算74

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills