Zum Inhalt springen
Skillpedia
Allgemeines Programmieren48k · #3612

gitnexus-refactoring

Was er macht

Diese Fähigkeit führt deinen Agenten dazu, Code umzustrukturieren, etwa eine Funktion umzubenennen oder in eine neue Datei zu verschieben, ohne die Teile zu brechen, die davon abhängen. Sie ist für Entwickler gedacht, die sicheres und konsistentes Refactoring wollen.

Wann du ihn nutzt

  • ✓Wenn du eine Funktion oder Klasse im ganzen Projekt sicher umbenennen willst.
  • ✓Wenn du einen Teil einer Datei in ein eigenes Modul herauslösen willst.
  • ✓Wenn du einen großen Dienst in kleinere Dateien verschieben oder aufteilen willst.

Link zum Skill

https://github.com/abhigyanpatwari/GitNexus/blob/main/.claude/skills/gitnexus-refactoring/SKILL.md

Kopiere ihn und füge ihn in deine KI ein (Claude, ChatGPT oder Cursor) mit der Bitte, den Anweisungen zu folgen.

So nutzt du ihn

Am einfachsten: Kopiere die Nachricht und füge sie in deine KI ein. Sie liest den Skill und folgt den Anweisungen.

Fertige Nachricht zum Einfügen

Nutze diesen Skill, um mir zu helfen: https://github.com/abhigyanpatwari/GitNexus/blob/main/.claude/skills/gitnexus-refactoring/SKILL.md Lies die SKILL.md unter diesem Link und folge ihren Anweisungen für meine Aufgabe.
Soll deine KI Skills wie diesen selbst finden?Installiere den kostenlosen Skillpedia-MCP: eine Zeile, und sie durchsucht vor jeder Aufgabe 15.000+ Skills.In 1 Minute installieren →

Beispielanfrage an deine KI

“Kannst du die Funktion calculateTotal überall in diesem Projekt in computeTotal umbenennen und mir die Änderungen vorher zeigen?”

5 neue Skills pro Woche. 1 Minute Lesezeit.

So funktioniert es

Der Agent bestätigt das Repository, führt eine Vorschau der Änderung aus und prüft die betroffenen Dateien, bevor er etwas schreibt. Erst danach wendet er die Bearbeitung an.

Technischer Inhalt (originale SKILL.md)

Originaltext des Autors, auf Englisch, direkt von GitHub.

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. Hot-tool staleness names which index answered (branch/lastCommit) and how fresh it is (status). Re-analyze only for behind or diverged — current is identity, unknown is unmeasurable.

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 semantic edits (omitting dry_run also previews)
- [ ] Confirm the previewed file paths are in the bound repository/worktree
- [ ] Review exact graph-backed semantic spans, coverage, and limitations
- [ ] If satisfied: rename({..., dry_run: false, plan_token: "<token from preview>"}) — apply exactly the reviewed 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 — semantic rename; preview first, then apply:

rename({symbol_name: "validateUser", new_name: "authenticateUser", repo: "my-app", dry_run: true})
→ 12 edits across 8 files
→ semantic_edits: 12, coverage: {name: "gitnexus-semantic", scope: "indexed-repository", limitations: [...]}
→ changes: [{file_path, edits: [{start, length, line, old_text, new_text, confidence: "semantic"}]}]

dry_run omitted or true previews and never writes; dry_run: false requires the successful preview's plan_token. Keep the same repository, selected symbol, and destination name. Tokens are single-use, expire after 15 minutes or a server restart, and may be evicted when retained previews reach 16 plans or 64 MiB. Any apply attempt consumes the token; request and review a fresh preview to retry. An MCP server started with GITNEXUS_MCP_READ_ONLY=1 still lists rename, but as preview-only: it rejects any dry_run other than omitted or true, so apply through

Häufige Fragen

Zeigt sie eine Vorschau, bevor sie schreibt?

Ja. Die Fähigkeit sagt, eine Vorschau der Umbenennung zu prüfen, bevor sie wirklich angewendet wird.

Was ist, wenn mehr als ein Projekt indiziert ist?

Die Fähigkeit sagt, bei jedem Aufruf das Repository zu nennen und nachzufragen, wenn unklar ist, welches gemeint ist.

Kann sie Code in einem verknüpften Worktree umbauen?

Ja. Sie kann einen Worktree-Pfad übernehmen, wenn die Änderungen in einem Worktree liegen, aus dem der Server nicht gestartet wurde.

Details

Originalbeschreibung des Autors

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\"

repo: abhigyanpatwari/GitNexus

Beliebtheit

GitHub-Sterne
48k
Platz im Ranking
#3612
Lizenz
—
Aktualisiert
2.11.2026

Ist dieser Skill nützlich?

0

Anmelden um abzustimmen.

Kommentare

  • …

Weitere Skills aus diesem Repository

Ähnliche Skills