skills/refactoring_patterns/SKILL.md
--- name: refactoring_patterns router_kit: FullStackKit description: Common refactoring patterns - Extract, Rename, Move ve code smell çözümleri. metadata: skillport: category: quality tags: [architecture, automation, best practices, clean code, coding, collaboration, compliance, debugging, design patterns, development, documentation, efficiency, git, optimization, productivity, programming, project management, quality assurance, refactoring, refactoring patterns, software engineering,
npx skillsauth add vuralserhat86/antigravity-agentic-skills skills/refactoring_patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Common refactoring patterns ve code smell çözümleri.
Davranışı DEĞİŞTİRME, sadece yapıyı iyileştir
Before: Input X → [Code A] → Output Y
After: Input X → [Code B] → Output Y (AYNI!)
| Smell | Çözüm | |-------|-------| | Long Method | Extract Method | | Large Class | Extract Class | | Duplicate Code | Extract + Reuse | | Long Parameter List | Parameter Object | | Feature Envy | Move Method | | Data Clumps | Extract Class |
// ❌ Before
function processOrder(order) {
// 20 lines of validation
// 30 lines of calculation
// 15 lines of formatting
}
// ✅ After
function processOrder(order) {
validateOrder(order);
const total = calculateTotal(order);
return formatOutput(total);
}
// ❌ Before
function getPrice(type) {
if (type === 'premium') return 100;
if (type === 'basic') return 50;
return 30;
}
// ✅ After
const pricing = { premium: 100, basic: 50, free: 30 };
const getPrice = (type) => pricing[type] ?? 30;
Refactoring Patterns v1.1 - Enhanced
Kaynak: Refactoring.guru & Martin Fowler - Refactoring
Decompose Conditional veya Replace Nested Conditional with Guard Clauses ile basitleştir.Extract Method ve Extract Class ile sorumlulukları (SRP) ayır. Primitive Obsession varsa Value Object'e çevir.var -> const/let, for -> map/filter, Callback -> Async/Await dönüşümlerini uygula (Dil özelliklerini kullan).| Aşama | Doğrulama | |-------|-----------| | 1 | Refactoring sırasında yeni özellik eklendi mi? (KESİNLİKLE HAYIR. İki şapka kuralı: Ya Refactor yap ya Feature ekle). | | 2 | Kodun okunabilirliği arttı mı? (Cognitive Complexity düştü mü?). | | 3 | Test kapsamı (Coverage) korundu mu? |
tools
Production-tested setup for Zustand state management in React. Includes patterns for persistence, devtools, and TypeScript patterns. Prevents hydration mismatches and render loops.
development
Comprehensive spreadsheet creation, editing, and analysis with support for formulas, formatting, data analysis, and visualization. When Claude needs to work with spreadsheets (.xlsx, .xlsm, .csv, .tsv, etc) for: (1) Creating new spreadsheets with formulas and formatting, (2) Reading or analyzing data, (3) Modify existing spreadsheets while preserving formulas, (4) Data analysis and visualization in spreadsheets, or (5) Recalculating formulas
development
--- name: websocket_engineer router_kit: FullStackKit description: WebSocket specialist for real-time communication systems. Invoke for Socket.IO, WebSocket servers, bidirectional messaging, presence systems. Keywords: WebSocket, Socket.IO, real-time, pub/sub, Redis. triggers: - WebSocket - Socket.IO - real-time communication - bidirectional messaging - pub/sub - server push - live updates - chat systems - presence tracking role: specialist scope: implementation output-format:
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.