본문으로 건너뛰기
Skillpedia
일반 코딩33k · #9141

refactor-safely

하는 일

이 스킬은 code-review-graph 도구로 코드를 안전하게 리팩터링하도록 AI 에이전트를 안내합니다. 다른 부분을 깨뜨리지 않고 이름을 바꾸거나 구조를 바꾸려는 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓코드베이스 전체에서 함수나 클래스 이름을 바꾸고 싶을 때.
  • ✓아무도 참조하지 않는 죽은 코드를 찾아야 할 때.
  • ✓큰 함수를 나누기 전에 그 함수에 의존하는 코드를 보고 싶을 때.

스킬 링크

https://github.com/tirth8205/code-review-graph/blob/staging/skills/refactor-safely/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/tirth8205/code-review-graph/blob/staging/skills/refactor-safely/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“calculateTotal 함수를 모든 곳에서 computeOrderTotal로 이름 바꿔 주실 수 있나요? 먼저 무엇이 바뀌는지 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 그래프에 이름 변경 미리 보기와 편집 목록을 요청하고, 목록을 보여 준 뒤, 확인을 받은 후에만 변경을 적용합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Refactor Safely

Plan a refactor from the dependency graph and apply renames from a preview.

Steps

  1. Call refactor_tool with mode="suggest" for refactoring candidates, or mode="dead_code" for unreferenced code.
  2. For a rename, call refactor_tool with mode="rename", old_name and new_name. Check the returned edit list before applying.
  3. Call apply_refactor_tool with the returned refactor_id to apply the rename.
  4. Before a large refactor, call get_impact_radius_tool and get_affected_flows_tool to see the dependents and critical paths involved.
  5. Call find_large_functions_tool to find functions worth splitting.
  6. After the change, call detect_changes_tool to confirm the impact matches the plan.

Token Efficiency Rules

  • Call get_minimal_context_tool(task="<your task>") before any other graph tool.
  • Pass detail_level="minimal" wherever a tool accepts it. Use "standard" only when minimal is not enough.
  • Prefer a targeted query_graph_tool call over a broad listing call.
  • Budget: about five tool calls and 800 tokens of graph output per task.
  • Read the implementation and its tests before changing code. The graph narrows scope; it does not replace the source.
자주 묻는 질문

미리 보기 없이 적용하나요?

아닙니다. 스킬은 이름을 바꾸기 전에 반환된 편집 목록을 확인하라고 말합니다.

사용되지 않는 코드를 찾을 수 있나요?

네. 죽은 코드 모드는 참조되지 않는 코드를 나열합니다.

그다음 무엇을 확인하나요?

영향이 계획과 맞는지 확인하기 위해 변경 탐지 단계를 실행하라고 권장합니다.

상세 정보

작성자의 원본 설명

Plan and execute safe refactoring using dependency analysis

repo: tirth8205/code-review-graph

인기도

GitHub 스타
33k
순위
#9141
라이선스
MIT
업데이트
2026. 10. 29.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬