software-complexity

Review code changes for cyclomatic and cognitive complexity violations.

Updated May 28, 2026
One-click install
npx skills add https://github.com/syntropic137/harness-app-template --skill software-complexity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: software-complexity
Source: https://github.com/syntropic137/harness-app-template/tree/main/.claude/skills/software-complexity
Command: npx skills add https://github.com/syntropic137/harness-app-template --skill software-complexity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Uncontrolled software complexity accumulates over time, making codebases harder to read, modify, and debug, which slows development and increases the risk of defects as projects scale.

Core Features & Use Cases

  • Complexity Bounds Guidance: Provides clear rules for limiting cyclomatic and cognitive complexity per function to keep code readable and reduce bug risk.
  • Module Design Principles: Teaches how to build deep, low-surface modules that hide implementation details to reduce coupling and maintenance burden across the codebase.
  • Anti-Pattern Detection: Lists red flags for common complexity mistakes like premature abstraction, shallow modules, and accidental coupling, with rationalization prevention to address common pushback.
  • Use Case: When reviewing a new feature implementation, use this skill to identify overly branchy functions, shallow module splits, and speculative abstractions before they become entrenched technical debt.

Quick Start

Use the software-complexity skill to review the recent code changes for complexity violations and get prioritized refactoring recommendations.

Frequently Asked Questions about software-complexity

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce high cyclomatic complexity in overly branchy functions during code review?

To reduce cyclomatic complexity during code review, apply bounded complexity rules per function to limit branch paths, then extract disciplined abstractions to flatten deeply nested logic. This keeps code readable and reduces bug risk in long-lived codebases.

What is cognitive complexity and how does it affect software maintenance costs?

Cognitive complexity measures how difficult code is for humans to read and understand, directly impacting software maintenance costs. Uncontrolled cognitive complexity accumulates over time, making polyglot codebases harder to modify and debug as projects scale.

How do I design deep modules to reduce coupling and technical debt?

To design deep modules that reduce coupling and technical debt, build low-surface modules that hide implementation details effectively. This module design principle enforces orthogonality and minimizes the interface exposed to the rest of the codebase.

Does this approach work for refactoring technical debt in safety-critical production services?

Yes, this approach works for refactoring technical debt in safety-critical production services. It applies to polyglot software projects across all maturity levels, from prototypes to production services, ensuring orthogonality enforcement and bounded complexity.

What are common software complexity anti-patterns like premature abstraction and shallow modules?

Common software complexity anti-patterns include premature abstraction, shallow modules, and accidental coupling. Detecting these red flags during code review prevents speculative abstractions from becoming entrenched technical debt and increases long-term maintenance burden.

When should I enforce bounded cyclomatic complexity limits to prevent code defects?

You should enforce bounded cyclomatic complexity limits whenever reviewing new feature implementations to prevent code defects. Applying these limits early stops overly branchy functions from compounding maintenance costs and introducing defects in long-lived codebases.