Data Modeling logo

Data Modeling

Community
nimadorostkar
data-modeling

Use when designing a schema. Covers normalization and when to break it, choosing keys, modeling time and history, soft deletes, multi-tenancy, and schema decisions that are expensive to reverse. Trigger on "design the schema for this", "model multi-tenancy", "soft delete or hard delete", "keep history of changes". Do not use for speeding up queries — see the database-performance skill; for domain vocabulary in code, see the domain-modeling skill.

Overview

Publishernimadorostkar
RepositoryClaude-Skills-collection
Skill namedata-modeling
Stars
34
Forks
4
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by nimadorostkar on GitHub. Read the source before you install it.

Installation

Install the Data Modeling AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/data/data-modeling
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nimadorostkar/Claude-Skills-collection.git /tmp/Claude-Skills-collection
mkdir -p .claude/skills
cp -r /tmp/Claude-Skills-collection/skills/data/data-modeling .claude/skills/data-modeling
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Data Modeling in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Data Modeling on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Data Modeling is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Data Modeling

Purpose

Design a schema that supports the queries you need and the changes you will want. Schema mistakes are the most expensive category of technical debt because the data outlives every application that touched it.

When to Use

  • Designing a new schema or a significant new table.
  • Adding multi-tenancy to an existing model.
  • Modeling history, versioning, or audit requirements.
  • Reviewing a schema before it becomes hard to change.

Capabilities

  • Normalization, and deliberate denormalization.
  • Key selection: natural, surrogate, UUID, ULID.
  • Temporal modeling: valid time, transaction time, event history.
  • Multi-tenancy strategies and their isolation guarantees.
  • Constraint design: the invariants the database should enforce.

Inputs

  • The domain entities and the relationships between them.
  • The queries the schema must serve, and their frequency.
  • Retention, audit, and compliance requirements.

Outputs

  • A schema with enforced constraints and appropriate keys.
  • A documented tenancy and soft-delete strategy.
  • A migration path from the current schema, if there is one.

Workflow

  1. Normalize first — Third normal form as the default. Denormalize only where a measured query cost justifies it, and record the decision.
  2. Choose keys deliberately — A surrogate key (UUID/ULID) is stable and safe to expose. A natural key is meaningful and changes when the business changes its mind. Prefer surrogates for identity, and enforce natural uniqueness with a constraint.
  3. Enforce invariants in the database — Foreign keys, unique constraints, check constraints, not-null. Application-level validation does not survive a concurrent request, a background job, or a psql session.
  4. Model time explicitly — If history matters, do not overwrite. Append versions or events. updated_at tells you when, not what it was before.
  5. Decide tenancy up front — Shared table with a tenant column, schema per tenant, or database per tenant. Migrating between these later is a project, not a task.
  6. Plan the migration — Every schema change on a large table needs a plan that does not lock it.

Best Practices

  • A soft delete (deleted_at) makes every query wrong by default: any query that forgets the filter returns deleted rows. If you use it, enforce it with a view or a row-level policy, not with discipline.
  • Sequential integer IDs leak business information (your order count) and are enumerable. ULIDs are sortable, unique, and safe to expose.
  • Storing money as a float is a defect. Use an integer of minor units, or numeric — never float or double.
  • Store timestamps in UTC, in a timestamp-with-timezone column. Store the user's timezone separately if you need to render local time.
  • A nullable foreign key with a nullable meaning ("null means unassigned, or means deleted, or means legacy") is three columns pretending to be one.
  • The EAV pattern (entity-attribute-value) makes every query hard and every constraint impossible. Use JSONB for genuinely dynamic attributes instead.

Examples

History as an append-only fact, rather than an overwritten field:

sql
-- Overwriting loses the answer to "what was the price when they ordered?"
-- forever, and that question will be asked.
CREATE TABLE product_prices (
  id           uuid PRIMARY KEY DEFAULT gen_random_uuid(),
  product_id   uuid NOT NULL REFERENCES products(id),
  amount_cents bigint NOT NULL CHECK (amount_cents >= 0),
  currency     char(3) NOT NULL,
  valid_from   timestamptz NOT NULL,
  valid_to     timestamptz,                       -- NULL = currently in effect

  -- No two price rows for the same product may overlap in time.
  EXCLUDE USING gist (
    product_id WITH =,
    tstzrange(valid_from, valid_to) WITH &&
  )
);

-- The price at any point in time is now a query, not an archaeology project.
SELECT amount_cents FROM product_prices
WHERE product_id = $1
  AND tstzrange(valid_from, valid_to) @> $2::timestamptz;

Multi-tenancy that the database enforces, not the application:

sql
ALTER TABLE orders ENABLE ROW LEVEL SECURITY;

CREATE POLICY tenant_isolation ON orders
  USING (tenant_id = current_setting('app.tenant_id')::uuid);

A forgotten WHERE tenant_id = ... in application code is now not a data breach. Relying on every query in the codebase to remember the filter, forever, is not a strategy.

Notes

  • The exclusion constraint above is enforced by the database, so overlapping price periods cannot exist even under concurrent writes. Application-level checks for this are subject to a race that will eventually happen.
  • Row-level security has a real performance cost and must be tested. It is still cheaper than a cross-tenant data leak.
  • Adding a column is easy; changing a column's type or removing it is not. Think hardest about the columns you are most confident about.

Frequently asked questions

What does the Data Modeling AI skill do?

Use when designing a schema. Covers normalization and when to break it, choosing keys, modeling time and history, soft deletes, multi-tenancy, and schema decisions that are expensive to reverse. Trigger on "design the schema for this", "model multi-tenancy", "soft delete or hard delete", "keep history of changes". Do not use for speeding up queries — see the database-performance skill; for domain vocabulary in code, see the domain-modeling skill.

Why use Data Modeling on TypingMind?

Because you install it once and use it with any model. Data Modeling is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Data Modeling in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/data/data-modeling. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Data Modeling?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Data Modeling?

As many as you like. As long as a model supports skills, you can use Data Modeling with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Data Modeling AI skill free?

Yes. It is published on GitHub by nimadorostkar under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇