gitnexus-refactoring
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"
By abhigyanpatwari · 1,596 installs
npx skills add abhigyanpatwari/gitnexus --skill gitnexus-refactoring
Source repository · Upstream listing
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
If "Index is stale" → run node .gitnexus/run.cjs analyze in terminal.
Checklists
Rename Symbol
Extract Module
Split Function/Service
Tools
rename — automated multi file rename:
impact — map all dependents first:
detect changes — verify your changes after refactoring:
partial: true (a graph query failed) or truncated: true (the changed symbol
listing was capped) means the result is short of the truth: a short or empty
list is not proof that only the expected files changed. Re run it rather than
treat the refactor as verified.
A wrong worktree zero carries neither flag and is indistinguishable from a
clean verification, so confirm the diffed checkout is the one you edited.
cypher — custom reference queries:
Risk Rules
Risk Factor Mitigation
Many callers ( 5) Use rename for automated updates
Cross area refs Use detect changes after to verify scope
String/dynamic refs query to find them
External/public API Version and deprecate properly
Same name in another indexed repo Bind repo ; verify previewed paths before applying
Example: Rename validateUser to authenticateUser
With a single indexed repository, step 0 returns total: 1 and the repo
argument drops out of every call above.