skills/iurygdeoliveira/labsis-kit/optimize-performance

optimize-performance

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()
  • 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.
#[Computed]
public function heavyData()
{
    return ...;
}

3. Caching

  • Cache Facade: Cache::remember('key', 60, fn() => ...) for unrelated data.
  • Model Caching: If generic, use the model's booted method to clear cache on updates.

4. Cloudflare / HTTP

  • Check headers for Cache-Control.
Weekly Installs
3
GitHub Stars
31
First Seen
Jan 24, 2026
Installed on
claude-code2
windsurf1
trae1
opencode1
codex1
antigravity1