gitnexus-refactoring

Guides safe code renaming, extraction, and restructuring using GitNexus dependency graph analysis.

10|3|Updated Mar 7, 2026
One-click install
npx skills add https://github.com/Cynthia1070711/PHYCOOL_Tools --skill gitnexus-refactoring-cynthia1070711
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gitnexus-refactoring
Source: https://github.com/Cynthia1070711/PHYCOOL_Tools/tree/main/config-templates/claude/skills/gitnexus/gitnexus-refactoring
Command: npx skills add https://github.com/Cynthia1070711/PHYCOOL_Tools --skill gitnexus-refactoring-cynthia1070711

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Refactoring code across a large codebase is risky because renaming a symbol or extracting a module can silently break callers, tests, and dynamic references scattered across many files. This Skill uses GitNexus's dependency graph and impact analysis to map every dependent before making changes, so refactoring is planned and verified rather than guesswork. ## Core Features & Use Cases - Impact-First Planning: Maps all upstream dependents and affected execution flows with gitnexus_impact before touching any code. - Automated Multi-File Rename: Previews and applies symbol renames across files with gitnexus_rename, distinguishing high-confidence graph edits from ast_search edits that need manual review. - Post-Change Verification: Uses gitnexus_detect_changes to confirm only expected files changed and to assess the risk level of affected processes. - Use Case: When renaming a function like validateUser to authenticateUser, the Skill previews 12 edits across 8 files, flags a dynamic reference in config.json for review, applies the edits, then verifies the affected LoginFlow and TokenRefresh processes so you know which tests to run. ## Quick Start Ask the AI to safely rename a function or extract a module, for example: "Rename the validateUser function to authenticateUser and update all its callers."

Frequently Asked Questions about gitnexus-refactoring

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

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

Run gitnexus_rename with dry_run set to true to preview all edits across files, review the ast_search edits carefully, then rerun with dry_run set to false to apply. Finish with gitnexus_detect_changes to verify only expected files changed.

How to check what breaks before refactoring code?

Use gitnexus_impact with direction set to upstream to map all dependents of the target symbol, and gitnexus_query to find execution flows involving it. This reveals callers, affected processes, and risk level before you edit anything.

What should I do when GitNexus reports the index is stale?

Run npx gitnexus analyze in the terminal to rebuild the index. The refactoring workflow depends on an up-to-date dependency graph, so stale index warnings must be resolved before impact analysis or rename operations.

Can automated rename handle dynamic or string references?

Graph-based edits are high confidence, but string or dynamic references appear as ast_search edits that require manual review. Use gitnexus_query or a custom gitnexus_cypher query to locate dynamic references that automated rename might miss.

When is GitNexus refactoring not the right approach?

It is less suitable for public or external APIs, where you should version and deprecate properly instead of renaming in place. It also requires an indexed repository, so unindexed codebases cannot benefit from its graph analysis.