refactor-safely
यह क्या करती है
यह स्किल code-review-graph टूल से कोड को सुरक्षित रूप से refactor करने में AI एजेंट को मार्गदर्शन देती है। यह उन डेवलपर के लिए है जो बाकी हिस्से तोड़े बिना नाम बदलना या संरचना बदलना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप पूरे कोडबेस में कोई फ़ंक्शन या क्लास का नाम बदलना चाहें।
- ✓जब आपको ऐसा dead code खोजना हो जिसे कोई संदर्भ नहीं देता।
- ✓जब आप बड़े फ़ंक्शन को तोड़ने की योजना बना रहे हों और उनके उपयोगकर्ता देखना चाहें।
Skill का लिंक
https://github.com/tirth8205/code-review-graph/blob/staging/skills/refactor-safely/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप calculateTotal फ़ंक्शन का नाम हर जगह computeOrderTotal कर सकते हैं, लेकिन पहले दिखा दीजिए कि क्या बदलेगा?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
आपका एजेंट ग्राफ़ से नाम बदलने का पूर्वावलोकन और उसकी edits की सूची माँगता है, आपको सूची दिखाता है, और केवल पुष्टि के बाद बदलाव लागू करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Refactor Safely
Plan a refactor from the dependency graph and apply renames from a preview.
Steps
- Call
refactor_toolwithmode="suggest"for refactoring candidates, ormode="dead_code"for unreferenced code. - For a rename, call
refactor_toolwithmode="rename",old_nameandnew_name. Check the returned edit list before applying. - Call
apply_refactor_toolwith the returnedrefactor_idto apply the rename. - Before a large refactor, call
get_impact_radius_toolandget_affected_flows_toolto see the dependents and critical paths involved. - Call
find_large_functions_toolto find functions worth splitting. - After the change, call
detect_changes_toolto 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_toolcall 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.
अक्सर पूछे जाने वाले सवाल
क्या यह बिना पूर्वावलोकन बदलाव लागू करती है?
नहीं। स्किल कहती है कि नाम बदलने से पहले लौटाई गई edits की सूची जाँचें।
क्या यह बेकार कोड खोज सकती है?
हाँ। एक dead code मोड ऐसा कोड सूचीबद्ध करता है जिसका कोई संदर्भ नहीं है।
इसके बाद कौन-सी जाँच होती है?
स्किल सुझाती है कि प्रभाव योजना से मेल खाए, यह पुष्टि करने के लिए change detection चरण चलाएँ।
जानकारी
लेखक का मूल विवरण
Plan and execute safe refactoring using dependency analysis
लोकप्रियता
- GitHub स्टार
- 33k
- रैंकिंग में स्थान
- #9141
- लाइसेंस
- MIT
- अपडेट की गई
- 29/10/2026
कमेंट
- …
इस repository की और skills
build-graph
33kयह आपके एजेंट को आपकी रिपॉज़िटरी का कोड ज्ञान ग्राफ़ बनाने या अपडेट करने देती है, ताकि बाद की कोड समीक्षा और खोज तेज़ हों।
debug-issue
33kयह आपके एजेंट को स्रोत कोड पढ़ने से पहले कॉल-चेन का पीछा करके कोड ज्ञान ग्राफ़ के ज़रिए बग का रास्ता खोजने में मदद करती है।
explore-codebase
33kयह आपके एजेंट को कोड ज्ञान ग्राफ़ में मॉड्यूल और संबंध खोजकर अपरिचित कोडबेस में रास्ता खोजने में मदद करती है।
review-changes
33kयह आपके एजेंट को जोखिम स्कोर, टेस्ट की कमी और blast radius के साथ कोड बदलावों की समीक्षा करने में मदद करती है, जोखिम के स्तर के अनुसार समूहित करके।
मिलती-जुलती skills
diffs
394kयह आपके एजेंट को बदलावों का असली diff बनाने देती है, जिसे व्यूअर लिंक या इमेज फ़ाइल के रूप में साझा किया जा सकता है, हाथ से लिखे सारांश के बजाय।
coding-agent
394kयह आपके एजेंट को बड़े कोडिंग काम Codex, Claude Code या OpenCode को बैकग्राउंड वर्कर के रूप में सौंपने, फिर उसकी प्रगति जांचने में मदद करती है।
gh-issues
394kयह आपके एजेंट को GitHub issues खोजने, उनमें से काम करने लायक चुनने, और सुधार के साथ pull requests खोलने में मदद करती है, जिसमें समीक्षा टिप्पणियों का फ़ॉलो-अप भी शामिल है।