refactoring-methodology

Analyzes touched files and neighboring code for safe, behavior-preserving refactoring opportunities.

3|Updated Dec 7, 2025
One-click install
npx skills add https://github.com/Grimblaz/agent-orchestra --skill refactoring-methodology-grimblaz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-methodology
Source: https://github.com/Grimblaz/agent-orchestra/tree/main/skills/refactoring-methodology
Command: npx skills add https://github.com/Grimblaz/agent-orchestra --skill refactoring-methodology-grimblaz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Proactive refactoring workflow for touched files and nearby debt. Use when hunting extraction opportunities, evaluating duplication or oversized files, or improving structure without changing intended behavior. DO NOT USE FOR: adversarial defect review (use adversarial-review) or net-new feature implementation (use implementation-discipline)

Core Features & Use Cases

  • When recently modified files need a proactive refactoring pass
  • When duplication, oversized functions, or structural debt may have been introduced or exposed
  • When integration gaps or symmetric mechanical fixes should be checked while the relevant code is already open
  • When refactoring decisions need a repeatable analysis and verification flow
  • Proactive hunting stance: do not rubber-stamp a touched file as "fine" without inspection
  • Integration guidance: ensure behavior preserved and architecture rules respected

Quick Start

Identify touched modules and run a proportionate refactor pass to extract reusable helpers and reduce duplication

Frequently Asked Questions about refactoring-methodology

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

FAQPage Schema
How do I refactor recently modified files to reduce code duplication without changing behavior?

To refactor recently modified files without changing behavior, identify touched modules and run a proportionate pass to extract reusable helpers, evaluate duplication, and reduce structural debt. The methodology enforces mandatory checks for size, readability, testability, and integration gaps with explicit guardrails.

What is a proactive refactoring pass and when should I apply it?

A proactive refactoring pass is a workflow that hunts for extraction opportunities, duplication, and oversized functions in touched files and nearby code areas. Apply it when recently modified code exposes structural debt or integration gaps that need behavior-preserving improvements.

Does this refactoring methodology work for checking integration gaps and testability?

Yes, this refactoring methodology explicitly checks for integration gaps, testability, readability, and code duplication. It applies mandatory checks across the touched area to ensure architecture rules are respected and behavior remains preserved during structural improvements.

When should I not use a behavior-preserving refactor playbook?

You should not use a behavior-preserving refactor playbook for adversarial defect review or net-new feature implementation. It is strictly designed for evaluating and improving existing code structure, extracting reusable helpers, and reducing duplication in already touched files.

How do I evaluate overly large functions and structural debt in my codebase?

To evaluate overly large functions and structural debt, apply a repeatable analysis flow that inspects touched files and neighboring code areas. This methodology uses mandatory size, duplication, readability, and testability checks to identify extraction opportunities while preserving intended behavior.