Complexity guardrails
Skill ComeOnOliver/skillshub/skills/noartem/skills/complexity-guardrails
🧠The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.From the repository description
npx -y skills add ComeOnOliver/skillshub --skill complexity-guardrailsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
0.7 KB, 147 tokens by cl100k_base, as published. Nobody here has run it
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
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.