refactor-inline-complexity

Audit inline complexity and recommend variable extraction.Produces a report with flattening suggestions for nested expressions.

⭐5stars🔀0forks📁View on GitHub🕐Updated Jan 10, 2026

When & Why to Use This Skill

The refactor-inline-complexity Claude skill is a specialized developer tool designed to enhance code maintainability by auditing inline complexity. It automatically identifies deeply nested expressions, complex attribute chains, and dense compound logic, providing actionable reports for variable extraction. By suggesting how to flatten code through named intermediates, this skill helps engineers improve code readability, reduce cognitive load, and streamline the code review process.

Use Cases

  • Automated Code Quality Audits: Integrate the skill into your workflow to scan pull requests for 'arrow code' or overly complex one-liners that violate clean code principles.
  • Refactoring Legacy Code: Use the skill to analyze inherited codebases, identifying dense logic blocks that can be simplified through intermediate variable extraction for better long-term maintenance.
  • Enhancing Code Readability: Apply the skill to complex conditional statements or long return expressions to transform them into self-documenting code with descriptive variable names.
  • Technical Debt Reduction: Systematically identify and flatten nested expressions in large functions to make the logic more transparent and easier for team members to debug.
namerefactor-inline-complexity
licenseMIT
description|
authorJordan Godau

Instructions

Read all references in references/ before using this skill.

Signals

  • Reviewing code for nested calls or deep attribute chains
  • Compound expressions that should be flattened with named intermediates
  • The user asks to "audit complexity" or "flatten expressions"
  • Readability concerns in conditionals, returns, or argument lists

References

Directory: references/

  • 01_GOAL.md
  • 02_DEFINITIONS.md
  • 03_INVARIANTS.md
  • 04_SCOPE.md
  • 05_CHECKS.md
  • 06_OUTPUT.md