filament-plugin-scaffold
9
总安装量
9
周安装量
#32199
全站排名
安装命令
npx skills add https://github.com/mwguerra/claude-code-plugins --skill filament-plugin-scaffold
Agent 安装分布
opencode
9
github-copilot
9
amp
9
codex
9
kimi-cli
9
gemini-cli
9
Skill 文档
Filament Plugin Scaffold Skill
Creates a complete Filament plugin skeleton (panel or standalone) following Filament’s official plugin development guidelines.
Usage
When the user wants to create a Filament plugin, use the scaffold script:
python3 ${SKILL_DIR}/scripts/scaffold_filament_plugin.py <vendor/plugin-name> [options]
Options
--with-resource <name>– Include a sample Resource--with-page– Include a sample custom Page--with-widget– Include a sample Widget--with-livewire– Include Livewire component structure--with-pest– Include PestPHP testing (default: yes)--no-pest– Exclude PestPHP testing
Examples
Basic Filament plugin
python3 ${SKILL_DIR}/scripts/scaffold_filament_plugin.py mwguerra/filament-blog
Plugin with Resource
python3 ${SKILL_DIR}/scripts/scaffold_filament_plugin.py mwguerra/filament-blog --with-resource Post
Full-featured plugin
python3 ${SKILL_DIR}/scripts/scaffold_filament_plugin.py mwguerra/filament-blog --with-resource Post --with-page --with-widget
What Gets Created
Directory Structure
packages/
âââ vendor/
âââ filament-plugin-name/
âââ composer.json
âââ README.md
âââ LICENSE
âââ .gitignore
âââ phpunit.xml
âââ config/
â âââ filament-plugin-name.php
âââ database/
â âââ migrations/
â âââ .gitkeep
âââ resources/
â âââ lang/
â â âââ en/
â â âââ messages.php
â âââ views/
â âââ .gitkeep
âââ src/
â âââ PluginNamePlugin.php
â âââ PluginNameServiceProvider.php
â âââ Facades/
â â âââ PluginName.php
â âââ Resources/
â â âââ .gitkeep (or generated Resource)
â âââ Pages/
â â âââ .gitkeep (or generated Page)
â âââ Widgets/
â â âââ .gitkeep (or generated Widget)
â âââ Livewire/
â â âââ .gitkeep
â âââ Commands/
â âââ .gitkeep
âââ tests/
âââ Pest.php
âââ TestCase.php
âââ Unit/
â âââ ExampleTest.php
âââ Feature/
âââ .gitkeep
Generated Files
-
composer.json
- Filament ^3.3 (latest)
- Livewire ^3.6 (latest)
- Laravel ^11.0|^12.0 support
- Orchestra Testbench ^10.0 (latest)
- PestPHP ^3.8 (latest)
- PSR-4 autoloading
- Laravel auto-discovery
-
Plugin Class (
PluginNamePlugin.php)- Implements
Filament\Contracts\Plugin - Resource, Page, Widget registration
- Panel configuration hooks
- Implements
-
ServiceProvider
- View namespace registration
- Translation loading
- Migration publishing
- Config merging
-
Resource (if
--with-resource)- Form schema
- Table configuration
- Resource pages (List, Create, Edit)
-
Page (if
--with-page)- Custom Filament page
- View and logic
-
Widget (if
--with-widget)- Dashboard widget
- Stats or chart example
-
Testing Setup
- PestPHP configuration
- Orchestra Testbench
- Livewire testing utilities
After Running
-
Install dependencies:
composer update -
Register plugin in Panel Provider:
use Vendor\PluginName\PluginNamePlugin; public function panel(Panel $panel): Panel { return $panel ->plugins([ PluginNamePlugin::make(), ]); } -
Publish assets (if needed):
php artisan vendor:publish --tag=filament-plugin-name-config php artisan vendor:publish --tag=filament-plugin-name-migrations -
Run tests:
cd packages/vendor/filament-plugin-name composer install ./vendor/bin/pest
Filament Plugin Best Practices
- Use the Plugin Contract: Always implement
Filament\Contracts\Plugin - Register in boot(): Register resources/pages/widgets in
boot()method - Support Panel Configuration: Allow users to customize via
->plugin() - Translations: Use translation keys for all user-facing strings
- Views: Use namespaced views (
filament-plugin-name::view-name) - Testing: Test Livewire components with
Livewire::test()