gitnexus-refactoring

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

18|8|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/PyModel/pythinker-code --skill gitnexus-refactoring-pymodel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gitnexus-refactoring
Source: https://github.com/PyModel/pythinker-code/tree/main/.agents/skills/gitnexus/gitnexus-refactoring
Command: npx skills add https://github.com/PyModel/pythinker-code --skill gitnexus-refactoring-pymodel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Refactoring code across a large codebase is risky: renaming a function 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 planned, previewed, and verified. ## 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 text-search matches that need review. - Impact Analysis: Map all upstream dependents and affected execution flows before extracting modules or splitting services. - Change Verification: Run detect_changes after refactoring to confirm only expected files changed and assess risk level for affected processes. - Use Case: Rename validateUser to authenticateUser across 8 files with a dry-run preview, review dynamic references in config files, apply the edits, then verify the affected LoginFlow and TokenRefresh processes. ## Quick Start Ask the agent to rename a function safely across the entire codebase and verify which execution flows are affected.

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?

Use the rename tool with dry_run set to true to preview all edits across files, review the graph-based and text-search edits, then run it again with dry_run false to apply. Finish with detect_changes to verify only expected files changed.

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

First run context on the target to see all incoming and outgoing references, then use 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 should I do when GitNexus reports the index is stale?

Run node .gitnexus/run.cjs analyze in the terminal to rebuild the code index. A stale index means the dependency graph no longer reflects the current code, so refactoring analysis would be inaccurate until it is refreshed.

Can refactoring handle dynamic or string-based references?

Yes, but they require manual review. The rename tool flags text_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 is a refactoring considered high risk?

Risk rises when a symbol has more than five callers, cross-area references, string or dynamic references, or is part of a public API. Mitigate by using automated rename, verifying scope with detect_changes, and versioning public APIs properly.