mcpField
C
complexity-guardrails

complexity-guardrails

github.com/noartemDevelopment1378 installsUpdated 2w ago
Repository

About complexity-guardrails

A coding skill for keeping software complexity low from the start. It offers measurable limits and refactoring tactics for functions and modules, aimed at developers designing or maintaining code.

Key features

  1. 01Cyclomatic complexity targets
  2. 02Function length limits
  3. 03Single-responsibility guidance
  4. 04Refactoring tactics for branching
  5. 05Separation of processing phases

Use cases

  1. 01Setting complexity standards in a codebase
  2. 02Refactoring deeply nested functions
  3. 03Separating validation from I/O

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/noartem/skills --skill complexity-guardrails

After installing, type/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