Logotipo de Domain Modeling

Domain Modeling

Comunidad
nimadorostkar
domain-modeling

Use when the code's vocabulary does not match the business's. Establishes a ubiquitous language, models domain concepts as explicit types, and identifies bounded contexts. Trigger on "we call it a customer here and an account there", "this model is used by everything", "what are our bounded contexts". Do not use for database schema design — see the data-modeling skill; for splitting into deployable services, see the microservices skill.

Descripción general

Editornimadorostkar
RepositorioClaude-Skills-collection
Nombre de la habilidaddomain-modeling
Estrellas
34
Forks
4
Archivos incluidos
Solo instrucciones
LicenciaMIT
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando la petición encaja con la habilidad.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • Todo en las instrucciones

    Todo lo que necesita el modelo está en las instrucciones: no hay archivos adicionales que sincronizar.

  • Código abierto

    Publicada por nimadorostkar en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Domain Modeling en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/development/domain-modeling
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

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/development/domain-modeling .claude/skills/domain-modeling
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Domain Modeling en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición encaja con la habilidad, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Domain Modeling automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Domain Modeling no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición que encaja con la habilidad, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

Domain Modeling

Purpose

Make the code speak the business's language precisely. Most long-lived complexity comes from a mismatch between the words the business uses and the structures the code has — where "user" means four different things and none of them are named.

When to Use

  • The same concept has different names in code, in the database, and in conversation.
  • A single model class is used by three subsystems that each need something different from it.
  • New requirements consistently require changes in unrelated modules.
  • Designing a new subsystem in a domain with real business rules.

Capabilities

  • Ubiquitous language: a shared, enforced vocabulary between code and domain experts.
  • Modeling entities, value objects, and aggregates with clear invariants.
  • Bounded-context identification and mapping.
  • Replacing primitive obsession with domain types.
  • Making illegal states unrepresentable.

Inputs

  • The domain vocabulary, ideally from the people who use it daily.
  • The current model and where it hurts.
  • The business rules, especially the ones that are currently enforced by convention.

Outputs

  • A glossary of terms, each with exactly one meaning.
  • Domain types that carry their invariants.
  • Named bounded contexts and the translation between them.

Workflow

  1. Collect the vocabulary — Listen to how the domain experts speak. When they say "a subscription lapses", the code should have a lapse() and not a status = 3.
  2. Find the collisions — The same word meaning two things is the highest-value finding. "Order" in fulfilment and "Order" in billing are usually different concepts.
  3. Draw the context boundaries — Where the meaning of a word changes, a context boundary exists. Draw it explicitly and translate at the edge.
  4. Replace primitives with types — Money, EmailAddress, SubscriptionId. A type that validates on construction cannot be invalid downstream.
  5. Move invariants into the model — If a rule is currently enforced in a controller, the model permits an invalid state. Move it.
  6. Rename ruthlessly — Code that uses a word the business does not use is code the business cannot verify.

Best Practices

  • One word, one meaning, per context. If you need to say "billing order" to be clear, the type should be BillingOrder.
  • A value object with no identity should be immutable and compared by value. Money(1000, "USD") equals Money(1000, "USD").
  • An aggregate is a consistency boundary. Everything inside it is transactionally consistent; everything outside it is eventually consistent. Choose the boundary deliberately.
  • Never share a database table across bounded contexts. That is a hidden coupling that no interface can undo.
  • Do not build a domain model for a CRUD application. If there are no invariants, a form and a table is the correct architecture.
  • The glossary belongs in the repository, and disagreements about it are the most productive meetings you will have.

Examples

Primitive obsession versus a domain type:

typescript
// Before: every caller must remember the currency and the unit.
function refund(orderId: string, amount: number, currency: string) { ... }
refund("ord_1", 19.99, "USD");   // floating point money, in an unvalidated string id

// After: the types make the mistakes impossible.
class Money {
  private constructor(readonly cents: bigint, readonly currency: Currency) {}

  static of(cents: bigint, currency: Currency): Money {
    if (cents < 0n) throw new DomainError("Money cannot be negative");
    return new Money(cents, currency);
  }

  plus(other: Money): Money {
    if (other.currency !== this.currency) {
      throw new DomainError(`Cannot add ${other.currency} to ${this.currency}`);
    }
    return new Money(this.cents + other.cents, this.currency);
  }
}

function refund(orderId: OrderId, amount: Money): Refund { ... }

Currency mismatches and negative amounts are now compile-time or construction-time errors rather than production incidents.

Notes

  • Aggregate boundaries that are too large create lock contention; boundaries that are too small push consistency into the application layer. Start with the smallest set of objects that must change together atomically.
  • Anti-corruption layers exist so that a bad upstream model does not leak into a good one. When integrating a vendor API, translate at the edge — do not let their nouns into your domain.

Preguntas frecuentes

¿Qué hace la habilidad de IA Domain Modeling?

Use when the code's vocabulary does not match the business's. Establishes a ubiquitous language, models domain concepts as explicit types, and identifies bounded contexts. Trigger on "we call it a customer here and an account there", "this model is used by everything", "what are our bounded contexts". Do not use for database schema design — see the data-modeling skill; for splitting into deployable services, see the microservices skill.

¿Por qué usar Domain Modeling en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Domain Modeling está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Domain Modeling en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/nimadorostkar/Claude-Skills-collection/tree/main/skills/development/domain-modeling. TypingMind lee el archivo SKILL.md de esa carpeta e instala su contenido como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Domain Modeling?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Domain Modeling?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Domain Modeling con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Domain Modeling?

Sí. nimadorostkar la ha publicado en GitHub bajo la licencia MIT. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver el directorio

Crea ya tu propio espacio de trabajo con IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇