/laravel-ddd:decide-registryfrom laravel-ddd
When to use the Registry pattern for runtime extensibility.
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.
"Register once, resolve anywhere."
Use Registry when:
Use Direct DI when:
Ask: "Do I need to discover or extend implementations at runtime?"
| Scenario | Use |
|---|---|
| User selects from available strategies | Registry |
| Third-party can add implementations | Registry |
Need all() or getOptions() methods | Registry |
| One implementation, injected directly | Direct DI |
| Known at compile time | Direct DI |
class StrategyRegistry {
public function register(StrategyInterface $s): void;
public function resolve(string $id): ?StrategyInterface;
public function all(): Collection;
}
For concrete examples from Laravel, Spatie, and production code, 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-actionCrafting an Action. The heart of business logic./craft-collectionCrafting custom collections. Domain pipelines./craft-concernCrafting Concerns (traits). Thin wiring, not business logic./craft-contextCrafting Context Objects. Parameter encapsulation for complex operations./craft-controllerCrafting thin controllers. Traffic cops, not business logic./craft-domain-structureCrafting Domain Structure. Mini-Laravel-app per domain.