Token导航 LogoToken导航

Agent Skill · 研究检索

debug_laravel(调试 Laravel)

debug_laravel 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

debug_laravel 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为权限未标注;许可证为 MIT,暂无第三方扫描结果,按安装量在研究检索类的 73,675 个 Skill 里排第 44,028。

总安装 941周安装 40GitHub Stars 公开资料未说明下载 330核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:debug_laravel(调试 Laravel)
来源仓库:https://github.com/snakeo/claude-debug-and-refactor-skills-plugin
仓库路径:skills/debug_laravel
安装命令:
npx skills add snakeo/claude-debug-and-refactor-skills-plugin --skill "debug:laravel"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add snakeo/claude-debug-and-refactor-skills-plugin --skill "debug:laravel"

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

debug_laravel 提供 Laravel PHP 框架的调试与开发支持。适用于路由、模型和控制器的问题分析与修复。debug_laravel 属于研究检索类 Skill,可作为该场景下的辅助能力补充。通过 npx 命令安装,需确认 Composer 依赖和环境配置。

使用前应检查数据库连接和缓存设置,防止配置错误。建议结合 Artisan 命令验证操作,确保不影响线上服务。

来源仓库内路径:skills/debug_laravel

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add snakeo/claude-debug-and-refactor-skills-plugin --skill "debug:lar…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    权限没有明确标注,第一次使用时只给一个无关紧要的任务,观察它到底读了哪些文件和网络。

常见问题

6 条

debug_laravel 怎么安装?

在终端执行 npx skills add snakeo/claude-debug-and-refactor-skills-plugin --skill "debug:laravel"。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

debug_laravel 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

debug_laravel 需要什么权限?

权限级别没有明确标注。第一次使用时建议只给无关紧要的任务,观察它实际读写了哪些内容。

debug_laravel 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

debug_laravel 用的人多吗?

公开数据是累计安装 941 次,近一周安装 40 次,下载 330 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

debug_laravel 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
debug_laravel

调试 Laravel · 本页

941—权限未标注MIT未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Laravel Debugging Guide

Overview

Debugging in Laravel requires understanding the framework's conventions, lifecycle, and tooling ecosystem. This guide provides a systematic approach to diagnosing and resolving Laravel issues, from simple configuration problems to complex runtime errors.

Key Principles:

  • Always check logs first (storage/logs/laravel.log)
  • Use appropriate tools for the environment (development vs production)
  • Follow Laravel conventions - most errors stem from convention violations
  • Isolate the problem layer (routing, middleware, controller, model, view)

Common Error Patterns

Class and Namespace Errors

Class 'App\Http\Controllers\Controller' not found

// Problem: Missing base controller extension or incorrect namespace
// Solution: Ensure proper namespace and inheritance
namespace App\Http\Controllers;

use Illuminate\Routing\Controller as BaseController;

class YourController extends BaseController
{
    // ...
}

Target class [ControllerName] does not exist

// Check routes/web.php or routes/api.php
// Laravel 8+ requires full namespace or route groups
use App\Http\Controllers\UserController;

Route::get('/users', [UserController::class, 'index']);

// Or use route group with namespace
Route::namespace('App\Http\Controllers')->group(function () {
    Route::get('/users', 'UserController@index');
});

Database Errors (SQLSTATE)

SQLSTATE[HY000] [1045] Access denied

# Check .env database credentials
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password

# Clear config cache after changes
php artisan config:clear

SQLSTATE[42S02] Table not found

# Run migrations
php artisan migrate

# Check migration status
php artisan migrate:status

# Fresh database with seeders
php artisan migrate:fresh --seed

QueryException with foreign key constraint

// Check migration order - parent tables must exist first
// Use Schema::disableForeignKeyConstraints() for fresh migrations
Schema::disableForeignKeyConstraints();
// ... your schema changes
Schema::enableForeignKeyConstraints();

Route Errors

404 Not Found - Route does not exist

# List all registered routes
php artisan route:list

# Check specific route
php artisan route:list --name=users

# Clear route cache
php artisan route:clear

MethodNotAllowedHttpException

// Wrong HTTP method for route
// Check route definition matches request method
Route::post('/submit', [FormController::class, 'store']);  // Expects POST
Route::put('/update/{id}', [FormController::class, 'update']);  // Expects PUT

// For HTML forms using PUT/PATCH/DELETE
<form method="POST" action="/update/1">
    @csrf
    @method('PUT')
</form>

View Errors

View [name] not found

# Check view file exists at correct path
# resources/views/users/index.blade.php for view('users.index')

# Clear view cache
php artisan view:clear

Undefined variable in view

// Ensure variable is passed from controller
return view('users.index', [
    'users' => $users,
    'total' => $total,
]);

// Or use compact()
return view('users.index', compact('users', 'total'));

Middleware Issues

TokenMismatchException (CSRF)

// Include @csrf in all POST/PUT/DELETE forms
<form method="POST" action="/submit">
    @csrf
    <!-- form fields -->
</form>

// For AJAX requests, include token in headers
$.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
});

// Exclude routes from CSRF if needed (VerifyCsrfToken middleware)
protected $except = [
    'stripe/*',
    'webhook/*',
];

Unauthenticated / 403 Forbidden

# Check middleware applied to route
php artisan route:list --columns=uri,middleware

# Verify auth guards in config/auth.php
# Check Gate/Policy definitions

Queue and Job Failures

Job failed without reason

# Check failed jobs table
php artisan queue:failed

# Retry specific job
php artisan queue:retry <job-id>

# Retry all failed jobs
php artisan queue:retry all

# Clear failed jobs
php artisan queue:flush

Jobs not processing

# Ensure queue worker is running
php artisan queue:work

# Check queue connection in .env
QUEUE_CONNECTION=redis

# Restart queue after code changes
php artisan queue:restart

Cache and Session Problems

Session not persisting

# Clear session files
php artisan session:clear

# Check session driver
SESSION_DRIVER=file  # or redis, database, etc.

# Verify storage permissions
chmod -R 775 storage/
chown -R www-data:www-data storage/

Config/cache showing old values

# Clear all caches
php artisan optimize:clear

# Or individually
php artisan config:clear
php artisan cache:clear
php artisan route:clear
php artisan view:clear

Debugging Tools

Laravel Telescope

The most comprehensive debugging tool for Laravel development.

Installation:

composer require laravel/telescope --dev
php artisan telescope:install
php artisan migrate

Access: Navigate to /telescope in your browser

Key Features:

  • Requests: View all HTTP requests with headers, parameters, response
  • Exceptions: Stack traces and context for all errors
  • Queries: All SQL queries with execution time and bindings
  • Jobs: Queue job payloads, execution times, failures
  • Logs: All log entries in real-time
  • Mail: Preview sent emails with content
  • Cache: Track cache hits, misses, and operations
  • Events: All dispatched events and listeners

Security: Limit access in production via TelescopeServiceProvider:

protected function gate()
{
    Gate::define('viewTelescope', function ($user) {
        return in_array($user->email, [
            'admin@example.com',
        ]);
    });
}

Laravel Debugbar

Quick inline debugging for web pages.

Installation:

composer require barryvdh/laravel-debugbar --dev

Features:

  • Query count and execution time
  • Route information
  • View rendering time
  • Memory usage
  • Timeline visualization

Ray by Spatie

Desktop app for non-intrusive debugging.

Installation:

composer require spatie/laravel-ray --dev

Usage:

ray($variable);                    // Send to Ray app
ray($var1, $var2)->green();        // Color coded
ray()->measure();                  // Start timer
ray()->pause();                    // Pause execution
ray()->showQueries();              // Show all queries

Built-in Debugging Functions

// Dump and Die - stops execution
dd($variable);
dd($user, $posts, $comments);

// Dump without dying
dump($variable);

// Dump, Die, Debug (with extra info)
ddd($variable);

// In Blade templates
@dd($variable)
@dump($variable)

// Log to file
Log::debug('Message', ['context' => $data]);
Log::info('User logged in', ['user_id' => $user->id]);
Log::error('Payment failed', ['order' => $order]);

// Log levels: emergency, alert, critical, error, warning, notice, info, debug

Artisan Tinker

Interactive REPL for testing code:

php artisan tinker

# Test Eloquent queries
>>> User::where('active', true)->count()
=> 42

# Test relationships
>>> $user = User::find(1)
>>> $user->posts()->count()

# Test services
>>> app(UserService::class)->processUser($user)

The Four Phases of Laravel Debugging

Phase 1: Root Cause Investigation

Check Logs First:

# View latest errors
tail -f storage/logs/laravel.log

# Search for specific errors
grep -i "error\|exception" storage/logs/laravel.log | tail -50

# Check with specific date
cat storage/logs/laravel-2025-01-11.log

Verify Configuration:

# Check current environment
php artisan env

# Dump all config values
php artisan config:show

# Check specific config
php artisan config:show database
php artisan config:show queue

# Validate .env file
php artisan config:clear && php artisan config:cache

Check Application State:

# Check if app is in maintenance mode
php artisan up  # or down

# Check scheduled tasks
php artisan schedule:list

# Check registered routes
php artisan route:list

# Check registered events
php artisan event:list

Phase 2: Pattern Analysis

Compare with Laravel Conventions:

ComponentConventionCommon Mistake
ModelsApp\Models\User (singular)Using plural names
ControllersUserControllerMissing Controller suffix
Migrationscreate_users_table (plural)Singular table names
Viewsresources/views/users/index.blade.phpWrong directory structure
RoutesRESTful namingNon-standard HTTP methods

Check for Common Anti-patterns:

// BAD: N+1 query problem
$users = User::all();
foreach ($users as $user) {
    echo $user->profile->bio;  // Query per iteration!
}

// GOOD: Eager loading
$users = User::with('profile')->get();
foreach ($users as $user) {
    echo $user->profile->bio;  // No additional queries
}

Verify Dependencies:

# Check composer dependencies
composer show

# Check for package conflicts
composer diagnose

# Update autoloader
composer dump-autoload

Phase 3: Hypothesis and Testing

Create Focused Tests:

// tests/Feature/UserTest.php
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;

class UserTest extends TestCase
{
    use RefreshDatabase;

    public function test_user_can_be_created()
    {
        $response = $this->post('/users', [
            'name' => 'Test User',
            'email' => 'test@example.com',
        ]);

        $response->assertStatus(201);
        $this->assertDatabaseHas('users', [
            'email' => 'test@example.com',
        ]);
    }
}

Run Tests:

# Run all tests
php artisan test

# Run specific test file
php artisan test tests/Feature/UserTest.php

# Run specific test method
php artisan test --filter=test_user_can_be_created

# Run with coverage
php artisan test --coverage

# Use Pest (if installed)
./vendor/bin/pest

Test in Isolation:

# Test artisan commands
php artisan tinker
>>> User::factory()->create()
>>> $user->notify(new WelcomeNotification)

# Test queue jobs synchronously
QUEUE_CONNECTION=sync php artisan your:command

# Test with fresh database
php artisan migrate:fresh --seed && php artisan test

Phase 4: Implementation and Verification

Apply Fix:

# Clear all caches after changes
php artisan optimize:clear

# Rebuild autoloader
composer dump-autoload

# Restart queue workers
php artisan queue:restart

# Re-cache for production
php artisan config:cache
php artisan route:cache
php artisan view:cache

Verify Fix:

# Run full test suite
php artisan test

# Check for new errors in logs
tail -f storage/logs/laravel.log

# Monitor queue processing
php artisan queue:work --verbose

# Check application health
php artisan about

Quick Reference Commands

Clearing and Caching

# Clear everything
php artisan optimize:clear

# Individual clears
php artisan config:clear      # Config cache
php artisan route:clear       # Route cache
php artisan view:clear        # Compiled views
php artisan cache:clear       # Application cache
php artisan event:clear       # Event cache

# Rebuild caches (production)
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan event:cache

Database Commands

# Migration status
php artisan migrate:status

# Run migrations
php artisan migrate

# Rollback last migration
php artisan migrate:rollback

# Fresh database with seeds
php artisan migrate:fresh --seed

# Show database info
php artisan db:show

# Open database CLI
php artisan db

Queue Commands

# Check failed jobs
php artisan queue:failed

# Retry failed job
php artisan queue:retry <id>

# Retry all failed
php artisan queue:retry all

# Clear failed jobs
php artisan queue:flush

# Work queue
php artisan queue:work --verbose

# Restart workers (after code changes)
php artisan queue:restart

Route Commands

# List all routes
php artisan route:list

# Filter by name
php artisan route:list --name=api

# Filter by path
php artisan route:list --path=users

# Show columns
php artisan route:list --columns=method,uri,name,action

Debugging Commands

# Show app info
php artisan about

# Interactive shell
php artisan tinker

# Check environment
php artisan env

# Show config
php artisan config:show

# Schedule list
php artisan schedule:list

Environment-Specific Debugging

Development

APP_DEBUG=true
APP_ENV=local
LOG_CHANNEL=stack
LOG_LEVEL=debug

Enable all debugging tools:

  • Laravel Telescope
  • Laravel Debugbar
  • Ray

Production

APP_DEBUG=false
APP_ENV=production
LOG_CHANNEL=stack
LOG_LEVEL=error

Use:

  • Error tracking services (Sentry, Bugsnag)
  • Log aggregation (Papertrail, Loggly)
  • APM tools (New Relic, Scout)

Never expose detailed errors in production.

Logging Best Practices

Structured Logging

// Include context with every log
Log::info('Order processed', [
    'order_id' => $order->id,
    'user_id' => $order->user_id,
    'total' => $order->total,
    'items_count' => $order->items->count(),
]);

// Use appropriate log levels
Log::debug('Detailed debugging info');      // Development only
Log::info('Normal operational events');     // User actions, etc.
Log::warning('Unusual but not errors');     // Deprecated usage, etc.
Log::error('Runtime errors');               // Exceptions, failures
Log::critical('System is unusable');        // Database down, etc.

Custom Log Channels

// config/logging.php
'channels' => [
    'payments' => [
        'driver' => 'daily',
        'path' => storage_path('logs/payments.log'),
        'level' => 'info',
        'days' => 30,
    ],
],

// Usage
Log::channel('payments')->info('Payment processed', ['id' => $payment->id]);

Additional Resources

平台分布

OpenCode

29.58%
按下载量换算98

Claude Code

23.23%
按下载量换算77

Antigravity

16.66%
按下载量换算55

windsurf

12.13%
按下载量换算40

Codex

7.47%
按下载量换算25

Gemini CLI

3.13%
按下载量换算10

安全审计

暂无安全审计结果可展示。

权限和风险

权限未标注

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills