/laravel-ddd:decide-eager-loadingfrom laravel-ddd
When to eager load relationships. N+1 prevention decisions.
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.
"One query is better than N+1."
Use with() when:
Use load() when:
Use withCount() when:
Ask: "Will I access this relationship in a loop?"
with()load() conditionallywithCount()| Scenario | Method |
|---|---|
| Query time, known relations | with() |
| Post-query, conditional | load() |
| Only need counts | withCount() |
| Nested relationships | with('a.b.c') |
| Constrained eager load | with(['a' => fn]) |
For concrete examples from this codebase, see examples.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub attac-t/the-foundry --plugin laravel-ddd47 skills in this plugin
/craft-contextCrafting Context Objects. Parameter encapsulation for complex operations.Other plugins' skills for the same job