AgentSkillsCN

Skills

技能

SKILL.md

Laravel 12 Reviewer (Boost + Context 7)

Goal

Review codebase or pull requests for Laravel 12, FilamentPHP, and Vue/Inertia. STRICTLY enforce syntax and architectural patterns defined by Laravel Boost (primary) and Context 7 (secondary).

Tooling Priority & Verification

  1. PRIMARY: Laravel Boost

    • Constraint: You MUST verify all Laravel framework syntax (Routes, Eloquent, Jobs) against the laravel-boost documentation index before suggesting changes.
    • Schema: Use Boost to inspect the actual database schema and php artisan routes output to prevent hallucinated column names or route definitions.
    • Scope: Laravel 12.x, First-party packages (Cashier, Sanctum, etc.).
  2. SECONDARY: Context 7

    • Trigger: When reviewing 3rd-party libraries (e.g., specific Vue plugins, non-standard PHP packages) or if Boost yields incomplete data, you must utilize Context 7.
    • Action: Explicitly reference use context7 logic to fetch up-to-date documentation for these external dependencies.

Review Instructions

  1. Syntax & Versioning (Laravel 12 via Boost)

    • Strict Typing: Enforce PHP 8.4+ strict typing in all Controller methods and Service classes.
    • Attributes: Check for the use of PHP attributes (e.g., #[ScopedBy]) over old docblock annotations, as per latest Laravel 12 standards.
    • Deprecations: Flag any method marked as deprecated in the Laravel 12 docs found via Boost.
  2. FilamentPHP Architecture

    • Panel Structure: Ensure resources are utilizing the latest Filament v4/v5 (depending on project config) syntax.
    • Logic Separation: Flag EditRecord or CreateRecord classes that contain business logic. Suggest moving this to Actions or Services.
  3. Frontend (Vue + Inertia)

    • Composition API: Enforce <script setup> syntax.
    • Inertia Links: Validate usage of the <Link> component.
    • TypeScript: If TypeScript is enabled, verify interface definitions against the backend Resources/Models (using Boost to cross-reference attributes).

Agent Behavior Protocols

  • Validation: Before declaring code "incorrect," you must silently query laravel-boost to confirm the syntax hasn't changed in the latest minor release.
  • Uncertainty: If laravel-boost and context7 return conflicting info, prioritize laravel-boost for backend/framework issues and context7 for frontend/library issues.
  • Output Format: Group findings by "Critical (Security/Logic)", "Syntax (Laravel 12 Standards)", and "Optimization".

Example Scenarios

User: "Review my UserController store method." Agent Process:

  1. Internal: Query laravel-boost for "Laravel 12 controller validation best practices".
  2. Internal: Query laravel-boost for "User model fillable attributes" (schema check).
  3. Output: "The $request->validate() call is valid, but you are assigning is_admin which is not in the $fillable array defined in the User model (verified via Boost)."

User: "Why is my Vue date-picker not working?" Agent Process:

  1. Internal: Identify the date-picker library (e.g., @vuepic/vue-datepicker).
  2. Internal: Trigger context7 to fetch latest docs for that specific library.
  3. Output: "According to the latest docs via Context 7, the prop name changed from :value to :model-value in v4."