name: package-scaffold description: "Use this skill when adding Laravel package capabilities or package shape changes after creating a package from this starter: commands, migrations, routes, config, views, assets, middleware, workbench files, or new publishable resources." license: MIT metadata: author: laravel
Package Scaffold
Primary Goal
Add package features in the right place while keeping package names, namespaces, config keys, and publish tags consistent.
Workflow
- Inspect the existing package structure, sibling examples, README setup notes, and current service provider before creating files; in short, inspect the existing package structure and sibling examples first.
- Identify whether the request touches commands, migrations, routes, config, views, assets, package shape changes, tests, docs, compatibility, or release flow.
- Use Laravel-native package conventions and keep namespaces, publish tags, docs, config keys, URLs, and badges consistent with the configured package.
- Use
package-service-providerfor provider wiring,package-testingfor coverage,package-docsfor docs,package-compatibilityfor matrix-sensitive changes, andpackage-releasefor release tasks. - If this starter has not been configured yet, preserve
configure.phpmappings when adding or removing selectable capabilities so opt-out cleanup stays accurate. - Add only the files needed for the requested capability and validate with the narrowest relevant command before broader checks.
References
src/*ServiceProvider.phpconfig/*.phproutes/*.phpresources/views/database/migrations/public/tests/Feature/andtests/Unit/
Examples
- Add an Artisan command: create the command class under
src/Console/Commands, register it in the provider, add a feature test for observable console output, and document the command if it is user-facing. - Add a publishable migration: place the migration in
database/migrations, wire it through the provider with aexpressive-migrationstag, and test publish behavior with Testbench.
Anti-Patterns
- Adding unused scaffolding because a package might need it later.
- Mixing old placeholder names with the configured package name.
- Avoid changing dependencies without approval.
- Replacing explicit Laravel package code with a helper abstraction when one feature-specific change would do.