gitnexus-refactoring
Use when the user wants to rename, extract, split, move, or restructure code safely.
Skill by metagit-ai
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/metagit-ai-gitnexus-refactoring
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
gitnexus-refactoring- Description
- Use when the user wants to rename, extract, split, move, or restructure code safely. Examples: "Rename this function", "Extract this into a module", "Refactor this class", "Move this to a separate file"
- License
- MIT
- Metadata
- internal: true
- Instructions
- 160 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Refactoring with GitNexus
## When to Use
- "Rename this function safely"
- "Extract this into a module"
- "Split this service"
- "Move this to a new file"
- Any task involving renaming, extracting, splitting, or restructuring code
## Bind the repository first
Refactoring writes to disk. `rename` with `dry_run: false` edits files in
whichever repository was resolved, so binding identity here is a safety gate,
not bookkeeping.
Call `list_repos {}` before the first tool call. With one indexed repository,
use the examples below as written. With more than one, pass `repo` on every
call: an omitted `repo` normally errors, but under an MCP policy with a
configured default it resolves to that default silently. If you cannot tell
which repository is meant, stop and ask. Never run `rename` with
`dry_run: false` until the preview in the same bound repository has been
reviewed — its returned `file_path` values show which checkout is about to be
written, so read them as a confirmation of identity.
`list_repos` is paginated, so page with `offset: pagination.nextOffset` until
`hasMore` is false before concluding a repository is absent.
`detect_changes` takes `worktree` when you are editing a linked worktree the
MCP server was not launched from; otherwise `git diff` runs in the wrong
checkout and reports nothing changed, which reads as a verified refactor.
## Workflow
```
0. list_repos {} → Bind repo (and worktree)
1. impact({target: "X", direction: "upstream"}) → Map all dependents
2. query({search_query: "X"}) → Find execution flows involving X
3. context({name: "X"}) → See all incoming/outgoing refs
4. Plan update order: interfaces → implementations → callers → tests
```
> If "Index is stale" → run `node .gitnexus/run.cjs analyze` in terminal.
## Checklists
### Rename Symbol
```
- [ ] list_repos {} — bind repo; explicit repo when >1 indexed, ask if ambiguous
- [ ] rename({symbol_name: "oldName", new_name: "newName", dry_run: true}) — preview all edits
- [ ] Confirm the previewed file paths are in the bound repository/worktree
- [ ] Review graph edits (high confidence) and text_search edits (review carefully)
- [ ] If satisfied: rename({..., dry_run: false}) — apply edits
- [ ] detect_changes() — verify only expected files changed
- [ ] Run tests for affected processes
```
### Extract Module
```
- [ ] list_repos {} — bind repo; explicit repo when >1 indexed, ask if ambiguous
- [ ] context({name: target}) — see all incoming/outgoing refs
- [ ] impact({target, direction: "upstream"}) — find all external callers
- [ ] Define new module interface
- [ ] Extract code, update imports
- [ ] detect_changes() — verify affected scope
- [ ] Run tests for affected processes
```
### Split Function/Service
```
- [ ] list_repos {} — bind repo; explicit repo when >1 indexed, ask if ambiguous
- [ ] context({name: target}) — understand all callees
- [ ] Group callees by responsibility
- [ ] impact({target, direction: "upstream"}) — map callers to update
- [ ] Create new functions/services
- [ ] Update callers
- [ ] detect_changes() — verify affected scope
- [ ] Run tests for affected processes
```
## Tools
**rename** — automated multi-file rename:
```
rename({symbol_name: "validateUser", new_name: "authenticateUser", repo: "my-app", dry_run: true})
→ 12 edits across 8 files
→ 10 graph edits (high confidence), 2 text_search edits (review)
→ Changes: [{file_path, edits: [{line, old_text, new_text, confidence}]}]
```
**impact** — map all dependents first:
```
impact({target: "validateUser", repo: "my-app", direction: "upstream"})
→ d=1: loginHandler, apiMiddleware, testUtils
→ Affected Processes: LoginFlow, TokenRefresh
```
**detect_changes** — verify your changes after refactoring:
```
detect_changes({scope: "all"})
→ Changed: 8 files, 12 symbols
→ Affected processes: LoginFlow, TokenRefresh
→ Risk: MEDIUM
```
`partial: true` (a graph query failed) or `truncated: true` (the changed-symbol
listing was capped) means the result is short of the truth: a short or empty
list is not proof that only the expected files changed. Re-run it rather than
treat the refactor as verified.
A wrong-worktree zero carries neither flag and is indistinguishable from a
clean verification, so confirm the diffed checkout is the one you edited.
**cypher** — custom reference queries:From metagit-ai/metagit-cli, MIT.
More from metagit-ai/metagit-cli
- 0.614score
metagit-agent-access
metagit-ai
Optimize any repository for minimal-token agent onboarding — llms.txt, AGENTS.md, hidden HTML agent blocks, docs/agents.md.
SkillAFreshness: A★ 4Claude Code +9 - 0.611score
metagit-bootstrap
metagit-ai
Create or refine a local .metagit.yml.
SkillAFreshness: A★ 4Claude Code +9 - 0.609score
metagit-aos
metagit-ai
Compose ACL, task graph, scheduler, merge, and related coordination subsystems via metagit aos|coord status|doctor|next.
SkillAFreshness: A★ 4Claude Code +9 - 0.609score
metagit-agent-coordination
metagit-ai
Isolate concurrent agents with RFC-0007 ACL primitives: allocate agent/* branches, acquire branch leases, create exclusive git worktrees, and declare advisory…
SkillAFreshness: A★ 4Claude Code +9 - 0.609score
metagit-config-refresh
metagit-ai
Refresh or bootstrap `.metagit.yml` using deterministic init/validate.
SkillAFreshness: A★ 4Claude Code +9 - 0.606score
metagit-campaign
metagit-ai
Plan and track cross-project multi-repo campaigns — YAML overlays, repo rollups, objective fan-out, and MR status.
SkillAFreshness: A★ 4Claude Code +9 - 0.597score
metagit-cli
metagit-ai
CLI-only shortcuts for metagit agents — workspace catalog, discovery, prompts, sync, layout, and config.
SkillAFreshness: A★ 4Claude Code +9
Signals
- Stars
- 4
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Sep 7, 2026 (1 month ago)
- Last release
- Oct 2, 2026 (27 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/metagit-ai/metagit-cli
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.569score
gitnexus-refactoring
funky-eyes
Use when the user wants to rename, extract, split, move, or restructure code safely.
SkillBFreshness: B★ 12Claude Code +9 - 0.350score
gitnexus-refactoring
metagit-ai
Use when the user wants to rename, extract, split, move, or restructure code safely.
SkillAFreshness: A★ 4Claude Code +9 - 0.283score
gitnexus-refactoring
novolei
Use when the user wants to rename, extract, split, move, or restructure code safely.
SkillCFreshness: C★ 1Claude Code +9 - 0.283score
gitnexus-refactoring
3rdAI-admin
Use when the user wants to rename, extract, split, move, or restructure code safely.
SkillCFreshness: C★ 1Claude Code +9 - 0.270score
gitnexus-refactoring
novolei
Use when the user wants to rename, extract, split, move, or restructure code safely.
SkillCFreshness: CClaude Code +9 - 0.270score
gitnexus-refactoring
buihongduc132
Use when the user wants to rename, extract, split, move, or restructure code safely.
SkillCFreshness: CClaude Code +9 - 0.267score
gitnexus-refactoring
Iranb
Use when the user wants to rename, extract, split, move, or restructure code safely.
SkillCFreshness: CClaude Code +9 - 0.228score
gitnexus-refactoring
cruldra
Use when the user wants to rename, extract, split, move, or restructure code safely.
SkillDFreshness: DClaude Code +9
More from metagit-ai
- 0.614score
metagit-agent-access
metagit-ai
Optimize any repository for minimal-token agent onboarding — llms.txt, AGENTS.md, hidden HTML agent blocks, docs/agents.md.
SkillAFreshness: A★ 4Claude Code +9 - 0.611score
metagit-bootstrap
metagit-ai
Create or refine a local .metagit.yml.
SkillAFreshness: A★ 4Claude Code +9 - 0.609score
metagit-agent-coordination
metagit-ai
Isolate concurrent agents with RFC-0007 ACL primitives: allocate agent/* branches, acquire branch leases, create exclusive git worktrees, and declare advisory…
SkillAFreshness: A★ 4Claude Code +9 - 0.609score
metagit-aos
metagit-ai
Compose ACL, task graph, scheduler, merge, and related coordination subsystems via metagit aos|coord status|doctor|next.
SkillAFreshness: A★ 4Claude Code +9 - 0.609score
metagit-config-refresh
metagit-ai
Refresh or bootstrap `.metagit.yml` using deterministic init/validate.
SkillAFreshness: A★ 4Claude Code +9 - 0.606score
metagit-campaign
metagit-ai
Plan and track cross-project multi-repo campaigns — YAML overlays, repo rollups, objective fan-out, and MR status.
SkillAFreshness: A★ 4Claude Code +9
Cite this page
gitnexus-refactoring skill. Agent Mart. https://agentmart.dev/skills/metagit-ai-gitnexus-refactoring (last updated 2026-10-24)