laravel:controller-cleanup

laravel:controller-cleanup is a skill for Claude Code from jpcaparas/superpowers-laravel. It costs 33 tokens per session (243 once invoked), scanned A, original, MIT.

A Laravel coding guide for keeping controllers—the parts of a web application that receive requests—small and focused. It moves validation, permissions, and business work into separate request classes, actions, services, and data objects.

In plain words
What is it for?
Use it to clean up oversized controllers, organize request validation and authorization, separate business operations, and test those operations independently.
Why use it?
It prevents controllers from becoming difficult-to-test files that mix many unrelated responsibilities.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the superpowers-laravel plugin — 12 skills, 44 commands, 1 agent, 1 hook shipped together

Good fit Use it to clean up oversized controllers, organize request validation and authorization, separate business operations, and test those operations independently.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jpcaparas/superpowers-laravel/controller-cleanup
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add jpcaparas/superpowers-laravel --skill controller-cleanup
Clone the repo
git clone --depth 1 https://github.com/jpcaparas/superpowers-laravel

Made for: Claude Code.

Or install superpowers-laravel, the plugin that ships this one along with the rest of its 12 skills, 44 commands, 1 agent, 1 hook.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for laravel:controller-cleanup

README.md
[![agentmods](https://agentmods.dev/badge/skills/jpcaparas/superpowers-laravel/controller-cleanup.svg)](https://agentmods.dev/skills/jpcaparas/superpowers-laravel/controller-cleanup)
Your own site
<a href="https://agentmods.dev/skills/jpcaparas/superpowers-laravel/controller-cleanup"><img src="https://agentmods.dev/badge/skills/jpcaparas/superpowers-laravel/controller-cleanup.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 243 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.00243
Opus 5 $0.00016 $0.00121
Sonnet 5 $0.00007 $0.00049
Haiku 4.5 $0.00003 $0.00024

Measured 7d ago against content hash 81133f8c2a0e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

laravel:controller-cleanup scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 7d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/controller-cleanup/SKILL.md · 40 lines

What it actually says

Controller Cleanup

Keep controllers small and focused on orchestration.

Move auth/validation to Form Requests

  • Create a Request class (e.g., StoreUserRequest) and use authorize() + rules()
  • Type-hint the Request in your controller method; Laravel runs it before the action
php artisan make:request StoreUserRequest

Extract business logic to Actions/Services

  • Create a small Action (one thing well) or a Service for larger workflows
  • Pass a DTO from the Request to the Action to avoid leaking framework concerns
final class CreateUserAction {
    public function __invoke(CreateUserDTO $dto): User { /* ... */ }
}

Prefer Resource or Single-Action Controllers

  • Use resource controllers for standard CRUD
  • For one-off endpoints, use invokable (single-action) controllers

Testing

  • Write feature tests for the controller route
  • Unit test Actions/Services independently with DTOs
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 7d ago First seen · 40 lines · 33 tokens per session scan A 81133f8c2a0e

Subscribe to this mod's changes

laravel:controller-cleanup is a skill published in the GitHub repository jpcaparas/superpowers-laravel (149 stars, last pushed 2mo ago), licensed MIT. It adds 33 tokens to every session and 243 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

laravel-specialist

Build and configure Laravel 10+ applications, including creating Eloquent models and relationships, implementing Sanctum authentication, configuring Horizon queues, designing RESTful APIs with API resources, and building reactive interfaces with Livewire. Use when creating Laravel models, setting up queue workers…

Jeffallan/claude-skills · 86 tokens

create-powergrid-plugin

Create a complete PowerGrid plugin from scratch, including PHP class, Column macro, Blade view, Alpine.js component, and registration.

Power-Components/livewire-powergrid · 31 tokens

laravel-patterns

Laravel architecture patterns, routing/controllers, Eloquent ORM, service layers, queues, events, caching, and API resources for production apps.

hashgraph-online/awesome-codex-plugins · 32 tokens

owl-admin-devtools-generator

A development guide for Owl Admin, a Laravel-based administration system, covering its code generator, API templates, relationships, and visual pages.

slowlyo/owl-admin · 82 tokens

llamaindex-development

Expert guidance for LlamaIndex development including RAG applications, vector stores, document processing, query engines, and building production AI applications.

Mindrally/skills · 32 tokens

craftcms

Craft CMS 5 plugin and module development — extending Craft with PHP. Covers elements, element queries, services, models, records, controllers, migrations, queue jobs, console commands, field types, native fields, events, behaviors, Twig extensions, widgets, filesystems, permissions, project config, GraphQL, testing…

michtio/craftcms-claude-skills · 327 tokens