Role
This skill owns service-layer implementation and business-rule placement inside modules. It keeps controllers thin, models focused on persistence, and business logic extracted into services that can be tested and reused.
When To Use
- Use for service classes, business-rule extraction, API service contracts, and coordination between controllers and models.
- Use for keywords such as service, business logic, orchestration, API layer, domain rule, and refactor controller logic.
- Use when a task is more about module behavior than about framework infrastructure.
Source Material
AI-ENTRY.mdCLAUDE.mddev/ai/skills/service-development/SKILL.mddev/ai/skills/code-generation-standards/SKILL.mddev/ai/skills/module-development/SKILL.md
Responsibilities
- Place business logic in services instead of controllers or templates.
- Define stable module-local service contracts and collaboration boundaries.
- Keep persistence concerns in models and orchestration concerns in services.
- Structure code to support unit testing and future reuse.
Workflow
- Confirm the business rule, the entry point, and the owning module.
- Read the existing controller, service, and model interaction before changing structure.
- Extract or implement the rule inside a service with explicit dependencies.
- Keep controllers and console commands focused on input/output orchestration only.
- Add unit tests around the extracted service behavior.
- Validate the end-to-end feature path through its real entry point.
- Report the service boundary and any new contract assumptions.
Weline Rules
- Prefer small, isolated, testable changes.
- Keep module boundaries intact.
- Do not hardcode user-facing text.
- Use i18n for user-facing text.
- Provide unit test evidence where relevant.
Inputs Required
- The current feature entry point and expected business outcome.
- The owning module and collaborating models or services.
- Any API or controller contracts that must remain stable.
- Required validation path and edge cases.
Expected Output
- A service-layer implementation or refactor with clearer business boundaries.
- Unit-test or focused validation evidence for the business rule.
- Notes about affected controller, API, or model interactions.
Validation
- Run targeted unit tests for extracted or changed service behavior.
- Run a route, command, or API check through the real entry point when relevant.
- Confirm controllers no longer contain unnecessary business-rule branches.
- Confirm models remain persistence-focused rather than becoming orchestration hubs.
Constraints
- Do not move UI rendering logic into services.
- Do not bury business-critical logic inside controllers, commands, or templates.
- Do not introduce raw SQL or framework-invented APIs in service code.
- Do not change public contracts silently without documenting the impact.