Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

database-architect数据库架构师

Agent Skill

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

总安装

349

周安装

14

GitHub Stars

2

下载量

113
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/wyattowalsh/agents --skill database-architect

简介

用于辅助数据库表结构、查询语句和迁移脚本编写。

  • 适合分析 schema、排查查询问题或生成索引建议。
  • 使用时需明确数据库类型、连接环境和目标表,区分只读与写入操作。
  • 安装命令:npx skills add https://github.com/wyattowalsh/agents --skill database-architect。
  • 涉及删除、更新或迁移时应优先 dry-run 或事务保护,避免误操作。

SKILL.md

Database Architect

Schema design, migration planning, query optimization, and zero-downtime schema evolution.

Scope: Database architecture decisions only. NOT for DBA operations, backup management, deployment strategies (use devops-engineer), or vector DB patterns (use data-wizard).

Dispatch

$ARGUMENTSMode
design <requirements>Design: generate schema DDL from requirements
migrate <description>Migrate: migration SQL with rollback plan
review <schema or migration path>Review: audit existing schema or migration files
optimize <query or table>Optimize: index and query optimization
evolveEvolve: codebase-wide schema evolution analysis
EmptyShow mode menu with examples

Canonical Vocabulary

TermDefinition
schemaComplete DDL definition: tables, columns, constraints, indexes
migrationA versioned, reversible schema change with up/down operations
zero-downtimeSchema change that requires no application downtime (expand-contract)
expand-contractTwo-phase migration: expand (add new), contract (remove old)
normalization level1NF through 5NF classification of table structure
index coveragePercentage of query patterns served by existing indexes
data loss riskWhether a migration operation can destroy existing data
backwards compatibleMigration that works with both old and new application code
hot pathQuery pattern executed at high frequency requiring optimization
covering indexIndex containing all columns needed to satisfy a query
partial indexIndex with a WHERE clause filtering indexed rows
cardinalityNumber of distinct values in a column relative to total rows

Mode 1: Design

Generate schema DDL from natural language requirements.

Design Step 1: Gather Requirements

Parse requirements from $ARGUMENTS. Identify:

  • Entities and their relationships (1:1, 1:N, M:N)
  • Required constraints (unique, not null, check, foreign key)
  • Expected query patterns and access paths
  • Target database engine (default: PostgreSQL)

Design Step 2: Analyze Schema

Run schema analyzer for structural validation:

uv run python skills/database-architect/scripts/schema-analyzer.py --ddl <path_or_stdin>

Use for iterating on the design. Parse JSON output for normalization level and structural issues.

Design Step 3: Generate DDL

Produce complete DDL with:

  • Table definitions with appropriate types and constraints
  • Indexes for declared query patterns
  • Foreign key relationships with appropriate ON DELETE/UPDATE actions
  • Comments on non-obvious design decisions

Read references/normalization-guide.md for normalization/denormalization decision rules. Read references/db-idioms.md for engine-specific type and syntax choices.

Design Step 4: Present

Output the DDL with a summary table:

TableColumnsIndexesForeign KeysNormalization

Include rationale for denormalization decisions (if any).

Mode 2: Migrate

Generate migration SQL with rollback plan and zero-downtime strategy.

Migrate Step 1: Understand the Change

Parse migration description from $ARGUMENTS. Classify each operation:

uv run python skills/database-architect/scripts/migration-validator.py --path <migration_dir>

Read references/migration-patterns.md for zero-downtime strategies per operation type.

Migrate Step 2: Generate Migration

For each operation, produce:

  • Up migration: forward SQL
  • Down migration: rollback SQL
  • Zero-downtime strategy: if the operation is not backwards-compatible
  • Data loss risk: flag destructive operations explicitly

Use expand-contract pattern for:

  • Column renames (add new, copy, drop old)
  • Column type changes (add new, backfill, drop old)
  • NOT NULL additions (add with default, backfill, add constraint)
  • Table renames (create new, migrate references, drop old)

Migrate Step 3: Validate

Run migration validator on generated SQL:

uv run python skills/database-architect/scripts/migration-validator.py --sql <path>

Flag any operations with data_loss_risk: true or reversible: false.

Migrate Step 4: Present

Output migration with sections: Up, Down, Zero-Downtime Notes, Risk Assessment.

Mode 3: Review

Audit existing schema or migration files for quality and safety.

Review Step 1: Read Target

Read the schema or migration files at the path in $ARGUMENTS.

Review Step 2: Analyze

Run schema analyzer:

uv run python skills/database-architect/scripts/schema-analyzer.py --ddl <path>

Check against:

  • Normalization issues (references/normalization-guide.md)
  • Missing indexes for common query patterns
  • Constraint completeness (foreign keys, NOT NULL, defaults)
  • Naming convention consistency
  • Engine-specific anti-patterns (references/db-idioms.md)

For migration files, also run:

uv run python skills/database-architect/scripts/migration-validator.py --path <dir>

Check against:

  • Reversibility of each operation
  • Data loss risk
  • Zero-downtime compatibility
  • Migration ordering and dependencies

Review Step 3: Present Findings

Group findings by severity:

  • Critical: data loss risk, missing constraints on foreign keys, irreversible migrations without rollback
  • Warning: missing indexes, denormalization without justification, suboptimal types
  • Info: naming inconsistencies, missing comments, style suggestions

Mode 4: Optimize

Index and query optimization recommendations.

Optimize Step 1: Gather Context

Read the query or table definition from $ARGUMENTS. Identify:

  • Current indexes on involved tables
  • Query execution pattern (point lookup, range scan, join, aggregation)
  • Data volume estimates if available

Optimize Step 2: Analyze

Run index recommender:

uv run python skills/database-architect/scripts/index-recommender.py --schema <path> --queries <path_or_stdin>

Read references/query-optimization.md for optimization patterns. Read references/db-idioms.md for engine-specific index capabilities.

Optimize Step 3: Present Recommendations

For each recommendation:

  • Table: affected table
  • Recommended index: column list and type
  • Rationale: which query pattern this serves
  • Trade-off: write overhead and storage cost
  • Estimated impact: qualitative (high/medium/low)

Mode 5: Evolve

Codebase-wide schema evolution analysis.

Evolve Step 1: Discover

Scan the codebase for:

  • Schema definition files (SQL, ORM models, migration directories)
  • Query patterns (raw SQL, ORM queries, query builders)
  • Migration history and ordering

Use Grep and Glob to find schema-related files.

Evolve Step 2: Analyze Evolution

Assess:

  • Schema drift between ORM models and actual migrations
  • Unused tables/columns (defined but never queried)
  • Migration health (reversibility, ordering, gaps)
  • Index coverage across query patterns
  • Normalization consistency

Evolve Step 3: Present Report

Output an evolution report with:

  • Schema health score (tables, indexes, constraints coverage)
  • Migration timeline summary
  • Top recommendations ranked by impact
  • Render dashboard for visual overview: Copy templates/dashboard.html to a temporary file, inject analysis JSON into the data script tag, open in browser.

Reference Files

Load ONE reference at a time. Do not preload all references.

FileContentRead When
references/migration-patterns.mdZero-downtime strategies, expand-contract, operation safetyMigrate mode
references/normalization-guide.mdNormalization levels, denormalization decision rulesDesign mode, Review mode
references/db-idioms.mdPostgreSQL, MySQL, SQLite, MongoDB type idioms and featuresDesign mode, Optimize mode
references/query-optimization.mdIndex strategies, query rewriting, explain plan interpretationOptimize mode
references/zero-downtime-checklist.mdPre-migration checklist, deployment coordinationMigrate mode
ScriptWhen to Run
scripts/schema-analyzer.pyDesign (validation), Review (analysis)
scripts/migration-validator.pyMigrate (validation), Review (migration audit)
scripts/index-recommender.pyOptimize (recommendations)
TemplateWhen to Render
templates/dashboard.htmlEvolve mode — inject schema analysis JSON

Critical Rules

  1. Every migration must have a rollback plan — no irreversible changes without explicit user acknowledgment
  2. Never recommend dropping columns/tables without confirming data preservation strategy
  3. Always flag data loss risk explicitly — silent destructive operations are unacceptable
  4. Zero-downtime means schema-level compatibility, NOT deployment coordination (that is devops-engineer)
  5. Default to PostgreSQL when no engine is specified — state the assumption
  6. Every index recommendation must include write overhead trade-off
  7. Do not generate ORM code — output raw DDL/SQL only
  8. Normalization decisions must cite the specific normal form and violation
  9. Run schema-analyzer.py or migration-validator.py before presenting results — do not rely on LLM analysis alone
  10. Never copy honest-review's wave pipeline, confidence scoring, or team structure — this is a generator skill
  11. Always present before executing — approval gate before any schema modification
  12. Migration naming must follow NNNN_description convention (sequential, descriptive)

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Claude

31.6%
按下载量换算36

Codex

31.1%
按下载量换算35

Cursor

17.45%
按下载量换算20

Gemini CLI

10.1%
按下载量换算11

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

来源信息

继续浏览同类 Skills