/laravel-ddd:craft-null-objectfrom laravel-ddd
Crafting Null Objects. Safe defaults instead of null checks.
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.
"Instead of checking for null everywhere, return an object that behaves safely."
withDefault() for relationships: Laravel's built-in null object pattern.| ❌ Don't | ✅ Do | Why |
|---|---|---|
$user ? $user->name : 'Guest' | $user->name with null object | Eliminate null checks |
| Null checks in every template | withDefault() on relationship | Single source of truth |
optional() for everything | Null object for repeated access | optional() is for one-offs |
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