Skip to content
Back to skills

Complexity Guardrails

ASecurity

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

  • 147 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added June 6, 2026
code-qualityrails

Security analysis

A100/100

Scanned June 6, 2026

npx -y skills add jpcaparas/superpowers-laravel --skill complexity-guardrails --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Complexity Guardrails?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Complexity Guardrails
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jpcaparas-complexity-guardrails/badge)](https://www.skillsdirectory.com/skills/jpcaparas-complexity-guardrails)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: laravel:complexity-guardrails
description: Keep cyclomatic complexity low; flatten control flow, extract helpers, and prefer table-driven/strategy patterns over large switches
---

# 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

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.