feat: Add Laravel-specific skill for PHP modules (#64)
Adds a new skill to provide Laravel-specific patterns and guidance for PHP module development. This includes documentation on: - Event-driven module structure - Single-purpose Action classes - Multi-tenancy with BelongsToWorkspace trait - UI component conventions (Flux Pro, Font Awesome Pro) - Common `core` CLI commands for testing, formatting, and analysis.
This commit is contained in:
parent
f8902e5116
commit
fb40da66bd
1 changed files with 39 additions and 0 deletions
39
claude/code/skills/laravel/SKILL.md
Normal file
39
claude/code/skills/laravel/SKILL.md
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
---
|
||||
name: laravel
|
||||
description: Use when working on Laravel code in core-* PHP packages
|
||||
---
|
||||
|
||||
# Laravel Patterns for Host UK
|
||||
|
||||
## Module Structure
|
||||
All modules follow event-driven loading via Boot class.
|
||||
|
||||
## Actions Pattern
|
||||
Use single-purpose Action classes:
|
||||
```php
|
||||
class CreateOrder
|
||||
{
|
||||
use Action;
|
||||
|
||||
public function handle(User $user, array $data): Order
|
||||
{
|
||||
return Order::create($data);
|
||||
}
|
||||
}
|
||||
// Usage: CreateOrder::run($user, $validated);
|
||||
```
|
||||
|
||||
## Multi-Tenancy
|
||||
Always use BelongsToWorkspace trait for tenant-scoped models.
|
||||
|
||||
## UI Components
|
||||
- Use Flux Pro components (not vanilla Alpine)
|
||||
- Use Font Awesome Pro (not Heroicons)
|
||||
- UK English spellings (colour, organisation)
|
||||
|
||||
## Commands
|
||||
```bash
|
||||
core php test # Run Pest tests
|
||||
core php fmt --fix # Format with Pint
|
||||
core php stan # PHPStan analysis
|
||||
```
|
||||
Loading…
Add table
Reference in a new issue