← ClaudeAtlas

patterns-and-refactoringlisted

Use before designing or writing any non-trivial code, and before any refactor. Two entry paths — for new code, name the axis of change and pick the pattern that absorbs it (or prove none is needed); for existing code, name the smell and pick the refactoring that cures it. Covers the 22 Gang of Four patterns, 66 refactoring techniques, 22 code smells, enterprise (PoEAA), architectural, DDD, distributed/cloud, messaging, concurrency, functional and frontend patterns, plus pattern anti-patterns and the idioms your framework already provides. Triggers on designing a class/service/module/package, choosing an approach, "how should I structure this", refactoring, cleaning up, "this code is messy", legacy migration, and reviewing a design.
christianpasinrey/refactoring.guru-skill · ★ 3 · Code & Development · score 74
Install: claude install-skill christianpasinrey/refactoring.guru-skill
# Patterns & Refactoring Two doors into this skill. Pick the one that matches the trigger. ```mermaid flowchart TD T{What triggered this?} -->|New code to design| A[Path A: Force → Pattern] T -->|Existing code that hurts| B[Path B: Smell → Refactoring] A --> A1[Step 1: Name the force] A1 --> A2[Step 2: Route to a family] A2 --> A3[Step 3: Framework already solve it?] A3 --> A4[Step 4: YAGNI gate] A4 --> A5[Step 5: State the decision] B --> B1[Step 1: Name the smell] B1 --> B2[Step 2: Cover with tests] B2 --> B3[Step 3: Smallest refactoring first] B3 --> B4{Does a pattern<br/>emerge naturally?} B4 -->|Yes| A4 B4 -->|No| B5[Stop. Refactoring was enough.] A5 --> Z[Implement] B5 --> Z ``` --- ## Step 0 — Triage (both paths) Over-applying this skill is itself an anti-pattern. Be honest about the level. | Level | Looks like | What you produce | |---|---|---| | **TRIVIAL** | One-line fix, copy change, config value, new field on an existing form, bug fix introducing no abstraction | **Nothing.** Skip this skill and write the code. | | **STANDARD** | New service, endpoint, component, job, integration; a refactor across a handful of files | 2–4 lines before coding: *force or smell → choice made → alternative rejected and why* | | **ARCHITECTURAL** | New module or bounded context, publishable package, cross-cutting refactor, a decision other code must live with | A **Pattern Decisions** section in the spec or plan, with a