Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计通过

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

Agent Skill

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

总安装

2,691

周安装

111

GitHub Stars

103

下载量

879
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/onewave-ai/claude-skills --skill database-schema-designer

简介

数据库模式设计器技能辅助表结构、查询语句和迁移脚本编写。

  • 适合分析 schema、编写 SQL、排查查询问题和生成索引建议。
  • 使用时需明确数据库类型、连接环境和目标表结构。
  • 涉及删除、更新或迁移操作时应优先 dry-run 或事务保护。
  • database-schema-designer 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Database Schema Designer

Design optimized, scalable database schemas with proper relationships and indexes.

Instructions

When a user needs database schema design:

  1. Gather Requirements:

- What type of database (PostgreSQL, MySQL, MongoDB, etc.)? - What is the application domain? - What are the main entities/resources? - What queries will be most common? - Expected data volume and growth? - Performance requirements? - Specific constraints or compliance needs?

  1. Design Schema Following Best Practices: For SQL Databases: For NoSQL Databases:

- Identify entities and their attributes - Define primary keys (prefer UUIDs for distributed systems) - Establish relationships (1:1, 1:N, N:M) - Normalize to 3NF (unless denormalization needed for performance) - Add appropriate indexes - Define foreign key constraints - Include timestamps (created_at, updated_at) - Add soft delete flags if needed - Plan for data archival - Design for access patterns (query-first approach) - Embed vs reference decision - Plan for denormalization - Design indexes for common queries - Consider document size limits - Plan for eventual consistency

  1. Generate Complete Schema: SQL Schema Output: -- [Entity Name] Table -- Purpose: [Description] CREATE TABLE [table_name] (id UUID PRIMARY KEY DEFAULT gen_random_uuid(), [field_name] [TYPE] [CONSTRAINTS], created_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW(), deleted_at TIMESTAMP); -- Indexes CREATE INDEX idx_[table]_[field] ON [table]([field]); CREATE INDEX idx_[table]_[field1]_[field2] ON [table]([field1], [field2]); -- Foreign Keys ALTER TABLE [child_table] ADD CONSTRAINT fk_[constraint_name] FOREIGN KEY ([foreign_key_field]) REFERENCES [parent_table](id) ON DELETE CASCADE; NoSQL Schema Output (MongoDB example): // [Collection Name] // Purpose: [Description] {_id: ObjectId, [field_name]: [type], // Embedded document [embedded_object]: {field1: type, field2: type}, // Reference [related_id]: ObjectId, // Ref to [other_collection] created_at: ISODate, updated_at: ISODate} // Indexes db.[collection].createIndex({field: 1}) db.[collection].createIndex({field1: 1, field2: -1}) db.[collection].createIndex({field: "text"}) // Text search
  2. Create Entity Relationship Diagram (text format): ┌─────────────────────┐ │ users │ ├─────────────────────┤ │ id (PK) │ │ email (UNIQUE) │ │ name │ │ created_at │ └──────────┬──────────┘ │ │ 1:N │ ┌──────────▼──────────┐ │ posts │ ├─────────────────────┤ │ id (PK) │ │ user_id (FK) │ │ title │ │ content │ │ created_at │ └──────────┬──────────┘ │ │ N:M (via post_tags) │ ┌──────────▼──────────┐ │ tags │ ├─────────────────────┤ │ id (PK) │ │ name (UNIQUE) │ └─────────────────────┘
  3. Provide Migration Scripts: -- Migration: create_users_table -- Date: 2024-01-15 BEGIN; CREATE TABLE users (id UUID PRIMARY KEY DEFAULT gen_random_uuid(), email VARCHAR(255) NOT NULL UNIQUE, name VARCHAR(255) NOT NULL, password_hash VARCHAR(255) NOT NULL, created_at TIMESTAMP NOT NULL DEFAULT NOW(), updated_at TIMESTAMP NOT NULL DEFAULT NOW()); CREATE INDEX idx_users_email ON users(email); CREATE INDEX idx_users_created_at ON users(created_at); COMMIT; -- Rollback BEGIN; DROP TABLE users; COMMIT;
  4. Format Complete Output: 🗄️ DATABASE SCHEMA DESIGN Database: [PostgreSQL/MySQL/MongoDB/etc.] Domain: [Application type] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📋 ENTITY RELATIONSHIP DIAGRAM ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [ASCII ERD] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 📊 TABLE DEFINITIONS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [SQL CREATE TABLE statements] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔗 RELATIONSHIPS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [Foreign key constraints] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ⚡ INDEXES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [Index definitions with rationale] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 🔄 MIGRATION SCRIPTS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ [Up and down migrations] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 💡 OPTIMIZATION NOTES ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Performance Considerations: • [Index strategy] • [Partitioning recommendations] • [Denormalization opportunities] Scaling Strategy: • [Sharding approach] • [Read replicas] • [Caching layer] Data Integrity: • [Constraint strategy] • [Validation rules] • [Audit logging]
  5. Schema Design Best Practices: Naming Conventions: Data Types: Indexes: Relationships: Performance:

- Use snake_case for table and column names - Pluralize table names (users, posts) - Use descriptive foreign key names (user_id, not uid) - Prefix indexes (idx_table_column) - Prefix constraints (fk_, uk_, ck_) - Use appropriate types (INT vs BIGINT, VARCHAR vs TEXT) - Consider storage size - Use ENUM for fixed sets of values - Use JSON/JSONB for flexible attributes - Use proper date/time types (TIMESTAMP vs DATETIME) - Index foreign keys - Index columns in WHERE clauses - Composite indexes for multi-column queries - Consider covering indexes - Monitor index usage and remove unused ones - Always use foreign keys in relational DBs - Cascade deletes where appropriate - Consider soft deletes for audit trails - Use junction tables for many-to-many - Denormalize for read-heavy workloads - Partition large tables - Use materialized views for complex queries - Consider read replicas - Plan for archival of old data

Example Triggers

  • "Design a database schema for an e-commerce platform"
  • "Create SQL tables for a blog system"
  • "Help me design a MongoDB schema for a social network"
  • "Optimize this database schema for performance"
  • "Generate migration scripts for my schema"

Output Quality

Ensure schemas:

  • Follow normalization principles (unless deliberately denormalized)
  • Include all necessary constraints
  • Have appropriate indexes
  • Use proper data types
  • Include timestamps
  • Have clear relationships
  • Consider scalability
  • Include migration scripts
  • Follow naming conventions
  • Are documented with comments
  • Consider performance implications
  • Include rollback capability

Generate production-ready, optimized database schemas that scale.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

26.13%
按下载量换算230

windsurf

23.47%
按下载量换算206

Cursor

17.16%
按下载量换算151

Antigravity

12.19%
按下载量换算107

OpenCode

7.86%
按下载量换算69

Gemini CLI

3.25%
按下载量换算29

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

来源信息

继续浏览同类 Skills