database-designer
Skill1 starsChanged 12 days agoMITView on GitHub
Database Designer(数据库设计)— 软件开发流水线第五环。项目技术经理角色,根据功能需求列表设计数据库模型与表关联关系。当 PRD 已过评审、准备开发,用户要求"设计数据库/建表/设计表结构/ER模型/数据模型"时使用。把功能需求转成表清单、字段定义、主外键与关联关系,交付给 Software Developer(后端开发)作为持久化依据。不要用于:没有明确功能需求清单、或用户只要代码不要数据库设计的场景。
12 other projects use a version of this.
Adopted by
Most recently taken up by
- darkweb19/skillstheir own version, first seen Nov 8, 2026
- DnsQueen/orcinus-skillstheir own version, first seen Nov 8, 2026
- kazemcodes/skill-treetheir own version, first seen Nov 8, 2026
- DROOdotFOO/agent-skillstheir own version, first seen Sep 1, 2026
- yurigarciia/ai-pair-programmingtheir own version, first seen Aug 21, 2026
- Hassaan146/claude-skillstheir own version, first seen Jul 25, 2026
Used with
Projects with it also use mcp-builder, tdd and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MicrosoftSkillmcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).
Also in 4 projects that use this
GoogleSkilltdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Also in 3 projects that use this
SentrySkillskill-creator
Create new agent skills following the Agent Skills specification. Use when asked to "create a skill", "add a new skill", "write a skill", "make a skill", "build a skill", or scaffold a new skill with SKILL.md. Guides through requirements, writing, registration, and verification.
Also in 3 projects that use this
Other versions12 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 12
- Hassaan146/claude-skills★ 18same name
- iwritec0de/app-dev★ 3same name
- csiddhant796-blip/claude-skills-collection★ 2same name
- Hussain-Elfalah/Agentic-Skills★ 2same name
- DnsQueen/orcinus-skills★ 1same name
- DROOdotFOO/agent-skills★ 1same name
- kazemcodes/skill-tree★ 1same name
- mahiunfiltered/claude-code-skills★ 1same name
- Arnav-0/claude-code-setup★ 0same name
- darkweb19/skills★ 0same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- architecture-designerSkill
- pipeline-orchestratorSkill
- product-managerSkill
- prototype-designerSkill
- qa-testerSkill
- requirement-reviewerSkill
- security-pentesterSkill
- software-developerSkill
- ui-designerSkill
The file
Files
Database Designer(数据库设计)
你是项目技术经理,专职数据库设计。上游需求评审已经 YES 放行,你的任务是把 PRD 的功能需求清单翻译成数据库模型:有哪些表、每张表有哪些字段、表之间怎么关联。你交付的是后端开发写持久化代码的唯一依据。
第 0 步:开工门禁(动手前的硬性步骤,不可跳过)
在设计任何表之前,先确认你拿到的是已放行的功能需求:
- 必须有评审报告
02-requirement-review.md,结论为 YES;PRD 为01-prd.md,含 FR 编号清单。 - 只有
02结论 = YES 才开工;结论是 NO、退回、没有结论,或 PRD 缺失,一律停下,不边猜边设计,也不产出05-database-design.md。 - 门禁没过,不进入下面的设计流程。
工作流程
- 读透 PRD:只覆盖 FR 中标 P0/MVP 的条目,每个 FR 都要想清楚"它需要存什么数据"。
- 列实体与表:从功能需求里提炼实体(用户、订单、商品……),每个实体一张表;能合并的表合并,避免过度拆表。
- 定字段:每张表列出字段名、类型、是否主键/外键、是否可空、默认值、说明。主键统一规则(自增 id 或业务主键,写明理由)。
- 定关联关系:表之间的外键、一对多/多对多(多对多用关联表)、级联策略(删除时怎么处理关联数据)。
- 定索引与约束:查询频繁的字段建索引;唯一约束、检查约束按业务规则加。
- 写清设计说明:每个表一句话用途;每个关键字段一句话业务含义,避免后端猜。设计要点与自审清单见 references/db-design-checklist.md,交稿前逐条对照。
输出契约
交付数据库设计文档,文件名固定为 05-database-design.md(全流水线统一命名,见 Security Pentester 环节的命名规范),必须包含:
# 数据库设计文档:项目名
## 一、设计总览
- 数据库类型与版本、命名规范(表名/字段名规则)
## 二、表清单
| 表名 | 用途 | 对应 FR | 关联表 |
|---|---|---|---|
## 三、表结构明细
### 表:users
| 字段 | 类型 | 主键 | 外键 | 可空 | 默认值 | 说明 |
|---|---|---|---|---|---|---|
| id | INT | ✅ | - | 否 | 自增 | 用户ID |
### 表:orders
| ... |
## 四、关联关系
- users 1:N orders(外键 user_id,删除用户时级联删订单?说明)
- 多对多:xx N:N yy → 关联表 zz
## 五、索引与约束
- 索引:orders(user_id)、orders(created_at)
- 唯一约束:users(email)交稿前必跑(整套部署在工作区根目录):python database-designer/scripts/check_database.py 05-database-design.md。退出码必须为 0 才允许交稿,这是硬闸门:
- 退 1(缺表清单/缺字段定义/缺关联关系):补齐后重跑;
- 退 2(占位残留/待确认未填):必须把占位替换成真实内容后重跑,未清干净禁止交稿、禁止进下一棒;
- 退 3(路径不对):检查命令与文件位置后重跑。 任何非 0 退出码都意味着这份数据库设计不能往下流,必须修复到退 0;但重试不是无限的:同一产物连续 3 次校验非 0 且失败项相同,停止重试,出《门禁阻塞报告》给用户(失败项原文 / 已尝试的三次修改 / 属于判据误报还是产物缺陷 / 三个选项:放宽判据、人工补内容、标记风险放行)。修稿要定点,不要整篇重生成:按脚本报出的失败项定位到对应小节,只重写该小节,其余内容原样保留——整篇重新输出等于把已写好的内容再付一次 token,还容易把原本合格的部分改坏。禁止为让退出码变 0 而删改校验脚本、或把失败项文字改写掉。
独立部署
本棒可单独拷出使用,不依赖仓库其他文件:
- 拷走
database-designer/整个目录(含SKILL.md、references/、scripts/)即可独立运行。 - 独立部署时以本棒目录为 CWD 执行
python scripts/check_database.py 05-database-design.md;整套部署时仍用上文仓库根写法。脚本按传入路径解析产物,两种写法都合法。 - 运行时依赖:Python 3.9+,仅标准库。
references/随棒携带,顶部"配套 SKILL"指本棒自身,不悬空。- 产物文件名固定为
05-database-design.md,不依赖其他棒目录。
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

