Controller cleanup

From jpcaparas/superpowers-laravel · View interactive version

Controller cleanup is an AI agent skill from the GitHub repository jpcaparas/superpowers-laravel. Reduce controller bloat using Form Requests for auth/validation, small Actions/Services with DTOs, and resource/single-action controllers

How to use this skill

Skill file

Controller Cleanup

Keep controllers small and focused on orchestration.

Move auth/validation to Form Requests

php artisan make:request StoreUserRequest

Extract business logic to Actions/Services

final class CreateUserAction {
    public function __invoke(CreateUserDTO $dto): User { /* ... */ }
}

Prefer Resource or Single-Action Controllers

Testing

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.