laravel-refactor

Refactors Laravel and Livewire projects to modern patterns with Pint, PHPStan, Pest, and Rector.

3|Updated Nov 11, 2025
One-click install
npx skills add https://github.com/vlados/lawdiff --skill laravel-refactor-vlados
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: laravel-refactor
Source: https://github.com/vlados/lawdiff/tree/main/.claude/skills/refactor
Command: npx skills add https://github.com/vlados/lawdiff --skill laravel-refactor-vlados

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides expert guidance and actionable patterns to modernize Laravel and Livewire applications by introducing a cohesive toolset, architecture improvements, and automated quality gates.

Core Features & Use Cases

  • Structured refactoring guidance: Transform fat controllers, improve architecture, and extract business logic into services/actions.
  • Modern tooling adoption: Set up Laravel Pint, PHPStan/Larastan, Pest, and Rector, plus CI/CD quality gates and architecture tests.
  • Livewire optimization: Update Livewire components to modern patterns and migrate to Livewire 3 where applicable.
  • Use Case: You have a legacy Laravel app with heavy controllers and outdated Livewire components; use this skill to plan and execute a modernization sprint with automated tests and CI integration.

Quick Start

  • Provide a Laravel project to refactor; the skill will guide the adoption of Pint, PHPStan/Larastan, Pest, and Rector, plus CI/CD integration and Livewire 3 migration patterns.

Frequently Asked Questions about laravel-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a legacy Laravel app to use modern tooling?

Migrating to Livewire 3 involves updating existing components to modern patterns and utilizing structured refactoring guidance. This Skill provides specific migration patterns to safely transition your Livewire components during the modernization sprint.

Do I need PHPStan and Rector to set up automated quality gates in Laravel?

Refactoring fat controllers involves extracting business logic into dedicated services or actions to improve application architecture. This Skill provides structured guidance to transform heavy controllers and establish a more maintainable codebase structure.

Can I use this approach to migrate legacy Livewire components to Livewire 3?

Yes, this approach specifically supports Livewire optimization by updating legacy components to modern patterns. It provides actionable migration patterns to transition your Livewire components to version 3 during your refactoring sprint.

What is the best way to set up a CI/CD quality gate for a Laravel project?

The best way to set up a CI/CD quality gate is integrating Laravel Pint for formatting, PHPStan for static analysis, and Pest for testing. This toolchain automates code standard enforcement and runs architecture tests on every pipeline run.