gitnexus-refactoring

Performs safe multi-file code refactoring using graph-based impact analysis and automated renames.

3|5|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/BenSheridanEdwards/ArchitectPlaybook --skill gitnexus-refactoring-bensheridanedwards
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gitnexus-refactoring
Source: https://github.com/BenSheridanEdwards/ArchitectPlaybook/tree/main/.claude/skills/gitnexus/gitnexus-refactoring
Command: npx skills add https://github.com/BenSheridanEdwards/ArchitectPlaybook --skill gitnexus-refactoring-bensheridanedwards

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Renaming, extracting, splitting, or moving code across a codebase is risky because hidden callers, dynamic references, and cross-module dependencies are easy to miss. This Skill maps dependents through a code knowledge graph before making changes, so refactors are planned and verified rather than guessed. ## Core Features & Use Cases - Automated Multi-File Rename: Preview all edits with a dry run, review graph-based versus text-search edits, then apply changes across files. - Impact Analysis: Map upstream dependents and affected execution flows before extracting modules or splitting services. - Change Verification: Run detect_changes after refactoring to confirm only expected files and processes were affected, with a risk rating. - Use Case: Rename a function like validateUser to authenticateUser across 8 files, catch a dynamic reference in a config file, then verify the LoginFlow and TokenRefresh processes still behave correctly. ## Quick Start Ask the assistant to rename a function across the codebase safely, previewing all edits before applying them.

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?

Run the rename tool with dry_run set to true to preview every edit, review the graph-based and text-search edits, then rerun with dry_run false to apply. Finish with detect_changes to confirm only expected files changed.

How to extract code into a separate module without breaking callers?

First use context to see all incoming and outgoing references, then impact with upstream direction to find external callers. Define the new module interface, extract the code, update imports, and verify scope with detect_changes.

What happens if the code index is stale during refactoring?

If the tools report the index is stale, run node .gitnexus/run.cjs analyze in the terminal to rebuild the knowledge graph. Refactoring against a stale index can miss recent callers or references.

Can refactoring handle dynamic or string-based references?

Yes, but they need manual review. The rename tool flags ast_search edits separately from high-confidence graph edits, and the query tool helps locate dynamic references such as strings in config files before applying changes.

When should I not use automated multi-file rename?

Avoid it for external or public APIs where consumers are outside the indexed codebase. In those cases, version and deprecate the interface properly instead of renaming in place.