Pdlc db design
数据库设计From its SKILL.md
npx -y skills add kanfu-panda/pdlc-skills --skill pdlc-db-designAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 10 stars10 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.0 KB, 974 tokens by cl100k_base, as published. Nobody here has run it
数据库设计
<!-- @include templates/prompts/iron-law.md -->根据需求和 API 设计文档,创建数据库设计方案。
PDLC 前置检查(必须执行,不可跳过)
- 从用户输入中提取功能名称关键词
- 在
docs/01_requirements/prd/目录下搜索包含该关键词的 PRD 文档- 匹配新格式:
F<日期>-<编号>-*<关键词>*-prd.md - 匹配旧格式:
YYYYMMDD-*<关键词>*-prd.md - 同时检查文件内容中是否包含该关键词
- 匹配新格式:
- 未找到 → 输出以下信息后立即停止,不继续执行:
⛔ PDLC 守卫:未找到与「<功能名>」相关的 PRD 文档。 数据库设计必须基于已有的 PRD。请先运行: 👉 /pdlc-prd <需求描述> - 找到 → 提取功能ID(如
F20260326-090000),读取该 PRD 内容,继续执行
工作流程
- 阅读需求: 阅读找到的 PRD 文档
- 阅读 API 设计: 阅读
docs/02_design/api/下同功能ID的 API 设计文档(如有) - 梳理数据模型: 识别实体、属性、关系
- ER 图: 用文本方式描绘实体关系图
- 表结构定义: 逐表定义字段、类型、约束
- 索引设计: 根据查询场景设计索引
- 输出设计文档: 在
docs/02_design/database/下创建数据库设计文档
文档内容
- 文件名格式:
<功能ID>-<功能名>-db.md(如F20260326-090000-user-auth-db.md)- 若 PRD 为旧格式无功能ID,则使用旧格式
YYYYMMDD-<模块名>-db.md
- 若 PRD 为旧格式无功能ID,则使用旧格式
- 文档顶部必须包含 PDLC 追溯头:
<!-- PDLC-TRACE --> <!-- 功能ID: F20260326-090000 --> <!-- 功能名称: user-auth --> <!-- 阶段: 设计 --> <!-- 前置文档: docs/01_requirements/prd/F20260326-090000-user-auth-prd.md -->
ER 图格式
[用户] 1──N [订单] N──N [商品]
│ │
└───N [地址] [库存] 1─┘
表结构格式
| 字段 | 类型 | 可空 | 默认值 | 索引 | 描述 |
|---|
必须包含
- 公共字段约定(id、created_at、updated_at、deleted_at 等)
- 主键策略(自增/UUID/雪花ID)
- 软删除策略
- 分表分库策略(如数据量大)
- 数据迁移方案(DDL 变更脚本)
要求
<!-- @include templates/prompts/output-language.md -->- 字段命名使用 snake_case
- 枚举值必须有中文说明
- 考虑数据量增长后的性能影响
设计目标: $ARGUMENTS
<!-- @include templates/prompts/handoff.md -->本命令的 handoff 输出:
✅ 数据库设计文档 完成
📦 产出:docs/02_design/database/<功能ID>-<功能名>-db.md
👉 下一步:(本次流程结束,无后续)
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.
Gives 0 of the 12 instructions most design frontend skills give in 974 tokens
Counted across 1,179 of the 2,086 authors here whose files we hold, read 2026-09-06
- Commit to a bold aesthetic directionin 31 of 1179, across 24 files
- Prefer component composition over inheritancein 28 of 1179, across 14 files
- Animate only transform and opacity propertiesin 27 of 1179, across 22 files
- Memoize expensive computations with useMemoin 26 of 1179, across 13 files
- Use semantic HTML elementsin 24 of 1179, across 23 files
- Virtualize long lists for performancein 21 of 1179, across 10 files
- Use CSS variables for design tokensin 20 of 1179, across 14 files
- Implement loading, empty, and error statesin 20 of 1179
- Lazy load heavy components with Suspensein 19 of 1179, across 8 files
- Respect prefers-reduced-motion media queriesin 18 of 1179, across 10 files
- Prioritize CSS-only animations for HTMLin 18 of 1179, across 16 files
- Use compound components for related UI elementsin 18 of 1179, across 7 files
Said here and by no other author read
- Search for PRD using function name keywords
- Include the PDLC trace header at the top
- Extract feature keywords from user input
- Read the identified PRD and API design documents
- Identify entities, attributes, and relationships
- Draw the entity relationship diagram using text
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.