Skip to main content

phase-1-schema

Phase 1: Data Modeling and Terminology Definition. Define database schema, entity relationships, and project glossary. Next: $phase-2-convention. Triggers: schema, data model, entity, ERD, database design, terminology, 스키마, 데이터 모델, 엔티티, 용어 정의, スキーマ, データモデル, 用語, esquema, modelo de datos, schéma, modèle de données, Datenmodell, Schema Do NOT use for: API design (use $phase-4-api), coding rules (use $phase-2-convention).

跳到安装

来源信息

仓库
ww-w-ai/bkit-codex
最近来源活动
2026年2月14日 15:39
检测到的 SKILL.md 语言
英语
星标
69
分支
21

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
3 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
phase-1-schema
description
Phase 1: Data Modeling and Terminology Definition. Define database schema, entity relationships, and project glossary. Next: $phase-2-convention. Triggers: schema, data model, entity, ERD, database design, terminology, 스키마, 데이터 모델, 엔티티, 용어 정의, スキーマ, データモデル, 用語, esquema, modelo de datos, schéma, modèle de données, Datenmodell, Schema Do NOT use for: API design (use $phase-4-api), coding rules (use $phase-2-convention).
# Phase 1: Schema & Data Modeling > Define your data foundation before writing any code. ## Purpose Phase 1 establishes the data layer that everything else builds on. Poor data modeling leads to costly refactors later. ## Actions | Action | Description | Example | |--------|-------------|---------| | `start` | Begin Phase 1 | `$phase-1-schema start` | | `review` | Review current schema | `$phase-1-schema review` | | `glossary` | Generate terminology glossary | `$phase-1-schema glossary` | ## Deliverables 1. **Terminology Glossary** - Project-wide term definitions 2. **Entity List** - All data entities with descriptions 3. **ERD (Entity Relationship Diagram)** - Visual entity relationships 4. **Field Definitions** - Per-entity field specs (name, type, constraints) 5. **Schema Document** - `docs/01-plan/schema.md` ## Process ### Step 1: Define Terminology Create a glossary of domain terms used across the project: ```markdown | Term | Definition | Korean | Example | |------|-----------|--------|---------| | User | Person with an account | 사용자 | john@example.com | | Post | Content created by a user | 게시글 | Blog article | | Comment | Response to a post | 댓글 | Feedback on article | ``` ### Step 2: Identify Entities List all data entities: ```markdown ## Entities - User: Account holder (email, name, role) - Post: User-generated content (title, body, status) - Comment: Feedback on posts (body, author) - Tag: Content categorization (name, slug) ``` ### Step 3: Define Relationships ``` User 1--* Post (one user has many posts) Post 1--* Comment (one post has many comments) User 1--* Comment (one user has many comments) Post *--* Tag (many-to-many via PostTag) ``` ### Step 4: Field Specifications For each entity, define fields: ```markdown ### User | Field | Type | Required | Unique | Default | Description | |-------|------|----------|--------|---------|-------------| | id | UUID | Yes | Yes | auto | Primary key | | email | String(255) | Yes | Yes | - | Login email | | name | String(100) | Yes | No | - | Display name | | role | Enum | Yes | No | 'user' | user/admin | | created_at | DateTime | Yes | No | now() | Creation time | ``` ### Step 5: Validation Rules Define business rules per entity: - Email must be valid format - Name must be 2-100 characters - Role must be one of: user, admin - Post title must be 1-200 characters ## Schema Patterns See `references/schema-patterns.md` for common patterns: - Soft delete pattern - Audit trail pattern - Multi-tenancy pattern - Polymorphic associations ## Output Location ``` docs/01-plan/ ├── schema.md # Full schema document ├── glossary.md # Terminology glossary └── erd.md # Entity relationship diagram ``` ## Next Phase When schema is complete, proceed to **$phase-2-convention** for coding conventions. ## Common Mistakes | Mistake | Solution | |---------|----------| | Skipping terminology | Leads to naming inconsistency later | | Over-normalizing | Start simple, normalize when needed | | Missing timestamps | Always include created_at, updated_at | | No soft delete | Add deleted_at for recoverable data | | Ignoring indexes | Plan indexes for query patterns early |
在 GitHub 查看