One-click install
npx skills add https://github.com/moughamir/justwaitit-review --skill refactor-moughamir
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/moughamir/justwaitit-review/tree/main/.agents/skills/refactor
Command: npx skills add https://github.com/moughamir/justwaitit-review --skill refactor-moughamir

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you refactor existing code safely and consistently by turning common code smells and complexity patterns into a structured set of vetted transformations.

Core Features & Use Cases

  • Guided refactoring rules: 43+ rules across eight impact-prioritized categories (structure, coupling, naming, conditionals, patterns, data organization, error handling, micro-refactoring).
  • AI-ready reviewing workflow: supports agent-driven code improvement tasks such as extracting methods/classes, reducing coupling, and improving readability for maintainability.
  • Consistency and safety checks: uses quantified impact guidance and explicit “when NOT to use” constraints to reduce harmful or unnecessary refactors.
  • Rule-by-rule operational instructions: each rule includes rationale plus incorrect vs correct examples to standardize agent behavior.

Quick Start

Use the refactor skill to review a target code file and apply the highest-impact refactoring rules needed to reduce complexity and improve maintainability.

Frequently Asked Questions about refactor

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

FAQPage Schema
How do I reduce code complexity and improve maintainability?

You reduce code complexity by applying structured refactoring rules that extract methods, decompose conditionals, and reduce coupling. This process systematically transforms code smells into lower-complexity, maintainable patterns using vetted transformations.

What is the best way to refactor code safely without breaking functionality?

The safest way to refactor involves using impact-prioritized rules with explicit constraints. By following structured guidance with "when NOT to use" checks and incorrect versus correct examples, you minimize harmful or unnecessary code transformations.

How do I decompose complex conditionals and simplify code readability?

You decompose complex conditionals and simplify readability by applying targeted refactoring rules. These rules provide specific techniques for conditional simplification and naming conventions to standardize code structure and improve clarity.

When should I not use automated refactoring on my codebase?

You should avoid automated refactoring when changes fall under explicit "when NOT to use" constraints defined by specific rules. These safety checks prevent unnecessary refactors that might increase coupling or fail to improve maintainability.

Can I use Clean Code principles to extract methods and classes from existing code?

Yes, you can use Clean Code principles to extract methods and classes from existing code. The refactoring process applies these principles alongside Martin Fowler's structured guidance to perform agent-assisted code improvements.