Token导航 LogoToken导航

Agent Skill · AI 工具

database-schema-designer(数据库模式设计器)

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

database-schema-designer 是AI 工具类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描有提醒项,按安装量在AI 工具类的 2,536 个 Skill 里排第 2,236。

总安装 272周安装 11GitHub Stars 161下载 85核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/yonatangross/orchestkit --skill database-schema-designer

这个 Skill 是做什么的

AI 工具类 Skill 用来扩展助手本身的能力,例如接模型、接检索、接外部服务。

用于辅助数据库表结构、查询语句和迁移脚本处理,适合数据维护场景。可分析 schema、编写 SQL、排查查询问题或生成迁移建议,支持多宿主环境。需明确数据库类型、连接环境和目标表,区分只读分析与写入变更。涉及删除、更新、迁移和批量导入时,应优先 dry-run、备份或事务保护。

database-schema-designer 属于AI 工具类 Skill,可作为该场景下的辅助能力补充。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

database-schema-designer 怎么安装?

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

database-schema-designer 支持哪些 AI 工具?

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

database-schema-designer 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

database-schema-designer 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

database-schema-designer 用的人多吗?

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

database-schema-designer 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 标注为只读权限,试用阶段不容易误改本地文件。

先想清楚的地方

  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理AI 工具类任务、又不想每次都手写提示词的人。
  • 只想先试试效果、不希望它改动本地文件的人。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

AI 工具类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
executing-plans

执行计划 · Codex、Claude

1,515,336173,110只读MIT通过
verification-before-completion

完成前的验证 · Codex、Claude

1,319,472173,121权限未标注MIT通过
subagent-driven-development

子 Agent 驱动开发 · Codex、Claude

1,312,416173,138只读MIT通过
copy-editing

复制编辑 · Codex、Claude

1,209,57625,632只读MIT通过
paywall-upgrade-cro

付费专区升级 cro · Codex、Claude

1,030,17625,617只读MIT通过
database-schema-designer

数据库模式设计器 · 本页

272161只读MIT有提醒

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

SKILL.md 原文

Database Schema Designer

This skill provides comprehensive guidance for designing robust, scalable database schemas for both SQL and NoSQL databases. Whether building from scratch or evolving existing schemas, this framework ensures data integrity, performance, and maintainability.

Overview

  • Designing new database schemas
  • Refactoring or migrating existing schemas
  • Optimizing database performance
  • Choosing between SQL and NoSQL approaches
  • Creating database migrations
  • Establishing indexing strategies
  • Modeling complex relationships
  • Planning data archival and partitioning

Database Design Philosophy

Core Principles

1. Model the Domain, Not the UI

  • Schema reflects business entities and relationships
  • Don't let UI requirements drive data structure
  • Separate presentation concerns from data model

2. Optimize for Reads or Writes (Not Both)

  • OLTP (transactional): Normalized, optimized for writes
  • OLAP (analytical): Denormalized, optimized for reads
  • Choose based on access patterns

3. Plan for Scale From Day One

  • Indexing strategy
  • Partitioning approach
  • Caching layer
  • Read replicas

4. Data Integrity Over Performance

  • Use constraints, foreign keys, validation
  • Performance issues can be optimized later
  • Data corruption is costly to fix

SQL Database Design

Normalization

Database normalization reduces redundancy and ensures data integrity.

1st Normal Form (1NF)

Rule: Each column contains atomic (indivisible) values, no repeating groups.

-- ❌ Violates 1NF (multiple values in one column)
CREATE TABLE orders (
  id INT PRIMARY KEY,
  customer_id INT,
  product_ids VARCHAR(255)  -- '101,102,103' (bad!)
);

-- ✅ Follows 1NF
CREATE TABLE orders (
  id INT PRIMARY KEY,
  customer_id INT
);

CREATE TABLE order_items (
  id INT PRIMARY KEY,
  order_id INT,
  product_id INT,
  FOREIGN KEY (order_id) REFERENCES orders(id)
);
2nd Normal Form (2NF)

Rule: Must be in 1NF + all non-key columns depend on the entire primary key.

3rd Normal Form (3NF)

Rule: Must be in 2NF + no transitive dependencies (non-key columns depend only on primary key).


Indexing Strategies

Indexes speed up reads but slow down writes. Use strategically.

When to Create Indexes
-- ✅ Index foreign keys
CREATE INDEX idx_orders_customer_id ON orders(customer_id);

-- ✅ Index frequently queried columns
CREATE INDEX idx_users_email ON users(email);

-- ✅ Index columns used in WHERE, ORDER BY, GROUP BY
CREATE INDEX idx_orders_created_at ON orders(created_at);

-- ✅ Composite index for multi-column queries
CREATE INDEX idx_orders_customer_status ON orders(customer_id, status);
Composite Indexes (Column Order Matters)
-- ✅ Good: Index supports both queries
CREATE INDEX idx_orders_customer_status ON orders(customer_id, status);

-- Query 1: Uses index efficiently
SELECT * FROM orders WHERE customer_id = 123 AND status = 'pending';

-- Query 2: Uses index (customer_id only)
SELECT * FROM orders WHERE customer_id = 123;

-- ❌ Query 3: Doesn't use index (status is second column)
SELECT * FROM orders WHERE status = 'pending';

Rule of Thumb: Put most selective column first, or most frequently queried alone.


Constraints

Use constraints to enforce data integrity at the database level.

CREATE TABLE products (
  id INT PRIMARY KEY,
  price DECIMAL(10, 2) CHECK (price >= 0),
  stock INT CHECK (stock >= 0),
  discount_percent INT CHECK (discount_percent BETWEEN 0 AND 100)
);

Database Migrations

Migration Best Practices

1. Always Reversible

-- Up migration
ALTER TABLE users ADD COLUMN phone VARCHAR(20);

-- Down migration
ALTER TABLE users DROP COLUMN phone;

2. Backward Compatible

-- ✅ Good: Add nullable column
ALTER TABLE users ADD COLUMN middle_name VARCHAR(50);

-- ❌ Bad: Add required column (breaks existing code)
ALTER TABLE users ADD COLUMN middle_name VARCHAR(50) NOT NULL;

3. Data Migrations Separate from Schema Changes

-- Migration 1: Schema change
ALTER TABLE orders ADD COLUMN status VARCHAR(20) DEFAULT 'pending';

-- Migration 2: Data migration
UPDATE orders SET status = 'completed' WHERE completed_at IS NOT NULL;

Quick Start Checklist

When designing a new schema:

  • Identify entities and relationships
  • Choose SQL or NoSQL based on requirements
  • Normalize to 3NF (SQL) or decide embed/reference (NoSQL)
  • Define primary keys (INT auto-increment or UUID)
  • Add foreign key constraints
  • Choose appropriate data types
  • Add unique constraints where needed
  • Plan indexing strategy (foreign keys, WHERE columns)
  • Add NOT NULL constraints for required fields
  • Create CHECK constraints for validation
  • Plan for soft deletes (deleted_at column) if needed
  • Add timestamps (created_at, updated_at)
  • Design migration scripts (up and down)
  • Test migrations on staging

Related Skills

  • alembic-migrations - Alembic-specific migration patterns for SQLAlchemy projects
  • zero-downtime-migration - Safe schema changes without service interruption
  • database-versioning - Version control strategies for database objects
  • caching-strategies - Cache layer design to complement database performance

Key Decisions

DecisionChoiceRationale
Normalization target3NF for OLTPReduces redundancy while maintaining query performance
Primary key strategyINT auto-increment or UUIDUUIDs for distributed systems, INT for single-database
Soft deletesdeleted_at timestamp columnPreserves audit trail, enables recovery, supports compliance
Composite index orderMost selective column firstOptimizes index usage for common query patterns

Skill Version: 2.0.0 Last Updated: 2026-01-08 Maintained by: AI Agent Hub Team

Capability Details

schema-design

Keywords: schema, table, entity, relationship, erd Solves:

  • Design database schema
  • Model relationships
  • ERD creation

normalization

Keywords: normalize, 1nf, 2nf, 3nf, denormalize Solves:

  • Normalization levels
  • When to denormalize
  • Reduce redundancy

indexing

Keywords: index, b-tree, composite, query performance Solves:

  • Which columns to index
  • Optimize slow queries
  • Index types

migrations

Keywords: migration, alter table, zero downtime, backward compatible Solves:

  • Write safe migrations
  • Zero-downtime changes
  • Reversible migrations

平台分布

Claude Code

27.24%
按下载量换算23

OpenCode

23.66%
按下载量换算20

Gemini CLI

15.22%
按下载量换算13

Antigravity

10.84%
按下载量换算9

windsurf

8.28%
按下载量换算7

Codex

2.97%
按下载量换算3

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。

继续浏览同类 Skills