Skip to content
Back to skills

Domain Modeling

ASecurity

Use when Builds and sharpens project domain models, ubiquitous language, entity relationships, and bounded contexts before writing code.

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
ai-agentstypescriptbashdatabase

Works with

  • cli

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add Harmitx7/tribunal-kit --skill domain-modeling --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Domain Modeling?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Domain Modeling
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/harmitx7-domain-modeling-tribunal-kit/badge)](https://www.skillsdirectory.com/skills/harmitx7-domain-modeling-tribunal-kit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: domain-modeling
description: "Use when Builds and sharpens project domain models, ubiquitous language, entity relationships, and bounded contexts before writing code."
version: 5.0.0
last-updated: 2026-09-13
skills:
  - architecture
  - codebase-design
  - database-design
tools: Read, Grep, Glob, Bash, Edit, Write
scripts-binding:
  - .agent/scripts/lint_runner.js
  - .agent/scripts/verify_all.js
---

# Domain Modeling β€” Ubiquitous Language & Bounded Contexts

---

## πŸ› οΈ Technical Architecture & Reference Recipes

---

---

## 4 Domain Modeling Rules

### 1. Establish Ubiquitous Language

- Agree on strict, unambiguous terms used identically across domain experts, code variable names, database tables, and UI copy.
  - ❌ _User_, _Account_, _Member_, _Client_ used interchangeably for the same concept.
  - βœ… Define 1 clear term: **Customer** (for billing context) vs **User** (for authentication context).

### 2. Define Bounded Contexts

- Separate large systems into distinct bounded contexts. An entity named `Product` in the _Inventory Context_ (stock level, warehouse bin) has different attributes than `Product` in the _Catalog Context_ (hero image, pricing).

### 3. Aggregates & Invariants

- An **Aggregate Root** (e.g. `Order`) enforces internal business invariants across child entities (`OrderItem`).
- Never mutate a child entity (`OrderItem`) directly without passing through the aggregate root method (`order.addItem(product, qty)`).

### 4. Value Objects Over Primitives

- Wrap primitives into type-safe Value Objects to enforce validation logic:

```typescript
// Value Object enforcing domain rule
export class EmailAddress {
  private readonly value: string;

  constructor(email: string) {
    if (!email.includes('@')) throw new Error('Invalid email domain');
    this.value = email.toLowerCase().trim();
  }

  public toString(): string {
    return this.value;
  }
}
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…