Works with the AI Agents you already use
Laravel Performance Audit and Optimization
by Saizul Amin
Audit Laravel projects and PHP-FPM configurations to fix high TTFB, cache issues, and server bottlenecks.
$10
Laravel Performance Audit and Optimization
Example session with this skill installed
Run the Laravel Performance Audit and Optimization skill on my project and give me a prioritised list of what to fix, with exact changes.
- Read your context and instructions
- Compiled the laravel performance audit
Here is what the Laravel Performance Audit and Optimization skill produced.
Demo: real, unedited output of the skill's bundled script on a sample input from its test suite.
Output
performance audit (production): 4 high, 1 medium, 4 low, 0 info
HIGH app/Http/Controllers/ReportController.php:15 [env-outside-config] env('STRIPE_KEY') outside config/: returns null after config:cache
fix: Add it to a config file ('x' => env('STRIPE_KEY')) and read config('file.x').
HIGH app/Services/Feature.php:9 [env-outside-config] env('FEATURE_X') outside config/: returns null after config:cache
fix: Add it to a config file ('x' => env('FEATURE_X')) and read config('file.x').
HIGH resources/views/footer.blade.php:1 [env-outside-config] env('APP_NAME') outside config/: returns null after config:cache
fix: Add it to a config file ('x' => env('APP_NAME')) and read config('file.x').
HIGH routes/web.php:3 [env-outside-config] env('APP_NAME') outside config/: returns null after config:cache
fix: Add it to a config file ('x' => env('APP_NAME')) and read config('file.x').
MEDIUM composer.json [dev-packages] barryvdh/laravel-debugbar is in require (installed in production)
fix: composer remove barryvdh/laravel-debugbar && composer require --dev barryvdh/laravel-debugbar
LOW composer.json [autoloader] optimize-autoloader is not set
fix: Set config.optimize-autoloader=true, or deploy with composer install --no-dev --optimize-autoloader.
LOW app/Http/Controllers/ReportController.php:11 [query-patterns] Order::all() loads the whole table
fix: Paginate, select columns, filter with where(), or chunkById() for batch work.
LOW app/Http/Controllers/ReportController.php:12 [query-patterns] ->get()->count() fetches every row first
fix: Use ->count() on the query builder.
LOW app/Http/Controllers/ReportController.php:13 [query-patterns] ->get()->isEmpty() fetches every row first
fix: Use ->doesntExist() on the query builder.
What you do next
- Fix the highest-severity items first.
- Ask your agent to apply the fixes it suggests, then run the skill again to confirm.
- Keep the skill installed and re-run it whenever the project changes.
Connects securely to your tools. The creator never sees your data.
About this skill
Laravel applications often suffer from high TTFB and sluggish response times due to misconfigured caches, suboptimal PHP settings, or improper environment variable usage. This skill audits your project and server configuration to identify the high-impact bottlenecks that slow down your production environment.
What it does
- Config & Route Audit identifies missing
config:cacheandroute:cachetriggers in deployment scripts. - Environment Leak Detection finds
env()calls outside of configuration files that break when Laravel's config is cached. - PHP Engine Tuning analyzes
php.iniorphp -ioutput to optimize OPcache settings, realpath cache, and JIT. - Production Hygiene flags
APP_DEBUG=true, active Xdebug sessions, or development packages installed on production servers. - Code Pattern Analysis detects expensive database patterns like
Model::all()or->get()->count()that waste memory. - Driver Validation checks if session, cache, and queue drivers are set to high-performance options like Redis.
How it works
- Initialize Audit by providing the project root and the PHP-FPM configuration output using
php-fpm -i. - Execute Audit via the
perf_audit.pyscript to scan codebase and server settings for performance regressions. - Prioritize Fixes based on the generated report, starting with high-impact server settings and cache commands.
- Benchmarking involves measuring TTFB and total response time using
curlbefore and after applying optimizations.
Frameworks & tools
Laravel 9 through 12, PHP 8.1+, PHP-FPM, Redis, Composer, and Laravel Octane (Swoole, RoadRunner, or FrankenPHP).
Why this beats prompting it yourself
Generic prompts often miss the critical interaction between env() calls and config:cache, which can lead to null values in production. This skill uses a dedicated Python auditor to scan the entire vendor-to-file ratio and specifically calculate max_accelerated_files based on your actual file count.
Use cases
- Pre-launch Check to ensure a new Laravel deployment is fully optimized for production traffic.
- Server Migration to tune a new PHP-FPM pool and OPcache settings on fresh infrastructure.
- Traffic Spike Prep to identify bottlenecks before an expected surge in users.
- Cost Reduction by lowering CPU and memory usage through better caching and autoloader optimization.
Known limitations
Does not audit front-end assets, image compression, or Nginx/Apache specific configurations. Requires manual extraction of PHP-FPM info if not running on the server directly.
Open source: saizul/laravel-php-skills on GitHub (MIT licence, by Saizul Amin).
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.
Does not audit front-end assets or Nginx/Apache configs. Requires PHP-FPM info via php -i for server tuning. Focuses on Laravel 9-12 and PHP 8.1+.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 day ago
- Software
Python 3.8+