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

gitnexus-refactoring

यह क्या करती है

यह आपके एजेंट को कोड की संरचना बदलना सिखाती है, जैसे किसी function का नाम बदलना या उसे नई फ़ाइल में ले जाना, बिना उन हिस्सों को तोड़े जो उस पर निर्भर हैं। यह उन डेवलपर्स के लिए है जो सुरक्षित और एक जैसा refactoring चाहते हैं।

कब इस्तेमाल करें

  • ✓जब आप पूरे प्रोजेक्ट में किसी function या class का नाम सुरक्षित रूप से बदलना चाहते हैं।
  • ✓जब आप किसी फ़ाइल का हिस्सा अपने अलग module में निकालना चाहते हैं।
  • ✓जब आप किसी बड़ी सेवा को छोटी फ़ाइलों में ले जाना या बाँटना चाहते हैं।

Skill का लिंक

https://github.com/abhigyanpatwari/GitNexus/blob/main/.claude/skills/gitnexus-refactoring/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

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

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

AI से क्या माँगें: उदाहरण

“क्या आप इस प्रोजेक्ट में हर जगह calculateTotal का नाम computeTotal कर सकते हैं, और पहले मुझे बदलाव दिखा सकते हैं?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट पुष्टि करता है कि repository सही है, बदलाव का preview चलाता है, और कुछ भी लिखने से पहले प्रभावित फ़ाइलों की समीक्षा करता है। उसके बाद ही वह संपादन लागू करता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Refactoring with GitNexus

When to Use

  • "Rename this function safely"
  • "Extract this into a module"
  • "Split this service"
  • "Move this to a new file"
  • Any task involving renaming, extracting, splitting, or restructuring code

Bind the repository first

Refactoring writes to disk. rename with dry_run: false edits files in whichever repository was resolved, so binding identity here is a safety gate, not bookkeeping.

Call list_repos {} before the first tool call. With one indexed repository, use the examples below as written. With more than one, pass repo on every call: an omitted repo normally errors, but under an MCP policy with a configured default it resolves to that default silently. If you cannot tell which repository is meant, stop and ask. Never run rename with dry_run: false until the preview in the same bound repository has been reviewed — its returned file_path values show which checkout is about to be written, so read them as a confirmation of identity.

list_repos is paginated, so page with offset: pagination.nextOffset until hasMore is false before concluding a repository is absent.

detect_changes takes worktree when you are editing a linked worktree the MCP server was not launched from; otherwise git diff runs in the wrong checkout and reports nothing changed, which reads as a verified refactor.

Workflow

0. list_repos {}                                  → Bind repo (and worktree)
1. impact({target: "X", direction: "upstream"})  → Map all dependents
2. query({search_query: "X"})                            → Find execution flows involving X
3. context({name: "X"})                           → See all incoming/outgoing refs
4. Plan update order: interfaces → implementations → callers → tests

If "Index is stale" → run node .gitnexus/run.cjs analyze in terminal. Hot-tool staleness names which index answered (branch/lastCommit) and how fresh it is (status). Re-analyze only for behind or diverged — current is identity, unknown is unmeasurable.

Checklists

Rename Symbol

- [ ] list_repos {} — bind repo; explicit repo when >1 indexed, ask if ambiguous
- [ ] rename({symbol_name: "oldName", new_name: "newName", dry_run: true}) — preview semantic edits (omitting dry_run also previews)
- [ ] Confirm the previewed file paths are in the bound repository/worktree
- [ ] Review exact graph-backed semantic spans, coverage, and limitations
- [ ] If satisfied: rename({..., dry_run: false, plan_token: "<token from preview>"}) — apply exactly the reviewed edits
- [ ] detect_changes() — verify only expected files changed
- [ ] Run tests for affected processes

Extract Module

- [ ] list_repos {} — bind repo; explicit repo when >1 indexed, ask if ambiguous
- [ ] context({name: target}) — see all incoming/outgoing refs
- [ ] impact({target, direction: "upstream"}) — find all external callers
- [ ] Define new module interface
- [ ] Extract code, update imports
- [ ] detect_changes() — verify affected scope
- [ ] Run tests for affected processes

Split Function/Service

- [ ] list_repos {} — bind repo; explicit repo when >1 indexed, ask if ambiguous
- [ ] context({name: target}) — understand all callees
- [ ] Group callees by responsibility
- [ ] impact({target, direction: "upstream"}) — map callers to update
- [ ] Create new functions/services
- [ ] Update callers
- [ ] detect_changes() — verify affected scope
- [ ] Run tests for affected processes

Tools

rename — semantic rename; preview first, then apply:

rename({symbol_name: "validateUser", new_name: "authenticateUser", repo: "my-app", dry_run: true})
→ 12 edits across 8 files
→ semantic_edits: 12, coverage: {name: "gitnexus-semantic", scope: "indexed-repository", limitations: [...]}
→ changes: [{file_path, edits: [{start, length, line, old_text, new_text, confidence: "semantic"}]}]

dry_run omitted or true previews and never writes; dry_run: false requires the successful preview's plan_token. Keep the same repository, selected symbol, and destination name. Tokens are single-use, expire after 15 minutes or a server restart, and may be evicted when retained previews reach 16 plans or 64 MiB. Any apply attempt consumes the token; request and review a fresh preview to retry. An MCP server started with GITNEXUS_MCP_READ_ONLY=1 still lists rename, but as preview-only: it rejects any dry_run other than omitted or true, so apply through

अक्सर पूछे जाने वाले सवाल

क्या बदलाव लिखने से पहले उसका preview देखा जा सकता है?

हाँ। स्किल कहती है कि नाम बदलने का preview असल में लागू करने से पहले देखें।

अगर मेरे एक से ज़्यादा प्रोजेक्ट index हों तो?

स्किल कहती है कि हर कॉल में repository का नाम दें, और अगर यह साफ़ न हो कि कौन सी बात है तो आपसे पूछें।

क्या यह किसी linked worktree में कोड refactor कर सकती है?

हाँ। जब बदलाव उस worktree में हों जहाँ से सर्वर शुरू नहीं हुआ, तब यह worktree का पाथ ले सकती है।

जानकारी

लेखक का मूल विवरण

Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: \"Rename this function\", \"Extract this into a module\", \"Refactor this class\", \"Move this to a separate file\"

repo: abhigyanpatwari/GitNexus

लोकप्रियता

GitHub स्टार
48k
रैंकिंग में स्थान
#3612
लाइसेंस
—
अपडेट की गई
2/11/2026

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

0

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

कमेंट

  • …

इस repository की और skills

gitnexus-cli

48k

आपके एजेंट को GitNexus कमांड चलाने देती है, जो कोड प्रोजेक्ट का index बनाते हैं, उसकी स्थिति जाँचते हैं, index साफ़ करते हैं या wiki बनाते हैं।

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

gitnexus-debugging

48k

आपके एजेंट को किसी codebase में बग का सुराग लगाने में मदद करती है, यह ढूँढते हुए कि एरर कहाँ से शुरू होता है और कौन सा कोड विफल हिस्से को बुलाता है।

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

gitnexus-exploring

48k

आपके एजेंट को किसी अनजान codebase को खंगालने में मदद करती है, समझाते हुए कि उसके हिस्से कैसे जुड़े हैं और login जैसी सुविधा कैसे काम करती है।

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

gitnexus-guide

48k

आपके एजेंट को GitNexus टूल्स, संसाधनों और knowledge graph का त्वरित संदर्भ देती है, और सही गाइड की ओर इशारा करती है।

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

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