Scaffold Laravel packages with ServiceProvider, Facade, Config, and test setup
This skill is limited to using the following tools:
scripts/scaffold_laravel_package.pyCreates a complete Laravel package skeleton with proper structure and all necessary files.
When the user wants to create a Laravel package, use the scaffold script:
python3 ${SKILL_DIR}/scripts/scaffold_laravel_package.py <vendor/package-name> [--with-pest] [--with-facade] [--with-config] [--with-command]
python3 ${SKILL_DIR}/scripts/scaffold_laravel_package.py mwguerra/my-package
python3 ${SKILL_DIR}/scripts/scaffold_laravel_package.py mwguerra/my-package --with-pest
python3 ${SKILL_DIR}/scripts/scaffold_laravel_package.py mwguerra/my-package --with-pest --with-facade --with-config --with-command
packages/
└── vendor/
└── package-name/
├── composer.json
├── README.md
├── LICENSE
├── .gitignore
├── config/
│ └── package-name.php
├── src/
│ ├── PackageNameServiceProvider.php
│ ├── PackageName.php (main class)
│ ├── Facades/
│ │ └── PackageName.php
│ └── Commands/
│ └── InstallCommand.php
└── tests/ (if --with-pest)
├── Pest.php
├── TestCase.php
└── Unit/
└── ExampleTest.php
composer.json
src/ and tests/ServiceProvider
Facade (optional)
Config (optional)
Commands (optional)
Tests (optional)
The script automatically updates the project's composer.json:
packages/vendor/package-namerequire block as @devInstall dependencies:
composer update
Verify installation:
php artisan package-name:install
Publish config (if applicable):
php artisan vendor:publish --tag=package-name-config
Run tests (if testing was added):
cd packages/vendor/package-name
composer install
./vendor/bin/pest
kebab-case (e.g., my-awesome-package)PascalCase (e.g., MyAwesomePackage)kebab-case (e.g., my-awesome-package)kebab-case:action (e.g., my-awesome-package:install)composer.json extra.laravel.providers (and optional aliases).register(): mergeConfigFrom() and container bindings.boot(): publishes() / publishesMigrations() plus loadRoutesFrom(), loadViewsFrom(), loadTranslationsFrom().package-config, package-migrations, package-views, public).about, and hook into optimize / reload.