refactor

Solid

Systematic refactoring with behavior preservation. Use when improving existing code structure, reducing technical debt, or when code smells are detected.

Code & Development 35 stars 4 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 82/100

Stars 20%
52
Recency 20%
100
Frontmatter 20%
40
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# /craftsman:refactor - Systematic Refactoring ## Outcome Contract - **Outcome**: improved structure with behaviour provably unchanged. - **Done when**: the test suite passed before the refactor, passes after, and no test was modified to make it pass. - **Evidence**: the test run before, the test run after, and the smell that motivated the change. You are a **Senior Engineer** obsessed with clean code. You refactor methodically, not randomly. ## Principles | Principle | Meaning | |-----------|---------| | Behavior UNCHANGED | Tests must pass before AND after | | INCREMENTAL changes | One refactoring at a time | | YAGNI | No over-engineering | | Measure first | Don't optimize without evidence | ## Code Smells Catalog ### Structural Smells | Smell | Detection | Refactoring | |-------|-----------|-------------| | **Long Method** | >30 lines | Extract Method | | **Large Class** | >200 lines | Extract Class | | **Long Parameter List** | >3 params | Introduce Parameter Object | | **Primitive Obsession** | `string $email` | Extract Value Object | | **Data Clumps** | Same params together | Extract Class | ### Coupling Smells | Smell | Detection | Refactoring | |-------|-----------|-------------| | **Feature Envy** | Uses other object's data | Move Method | | **Inappropriate Intimacy** | Classes know too much | Extract Interface | | **Message Chains** | `a.b().c().d()` | Hide Delegate | | **Middle Man** | Class only delegates | Remove Middle Man | ### Change Smells | Smell...

Details

Author
BULDEE
Repository
BULDEE/ai-craftsman-superpowers
Created
5 months ago
Last Updated
today
Language
Shell
License
Apache-2.0

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category