본문으로 건너뛰기
Skillpedia
웹사이트 및 UI (프런트엔드)5.1k · #15109

omh-frontend-refactor

하는 일

너무 커지거나 얽힌 인터페이스 컴포넌트를 위한 리팩터링 계획을 미리 보고, 동작이 바뀌지 않는 단계로 적용합니다. 너무 커진 컴포넌트를 가진 프런트엔드 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓UI 컴포넌트가 너무 커지거나 따라가기 어려울 때.
  • ✓상태 플래그가 많아 하나로 합칠 필요가 있을 때.
  • ✓인터페이스의 동작을 바꾸지 않는 리팩터링을 원할 때.

스킬 링크

https://github.com/rlaope/oh-my-hermes/blob/main/agent-skills/omh-frontend-refactor/SKILL.md

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

사용 방법

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

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

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

AI에게 요청하는 예시

“이 대시보드 컴포넌트는 800줄에 상태 플래그가 여섯 개예요. 동작을 바꾸지 않고 리팩터링해 주세요.”

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

작동 방식

에이전트가 먼저 현재 동작이 테스트로 고정되어 있는지 확인하고, 줄 번호와 함께 변경 계획을 미리 보며, 별도의 명시적 단계로만 적용합니다.

기술 내용 (원본 SKILL.md)

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

Frontend Refactor

This is an OMH frontend-refactor workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).

Why This Exists

frontend-refactor exists so UI restructuring runs as a previewed, behavior-locked, impact-ordered process instead of ad-hoc rewrites: the plan comes before any edit, state fixes come before polish, and every change carries its safety reason.

Do Not Use When

  • The target is not UI code, or the smell is generic slop, duplication, or dead code outside a component tree; use omh-ai-slop-cleaner.
  • The user wants new UI built or redesigned rather than restructured; use omh-frontend.
  • The user wants findings and a verdict without changing the code; use omh-code-review.
  • The restructuring crosses module boundaries or changes architecture beyond the component tree; use omh-refactor-plan for the phased execution shape, or ulw-plan first when the direction itself is still contested.

Examples

Good example:

  • Prompt: This dashboard component is 800 lines and has six useState booleans - refactor it without changing behavior.
  • Expected behavior: Preview first: characterization-test gate, then a plan that folds the booleans into one state union, extracts along change reasons found by the scroll test, and lists per-change line refs with safety reasons; apply only as the explicit second step.
  • Why: Oversized component plus flag-cluster state is exactly the impact-ordered, behavior-locked restructuring this workflow owns.

Bad example:

  • Prompt: Refactor and also add the dark-mode feature while you are in there.
  • Expected behavior: Split the request: the behavior-preserving refactor runs under this workflow, and the dark-mode feature is new frontend work planned separately.
  • Why: A refactor that changes behavior cannot claim behavior preservation; mixing the two hides the feature from review.

Completion Checklist

  • The preview plan was emitted before any file changed, and the apply step was an explicit second decision.
  • Behavior evidence exists on both sides of apply, and unsafe-in-isolation changes are listed as notes, not half-applied.
  • Pass order was impact-first and each finding names its category and safety reason.
  • Out-of-scope smells were routed: generic slop to ai-slop-cleaner, new UI to frontend, verdict-only review to code-review.

Recovery Notes

  • If no tests exist, write the characterization checks first or hand the user the smallest set to approve; do not start the macro pass on unlocked behavior.
  • If a change turns out to alter behavior mid-apply, revert that change, record it as a finding, and keep the rest of the pass.
  • If the component resists extraction because state is tangled, run the state ladder first and re-attempt decomposition after.

When to Use

Use when existing UI code needs restructuring without behavior change - an oversized component, boolean-flag state, effect chains, prop drilling - and the user wants a previewed, pass-ordered refactor plan rather than a new build or a verdict-only review.

Strong routing signals: `frontend-refactor`, `front-refactor`, `frontend refactor`, `refactor this component`, `refactor the component`, `refactor my component`, `component refactor`, `react refactor`, `refactor this hook`, `split this component`, `split the component`, `this component is too big`, `component is too large`, `state management review`, `state management`, `state colocation`, `too many useeffects`, `useeffect cleanup`, `clean up useeffect`, `prop drilling`, `컴포넌트 리팩터링`, `컴포넌트 리팩토링`, `컴포넌트 분리`, `컴포넌트가 너무 커`, `상태 관리 정리`, `상태 관리 리뷰`, `프론트 리팩터링`, `프론트엔드 리팩터링`, `useEffect 정리`, `рефакторинг компонента`, `раздели компонент`, `компонент слишком большой`, `рефакторинг фронта`, `разбей компонент`

Catalog Metadata

Category: maintenance Phase: frontend-refactor Quality tier: behavior-lock-gated Reasoning demand: heavy

Quality bar:

  • Work the ladder impact-first: state architecture before hook patterns before decomposition before naming and style - a state fix usually deletes the code a style pass would have polished.
  • Make impossible states unrepresentable before memoizing anything: flag clusters become one discriminated union or reducer, and a state machine only when transitions carry retries, resets, or races.
  • Treat effects as synchronization with external systems: deriving, event responses, prop-change resets, parent notification, and effect chains each hav
자주 묻는 질문

묻지 않고 코드를 바꾸나요?

아니요. 전체 계획을 먼저 보여 주고, 변경은 별도의 단계로만 적용합니다.

새 인터페이스를 디자인하나요?

아니요. UI를 만들거나 다시 디자인하는 것은 프런트엔드 스킬이 다룹니다.

UI 컴포넌트 밖의 코드도 정리하나요?

일반적인 정리는 별도의 코드 정리 스킬이 다룹니다.

상세 정보

작성자의 원본 설명

[omh] Oversized or tangled UI component: behavior-preserving refactor of UI code - preview the full change plan first, apply as a second explicit step, and work impact-ordered from state architecture down to naming polish. Use when the user says: frontend-refactor, front-refactor, frontend refactor, refactor this component, refactor the component, refactor my component, component refactor, react refactor.

repo: rlaope/oh-my-hermes

인기도

GitHub 스타
5.1k
순위
#15109
라이선스
MIT
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

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

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬