- Home
- Skills
- Agents & Orchestration
- Error Detective (agent)
Error Detective (agent)
Error Detective (agent): Error tracking, stack trace analysis, reproduction step generation, and root cause identification
$2
Error Detective (agent)
Example session with this skill installed
I am getting a 'Target class [App\Http\Controllers\OrderController] does not exist' error in my Laravel 11 app after moving some files around. Here is my web.php and the file structure.
- Read your context and instructions
- Compiled the error detective agent
I have analyzed the routing configuration and directory structure to identify why the OrderController is not being resolved by the Service Container.
Error Analysis Report
| Component | Status | Finding |
|---|---|---|
| Route Definition | Conflict | The route uses string-syntax OrderController@index which requires a namespace prefix. |
| Namespace | Mismatch | OrderController.php has namespace App\Controllers; but is located in app/Http/Controllers. |
| Autoloading | Valid | Composer PSR-4 mapping for App\ is correctly pointing to app/. |
| Class Name | Valid | The filename matches the class definition exactly (case-sensitive). |
Root Cause
The controller was moved to app/Http/Controllers but the internal namespace declaration within the file was updated to namespace App\Controllers;. Additionally, Laravel 11 does not apply a default namespace prefix to routes, causing the string-based route helper to fail.
Reproduction Steps
- Create a route using
Route::get('/test', 'OrderController@index');. - Ensure
OrderControlleris inapp/Http/Controllerswithnamespace App\Controllers;. - Hit the
/testendpoint to trigger theBindingResolutionException.
Recommended Fix
// 1. Update the namespace in app/Http/Controllers/OrderController.php:
namespace App\Http\Controllers;
// 2. Update the route in routes/web.php to use class-based syntax:
use App\Http\Controllers\OrderController;
Route::get('/orders', [OrderController::class, 'index']);
Assumptions
- You are not using a custom RouteServiceProvider with a protected
$namespaceproperty. - The
appdirectory follows standard PSR-4 conventions.
Next steps
- Update the namespace declaration in
OrderController.php. - Run
php artisan route:clearto ensure no stale route caching interferes with the fix.
Connects securely to your tools. The creator never sees your data.
About this skill
Debugging Laravel applications often feels like guesswork when stack traces are incomplete or logs are noisy. This skill transforms your agent into a senior debugger that systematically breaks down errors, identifies root causes, and generates reproduction steps.
What it does
- Stack trace analysis parses complex PHP and Laravel error logs to pinpoint the exact failure point.
- Root cause identification connects symptoms to underlying issues in business logic, environment config, or database state.
- Reproduction step generation creates clear, actionable instructions to trigger the error in a local environment.
- Assumption logging explicitly lists what is unknown about the environment rather than hallucinating facts.
- Security auditing checks proposed fixes against security guidelines to prevent introducing vulnerabilities.
How it works
- Goal definition where the agent restates the debugging objective based on your error report.
- Input audit to identify missing logs, environment details, or context needed for a full analysis.
- Investigation plan outlining the steps to trace the execution flow through the Laravel stack.
- Execution and verification where the agent analyzes the code against Laravel coding standards and security protocols.
- Structured reporting delivering a standardized output containing summary, details, assumptions, and risks.
Frameworks & tools
Specifically optimized for the Laravel ecosystem, including PHP 8.x, Eloquent ORM, Blade, and common Laravel stack traces (Spatie Ignition).
Why this beats prompting it yourself
Manual prompting often leads to agents making "best guesses" about missing context. This skill enforces a strict workflow that prioritizes accuracy, forces the declaration of assumptions, and applies specific Laravel-centric security and coding standards.
Use cases
- Analyze cryptic production stack traces to find the failing line of code.
- Generate automated test cases or manual steps to reproduce a reported bug.
- Audit a proposed bug fix for compliance with Laravel security best practices.
- Debug database-level errors by mapping Eloquent queries to underlying SQL issues.
Known limitations
Requires specific shared files for coding standards and output templates to be present in the agent context. Optimised for PHP/Laravel; accuracy may decrease for other languages.
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 7 days ago
- Software
Git
Permissions
What's inside
Frequently Asked Questions
New in Agents & Orchestration
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.