omh-frontend-refactor
Qué hace
Previsualiza un plan de refactorización para un componente de interfaz demasiado grande o enredado, y luego lo aplica en pasos que mantienen el comportamiento sin cambios. Es para desarrolladores de frontend con un componente que creció demasiado.
Cuándo usarla
- ✓Cuando un componente de interfaz creció demasiado o es difícil de seguir.
- ✓Cuando un componente tiene muchas banderas de estado que hay que consolidar.
- ✓Cuando quieres una refactorización que no cambie cómo se comporta la interfaz.
Link de la skill
https://github.com/rlaope/oh-my-hermes/blob/main/agent-skills/omh-frontend-refactor/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Este componente de tablero tiene 800 líneas y seis banderas de estado. Refactorízalo sin cambiar su comportamiento.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente primero verifica que el comportamiento actual esté fijado por pruebas, previsualiza el plan de cambios con referencias de línea y solo lo aplica como un segundo paso explícito.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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-planfor the phased execution shape, orulw-planfirst 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
frontendwork 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 tofrontend, verdict-only review tocode-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
Preguntas frecuentes
¿Cambia el código sin preguntar?
No. Muestra el plan completo primero y aplica los cambios solo como un paso aparte.
¿Diseña una interfaz nueva?
No. Construir o rediseñar una interfaz lo cubre una skill de frontend.
¿Limpia código fuera de los componentes de interfaz?
La limpieza genérica de código la cubre una skill aparte de limpieza.
Detalles
Descripción original del autor
[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
Popularidad
- Estrellas en GitHub
- 5,1 mil
- Posición en el ranking
- #15109
- Licencia
- MIT
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
omh-accessibility-audit
5,1 milAyuda a tu agente a revisar una pantalla o flujo en busca de brechas de accesibilidad: teclado, lectores de pantalla, contraste y tamaño de los objetivos táctiles.
omh-adversarial-consensus
5,1 milAyuda a tu agente a atacar una propuesta técnica desde varios ángulos independientes antes de comprometerte con ella, y luego resume lo que sobrevive.
omh-agent-debug
5,1 milAyuda a tu agente a averiguar por qué otro agente de IA está atascado, en bucle o desviado, y sugiere la forma más pequeña y segura de recuperarlo.
omh-agent-instructions
5,1 milAyuda a tu agente a escribir o actualizar el archivo de instrucciones, como AGENTS.md o CLAUDE.md, que indica a las herramientas de IA cómo trabajar en un proyecto.
Skills parecidas
angular-developer
280 milAyuda a tu agente con código de Angular y la estructura del proyecto. Útil para empezar proyectos, crear partes de código o mejorar el rendimiento y la accesibilidad.
frontend-a11y
280 milAyuda a tu agente a hacer que las interfaces web sean accesibles para todos. Asegura que sitios y apps funcionen bien con lectores de pantalla y navegación por teclado.
frontend-patterns
280 milHace que tu agente aplique patrones modernos en desarrollo frontend. Optimiza el rendimiento, gestiona el estado y sigue buenas prácticas en React y Next.js.