gitnexus-refactoring

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

Updated May 28, 2026
One-click install
npx skills add https://github.com/changfengpro/agent-skills --skill gitnexus-refactoring-changfengpro
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gitnexus-refactoring
Source: https://github.com/changfengpro/agent-skills/tree/main/skills/gitnexus-refactoring
Command: npx skills add https://github.com/changfengpro/agent-skills --skill gitnexus-refactoring-changfengpro

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, dynamic references, and tests scattered across many files. This Skill uses GitNexus's code graph to map every dependency before making changes, so refactors are verified rather than guessed. ## Core Features & Use Cases - Automated Multi-File Rename: Preview and apply symbol renames across all files with confidence-scored edits, distinguishing graph-based edits from ast_search matches that need review. - Impact Analysis Before Changes: Map all upstream dependents and affected execution flows before extracting modules, splitting services, or moving code. - Post-Refactor Verification: Run change detection to confirm only expected files changed and identify which processes need test coverage. - Use Case: You need to rename validateUser to authenticateUser across 8 files including a dynamic reference in config.json. The Skill previews all 12 edits, flags the risky dynamic reference for review, applies the changes, and tells you to run tests for the LoginFlow and TokenRefresh processes. ## Quick Start Ask the AI to safely rename a function across the entire codebase, previewing all affected files and dependents before applying any changes.

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?

Use gitnexus_rename with dry_run set to true to preview all edits across files, review the ast_search matches carefully, then run it again with dry_run false to apply. Finish with gitnexus_detect_changes to verify only expected files changed.

How to check what code breaks before refactoring a module?

Run gitnexus_impact with direction set to upstream to map all dependents of the target symbol, then use gitnexus_context to see all incoming and outgoing references. This reveals affected execution flows before you make any edits.

Does GitNexus refactoring handle dynamic or string references?

Yes, but with caution. Graph-based edits are high confidence, while ast_search edits catch string and dynamic references that require manual review. Use gitnexus_query to find dynamic references that automated rename might miss.

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

Run npx gitnexus analyze in the terminal to rebuild the code index. A stale index means the dependency graph no longer reflects the current codebase, so refactoring decisions based on it could be inaccurate.

When should I not use automated rename for refactoring?

Avoid fully automated renames when the symbol is part of an external or public API, where you should version and deprecate properly instead. Also manually review changes when many ast_search edits appear, since these are lower-confidence matches.