gitnexus-refactoring — Claude Code skill: setup and usage
Safely rename symbols, split services, and extract modules using GitNexus semantic graphs. It verifies call hierarchies before touching files.
npx skills add abhigyanpatwari/GitNexus --skill gitnexus-refactoring -a claude-codeWhat gitnexus-refactoring does
The skill orchestrates refactoring through GitNexus MCP tools without relying on plain text search. Before editing files, it runs impact and context queries to map inbound and outbound references across your repository. Comments and string literals stay untouched because the system relies strictly on scope resolution.
File edits follow a two-step execution pattern. Calling rename with dry_run: true returns a diff preview and a single-use plan_token. Applying edits to disk requires this token, which expires after 15 minutes. Unplanned disk writes are blocked by design.
If you manage multiple indexed projects, pass the repo parameter explicitly to avoid applying changes to the wrong tree. When the graph reports staleness, run node .gitnexus/run.cjs analyze in your terminal to reindex the repository.
What it helps with
- rename functions and classes across files using semantic references
- extract cohesive logic blocks into dedicated modules
- split monolithic services into smaller components
- preview code modifications before writing changes to disk
Example prompts for the agent
- Rename function validateUser to authenticateUser across the my-app repository
- Extract the session validation logic into a separate module
- Split this payment service and check affected upstream callers
How to install gitnexus-refactoring
1Skills CLI (Vercel)
npx skills add abhigyanpatwari/GitNexus --skill gitnexus-refactoring -a claude-code2Manually: put the files in place
~/.claude/skills/gitnexus-refactoring/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/gitnexus-refactoring/
1Skills CLI (Vercel)
npx skills add abhigyanpatwari/GitNexus --skill gitnexus-refactoring -a codex2Manually: put the files in place
.agents/skills/gitnexus-refactoring/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add abhigyanpatwari/GitNexus --skill gitnexus-refactoring -a cursor2Manually: put the files in place
.cursor/skills/gitnexus-refactoring/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install abhigyanpatwari/GitNexus gitnexus-refactoring2Manually: put the files in place
.github/skills/gitnexus-refactoring/SKILL.md1Skills CLI (Vercel)
npx skills add abhigyanpatwari/GitNexus --skill gitnexus-refactoring -a gemini-cli2Platform CLI
gemini skills install https://github.com/abhigyanpatwari/GitNexus --path gitnexus-claude-plugin/skills/gitnexus-refactoringManually: put the files in place
.devin/skills/gitnexus-refactoring/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add abhigyanpatwari/GitNexus --skill gitnexus-refactoring -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Similar
Questions about gitnexus-refactoring
How to install gitnexus-refactoring in Claude Code?
Run npx skills add abhigyanpatwari/GitNexus --skill gitnexus-refactoring -a claude-code. The skill will be configured in ~/.claude/skills/gitnexus-refactoring/SKILL.md.
What does gitnexus-refactoring do?
It analyzes code relationships using a local graph, previews semantic renames, and applies validated multi-file refactoring steps.
How does the skill prevent accidental code overwrites?
It requires generating a preview first to obtain a plan_token. Disk writes fail unless executed with this valid single-use token.