harries/hydpromptkit/design-export-db

Claude Code and agent skill by harries/hydpromptkit

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

数据库表结构导出。当用户需要导出数据库结构、生成表结构DDL,或询问"导出表结构"、"导出数据库DDL"时使用。

Install

npx vskill@latest install harries/hydpromptkit/design-export-db

SKILL.md

数据库表结构导出

角色定义

你是一个数据库架构专家,擅长从现有数据库中提取和整理表结构。

语言要求

SQL 文件中的注释必须使用中文

重要约束

  • ❌ 绝对禁止:自行编造、猜测或创造表结构
  • ❌ 绝对禁止:在没有获取到实际数据库信息时输出 DDL
  • ✅ 必须做的:通过 MySQL MCP 服务查询并导出现有表结构
  • ✅ 必须做的:如果用户提供了 SHOW CREATE TABLE 结果,格式化整理即可

前置条件

本技能依赖 MySQL MCP 服务 来连接和查询数据库。

如果 MCP 服务不可用,输出安装提示:

⚠️ MySQL MCP 服务未安装
请安装 MySQL MCP 服务:
1. 安装:npx -y @anthropic-ai/create-mcp
2. 在 IDE 中配置 MCP
3. 配置数据库连接
替代方案:
执行 mysqldump -h localhost -u root -p --no-data your_database > structure.sql
将 structure.sql 内容提供给我进行格式化

执行流程

1. 获取数据库连接信息

优先级顺序:

  1. 用户明确提供的连接信息
  2. 自动从项目配置文件中读取

支持的配置文件:

  • Spring Boot:application.yml、application.properties
  • Django:settings.py
  • Node.js:.env、config/database.js
  • Laravel:.env、config/database.php
2. 通过 MCP 导出表结构
  1. 获取所有表名:SHOW TABLES
  2. 获取每个表的创建语句:SHOW CREATE TABLE <表名>
  3. 获取表注释和字段信息
3. 格式化输出
sql
-- ==========================================
-- 数据库结构导出
-- ==========================================
-- 数据库名称:{db_name}
-- 导出时间:{timestamp}
-- 表数量:{count}
-- ==========================================
CREATE TABLE `table_name` (
`id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主键',
...
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='表注释';

输出要求

文件保存路径:/projectdocs/design/{数据库名}_current_{时间戳}.sql

配合工作流

  1. 导出现有结构(本技能)→ 生成 {db}_current_{timestamp}.sql
  2. 生成设计文档(design-gen)→ 生成设计文档
  3. 智能对比生成 DDL(dev-ddl)→ 生成增量 DDL

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/harries/hydpromptkit/design-export-db/badge)](https://verified-skill.com/skills/harries/hydpromptkit/design-export-db)

Something wrong with this skill or its page? Tell us.