मुख्य सामग्री पर जाएँ
Skillpedia
सामान्य कोडिंग33k · #9141

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 पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/tirth8205/code-review-graph/blob/staging/skills/refactor-safely/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

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

  1. Call refactor_tool with mode="suggest" for refactoring candidates, or mode="dead_code" for unreferenced code.
  2. For a rename, call refactor_tool with mode="rename", old_name and new_name. Check the returned edit list before applying.
  3. Call apply_refactor_tool with the returned refactor_id to apply the rename.
  4. Before a large refactor, call get_impact_radius_tool and get_affected_flows_tool to see the dependents and critical paths involved.
  5. Call find_large_functions_tool to find functions worth splitting.
  6. After the change, call detect_changes_tool to 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_tool call 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

repo: tirth8205/code-review-graph

लोकप्रियता

GitHub स्टार
33k
रैंकिंग में स्थान
#9141
लाइसेंस
MIT
अपडेट की गई
29/10/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

build-graph

33k

यह आपके एजेंट को आपकी रिपॉज़िटरी का कोड ज्ञान ग्राफ़ बनाने या अपडेट करने देती है, ताकि बाद की कोड समीक्षा और खोज तेज़ हों।

कोडिंगसामान्य कोडिंग

debug-issue

33k

यह आपके एजेंट को स्रोत कोड पढ़ने से पहले कॉल-चेन का पीछा करके कोड ज्ञान ग्राफ़ के ज़रिए बग का रास्ता खोजने में मदद करती है।

कोडिंगसामान्य कोडिंग

explore-codebase

33k

यह आपके एजेंट को कोड ज्ञान ग्राफ़ में मॉड्यूल और संबंध खोजकर अपरिचित कोडबेस में रास्ता खोजने में मदद करती है।

कोडिंगसामान्य कोडिंग

review-changes

33k

यह आपके एजेंट को जोखिम स्कोर, टेस्ट की कमी और blast radius के साथ कोड बदलावों की समीक्षा करने में मदद करती है, जोखिम के स्तर के अनुसार समूहित करके।

कोडिंगसामान्य कोडिंग

मिलती-जुलती skills