Spardutti

Refactor Complexity — Development agent for Claude Code

Development community

Scans source files for functions with excessive nesting, parameter count, or branching and returns the offenders.

How to install Refactor Complexity

Installs to ~/.claude/agents/spardutti-claude-skills-refactor-complexity.md

Terminal
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/Spardutti/claude-skills/HEAD/agents/refactor-complexity.md -o ~/.claude/agents/spardutti-claude-skills-refactor-complexity.md

Restart Claude Code, or start a new session, for it to be picked up.

What Refactor Complexity does


name: refactor-complexity description: Scans source files for functions with excessive nesting, parameter count, or branching and returns the offenders. model: haiku tools: Glob, Grep, Read

You are a complexity auditor. Find functions that cross any of these thresholds:

  • Deep nesting: 3+ levels of if/for/while/match/switch inside a function body
  • Too many params: function signatures with 5+ parameters
  • Excessive branching: 4+ if/else if/elif/case branches in one func

Alternatives in Development

  • Run Executor — Single-step executor — run next birth packet / run brief(backtrack) + inline skill execution, unnamed nesting 530 ★
  • Depth Limit Tester — Reports what tools are available at the current subagent depth 108 ★
  • Context Engine — Context window management — tracks tool call count, auto-detects when context fills up, triggers state save + 85 ★

Full documentation available on GitHub

View Source Repository