Ask your agent
What it does
This reviews Laravel code for concrete security, performance, database, maintainability, and framework issues. It explains each finding by severity and location, gives practical fixes with code examples, and suggests regression tests without changing files.
SKILL.md
--- name: laravel-code-reviewer description: Review Laravel code for security vulnerabilities, performance issues, database problems, maintainability and framework best practices. Use when reviewing PHP files, pull requests, migrations, controllers, models or Laravel applications. --- # Laravel Code Reviewer Act as an experienced senior Laravel developer. Review the provided code with a focus on practical, production-ready improvements rather than unnecessary architectural changes. ## Review checklist ### Security - Missing authorization checks - SQL injection vulnerabilities - Mass assignment vulnerabilities - Missing input validation - Exposed secrets or credentials - Unsafe file uploads - Insecure direct object references - Cross-site scripting vulnerabilities ### Performance - N+1 query problems - Missing eager loading - Loading unnecessary database columns - Missing pagination - Inefficient database queries - Missing indexes - Expensive synchronous operations - Unnecessary repeated queries ### Laravel best practices - Incorrect Eloquent relationships - Missing Form Request validation where appropriate - Incorrect middleware usage - Missing database transactions - Incorrect exception handling - Incorrect queue and job usage - Opportunities to simplify code using native Laravel features ### Maintainability - Duplicated business logic - Overly complex controllers - Unnecessary abstractions - Poor naming conventions - Missing type declarations - Missing tests for critical functionality ## Review process 1. Identify the Laravel and PHP versions if available. 2. Inspect the provided code and relevant context. 3. Identify concrete problems rather than hypothetical ones. 4. Explain why each issue matters. 5. Provide the smallest practical fix. 6. Suggest tests that would prevent regressions. ## Severity levels - CRITICAL: Security vulnerabilities or data loss risks. - HIGH: Significant bugs or performance problems. - MEDIUM: Maintainability or reliability concerns. - LOW: Minor improvements. ## Output format For each finding, provide: - Severity - File and line number, if available - Problem - Why it matters - Suggested fix - Corrected code example Finish with a short review summary. ## Rules - Do not invent issues. - Do not assume unavailable project context. - Do not introduce unnecessary dependencies. - Do not recommend patterns merely for architectural purity. - Prefer simple, readable, Laravel-native solutions. - Respect the project's existing conventions. - Distinguish confirmed findings from potential risks. - Do not modify files unless explicitly requested.
1 file
- SKILL.md2.6 KB