mcpField
L
laravel:complexity-guardrails

laravel:complexity-guardrails

github.com/jpcaparasDevelopment157121 installsUpdated 17w ago
Repository

About laravel:complexity-guardrails

A complexity-management skill for Laravel developers, with design targets for functions and modules and signs that code needs refactoring. It suggests early returns, helper extraction, and phased processing to keep complexity in check.

Key features

  1. 01Set complexity and function-length targets
  2. 02Keep one responsibility per function
  3. 03Use early returns and guard clauses
  4. 04Extract branches into named helpers
  5. 05Organize processing into phases

Use cases

  1. 01Split hard-to-test code paths
  2. 02Refactor subtly different repeated conditionals
  3. 03Separate I/O, validation, and transformation

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/jpcaparas/superpowers-laravel --skill laravel:complexity-guardrails

After installing, type/laravel:complexity-guardrailsin Claude Code to confirm it loaded.

Details

From the project README

Complexity Guardrails

Design to keep complexity low from day one.

Targets

  • Cyclomatic complexity per function ≤ 7 (start splitting at 5)
  • Function length ≤ 80 lines (aim for ≤ 30)
  • One responsibility per function; one axis of variation per module

Tactics

  • Use early returns and guard clauses; avoid deep nesting
  • Extract branch bodies into named helpers
  • Replace long if/else/switch with tables (maps) or strategies
  • Separate phases: parse → validate → normalize → act

Signs to refactor now

  • Hard-to-test code paths
  • Repeated conditionals with subtle differences
  • Mixed concerns (IO, validation, transformation) in one method

Comments

Markdown supported