create-entity

Create immutable DDD domain entities with private constructors and static factories.

Updated Dec 16, 2019
One-click install
npx skills add https://github.com/Dev-Int/tests --skill create-entity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: create-entity
Source: https://github.com/Dev-Int/tests/tree/main/.claude/skills/create-entity
Command: npx skills add https://github.com/Dev-Int/tests --skill create-entity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the complexity of implementing proper domain entities by automatically generating immutable classes with business behavior.

Core Features & Use Cases

  • Domain Modeling: Create rich domain entities with encapsulated business logic and validation.
  • Immutable Design: Automatically implement immutable patterns with private constructors and static factories.
  • Use Case: When modeling a new business concept like an Article, this Skill generates the entity class with proper value objects and domain methods.

Quick Start

Create an Article entity in the Admin bounded context with name and uuid fields, including rename behavior.

Frequently Asked Questions about create-entity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create an immutable domain entity following DDD patterns?

Create an immutable domain entity by using a final class with a private constructor and static factory method. This Skill automates generation of entities with encapsulated business logic, value objects, and behavior methods that enforce domain rules without exposing mutable state.

What's the best way to model business entities with domain-driven design?

Model business entities as immutable aggregates with private constructors, static factories, and behavior methods that enforce business rules. This Skill generates the complete structure including value objects, getters returning VOs, and validation steps to keep domain logic cohesive and testable.

Can I use domain entities with value objects in my bounded context?

Yes. This Skill creates domain entities that integrate existing value objects from Shared\Entities\VO or generates new ones as needed. Entities reference VOs through getter methods, maintaining immutability and separating entity behavior from value semantics.

How do I enforce business logic in domain entities without public setters?

Enforce business logic by defining behavior methods on the immutable entity that validate and apply domain rules internally. This Skill generates private state with getter methods returning value objects, ensuring all changes pass through domain-aware behaviors rather than direct property modification.

What structure do domain entities need for aggregate roots?

Aggregate root entities require a final class, private constructor, static factory, immutable fields holding value objects, and behavior methods enforcing invariants. This Skill generates the complete pattern with domain validation and templates, then applies cs-fixer and stan for code quality.