gitnexus-refactoring

Renames, extracts, splits, and restructures code using GitNexus dependency graph analysis.

Updated Mar 4, 2026
One-click install
npx skills add https://github.com/gmolike/Claude-Template --skill gitnexus-refactoring-gmolike
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gitnexus-refactoring
Source: https://github.com/gmolike/Claude-Template/tree/main/.claude/skills/gitnexus-refactoring
Command: npx skills add https://github.com/gmolike/Claude-Template --skill gitnexus-refactoring-gmolike

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Refactoring code across a large codebase is risky because it is hard to know every caller and dependent of a symbol before renaming, extracting, or moving it. This Skill uses the GitNexus code graph to map the full blast radius of a change before applying it, preventing broken callers and missed references. ## Core Features & Use Cases - Safe Symbol Renaming: Preview and apply multi-file renames with gitnexus_rename, distinguishing high-confidence graph edits from lower-confidence ast_search matches that need review. - Impact Analysis: Use gitnexus_impact and gitnexus_context to map all upstream dependents and incoming/outgoing references before extracting modules or splitting services. - Change Verification: Run gitnexus_detect_changes after refactoring to confirm only expected files changed and identify affected execution flows and risk level. - Use Case: You need to rename validateUser to authenticateUser across the codebase. The Skill verifies the index is fresh, previews 12 edits across 8 files, flags a dynamic reference in config.json for manual review, applies the rename, and confirms the affected LoginFlow and TokenRefresh processes so you know which tests to run. ## Quick Start Ask the assistant to rename a function safely across the codebase using GitNexus, for example: rename validateUser to authenticateUser and show me all affected files first.

Frequently Asked Questions about gitnexus-refactoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I rename a function across multiple files safely?

Use gitnexus_rename with dry_run set to true first to preview all edits across files, then review the ast_search matches carefully before applying with dry_run false. Always verify the GitNexus index is fresh by comparing the indexed commit to git HEAD first.

How to check the impact of refactoring before making changes?

Run gitnexus_impact with direction upstream to map all dependents of a target symbol, and gitnexus_context to see all incoming and outgoing references. This reveals affected execution flows and callers before you modify any code.

Why does gitnexus_detect_changes report no changes after refactoring?

A stale index causes gitnexus_detect_changes to return "No changes detected." even when many files changed, because it never checks index freshness. Run npx gitnexus status and re-analyze if the indexed commit does not match git HEAD.

Can I trust the exit code of npx gitnexus status for automation?

No, npx gitnexus status exits 0 in every case, including stale indexes and unindexed repositories. You must parse the stdout output and compare the indexed commit to git rev-parse HEAD instead of branching on the exit code.

What are the limitations of graph-based code renaming?

Graph-based renaming handles static references with high confidence but flags dynamic or string-based references as lower-confidence ast_search edits requiring manual review. External public APIs still need proper versioning and deprecation rather than direct renames.