laravel-optimization

Audit Laravel module paths for performance issues and generate phased optimization plans.

2|Updated Nov 16, 2024
One-click install
npx skills add https://github.com/onairmarc/dotfiles --skill laravel-optimization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-optimization
Source: https://github.com/onairmarc/dotfiles/tree/main/.agents/skills/laravel-optimization
Command: npx skills add https://github.com/onairmarc/dotfiles --skill laravel-optimization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Audits a Laravel application or composer package module path for performance issues (N+1 queries, unbounded gets, missing cache, sync observers, route closures, fat controllers), then delegates to the feature-planning skill to produce a self-contained, phased, agent-ready optimization plan. Does NOT execute optimizations. A single failing test in the plan's Phase 0 baseline gate is a hard stop.

Core Features & Use Cases

  • Detects common Laravel performance antipatterns in a module path (queries in loops, missing caches, unbounded data loads).
  • Delegates to the feature-planning skill to generate a concrete, phased optimization plan that is agent-ready and self-contained.
  • Does not execute optimizations itself; focuses on assessment and planning to enable safe, auditable improvements.

Quick Start

Audit a module path such as app_modules/WebCMS/src to produce an optimization plan and baseline tests.

Frequently Asked Questions about laravel-optimization

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

FAQPage Schema
How do I audit a Laravel module for N+1 queries and performance bottlenecks?

To audit a Laravel module for performance bottlenecks like N+1 queries, the skill scans a specified module path under app_modules or packages. It detects antipatterns such as unbounded gets, missing caches, and fat controllers to generate a concrete, phased optimization plan.

What is the best way to plan Laravel optimization without breaking existing functionality?

The best way to plan Laravel optimization safely is by generating a self-contained, agent-ready plan that includes a Phase 0 baseline gate. This skill assesses performance issues and delegates planning to enforce strict validation rules, ensuring a single failing test acts as a hard stop.

How do I find missing caches and unbounded gets in my Laravel application code?

Finding missing caches and unbounded gets in Laravel application code requires auditing the specific module path. This skill surfaces these common performance antipatterns alongside sync observers and route closures, then delegates to feature-planning to produce an actionable optimization plan.

Can I use this Laravel performance audit on composer packages?

Yes, you can use this Laravel performance audit on composer packages. The skill applies to module paths under app_modules or packages, allowing it to effectively audit both application code and package code for performance issues like N+1 queries and missing caches.

Does this Laravel optimization skill automatically execute code fixes?

No, this Laravel optimization skill does not execute code fixes or optimizations. It focuses entirely on assessment and planning, generating a self-contained, phased optimization plan that delegates to the feature-planning skill to enable safe, auditable improvements.

Why does my Laravel optimization plan have a hard stop at Phase 0?

A Laravel optimization plan has a hard stop at Phase 0 if a single baseline test fails. This strict validation rule is enforced during the planning phase to prevent unsafe modifications, ensuring the current codebase is stable before applying any phased optimizations.