decompose-model
Installation
SKILL.md
Decompose Model
When To Use
Use this skill when an Eloquent model is becoming too large or starts mixing persistence with workflow code.
Inputs Needed
- Model name, current responsibilities, reusable behaviors, query needs, and extraction target.
Workflow
- Inspect the model and its related classes.
- Identify what belongs in relations, casts, accessors, mutators, builders, policies, or support classes.
- Extract reusable query logic into a builder or query object.
- Extract reusable behavior into a concern when it fits.
- Keep only small model-level invariants in the model.
- Add or update tests for the extracted behavior.