lc-volt-component
Generate a Livewire Volt single-file component following project conventions.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Generate a Livewire Volt single-file component following project conventions.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Create a Larascraper scraper (v2 or v3) for a target website, chaining browser actions (click, type, wait, scroll), conditional flow (when/repeatUntil), captcha solving, and file/PDF downloads. Detects the installed major and generates the matching style.
Add or edit a Laracrate file collection in config/laracrate.php with the correct anatomy (disk, access, types, variants, previews, extract/embed, flags, per-model scoping).
Runtime-verified Laravel inspection using the Laravel Boost MCP server (Tinker, Database Query/Schema, Last Error) instead of static grep. Falls back to Docker/Tinker if Boost is not installed.
Scaffold spatie/laravel-permission setup - add the HasRoles trait to a model and generate a roles & permissions seeder.
Audit spatie/laravel-permission usage - permissions used in code but undefined, defined but unused, unprotected routes, guard mismatches, and cache pitfalls.
Extract business logic from a controller or Livewire component method into a Laractions Action class.
| name | lc:volt-component |
| description | Generate a Livewire Volt single-file component following project conventions. |
| argument-hint | [component-name] |
| user-invocable | true |
| allowed-tools | Read Grep Bash Edit Write Glob |
Create a Livewire Volt single-file component that follows the project's conventions and patterns. All Livewire components in this project MUST use the Volt single-file format -- never create separate PHP class files in app/Livewire/.
| Subcommand | Description |
|---|---|
| (no argument) | Prompt for the component name and purpose, then generate. |
[component-name] | Generate a Volt component at the specified path. Names can use dot or slash notation. |
This is a generator skill -- it always creates files. There is no analyze-only or fix mode.
[component-name] argument is provided, use it as the component name.
properties.edit) or slash notation (e.g., properties/edit).resources/views/livewire/{name}.blade.php (dots become directory separators).Before generating, examine existing components to match the project's conventions:
Glob to find similar components in the same directory or feature area.Read to examine 1-2 existing components to understand:
@text() for all translations with English defaults$color in group context)wire:model (not .live unless real-time updates needed)<x-modal> for modalsCreate the file using Write with this structure:
<?php
use App\Models\RequiredModel;
use Illuminate\Support\Facades\Auth;
use Livewire\Volt\Component;
new class extends Component {
// Public properties for data binding
public $property;
// Form data properties
public string $name = '';
public string $email = '';
// Validation rules
protected function rules(): array
{
return [
'name' => 'required|string|max:255',
'email' => 'required|email',
];
}
public function mount($property = null)
{
// Initialize component state
if ($property) {
$this->property = $property;
$this->name = $property->name;
}
}
public function save()
{
$this->validate();
// Business logic here
session()->flash('success', text('saved_successfully', 'Saved successfully'));
}
}; ?>
<div>
{{-- Template content --}}
</div>
For components that manage a single model (create/edit):
mount() to load existing data for edit modesave() method with validationFor components that display collections:
wire:model.liveFor components that open modals:
$dispatch('open-modal', { id: 'modal-id' }) for opening$dispatch('close-modal') for closingFor standalone form components:
$this->reset() after successful submission@error directives on x-fields componentsBefore writing the file, verify:
new class extends Componentuse statements (never inline \App\Models\...)<div> element wrapping all template content@text('key', 'Default') or text('key', 'Default')$color variable)wire:model used appropriately (not .live unless needed)dark:bg-..., dark:text-...)alert(), confirm(), or browser dialogs@error directives or uses x-fields components (which include them automatically)After creating the component, inform the user if they need to:
routes/app.php, routes/web.php, routes/group.php)<livewire:component-name /> or @livewire('component-name')resources/views/livewire/{feature}/{component}.blade.phpresources/views/livewire/web/{feature}/{component}.blade.phpresources/views/livewire/group/{feature}/{component}.blade.phpresources/views/livewire/{component}.blade.phpresources/views/livewire/modals/{component}.blade.phpapp/Livewire/. All Livewire logic goes in the Blade file.__() for translations. Always use text() or @text().wire:ignore on the JS-managed sections.use Livewire\WithFileUploads; trait and use WithFileUploads; in the class.use Livewire\WithPagination; trait and use WithPagination; in the class.