Agent skill
complexity-guardrails
Keep cyclomatic complexity low; flatten control flow, extract helpers, and prefer table-driven/strategy patterns over large switches
Install this agent skill to your Project
npx add-skill https://github.com/noartem/skills/tree/main/skills/complexity-guardrails
SKILL.md
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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
laravel-transactions-and-consistency
Wrap multi-write operations in transactions; use dispatchAfterCommit and idempotency patterns to ensure consistency
laravel-filesystem-uploads
Store and serve files via Storage; set visibility, generate URLs, and handle streaming safely
laravel-task-scheduling
Schedule tasks with safety; use withoutOverlapping, onOneServer, and visibility settings for reliable cron execution
laravel-dependencies-trim-packages
Remove unneeded Composer packages and assets to improve boot time, memory, and security surface
laravel-controller-tests
Write focused controller tests using HTTP assertions; keep heavy logic in Actions/Services and unit test them
laravel-strategy-pattern
Use the Strategy pattern to select behavior at runtime; bind multiple implementations to a shared interface
Didn't find tool you were looking for?