Refactor

From pproenca/dot-skills · View interactive version

Refactor is an AI agent skill from the GitHub repository pproenca/dot-skills. Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles (formerly refactoring). This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on task

How to use this skill

Skill file

Fowler/Martin Code Refactoring Best Practices

Comprehensive code refactoring guide based on Martin Fowler's catalog and Clean Code principles, designed for AI agents and LLMs. Contains 43 rules across 8 categories, prioritized by impact to guide automated refactoring and code generation.

When to Apply

Reference these guidelines when:

Rule Categories by Priority

| Priority | Category | Impact | Prefix |

|----------|----------|--------|--------|

| 1 | Structure & Decomposition | CRITICAL | struct- |

| 2 | Coupling & Dependencies | CRITICAL | couple- |

| 3 | Naming & Clarity | HIGH | name- |

| 4 | Conditional Logic | HIGH | cond- |

| 5 | Abstraction & Patterns | MEDIUM-HIGH | pattern- |

| 6 | Data Organization | MEDIUM | data- |

| 7 | Error Handling | MEDIUM | error- |

| 8 | Micro-Refactoring | LOW | micro- |

Quick Reference

1. Structure & Decomposition (CRITICAL)

2. Coupling & Dependencies (CRITICAL)

3. Naming & Clarity (HIGH)

4. Conditional Logic (HIGH)

5. Abstraction & Patterns (MEDIUM-HIGH)

6. Data Organization (MEDIUM)

7. Error Handling (MEDIUM)

8. Micro-Refactoring (LOW)

How to Use

Read individual reference files for detailed explanations and code examples:

Full Compiled Document

For the complete guide with all rules expanded: AGENTS.md

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.