Agent skill
filament-rules
Filament 4.x coding standards for Laravel 12. Custom Schema namespace (NOT Form), Vietnamese UI, Observer patterns, Image management. USE WHEN creating resources, fixing namespace errors, implementing forms, RelationManagers, Settings pages, or any Filament development.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/filament-rules
SKILL.md
Filament 4.x Standards
Quick reference for Filament 4.x in this Laravel 12 project.
When to Use
- Creating/editing Filament resources
- Namespace errors ("Class not found")
- Forms, tables, RelationManagers
- Settings pages
- Image management
Critical Namespaces
⚠️ This project uses Schema NOT Form!
// Layout → Schemas
use Filament\Schemas\Components\Tabs;
use Filament\Schemas\Components\Grid;
use Filament\Schemas\Components\Section;
// Fields → Forms
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Select;
use Filament\Forms\Components\Toggle;
// Utilities
use Filament\Schemas\Components\Utilities\Get;
use Filament\Schemas\Schema;
// Actions
use Filament\Actions\EditAction;
use Filament\Actions\DeleteAction;
Resource Structure
// Form: Schema with Tabs
public static function form(Schema $schema): Schema
{
return $schema->schema([
Tabs::make()->tabs([
Tabs\Tab::make('Thông tin')->schema([
TextInput::make('name')->label('Tên')->required(),
]),
])->columnSpanFull(),
]);
}
// Table: modifyQueryUsing for eager loading
public static function table(Table $table): Table
{
return $table
->modifyQueryUsing(fn($q) => $q->with(['category']))
->columns([
TextColumn::make('name')->label('Tên')->searchable(),
])
->recordActions([
EditAction::make()->iconButton(),
]);
}
Quick Patterns
Observer for SEO:
class ProductObserver {
public function creating(Product $p): void {
if (empty($p->slug)) $p->slug = Str::slug($p->name);
}
}
// Register: Product::observe(ProductObserver::class);
Vietnamese labels:
TextInput::make('name')->label('Tên')->required();
->dateTime('d/m/Y H:i')
Images:
public function images(): MorphMany {
return $this->morphMany(Image::class, 'model');
}
// Resource: ImagesRelationManager::class
Settings page:
class SettingsPage extends Page implements HasForms {
use InteractsWithForms;
public function form(Schema $schema): Schema { /* ... */ }
}
⚠️ allowHtml() - Use inline styles NOT Tailwind:
->options([1 => '<div style="display: flex;">...</div>'])->allowHtml();
References
Advanced patterns: read .claude/skills/filament/filament-rules/references/advanced-patterns.md
Complete guide: read .claude/skills/filament/filament-rules/CLAUDE.md
Related skills:
read .claude/skills/filament/filament-resource-generator/SKILL.mdread .claude/skills/filament/filament-form-debugger/SKILL.mdread .claude/skills/filament/image-management/SKILL.md
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?