AGENT SKILL

domain-service-creation

Use when creating or changing domain services, coordinated domain creation, business invariant checks, repository-backed invariants, or their service contracts, mocks, tests, and IoC wiring.

License 许可
AGPL-3.0
最近更新
2026-11-11
Stars
★ 0
Forks
0

01 前言 Front Matter

name
domain-service-creation
description
Use when creating or changing domain services, coordinated domain creation, business invariant checks, repository-backed invariants, or their service contracts, mocks, tests, and IoC wiring.

02 资源文件 1

03 SKILL.md 正文

Domain Service Creation

Load

Work

  • Inspect the nearby service, type contract, mock, tests, repositories, and IoC before editing.
  • Name the domain capability and the invariants it owns.
  • Put reusable service validation in services/validations/<subject>.validation.ts as a default-exported frozen object. Keep each genuine helper as one default-exported function per file.
  • Confirm the service can complete the service-philosophy sentence with a clear domain owner.
  • Keep the service dependency-free unless persisted state is required for an invariant.
  • Keep workflow persistence, transactions, context updates, event publication, and cross-domain orchestration outside the domain service.
  • Follow nearby immutable return, event, audit, contract, and mock patterns.
  • Test invariants through the public service API at the domain layer.

04 同仓库更多 Skills