원클릭으로
martin-fowler-refactoring
Apply Martin Fowler's catalog to identify code smells and select systematic refactorings.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Apply Martin Fowler's catalog to identify code smells and select systematic refactorings.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Human-navigated, agent-driven pair programming through small design increments and natural handoffs.
Refactor code when the user wants behavior-preserving cleanup or raises a structural concern such as a large method, duplication, mixed responsibilities, awkward control flow, misplaced logic, or difficult naming—even when they are still exploring what to change. Use for extracting, moving, simplifying, reorganizing, renaming internals, and replacing implementations without changing behavior. Route behavior changes and bug fixes to test-driven-development; styling and declarative configuration use targeted verification instead.
Test-drive meaningful application-owned behavior when adding or changing domain rules, interactions, state transitions, authorization, calculations, persistence, API contracts, or fixing bugs—even when the user does not request TDD. Route behavior-preserving structural work to safe-refactoring. Styling, declarative metadata or configuration, generated code, dependency upgrades, mechanical wiring, and test-only maintenance use targeted verification instead.
Inspect Pi session conversations and analyze session logs with DuckDB. Use when asked what happened in a session, to summarize or extract conversation fragments, to read user/assistant messages without tool traffic or thinking, to find debugging evidence, or to calculate session, message, and tool-use statistics from ~/.pi/agent/sessions/**.
Operate Fly.io Sprites via the `sprite` CLI as persistent remote Linux machines. Use when asked to create, list, select, inspect, use, or destroy a Sprite; run commands with `sprite exec`, open an interactive shell with `sprite console`, install packages, clone repos, edit files, serve or expose an app, check or change a Sprite URL, proxy ports, create/list/inspect/restore checkpoints, or troubleshoot common Sprite workflows including wake-up behavior, wrong target selection, auth, networking, and storage.
Process manager for long-running background processes. Use when starting development servers, watching files, or running commands that need to continue in the background while agent continues working.
| name | martin-fowler-refactoring |
| description | Apply Martin Fowler's catalog to identify code smells and select systematic refactorings. |
| disable-model-invocation | true |
| Code Smell | Primary Refactorings |
|---|---|
| Mysterious Name | Rename Function, Rename Variable, Rename Field, Change Function Declaration |
| Duplicated Code | Extract Function, Slide Statements, Pull Up Method |
| Long Function | Extract Function, Replace Temp with Query, Decompose Conditional, Replace Conditional with Polymorphism, Replace Loop with Pipeline |
| Long Parameter List | Replace Parameter with Query, Preserve Whole Object, Introduce Parameter Object, Remove Flag Argument, Combine Functions into Class |
| Global Data | Encapsulate Variable |
| Mutable Data | Encapsulate Variable, Split Variable, Slide Statements, Separate Query from Modifier, Remove Setting Method, Replace Derived Variable with Query |
| Divergent Change | Split Phase, Move Function, Extract Class |
| Shotgun Surgery | Move Function, Move Field, Combine Functions into Class, Combine Functions into Transform, Inline Function |
| Feature Envy | Move Function, Extract Function |
| Data Clumps | Introduce Parameter Object, Preserve Whole Object, Extract Class |
| Primitive Obsession | Replace Primitive with Object, Replace Type Code with Subclasses, Replace Conditional with Polymorphism, Extract Class, Introduce Parameter Object |
| Repeated Switches | Replace Conditional with Polymorphism |
| Loops | Replace Loop with Pipeline |
| Lazy Element | Inline Function, Inline Class, Collapse Hierarchy |
| Speculative Generality | Collapse Hierarchy, Inline Function, Inline Class, Change Function Declaration, Remove Dead Code |
| Temporary Field | Extract Class, Move Function, Introduce Special Case |
| Message Chains | Hide Delegate, Extract Function, Move Function |
| Middle Man | Remove Middle Man, Inline Function, Replace Superclass with Delegate, Replace Subclass with Delegate |
| Insider Trading | Move Function, Move Field, Hide Delegate, Replace Subclass with Delegate, Replace Superclass with Delegate |
| Large Class | Extract Class, Extract Superclass, Replace Type Code with Subclasses, Replace Conditional with Polymorphism |
| Alternative Classes with Different Interfaces | Change Function Declaration, Move Function, Extract Superclass |
| Data Class | Encapsulate Record, Remove Setting Method, Move Function, Extract Function, Split Phase |
| Refused Bequest | Push Down Method, Push Down Field, Replace Subclass with Delegate, Replace Superclass with Delegate |
| Comments | Extract Function, Change Function Declaration, Introduce Assertion |
Composing Functions: Extract Function, Inline Function, Extract Variable, Inline Variable, Change Function Declaration, Encapsulate Variable, Rename Variable, Introduce Parameter Object, Combine Functions into Class, Combine Functions into Transform, Split Phase, Preserve Whole Object
Encapsulation: Encapsulate Record, Encapsulate Collection, Replace Primitive with Object, Replace Temp with Query, Extract Class, Inline Class, Hide Delegate, Remove Middle Man, Replace Subclass with Delegate, Replace Superclass with Delegate
Moving Features: Move Function, Move Field, Move Statements into Function, Move Statements to Callers, Replace Inline Code with Function Call, Slide Statements, Split Loop, Replace Loop with Pipeline, Remove Dead Code
Organizing Data: Split Variable, Rename Field, Replace Derived Variable with Query, Change Reference to Value, Change Value to Reference
Simplifying Conditionals: Decompose Conditional, Consolidate Conditional Expression, Consolidate Duplicate Conditional Fragments, Remove Control Flag, Replace Nested Conditional with Guard Clauses, Replace Conditional with Polymorphism, Introduce Special Case, Introduce Assertion
Refactoring APIs: Separate Query from Modifier, Parameterize Function, Remove Flag Argument, Replace Parameter with Query, Replace Query with Parameter, Remove Setting Method, Replace Constructor with Factory Function, Replace Function with Command, Replace Command with Function
Dealing with Inheritance: Pull Up Method, Pull Up Field, Pull Up Constructor Body, Push Down Method, Push Down Field, Extract Subclass, Extract Superclass, Collapse Hierarchy, Replace Type Code with Subclasses, Remove Subclass, Replace Superclass with Delegate, Replace Subclass with Delegate