omh-frontend-refactor
यह क्या करती है
यह किसी बहुत बड़े या उलझे इंटरफ़ेस कंपोनेंट के लिए रीफ़ैक्टर योजना पहले दिखाती है, फिर उसे ऐसे चरणों में लागू करती है जो व्यवहार को वैसा ही रखें। यह उन फ़्रंटएंड डेवलपर्स के लिए है जिनका कंपोनेंट बहुत बड़ा हो गया है।
कब इस्तेमाल करें
- ✓जब कोई UI कंपोनेंट इतना बड़ा या उलझा हो गया है कि पढ़ना मुश्किल है।
- ✓जब किसी कंपोनेंट में कई स्टेट फ़्लैग को एक जगह समेटना है।
- ✓जब आप ऐसा रीफ़ैक्टर चाहते हैं जो इंटरफ़ेस के व्यवहार को न बदले।
Skill का लिंक
https://github.com/rlaope/oh-my-hermes/blob/main/agent-skills/omh-frontend-refactor/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“यह डैशबोर्ड कंपोनेंट 800 लाइन का है और उसमें छह स्टेट फ़्लैग हैं। इसका व्यवहार बदले बिना रीफ़ैक्टर कीजिए।”
हर हफ़्ते 5 नई skills, 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-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
अक्सर पूछे जाने वाले सवाल
क्या यह बिना पूछे कोड बदलती है?
नहीं। यह पूरी योजना पहले दिखाती है और बदलाव केवल एक अलग चरण में लागू करती है।
क्या यह नया इंटरफ़ेस डिज़ाइन करती है?
नहीं। UI बनाना या दोबारा डिज़ाइन करना एक फ़्रंटएंड स्किल से होता है।
क्या यह UI कंपोनेंट के अलावा कोड भी साफ़ करती है?
सामान्य सफ़ाई एक अलग code cleanup स्किल से होती है।
जानकारी
लेखक का मूल विवरण
[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
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
omh-accessibility-audit
5.1kयह आपके एजेंट को किसी स्क्रीन या फ़्लो में एक्सेसिबिलिटी की कमियाँ जाँचने में मदद करती है, जैसे कीबोर्ड उपयोग, स्क्रीन रीडर लेबल, कंट्रास्ट और टच टारगेट का आकार।
omh-adversarial-consensus
5.1kयह आपके एजेंट को किसी तकनीकी प्रस्ताव पर प्रतिबद्ध होने से पहले उस पर कई स्वतंत्र नज़रियों से हमला करवाने देती है, फिर देखती है कि क्या बचता है।
omh-agent-debug
5.1kयह आपके एजेंट को पता लगाने में मदद करती है कि कोई दूसरा AI एजेंट क्यों अटका है, लूप में है या भटक रहा है, और सबसे छोटा सुरक्षित सुधार सुझाती है।
omh-agent-instructions
5.1kयह आपके एजेंट को वह निर्देश फ़ाइल लिखने या अपडेट करने में मदद करती है, जैसे AGENTS.md या CLAUDE.md, जो बताती है कि AI टूल किसी प्रोजेक्ट में कैसे काम करें।
मिलती-जुलती skills
angular-developer
280kआपके एजेंट को Angular code बनाने और प्रोजेक्ट स्ट्रक्चर पर सलाह देने में मदद करता है। नए प्रोजेक्ट शुरू करने, code के हिस्से बनाने, या performance और accessibility सुधारने में उपयोगी है।
frontend-a11y
280kआपके एजेंट को web interfaces को सबके लिए accessible बनाने में मदद करता है। यह सुनिश्चित करता है कि websites और apps screen readers और keyboard navigation के साथ अच्छे से काम करें।
frontend-patterns
280kआपके एजेंट को React और Next.js में frontend development के modern patterns लागू करने में मदद करता है। यह performance optimize करता है, state manage करता है और best practices फॉलो करवाता है।