/laravel-ddd:craft-viewmodelfrom laravel-ddd
Crafting ViewModels. Data transformation for views.
Ships in laravel-ddd. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
"View models have one job—providing correct data to views."
?Model in constructor. Null for create, instance for edit.| ❌ Don't | ✅ Do | Why |
|---|---|---|
| View Composers | ViewModel in controller | Explicit > implicit |
| Duplicate create/edit | One ViewModel, optional model | DRY, single source of truth |
| Query in controller | Query in ViewModel method | Controller stays thin |
| Return arrays | Return ViewModel object | Type safety, testability |
See examples.md.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub attac-t/the-foundry --plugin laravel-ddd47 skills in this plugin
/craft-contextCrafting Context Objects. Parameter encapsulation for complex operations.