Loading...
Loading...
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 tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.
npx skill4agent add pproenca/dot-skills refactor| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 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 | |
struct-extract-methodstruct-single-responsibilitystruct-extract-classstruct-compose-methodstruct-function-lengthstruct-replace-method-with-objectstruct-parameter-objectcouple-dependency-injectioncouple-hide-delegatecouple-remove-middle-mancouple-feature-envycouple-interface-segregationcouple-preserve-whole-objectname-intention-revealingname-avoid-abbreviationsname-consistent-vocabularyname-searchable-namesname-avoid-encodingscond-guard-clausescond-polymorphismcond-decomposecond-consolidatecond-special-casecond-lookup-tablepattern-strategypattern-template-methodpattern-factorypattern-open-closedpattern-composition-over-inheritancepattern-extract-superclassdata-encapsulate-collectiondata-replace-primitivedata-encapsulate-recorddata-split-variabledata-replace-temp-with-queryerror-exceptions-over-codeserror-custom-exceptionserror-fail-fasterror-separate-concernsmicro-remove-dead-codemicro-inline-variablemicro-simplify-expressionsmicro-rename-for-clarityreferences/{prefix}-{slug}.mdAGENTS.md