Help us improve
Share bugs, ideas, or general feedback.
From complexity-reducer
Refactors complex function to reduce cyclomatic complexity via extract method, guard clauses, loop decomposition, and polymorphism. Runs/writes tests, preserves behavior, targets score <=5, reports improvement.
npx claudepluginhub rohitg00/awesome-claude-code-toolkit --plugin complexity-reducerHow this command is triggered — by the user, by Claude, or both
Slash command
/complexity-reducer:simplify-fnThe summary Claude sees in its command listing — used to decide when to auto-load this command
# /simplify-fn - Simplify Complex Function Refactor a complex function to reduce cyclomatic complexity. ## Steps 1. Read the target function and calculate its current complexity score 2. Identify the primary complexity drivers: nested ifs, loops, switch statements 3. Map the function's control flow to understand all execution paths 4. Apply Extract Method refactoring: pull out logical blocks into named functions 5. Replace nested conditionals with guard clauses (early returns) 6. Convert switch statements to lookup tables or strategy pattern where appropriate 7. Replace complex boolean e...
/simplifySimplifies complex code by reducing nesting, eliminating duplication, and improving clarity. Produces a report with before/after metrics, code changes, explanations, and test results.
/code-simplifySimplifies recently changed code for clarity and maintainability without altering behavior. Applies incremental refactorings like guard clauses, function extraction, and dead code removal, verifying tests after each change.
/simplifySimplifies code to improve readability and maintainability by reducing nesting, extracting functions, improving naming, removing duplication, simplifying conditionals, and verifying with tests.
/simplifySimplifies and refactors target code files or modules, reducing complexity and duplication while preserving behavior with included tests.
/complexityAnalyzes code complexity using cyclomatic, cognitive, and maintainability metrics. Identifies functions/classes needing refactoring and generates a summary report.
Share bugs, ideas, or general feedback.
Refactor a complex function to reduce cyclomatic complexity.