guru-refactor-calls

Apply structured refactoring techniques to simplify method calls in legacy code.

1|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/CybLow/pypaginate --skill guru-refactor-calls
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guru-refactor-calls
Source: https://github.com/CybLow/pypaginate/tree/main/.opencode/skills/guru-refactor-calls
Command: npx skills add https://github.com/CybLow/pypaginate --skill guru-refactor-calls

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamline complex code by applying structured refactoring techniques to simplify method calls.

Core Features & Use Cases

  • Catalog of techniques to clarify interfaces and reduce parameter clutter (Rename Method, Separate Query from Modifier, Introduce Parameter Object, Add/Remove Parameter, Parameterize Method, Preserve Whole Object, Replace Parameter with Method Call, Hide Method, Replace Constructor with Factory Method, Replace Error Code with Exception, Replace Exception with Test).
  • Real-world scenarios include transforming long multi-parameter methods into smaller helpers, separating data retrieval from modification, and switching error codes to exceptions for robust error handling.

Quick Start

Identify a confusing method signature and apply an appropriate refactoring technique to simplify its interface.

Frequently Asked Questions about guru-refactor-calls

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

FAQPage Schema
How do I simplify method calls with long parameter lists in legacy code?

Replace error codes with exceptions to improve robust error handling by applying the Replace Error Code with Exception refactoring technique. This structured approach separates normal logic from failure management, switching to exceptions for clearer control flow.

When should I separate query from modifier to clean up mixed responsibilities?

Separate query from modifier when a single method both retrieves data and changes state. Applying this refactoring technique splits the operation into distinct methods, ensuring data retrieval remains independent from modification to resolve mixed responsibilities.

What is the best way to refactor a confusing method signature?

The best way to refactor a confusing method signature is to apply Rename Method for clarity or Parameterize Method to handle variations. These structured refactoring techniques simplify the interface and make the code's intent immediately obvious.

Can I replace a constructor with a factory method during refactoring?

Yes, you can replace a constructor with a factory method to clarify object creation interfaces. This refactoring technique hides the constructor, providing better control over instantiation and simplifying complex initialization logic.

Why replace parameter with method call when streamlining complex code?

Replace parameter with method call when the receiving object can already compute the parameter value itself. This refactoring technique eliminates redundant parameter passing, reducing parameter clutter and streamlining complex code interfaces.