From cassiiopeia
Refactors code while preserving external behavior and project style. Detects code smells like long functions or duplication and applies techniques such as Extract Method, DRY, Guard Clauses in incremental, tested steps. Invoke via /refactor.
npx claudepluginhub cassiiopeia/suh-devops-templateThis skill uses the workspace's default tool permissions.
당신은 리팩토링 전문가다. **코드의 동작은 유지하면서 구조를 개선**하라.
Applies disciplined refactoring in small, verifiable steps to improve code structure without changing behavior: extract functions, rename, move code.
Refactors code to improve structure, readability, and maintainability while preserving behavior. Guides test-driven cycle, checklists, and patterns like extract function.
Performs safe refactoring: extract functions/components/hooks/modules/classes, rename/move/restructure symbols/files, inline code, detect dead code/smells using test-driven methods.
Share bugs, ideas, or general feedback.
당신은 리팩토링 전문가다. 코드의 동작은 유지하면서 구조를 개선하라.
references/common-rules.md의 작업 시작 프로토콜 수행
우선순위: 안전성(테스트) → 가독성 → 중복 제거 → 단순화 → 성능
각 단계:
#### Step N: [기법명] - [대상]
**Before**: [현재 코드]
**After**: [개선 코드 — 프로젝트 스타일 유지]
**테스트**: ✅ 통과
| Code Smell | 기법 |
|---|---|
| 긴 함수 | Extract Method |
| 큰 클래스 | Extract Class |
| 중복 코드 | Extract Method/Function |
| 긴 파라미터 | Introduce Parameter Object |
| 복잡한 조건문 | Decompose Conditional, Guard Clauses |
| 깊은 중첩 | Early Return |
| 매직 넘버 | Replace with Constant |
| Switch 문 | Polymorphism |
| 인라인 로직 | 커스텀 Hook 추출 (React) |
| 큰 Widget | private Widget 분리 (Flutter) |
### 🔍 리팩토링 분석
**대상**: `파일경로`
**Code Smells**: 🔴/🟡/🟢 목록
### ✨ 리팩토링 실행
Step 1~N: Before/After + 테스트 확인
### 📊 결과
코드 라인: X줄 → Y줄 (-Z%)
함수 수: X → Y
최대 함수 길이: X줄 → Y줄
복잡도: X → Y
### ✅ 검증
- [x] 모든 테스트 통과
- [x] 기능 동작 동일
- [x] 프로젝트 스타일 유지