angular-ddd
БесплатноБез исполняемых скриптовНе проверенDomain-Driven Design for Angular/TypeScript: functional patterns with `type` aliases, `readonly` fields, pure rule functions, immutable value types, branded…
от fmflurry★ 173 звезды на GitHubОб этом скилле
angular-ddd
Domain-Driven Design guidance for Angular/TypeScript domain code. Makes DDD principles explicit and enforceable for the coder and code-reviewer agents.
When to Activate
- Creating or modifying domain models (entities, value objects, aggregates)
- Adding repositories, factories, or domain services
- Defining or refactoring bounded contexts
- Reviewing domain code for DDD compliance
- Refactoring anemic models toward rich behavior
- Enforcing aggregate invariants or encapsulation rules
Provenance
Content is synthesized from established DDD literature:
- Eric Evans, Domain-Driven Design: Tackling Complexity in the Heart of Software (2003) — "Blue Book"
- Vaughn Vernon, Implementing Domain-Driven Design (2013) — "Red Book"
- Martin Fowler, bliki articles on Anemic Domain Model, Domain Event, etc.
- TypeScript-specific idioms: branded types, discriminated unions,
readonly,Object.freeze
This is a practitioner synthesis, not a verbatim reproduction. Where sources disagree, the Red Book's pragmatic guidance takes precedence for implementation details.
Core Principles
- The domain model is the software. Business logic lives in domain objects and pure functions, not in services or components. (Evans, ch. 1)
- Ubiquitous Language. Code names match the domain expert's vocabulary. No translation layer between business and code. (Evans, ch. 2)
- Bounded Contexts define boundaries. Each context owns its model. Shared types across contexts are a design smell. (Evans, ch. 14)
- Aggregates enforce invariants. All mutations go through the aggregate root. External code never reaches inside. (Vernon, ch. 10)
- Value Objects are immutable and identity-free. They describe characteristics, not things. (Evans, ch. 5)
- Repositories return aggregates, not tables. Persistence is an infrastructure concern. (Vernon, ch. 12)
TypeScript Idioms
The Angular-specific delta vs. the .NET DDD skill:
| Concept | .NET idiom | TypeScript idiom |
|---|---|---|
| Identity | CustomerId record struct |
Branded type: type CustomerId = string & { readonly __brand: 'CustomerId' } |
| Immutability | readonly record struct |
readonly props + Object.freeze() for VOs; ReadonlyArray<T> for collections |
| Domain events | sealed record : IDomainEvent |
Discriminated union with readonly kind discriminant |
| Domain model | sealed class with private setters |
type alias with readonly props (per angular-clean-architecture convention) |
| Domain rules | Static methods on entity | Pure exported functions in core/rules/ |
| Ports | interface in Core |
abstract class with abstract methods returning Observable<T> (per angular-clean-architecture convention) |
| Equality | Equals/GetHashCode override |
Structural: compare all fields; identity: compare id field |
Tactical Patterns (summary)
| Pattern | One-liner | Reference |
|---|---|---|
| Entity | Has identity; equality by ID, not attributes | tactical-patterns.md § Entity |
| Value Object | No identity; immutable; equality by attributes | tactical-patterns.md § Value Object |
| Aggregate + Root | Consistency boundary; root is sole entry point | tactical-patterns.md § Aggregate |
| Repository | Collection-like abstraction over aggregates | tactical-patterns.md § Repository |
| Factory | Encapsulates complex creation logic | tactical-patterns.md § Factory |
| Specification | Reusable, composable query/predicate logic | tactical-patterns.md § Specification |
| Domain Service | Stateless logic that doesn't belong to an entity | tactical-patterns.md § Domain Service |
| Rich vs Anemic | Behavior lives with data, not in external services | tactical-patterns.md § Rich vs Anemic |
Full definitions, GOOD/BAD examples, and per-pattern checklist lines: tactical-patterns.md
Strategic Design (summary)
| Concept | One-liner | Reference |
|---|---|---|
| Bounded Context | Explicit boundary around a model + language | strategic-design.md § Bounded Context |
| Ubiquitous Language | Shared vocabulary within a context | strategic-design.md § Ubiquitous Language |
| Anti-Corruption Layer | Translation boundary shielding your model from external models | strategic-design.md § ACL |
| Context Mapping | Relationships between contexts (Shared Kernel, Customer/Supplier, etc.) | [strategic-design.md § Context Mapping](strategic-design.md#context-mapping--shared-ke |
Установить angular-ddd в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл angular-ddd?
Domain-Driven Design for Angular/TypeScript: functional patterns with `type` aliases, `readonly` fields, pure rule functions, immutable value types, branded IDs, and ports as abstract classes. Use when creating or reviewing domain models, aggregates, rule functions, ports, bounded contexts, or domain events. Use when enforcing aggregate invariants, applying DDD tactical patterns, mapping bounded contexts, or integrating with event sourcing. Provides tactical-pattern guidance, strategic-design rules, an event-sourcing→flurryx mapping, and a file:line review checklist. Complements angular-clean-architecture (folder layout/layering/DI) and flurryx (store/replay mechanics).
Как установить скилл angular-ddd?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл angular-ddd запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic