agentsclimarketplace

Php architecture service layer

Skill ekut/claude-code-php-toolkit/skills/php-architecture-service-layer

Service-Oriented architecture for PHP — Service Layer, Transaction Scripts, DTOs, thin models, repository pattern. The pragmatic middle ground for moderate-complexity applications.From its SKILL.md

Install
npx -y skills add ekut/claude-code-php-toolkit --skill php-architecture-service-layer

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.5 KB, as published. Nobody here has run it

Service-Oriented Architecture

The Service-Oriented approach organizes code around services that own business logic, with thin models serving as data containers and persistence mappers. It is the most common architecture in PHP applications — pragmatic, easy to learn, and well-supported by all major frameworks.

This architecture works well when the domain is moderate in complexity: more than basic CRUD but without the deep invariants and bounded contexts that justify full DDD. It is the natural evolution of framework-centric code when the application grows beyond simple resource management.

When to Use

  • Domain complexity is moderate — business rules exist but are not deeply interconnected
  • The team prefers procedural logic organized in service classes
  • The application is CRUD-heavy with pockets of complex logic
  • Rapid onboarding is important — new developers are productive within days
  • You are migrating a brownfield codebase from fat controllers or framework-centric architecture
  • The project has a moderate lifespan (1-5 years) and steady feature growth
  • Multiple developers work on the project but formal bounded contexts are overkill

Module Index

TopicFileUse when…
Core Principlescore-principles.mdExplaining the service-owns-logic model, DTOs, repositories, transactions
Directory Structuredirectory-structure.mdSetting up a new project or reviewing layer organisation
Building Blocksbuilding-blocks.mdImplementing services, transaction scripts, DTOs, thin entities, repositories
Cross-Cuttingcross-cutting.mdLogging, auth, validation, and error handling in a service-oriented context
Anti-Patternsanti-patterns.mdCode review, migration decisions, "When to Migrate Away", checklist

Keep looking

Skills are one crate of 627,801. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.