omh-frontend-refactor
Ce qu’il fait
Elle prévoit un plan de refactorisation pour un composant d'interface trop volumineux ou emmêlé, puis l'applique par étapes qui laissent le comportement inchangé. Elle s'adresse aux développeurs frontend dont un composant a trop grossi.
Quand l’utiliser
- ✓Quand un composant d'interface est devenu trop gros ou difficile à suivre.
- ✓Quand un composant comporte de nombreux indicateurs d'état à regrouper.
- ✓Quand vous voulez une refactorisation qui ne modifie pas le fonctionnement de l'interface.
Lien du skill
https://github.com/rlaope/oh-my-hermes/blob/main/agent-skills/omh-frontend-refactor/SKILL.mdCopiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.
Comment l’utiliser
Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.
Message prêt à coller
Pour Claude Code, Codex ou Cursor : lancez-la dans le dossier du projet et le skill est installé.
Téléchargez le SKILL.md et placez-le dans le dossier de skills de votre agent.
Exemple de demande à votre IA
“Ce composant de tableau de bord fait 800 lignes et comporte six indicateurs d'état. Refactorise-le sans changer son comportement.”
5 nouveaux skills par semaine. 1 minute de lecture.
Comment ça marche
L'agent vérifie d'abord que le comportement actuel est verrouillé par des tests, prévisualise le plan de modification avec des références de lignes, et ne l'applique qu'ensuite, dans une seconde étape explicite.
Contenu technique (SKILL.md original)
Texte original de l’auteur, en anglais, directement depuis 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
Questions fréquentes
Modifie-t-elle le code sans demander ?
Non. Elle présente d'abord le plan complet et n'applique les changements que dans une étape séparée.
Conçoit-elle une nouvelle interface ?
Non. La construction ou la refonte d'une interface relève d'une compétence frontend.
Nettoie-t-elle du code en dehors des composants d'interface ?
Le nettoyage générique relève d'une compétence distincte de nettoyage de code.
Détails
Description originale de l’auteur
[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
Popularité
- Étoiles GitHub
- 5.1k
- Position au classement
- #15109
- Licence
- MIT
- Mis à jour
- 02/11/2026
Commentaires
- …
Autres skills de ce dépôt
omh-accessibility-audit
5.1kAide votre agent à repérer les lacunes d'accessibilité d'un écran ou d'un parcours : clavier, lecteurs d'écran, contraste et taille des zones tactiles.
omh-adversarial-consensus
5.1kAide votre agent à attaquer une proposition technique sous plusieurs angles indépendants avant que vous ne vous engagiez, puis à résumer ce qui tient encore.
omh-agent-debug
5.1kAide votre agent à comprendre pourquoi un autre agent IA est bloqué, tourne en boucle ou dérive, et à suggérer la récupération la plus petite et la plus sûre.
omh-agent-instructions
5.1kAide votre agent à rédiger ou mettre à jour le fichier d'instructions, comme AGENTS.md ou CLAUDE.md, qui indique aux outils d'IA comment travailler dans un projet.
Skills similaires
angular-developer
280kAide votre agent à créer du code Angular et à conseiller sur la structure des projets. Utile pour démarrer, créer des composants ou améliorer performances et accessibilité.
frontend-a11y
280kAide votre agent à rendre les interfaces web accessibles à tous. Il garantit que sites et apps fonctionnent avec les lecteurs d'écran et la navigation au clavier.
frontend-patterns
280kPermet à votre agent d'appliquer les modèles modernes du frontend : optimisation des performances, gestion d'état et bonnes pratiques avec React et Next.js.