Skip to content
Back to skills

Creating Domain Service

ASecurity

Create or refactor business calculations and rules spanning multiple domain objects when no single entity or value object naturally owns the behavior. Use when assessing a growing service class.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 29, 2026
ai-agents

Security analysis

A100/100

Scanned September 29, 2026

npx -y skills add maiobarbero/laravel-boost-ddd --skill creating-domain-service --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Creating Domain Service?

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

Security grade badge for Creating Domain Service
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/maiobarbero-creating-domain-service/badge)](https://www.skillsdirectory.com/skills/maiobarbero-creating-domain-service)

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: creating-domain-service
description: Create or refactor business calculations and rules spanning multiple domain objects when no single entity or value object naturally owns the behavior. Use when assessing a growing service class.
---

# Domain services

First look for a model or Value Object that naturally owns the behavior. Create `App\Domain\<Capability>\Services` only when a cohesive business operation has no such owner.

For example, `OrderCancellationFee` may calculate a fee using an order and a cancellation policy. It computes a business result; `CancelOrder` authorizes, coordinates, saves, and handles follow-up work.

Avoid generic `OrderService`, `UserService`, or `PaymentService` containers. Do not extract a service merely because a method is long or used twice.

Domain services must not depend on Application, Infrastructure, or delivery code. If a business calculation genuinely needs an external capability, define its contract under `App\Domain\<Capability>\Contracts`, implement it in Infrastructure, and bind it in a Laravel service provider. Do not hide an adapter lookup behind a facade or container call.

Use domain exceptions for rejected rules. Leave persistence coordination and transactions to Application. Direct collaboration with models in other capabilities is allowed within the same bounded context.

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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.