refactor-simplify

Refactor large Python modules by splitting long methods and consolidating boilerplate.

3|1|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/tomazb/rh-acm-switchover --skill refactor-simplify
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-simplify
Source: https://github.com/tomazb/rh-acm-switchover/tree/main/.claude/skills/refactor-simplify
Command: npx skills add https://github.com/tomazb/rh-acm-switchover --skill refactor-simplify

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Simplifies sprawling Python modules such as modules/finalization.py that suffer from long, unreadable methods, duplicated boilerplate, and fragile error handling while preserving every log, state change, and exception path.

Core Features & Use Cases

  • Method extraction with discipline: Splits routines longer than 80 lines into private helpers with clear responsibilities while keeping orchestrator methods thin and organized.
  • Safety-first enforcement: Mandates reading AGENTS/CLAUDE guidance, obeys logging and RBAC state-tracking rules, forbids new dependencies or signature changes, and insists on verification via existing tests.
  • Dual operating modes: Offers review-only reports with ranked, risk-tagged opportunities and apply-mode simplifications executed one transform at a time with syntax and behavioral checks.

Quick Start

Ask the assistant to simplify modules/finalization.py while preserving every log message, state transition, and side effect.

Frequently Asked Questions about refactor-simplify

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

FAQPage Schema
How do I refactor large Python modules without breaking logging and state tracking?

To refactor Python modules without breaking behavior, split long methods into private helpers while strictly preserving every log message, state transition, and exception path. This keeps orchestrator methods thin and maintains existing dry-run safeguards.

What is the safest way to simplify long Python methods with duplicated boilerplate?

Simplifying long Python methods involves extracting routines over 80 lines into focused private helpers and consolidating repeated boilerplate. The process mandates reading project guidance first and verifying changes through existing tests to ensure behavior remains unchanged.

Can I review Python refactoring opportunities before applying code changes?

Yes, you can use review-only mode to generate ranked, risk-tagged reports of simplification opportunities in your Python files. Apply-mode executes transforms one at a time with syntax and behavioral checks, ensuring safe code simplification.

How do I extract methods from complex Python routines while keeping dry-run safeguards intact?

Extract methods by splitting complex routines into clear private helpers while obeying logging and RBAC state-tracking rules. The process forbids new dependencies or signature changes, ensuring dry-run safeguards and error handling paths remain fully intact.

What are the limitations of refactoring Python modules for code simplification?

Limitations include forbidding new dependencies, signature changes, or alterations to logging and state tracking. You must verify all simplifications via existing tests, and the approach specifically targets Python modules with long methods and duplicated boilerplate.