/laravel-playbook:decide-facadefrom laravel-playbook
When to use Facade vs Trait vs Static Factory vs Helper vs Manager. Five API entry point patterns.
Ships in laravel-playbook. 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.
"Where does the developer think about this concept?"
Facade when:
Facade::fake() is valuablereturn MyService::classTrait when:
HasRoles, InteractsWithMedia, Searchable, Billable)$model->doSomething()Static factory when:
QueryBuilder::for(Model::class)AllowedFilter::exact('name')::make() variation for schema builders (Filament's declarative UI pattern)Manager when:
Cache::driver('redis'), Scout::engine('meilisearch') patternextend()__call delegates to itHelper function when:
activity(), route()Ask: "Where does the developer think about this concept?"
Model-level thinking -> trait. Global service -> facade. Builder/chain -> static factory. Multiple backends -> manager. Everywhere -> helper.
| Ask | Answer | Use |
|---|---|---|
| Does it attach to a model? | Yes | Trait |
| Is it a global, stateful service? | Yes | Facade |
| Does it start a fluent chain? | Yes | Static factory |
| Does it support multiple drivers/backends? | Yes | Manager |
| Is it called from everywhere, constantly? | Yes | Helper function |
Does $model->doSomething() feel natural? | Yes | Trait |
Does MyService::doSomething() feel natural? | Yes | Facade |
Does MyPackage::driver('x') feel natural? | Yes | Manager |
See examples.md.
What SKILL.md sets; muted values are Claude Code's defaults
29 skills in this plugin
Other plugins' skills for the same job
/craft-configCrafting a config file. The self-documenting contract between package and consumer.npx claudepluginhub attac-t/the-foundry --plugin laravel-playbook