Files
AX-Copilot-Codex/dist/AxCopilot/skills/refactor.skill.md
lacvet a027ea4f9a
Some checks failed
Release Gate / gate (push) Has been cancelled
재구성 AX Agent 설정과 채팅 UI를 Claude형 구조로
2026-04-04 17:48:51 +09:00

73 lines
2.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
name: refactor
label: 리팩토링 가이드
description: 코드베이스를 분석하여 리팩토링 포인트를 식별하고 실행 계획을 생성합니다.
icon: \uE90F
allowed-tools:
- search_codebase
- grep
- file_read
- code_review
- folder_map
- lsp_code_intel
tabs: code
# hooks / hook_filters 예시 (옵션):
# hooks:
# file_edit:
# pre:
# - lint-pre
# post: verify-post
# hook_filters: lint-pre@pre@file_edit, verify-post@post@*
---
코드베이스를 분석하여 리팩토링이 필요한 부분을 식별하고 개선 계획을 수립하세요.
## 워크플로우
1. **구조 파악**: folder_map + grep으로 프로젝트 전체 구조 분석
2. **코드 스멜 탐지**:
- 중복 코드 (grep으로 유사 패턴 검색)
- 긴 메서드/클래스 (file_read로 크기 확인)
- 복잡한 조건문 (중첩 if/switch)
- 미사용 코드 (lsp_code_intel로 참조 확인)
3. **의존성 분석**: lsp_code_intel로 참조 관계 파악
4. **우선순위 결정**: 영향도 × 난이도 매트릭스
5. **리팩토링 계획 생성**: 단계별 실행 계획
## 분석 항목
### 코드 스멜 (Code Smells)
- **중복 코드**: 3곳 이상 반복되는 유사 코드
- **거대 클래스**: 500줄 이상의 클래스
- **긴 메서드**: 50줄 이상의 메서드
- **매개변수 과다**: 5개 이상 파라미터
- **의존성 순환**: 상호 참조 관계
- **매직 넘버**: 하드코딩된 숫자/문자열
- **깊은 중첩**: 4단계 이상 들여쓰기
### 리팩토링 기법 (제안)
- Extract Method / Extract Class
- Rename (변수, 메서드, 클래스)
- Move Method / Move Field
- Replace Conditional with Polymorphism
- Introduce Parameter Object
- Remove Dead Code
## 출력 형식
### 리팩토링 보고서
| 우선순위 | 파일 | 이슈 | 제안 | 영향도 | 난이도 |
|---------|------|------|------|--------|--------|
| 🔴 높음 | ... | ... | ... | ★★★ | ★☆☆ |
| 🟡 중간 | ... | ... | ... | ★★☆ | ★★☆ |
### 실행 계획
1. [안전한 변경부터] ...
2. [테스트 추가 후] ...
3. [구조 변경] ...
## 규칙
- 코드를 직접 수정하지 않음 (분석 + 계획만)
- 기존 테스트가 있으면 테스트 커버리지 확인
- 팀 컨벤션/스타일 가이드 존중