Skip to content
Agentmart
Submit a tool

domain-modeling

Model entities, value objects, aggregates, ownership, invariants.

Skill by chnetajibc

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/chnetajibc-domain-modeling

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Model entities, value objects, aggregates, ownership, invariants. Separate domain, persistence, DTO, response models; never auto-expose ORM entities.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/domain-modeling

What's inside

Skill name
domain-modeling
Description
Model entities, value objects, aggregates, ownership, invariants. Separate domain, persistence, DTO, response models; never auto-expose ORM entities.
License
MIT
Instructions
43 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# domain-modeling

Make illegal states unrepresentable; keep persistence and API shapes out of the domain.

## Activate when

- Modeling business concepts, drawing aggregate boundaries, or reviewing anemic/leaky domain code.

## Do NOT activate for

- Table/index design (see databases/fundamentals); API contract shaping (see architecture/api-design).

## Inspection

List the concepts, their lifecycles, who owns them, and the invariants that must always hold. Find where ORM entities leak into APIs and where validation lives.

## Decision rules

- Entity (identity matters) vs value object (attributes matter, immutable) vs aggregate (consistency boundary with one root).
- Invariants enforced by the aggregate root at mutation time — never by callers remembering.
- Four models, four jobs: domain (rules) / persistence (ORM rows) / DTO (wire shapes) / response (client views). Map explicitly between them; auto-exposing ORM entities is a defect.
- Repositories per aggregate, not per table; domain events for cross-aggregate effects (with outbox, not dual-write).

## Procedure

1. Name aggregates, roots, and invariants; draw ownership and cross-aggregate flows.
2. Move validation into roots/value objects; split the four model layers with explicit mappers.
3. Cover each invariant with a test that violates it directly.
4. Verify: no ORM import in web layer, no invariant enforceable only by convention, aggregate tests green.

## Failure modes

- Anemic models (getters + service scripts); god aggregates; lazy-loading outside transactions; dual-write to DB + queue without outbox.

## Escalation

Persistence mechanics → databases/*; event transport → distributed/systems.

## References

- Related: `../data-modeling/`, `../../backend/database-design/`, `../../backend/validation/`.

From chnetajibc/skill-repo, MIT.

More from chnetajibc/skill-repo

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Sep 22, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from chnetajibc

Cite this page

domain-modeling skill. Agent Mart. https://agentmart.dev/skills/chnetajibc-domain-modeling (last updated 2026-10-24)