/claude-toolkit:package-devfrom claude-toolkit
Scaffolds, tests, documents, and releases Laravel/PHP packages: generates directory structure, service providers, facades, Pest tests with Orchestra Testbench, READMEs, and Packagist release workflows.
Ships in claude-toolkit. 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.
Scaffold, test, document, and release production-quality Laravel/PHP packages — from initial directory structure through Packagist publishing. Follows Laravel ecosystem conventions and integrates with Orchestra Testbench for package testing.
| Command | Description |
|---|---|
/package scaffold | Generate complete package directory structure with all boilerplate files |
/package test | Set up Pest test suite with Orchestra Testbench integration |
/package release | Run release checklist: version bump, changelog, git tag, Packagist |
/package readme | Generate professional README with badges, installation, usage, and testing sections |
/package upgrade | Upgrade PHP/Laravel version constraints and dependencies |
/package scaffold — Generate Package StructureAsk the user for:
cleaniquecoderslaravel-helper, profile)^8.4)^12.0, Laravel packages only)CleaniqueCoders\Profile)If the user already provided context, extract what you can and only ask for what is missing.
Use Spatie's skeleton templates to scaffold the package:
After cloning, run the skeleton's configure script to replace placeholders with the actual vendor name, package name, namespace, and author details.
Create the following structure:
packages/vendor/package-name/
├── src/
│ ├── PackageNameServiceProvider.php
│ ├── Facades/
│ │ └── PackageName.php
│ ├── Actions/
│ ├── Concerns/
│ └── Contracts/
├── config/
│ └── package-name.php
├── database/
│ ├── factories/
│ └── migrations/
├── resources/
│ └── views/
├── routes/
│ └── web.php
├── tests/
│ ├── Pest.php
│ ├── TestCase.php
│ └── Feature/
├── stubs/
├── .gitignore
├── CHANGELOG.md
├── LICENSE
├── README.md
├── composer.json
└── phpunit.xml
Only include directories for features the user selected. Always include src/, tests/,
composer.json, README.md, CHANGELOG.md, and LICENSE.
Read references/package-structure.md for the full template. Key sections:
{
"name": "vendor/package-name",
"description": "Package description here",
"keywords": ["laravel", "php"],
"license": "MIT",
"require": {
"php": "^8.4",
"illuminate/support": "^12.0"
},
"require-dev": {
"orchestra/testbench": "^10.0",
"pestphp/pest": "^5.0",
"pestphp/pest-plugin-laravel": "^5.0",
"laravel/pint": "^1.0"
},
"autoload": {
"psr-4": {
"Vendor\\PackageName\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Vendor\\PackageName\\Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"providers": [
"Vendor\\PackageName\\PackageNameServiceProvider"
],
"aliases": {
"PackageName": "Vendor\\PackageName\\Facades\\PackageName"
}
}
},
"config": {
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
Read references/package-structure.md for the full ServiceProvider patterns. The provider must:
Illuminate\Support\ServiceProviderregister() for bindings and merging configboot() for publishing assets, loading routes, views, migrations, and commandsif ($this->app->runningInConsole()) blocks for publishable assets{package-name}-config, {package-name}-migrations, etc.<?php
declare(strict_types=1);
namespace Vendor\PackageName\Facades;
use Illuminate\Support\Facades\Facade;
/**
* @see \Vendor\PackageName\PackageName
*/
class PackageName extends Facade
{
protected static function getFacadeAccessor(): string
{
return \Vendor\PackageName\PackageName::class;
}
}
<?php
return [
// Package configuration options
];
Generate .gitignore, LICENSE (MIT), initial CHANGELOG.md, and phpunit.xml.
/package test — Pest + Orchestra Testbench SetupScan the package for existing tests/ directory and phpunit.xml. If they exist, extend
rather than overwrite.
Read references/testbench-patterns.md for the full Testbench TestCase patterns.
<?php
declare(strict_types=1);
namespace Vendor\PackageName\Tests;
use Orchestra\Testbench\TestCase as Orchestra;
use Vendor\PackageName\PackageNameServiceProvider;
class TestCase extends Orchestra
{
protected function setUp(): void
{
parent::setUp();
}
protected function getPackageProviders($app): array
{
return [
PackageNameServiceProvider::class,
];
}
protected function getPackageAliases($app): array
{
return [
'PackageName' => \Vendor\PackageName\Facades\PackageName::class,
];
}
protected function getEnvironmentSetUp($app): void
{
config()->set('database.default', 'testing');
config()->set('database.connections.testing', [
'driver' => 'sqlite',
'database' => ':memory:',
'prefix' => '',
]);
}
protected function defineDatabaseMigrations(): void
{
$this->loadMigrationsFrom(__DIR__ . '/../database/migrations');
}
}
<?php
declare(strict_types=1);
use Vendor\PackageName\Tests\TestCase;
uses(TestCase::class)->in('Feature');
Generate tests based on what the package provides:
| Package Feature | Test File | Key Assertions |
|---|---|---|
| ServiceProvider | tests/Feature/ServiceProviderTest.php | Provider loads, bindings resolve, config merges |
| Config | tests/Feature/ConfigTest.php | Config file publishable, default values correct |
| Migrations | tests/Feature/MigrationTest.php | Tables created, columns match expectations |
| Commands | tests/Feature/CommandTest.php | Command registered, executes without error |
| Routes | tests/Feature/RouteTest.php | Routes registered, middleware applied, responses correct |
| Facade | tests/Feature/FacadeTest.php | Facade resolves, methods callable |
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Feature">
<directory>tests/Feature</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
/package release — Release ChecklistRun through these checks before releasing:
| Check | Command | Pass Condition |
|---|---|---|
| Tests pass | composer test or ./vendor/bin/pest | Exit code 0, no failures |
| Code style | ./vendor/bin/pint --test | No style violations |
| No uncommitted changes | git status | Clean working tree |
| README up to date | Manual review | Installation, usage, and changelog sections current |
| License file present | ls LICENSE | File exists |
Follow Semantic Versioning (SemVer):
| Change Type | Version Bump | Example |
|---|---|---|
| Bug fix, patch | PATCH | 1.0.0 -> 1.0.1 |
| New feature, backward-compatible | MINOR | 1.0.1 -> 1.1.0 |
| Breaking change | MAJOR | 1.1.0 -> 2.0.0 |
Update the version in composer.json if a version field exists (most packages rely on
git tags instead).
Follow Keep a Changelog format:
# Changelog
All notable changes to this project will be documented in this file.
## [Unreleased]
## [1.1.0] - 2026-02-27
### Added
- New feature X for handling Y
- Support for Laravel 12
### Changed
- Updated minimum PHP version to 8.2
### Fixed
- Resolved issue with config publishing (#42)
## [1.0.0] - 2026-01-15
### Added
- Initial release
- Service provider with config publishing
- Facade support
- Migration publishing
[Unreleased]: https://github.com/vendor/package/compare/1.1.0...HEAD
[1.1.0]: https://github.com/vendor/package/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/vendor/package/releases/tag/1.0.0
git add -A
git commit -m "chore: release 1.1.0"
git tag -a 1.1.0 -m "1.1.0"
git push origin main --tags
curl -X POST https://packagist.org/api/update-package?username=USER&apiToken=TOKEN/package readme — README GenerationRead composer.json, src/, and config/ to understand what the package provides.
# Package Name
[](https://packagist.org/packages/vendor/package-name)
[](https://github.com/vendor/package-name/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://packagist.org/packages/vendor/package-name)
Short description of the package — one or two sentences.
## Installation
You can install the package via Composer:
\```bash
composer require vendor/package-name
\```
You can publish the config file with:
\```bash
php artisan vendor:publish --tag="package-name-config"
\```
Optionally, you can publish the migrations with:
\```bash
php artisan vendor:publish --tag="package-name-migrations"
\```
## Usage
\```php
use Vendor\PackageName\Facades\PackageName;
// Example usage
$result = PackageName::doSomething();
\```
## Testing
\```bash
composer test
\```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security
vulnerabilities.
## Credits
- [Author Name](https://github.com/author)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE) for more information.
Based on the package scan:
| Package Feature | README Section to Add |
|---|---|
| Config file | "Configuration" section with key options documented |
| Migrations | "Database" section explaining tables created |
| Commands | "Commands" section listing artisan commands |
| Routes | "Routes" section with endpoint table |
| Views | "Views" section explaining publishable views |
| Events | "Events" section listing dispatched events |
| Middleware | "Middleware" section with registration instructions |
/package upgrade — Upgrade DependenciesBump PHP, Laravel, and ecosystem dependency version constraints in an existing package.
Parse composer.json for current constraints:
require.phpilluminate/* packagesorchestra/testbenchpestphp/pest-plugin-laravellaravel/pintFor each dependency being upgraded, verify the target version exists on Packagist:
composer show {package} --available or check https://packagist.org/packages/{vendor}/{package} to confirm the target version/constraint is publishedDisplay a comparison table with availability status:
| Dependency | Current | Target | Available? |
|---|---|---|---|
php | ^8.2 | ^8.4 | ✅ |
illuminate/support | ^11.0 | ^12.0 | ✅ |
orchestra/testbench | ^9.0 | ^10.0 | ✅ |
pestphp/pest-plugin-laravel | ^2.0 | ^3.0 | ✅ |
Confirm with the user before proceeding. Defaults:
^8.4^12.0^10.0Point the user to the official Laravel upgrade guide for breaking changes:
https://laravel.com/docs/{targetMajor}.x/upgradeFor example, when upgrading to Laravel 12: https://laravel.com/docs/12.x/upgrade
Bump version constraints for:
require.phpilluminate/* packages in require and require-devorchestra/testbenchpestphp/pest-plugin-laravellaravel/pintcomposer update
If dependency resolution fails, report which packages conflict and suggest resolution steps.
composer test
Or ./vendor/bin/pest if no test script is defined. Report any failures so the user can address breaking changes.
If the README contains version badges or a "Requirements" section referencing specific PHP/Laravel versions, update those to match the new constraints.
| Laravel | PHP | Testbench | Pest Plugin Laravel |
|---|---|---|---|
| 12.x | ^8.2 | ^10.0 | ^3.0 |
| 11.x | ^8.2 | ^9.0 | ^2.0 / ^3.0 |
| 10.x | ^8.1 | ^8.0 | ^2.0 |
| Anti-Pattern | Correct Approach |
|---|---|
| Hardcoding Laravel version in ServiceProvider | Use illuminate/* packages with version ranges |
Registering everything in boot() | Use register() for bindings, boot() for bootstrapping |
Missing declare(strict_types=1) | Include in every PHP file |
| No publish tags | Always tag publishable assets: {package}-config, {package}-migrations |
| Monolithic ServiceProvider | Extract to separate concerns if provider exceeds 100 lines |
| Testing against real database | Always use SQLite :memory: via Testbench |
Missing extra.laravel in composer.json | Required for auto-discovery to work |
No .gitignore for vendor/ and composer.lock | Packages must ignore composer.lock (apps keep it) |
| File | Read When |
|---|---|
references/package-structure.md | Scaffolding package structure, ServiceProvider, Facade, and composer.json patterns |
references/testbench-patterns.md | Setting up Orchestra Testbench, writing package tests |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
laravel-package, php-package, composer, packagist, testbench, pest
npx claudepluginhub nasrulhazim/claude --plugin claude-toolkit43 skills in this plugin
/business-cardSVG business card designer that takes contact details and brand preferences, then produces 12 front design concepts with optional back designs, interactive HTML preview galleries, individual card showcases with front/back flip animation, and print-ready SVG exports with bleed area and crop marks. Supports horizontal and vertical orientations, six layout styles (minimal, corporate, creative, elegant, bold, tech), multiple color schemes, QR code placeholders, social media icons, and logo integration. Use this skill whenever the user asks to design a business card, create a name card, make visiting cards, or says "design business card", "buat kad bisnes", "create name card", "reka kad perniagaan", "design kad nama", "I need a business card for X".
/ci-cd-pipelineCI/CD pipeline builder for Laravel projects — extends Kickoff's existing GitHub Actions CI with continuous deployment pipelines (staging/production), Docker containerisation, secret management, and failure notifications. Generates Dockerfiles, docker-compose.yml, deployment configs for VPS via SSH, container registry push workflows, and leverages Kickoff's /bin scripts (deploy.sh, backup.sh, setup.sh) in automated workflows. Use this skill whenever the user asks to set up deployment pipelines, containerise a Laravel app, configure CD for staging or production, push Docker images to a registry, manage deployment secrets, add failure notifications to CI, or integrate /bin scripts with GitHub Actions. Triggers for requests like "set up CD pipeline", "deploy to staging automatically", "dockerise my Laravel app", "add Docker to my project", "push image to registry", "manage secrets in CI", "notify on failure", "extend CI with deployment", "setup deploy pipeline", "nak deploy guna GitHub Actions", "tambah Docker dalam project", "setup CD untuk staging", "nak auto deploy ke production", "dockerise Laravel app aku", "tambah notification kalau CI fail", "macam mana nak manage secrets dalam GitHub Actions", or "integrate bin scripts dengan CI". Assumes Laravel Kickoff as the baseline — GitHub Actions CI (Pint, PHPStan, Rector, Pest) and /bin scripts (deploy.sh, backup.sh) are already configured. This skill extends that baseline with CD, Docker, and deployment automation.
/code-qualityPHP and Laravel code quality toolchain — static analysis with Larastan/PHPStan, code style enforcement with Pint, automated refactoring with Rector, baseline management for legacy codebases, and CI pipeline integration via GitHub Actions. Use this skill whenever the user asks to check code quality, fix linting errors, run static analysis, modernise PHP code, set up CI quality gates, manage PHPStan baselines, configure Pint presets, or apply Rector rules. Triggers for requests like "run quality check", "fix my code style", "analyse with larastan", "update phpstan baseline", "modernise my PHP code", "set up CI for quality", "check code quality", "pint tak jalan", "nak fix phpstan error", "setup rector", "betulkan code style", "tambah quality gate dalam CI", or "baseline phpstan untuk legacy code". Assumes Laravel Kickoff as the baseline — PHPStan, Pint, Rector, and GitHub Actions CI are already configured. This skill extends and customises that baseline.
/courseware-builderInteractive HTML courseware builder — turns any technical topic, flow, or process into a CD-Courseware-style interactive slide deck with animated diagrams, step-by-step simulation, syntax-highlighted code examples, and key points panels. Use this skill whenever the user wants to create teaching materials, interactive slides, animated flow diagrams, or step-by-step technical walkthroughs — even if they say "buatkan slides untuk topik X", "jadikan courseware", "buat interactive tutorial", or "create a lesson on X". Also triggers for "convert my diagram to interactive slides" or "build a visual walkthrough for my training".
/debuggingSystematic debugging and error recovery for Laravel and PHP projects — a five-step triage that goes reproduce, localise, reduce, fix, guard. Covers reading a stack trace properly, bisecting with git, isolating a failure to the smallest reproducer, telling a symptom apart from a root cause, and closing every fix with a regression test. Includes Laravel-specific traps: N+1 masked as a timeout, queue jobs failing silently on the wrong connection, cache and config caches serving stale values, Livewire state desync, and eloquent/model events firing in unexpected order. Use this skill whenever the user reports something broken, failing, flaky, slow-then-erroring, or behaving differently in production than locally — including "this test is flaky", "why is this failing", "debug this error", "it works locally but not on staging", "find the root cause", "this exception makes no sense", "the queue job never runs", "bisect this regression", "kenapa error ni", "tolong debug", "test ni kejap pass kejap fail", "cari punca sebenar", "jalan kat local tapi tak jalan kat production", or "job queue tak jalan". Pairs with kickoff-pest-testing for the regression test and log-monitor for production-log-driven investigations.
/deploy-appDeploys a Kickoff-based Laravel application to its host by running `bin/deploy` over SSH, then verifies the release and knows what each way it can stop means. Use this skill whenever the user asks to deploy an app, push the latest code to production, check what commit production is running, bring a site back up after a failed deploy, or roll back — "deploy latest", "deploy the app", "tolong deploy", "deploy latest dulu", "push to production", "apa commit dekat production", "site down after deploy", "keluarkan maintenance mode", "rollback production", "kenapa 503". Covers the deploy command and its flags, the post-deploy verification checklist, the recovery path for each failure mode, and the production traps that have already cost time. Does NOT cover provisioning a new host from bare metal (`bin/provision-host`), CI/CD pipeline design (`ci-cd-pipeline`), or writing deploy operations.
Other plugins' skills for the same job