This skill should be used when the user asks to "refactor,리팩토링,리팩터,코드정리". Safe refactoring with test-first approach and SOLID principles
From tenetxnpx claudepluginhub wooo-jin/tenetx/refactorOrchestrates refactoring for specified scope: assesses architecture and issues, plans incremental transformations with risk mitigation, provides code change guides with examples, validation tests, and monitoring plan.
/refactorSystematically refactors specified code area: identifies smells, ensures test coverage, plans and applies atomic changes with per-step verification.
/refactorRefactors code step-by-step using techniques like Extract Method and polymorphism, scores SOLID principles quantitatively, visualizes technical debt, and prioritizes improvements.
/refactorPerforms safe incremental refactoring on identified code issues; scores SOLID compliance (0-100 per principle); visualizes technical debt and prioritizes fixes.
/refactorSafely refactors code progressively using techniques like Extract Method, quantitatively scores SOLID principle adherence (0-100), visualizes technical debt, and prioritizes improvements.
/refactorPerforms safe incremental refactoring on code, scores SOLID principles compliance (0-100 total), detects smells via grep/bash, visualizes technical debt, and prioritizes fixes with examples.
코드 스멜 식별
SOLID 원칙 적용
리팩토링 카탈로그 (Fowler)
// Before
function processOrder(order) {
// 가격 계산 (20줄)
let total = 0;
for (const item of order.items) { total += item.price * item.qty; }
// ...
}
// After
function processOrder(order) {
const total = calculateTotal(order.items);
// ...
}
function calculateTotal(items) { /* ... */ }
// Before: if (type === 'A') ... else if (type === 'B') ...
// After: strategy[type].execute()
변경 (Refactor)
npm test / vitest run)refactor: Extract calculateTotal from processOrder검증 (Verify)
tsc --noEmiteslint src//tenetx:refactor src/services/PaymentService.ts — 200줄 함수 분리/tenetx:refactor 주문 처리 로직의 중복 코드 제거/tenetx:refactor UserController를 SOLID 원칙에 맞게 재설계$ARGUMENTS