laravel:complexity-guardrails

SkillDev tools

Keep cyclomatic complexity low; flatten control flow, extract helpers, and prefer table-driven/strategy patterns over large switches

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the laravel:complexity-guardrails skill

What this skill tells your AI

The instructions your AI receives, as published by jpcaparas/superpowers-laravel in skills/complexity-guardrails/SKILL.md and read by ahel’s review.

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

Signals

GitHub stars
153
Forks
2
Last commit
Jul 2026
Advanced
Catalog kind
skill
Gateway key
laravel-complexity-guardrails
Source
github.com/jpcaparas/superpowers-laravel