/laravel-playbook:craft-generatorfrom laravel-playbook
Crafting generators. Artisan commands as onboarding UX.
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.
"The install command IS the first impression."
Install Command First: Ship a php artisan package:install command. It publishes config, migrations, stubs, and provider in one step. The user runs one command, not four. Horizon does this. Filament does this. Make the install command do everything vendor:publish would, but guided and sequenced.
Stub Customization: Ship stubs in a stubs/ directory. Check the app's stubs/ first, fall back to the package stub. This lets users customize generated code without forking. Pennant's FeatureMakeCommand does exactly this: file_exists($customPath = $this->laravel->basePath('stubs/feature.stub')).
Extend GeneratorCommand: Use Illuminate\Console\GeneratorCommand for make:* commands. It handles namespace resolution, file existence checks, and stub variable replacement. Override getStub() for the template and getDefaultNamespace() for placement. The framework does the rest.
Use AsCommand Attribute: Register commands with #[AsCommand(name: 'package:action')]. The naming convention is {package}:{action} for package-specific commands, make:{thing} only when generating application code the user owns.
Publish Tags Are Namespaced: Every publishable asset gets a {package}-{type} tag. cashier-config, cashier-migrations, cashier-views. This lets users publish selectively. Never use generic tags like config or migrations.
Migration Stubs Over Real Migrations: Ship migrations as .php.stub files. The user publishes and controls when they run. This respects the developer's database workflow. Timestamps are added during publish, not at package creation time.
Generator Commands Are Onboarding: A make: command is not just scaffolding. It teaches structure. The generated file should include comments, sensible defaults, and the most common configuration. The stub IS documentation.
| Don't | Do | Why |
|---|---|---|
| Force migrations to run on install | Publish as stubs | Developers control their own database |
Require manual vendor:publish steps | Ship an install command | One command, not four |
| Hardcode stubs in the package | Check app stubs/ first | Users customize without forking |
| Use generic publish tags | Namespace as {package}-{type} | Selective publishing |
| Generate empty files | Include comments and defaults | Stubs teach structure |
See examples.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub attac-t/the-foundry --plugin laravel-playbook29 skills in this plugin
Other plugins' skills for the same job
/craft-configCrafting a config file. The self-documenting contract between package and consumer.