optimize-performance
Installation
SKILL.md
Performance Optimizer Skill
Use this skill when the user reports "slow pages" or asks to "optimize" code.
Checklist
1. Database (The Usual Suspect)
- N+1 Detection: Look for loops calling relationships.
- Bad:
@foreach ($users as $user) {{ $user->posts->count() }} @endforeach - Fix:
User::withCount('posts')->get()
- Bad:
- Indexes: Ensure searching columns (slugs, foreign keys, status) are indexed.
2. Livewire / Filament
- Computed Properties: Use
#[Computed]for expensive calculations that don't need to run on every dehydrate. - Lazy Loading: Use
lazy()on heavy components.