lc:slow-queries

Analyze Laravel Eloquent and Query Builder usage to detect database performance bottlenecks.

12|2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/edulazaro/laraclaude --skill lc-slow-queries
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lc:slow-queries
Source: https://github.com/edulazaro/laraclaude/tree/main/skills/slow-queries
Command: npx skills add https://github.com/edulazaro/laraclaude --skill lc-slow-queries

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill identifies performance bottlenecks in Laravel applications, such as missing indexes, inefficient queries inside loops, and unbounded database selects that can degrade application speed.

Core Features & Use Cases

  • Index Analysis: Detects columns used in queries that lack proper database indexes.
  • Loop Detection: Identifies database queries executed inside iteration constructs to prevent N+1 performance degradation.
  • Unbounded Selects: Flags queries that retrieve excessive data without limits or pagination.
  • Use Case: Run this skill on a legacy codebase to automatically generate migration files for missing indexes and receive refactoring suggestions for inefficient query patterns.

Quick Start

Run the lc:slow-queries skill to scan the entire project for potential database performance issues and generate a detailed report.

Frequently Asked Questions about lc:slow-queries

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find missing database indexes in Laravel?

To find missing database indexes in Laravel, analyze Eloquent and Query Builder usage to detect queried columns lacking schema indexes. This generates actionable refactoring recommendations and migration files.

How do I detect N+1 query problems in Laravel Eloquent loops?

To detect N+1 query problems in Laravel Eloquent loops, perform static analysis on PHP source code to identify database queries executed inside iteration constructs, revealing performance degradation patterns.

What's the best way to flag unbounded database selects in Laravel?

The best way to flag unbounded database selects in Laravel is scanning Query Builder and Eloquent code to identify queries retrieving excessive data without limits or pagination, preventing speed degradation.

Can I automatically generate Laravel migrations for missing indexes?

Yes, you can automatically generate Laravel migrations for missing indexes by running static analysis on PHP source code and migration files, validating schema efficiency and outputting required migration files.

Does this database optimization approach work with legacy Laravel codebases?

Yes, this database optimization approach works with legacy Laravel codebases by scanning existing Eloquent and Query Builder usage to identify bottlenecks and generate refactoring suggestions for inefficient patterns.