Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

patterns-entity-modeling

БесплатноЗапускает вложенные скриптыНе проверен

This skill MUST be invoked when the user says "extract entities", "define data model", "model relationships", "entity modeling", or "domain model". SHOULD…

deepeshBodhот deepeshBodh★ 41 звезда на GitHub

Об этом скилле

Modeling Domain Entities

Overview

Extract and model domain entities from requirements using Domain-Driven Design principles. This skill covers entity identification, attribute definition, relationship modeling, and state machine documentation.

When to Use

  • Creating data-model.md from requirements or specifications
  • Extracting entities from user stories and functional requirements
  • Defining attributes, types, and constraints for entities
  • Modeling relationships between entities with cardinality
  • Documenting state machines for stateful entities
  • Brownfield analysis of existing data models

When NOT to Use

  • API contract design - Use humaninloop:patterns-api-contracts instead
  • Database schema migration - This skill is conceptual, not implementation
  • When data model already exists and is complete - Don't duplicate work
  • Pure validation rules - Model entities first, then add validation
  • Technical architecture decisions - Use humaninloop:patterns-technical-decisions

Entity Extraction

Identification Heuristics

Look for entities in:

Source Pattern Example
User stories "As a [Role]..." User, Admin, Guest
Subjects "The [Entity] must..." Task, Order, Product
Actions "...create a [Entity]" Comment, Message, Report
Possessives "[Entity]'s [attribute]" User's profile, Order's items
Status mentions "[Entity] status" TaskStatus, OrderState

Entity vs. Attribute Decision

IF concept has its own lifecycle → Entity
IF concept only exists within another → Attribute
IF concept connects two entities → Relationship (possibly join entity)
IF concept has just one value → Attribute

Examples:
- "user email" → Attribute of User (just one value)
- "user address" → Could be Entity (if reused) or Attribute (if embedded)
- "order items" → Separate entity (has own lifecycle)
- "task status" → Enum/attribute (limited values)

Brownfield Entity Status

When modeling in brownfield projects:

Status Meaning Action
[NEW] Entity doesn't exist Create full definition
[EXTENDS EXISTING] Adding to existing entity Document new fields only
[REUSES EXISTING] Using existing as-is Reference only
[RENAMED] Avoiding collision Document new name + reason

Attribute Definition

Standard Attributes

Every entity typically needs:

Field Type Required Description
id Identifier Yes Primary key
createdAt Timestamp Yes Creation time
updatedAt Timestamp Yes Last modification
deletedAt Timestamp No Soft delete marker

Attribute Format

| Attribute | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| id | UUID | Yes | auto-generated | Unique identifier |
| email | Email | Yes | - | User's email address |
| name | Text(100) | No | null | Display name |
| role | Enum[admin,member,guest] | Yes | member | Access level |
| isVerified | Boolean | Yes | false | Email verified flag |

Conceptual Types

Use conceptual types (not database-specific):

Conceptual Type Description
Identifier / UUID Unique identifier
Text / Text(N) String with optional max length
Email Email format string
URL URL format string
Integer Whole number
Decimal / Decimal(P,S) Decimal with precision
Boolean True/false
Timestamp Date and time
Date Date only
Enum[values] Fixed set of values
JSON Structured data
Reference(Entity) Foreign key reference

PII Identification

Mark sensitive fields:

| Attribute | Type | Required | PII | Description |
|-----------|------|----------|-----|-------------|
| email | Email | Yes | **PII** | User's email |
| phone | Text(20) | No | **PII** | Phone number |
| ssn | Text(11) | No | **PII-SENSITIVE** | Social security |

Relationship Modeling

Relationships connect entities with defined cardinality: One-to-One (1:1), One-to-Many (1:N), or Many-to-Many (N:M).

See RELATIONSHIP-PATTERNS.md for detailed patterns, join entity examples, and documentation formats.

Relationship Diagram (Text)

## Entity Relationships

User ──1:N──▶ Task (owns) User ──1:N──▶ Session (has) User ◀──N:M──▶ Project (via ProjectMember) Task ──N:1──▶ Project (belongs to)


State Machine Modeling

Entities with status fields need state transition documentation.

See STATE-MACHINES.md for patterns, diagram formats, and common workflows.

When to Model State

Model state machines when:

  • Entity has a status or state field
  • Requirements mention workflow or lifecycle
  • Specific actions change entity state
  • Certain ac
Полный SKILL.md на GitHub

Установить patterns-entity-modeling в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/RELATIONSHIP-PATTERNS.mdreferences/STATE-MACHINES.mdreferences/VALIDATION-RULES.mdscripts/validate-model.py

FAQ

Что делает скилл patterns-entity-modeling?

This skill MUST be invoked when the user says "extract entities", "define data model", "model relationships", "entity modeling", or "domain model". SHOULD also invoke when user mentions "relationship", "cardinality", "state machine", or "data attributes".

Как установить скилл patterns-entity-modeling?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл patterns-entity-modeling запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить patterns-entity-modeling с