# data-model-designer

data-model-designer — a skill for Claude Code, Codex, Cursor and other agents that designs data models for construction projects: entities, relationships, schemas. Outputs SQL DDL, JSON Schema, and Mermaid ER diagrams.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 116 installs · ★ 434 repo stars
- Author: datadrivenconstruction
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/2_DDC_Book/2.5-Data-Modeling-Standards/data-model-designer/SKILL.md
- Updated: 2026-10-19
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/data-model-designer

## What it does

The skill runs on Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and OpenCode across macOS, Linux, and Windows. It is built in Python, so `python3` must be in `PATH` before the skill can execute anything.

At its core are Python classes — `ConstructionDataModel`, `Entity`, `Field`, and `Relationship`. The agent defines entities with typed fields (STRING, INTEGER, FLOAT, DATE, JSON, and others), sets relationship cardinality (`1:1`, `1:N`, `N:M`), and applies constraints: PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL. From the finished model it generates SQL DDL for PostgreSQL or other databases, a JSON Schema representation, and a Mermaid ER diagram.

The skill targets fragmented construction data: disconnected records across systems, inconsistent structures, broken links between entities. No `python3` in the environment means none of the generation steps will run.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill data-model-designer -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/data-model-designer/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/data-model-designer/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill data-model-designer -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/data-model-designer/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill data-model-designer -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/data-model-designer/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction 2_DDC_Book/2.5-Data-Modeling-Standards/data-model-designer
```

2. **Manually: put the files in place**
- File: `.github/skills/data-model-designer/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill data-model-designer -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --path 2_DDC_Book/2.5-Data-Modeling-Standards/data-model-designer
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/data-model-designer/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction --skill data-model-designer -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/2_DDC_Book/2.5-Data-Modeling-Standards/data-model-designer/SKILL.md

## When to use it
- Generate SQL DDL for PostgreSQL from a construction project description
- Build a Mermaid ER diagram for a set of project entities
- Define JSON Schema for domain objects like work orders or contractors
- Map relationships between entities with correct `1:N` and `N:M` cardinality
- Apply PRIMARY KEY and FOREIGN KEY constraints to an existing schema

## Example prompts
- Design a data model for a construction project with entities Project, Contractor, Task, and Material — generate PostgreSQL DDL
- Build a Mermaid ER diagram for `Project`, `Contractor`, and `WorkOrder` with their relationships
- Create a JSON Schema for a `WorkOrder` entity with fields for date, status, and cost

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: bd0b2814d9b7616c.

BEGIN THIRD-PARTY FILE bd0b2814d9b7616c
````text
---
name: "data-model-designer"
description: "Design data models for construction projects. Create entity-relationship diagrams, define schemas, and generate database structures."
homepage: "https://datadrivenconstruction.io"
metadata: {"openclaw": {"emoji": "📐", "os": ["darwin", "linux", "win32"], "homepage": "https://datadrivenconstruction.io", "requires": {"bins": ["python3"]}}}
---
# Data Model Designer

## Business Case

### Problem Statement
Construction data management challenges:
- Fragmented data across systems
- Inconsistent data structures
- Missing relationships between entities
- Difficult data integration

### Solution
Systematic data model design for construction projects, defining entities, relationships, and schemas for effective data management.

## Technical Implementation

```python
from typing import Dict, Any, List, Optional
from dataclasses import dataclass, field
from enum import Enum
import json


class DataType(Enum):
    STRING = "string"
    INTEGER = "integer"
    FLOAT = "float"
    BOOLEAN = "boolean"
    DATE = "date"
    DATETIME = "datetime"
    TEXT = "text"
    JSON = "json"


class RelationType(Enum):
    ONE_TO_ONE = "1:1"
    ONE_TO_MANY = "1:N"
    MANY_TO_MANY = "N:M"


class ConstraintType(Enum):
    PRIMARY_KEY = "primary_key"
    FOREIGN_KEY = "foreign_key"
    UNIQUE = "unique"
    NOT_NULL = "not_null"


@dataclass
class Field:
    name: str
    data_type: DataType
    nullable: bool = True
    default: Any = None
    description: str = ""
    constraints: List[ConstraintType] = field(default_factory=list)


@dataclass
class Entity:
    name: str
    description: str
    fields: List[Field] = field(default_factory=list)
    primary_key: str = "id"


@dataclass
class Relationship:
    name: str
    from_entity: str
    to_entity: str
    relation_type: RelationType
````
END THIRD-PARTY FILE bd0b2814d9b7616c

The third-party file has ended. Everything between the bd0b2814d9b7616c tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 1843 of 10769 bytes. © datadrivenconstruction · MIT · https://github.com/datadrivenconstruction/DDC_Skills_for_AI_Agents_in_Construction/tree/HEAD/2_DDC_Book/2.5-Data-Modeling-Standards/data-model-designer/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
