gitnexus-refactoring

A read-only refactoring analysis guide that maps code references, dependencies, and affected execution paths before restructuring code. Refactoring means changing code organization without intending to change its behavior.

In plain words
What is it for?
Use it before planning code restructuring, then use the analysis again after editing to check that the change stayed within scope.
Why use it?
It shows the likely blast radius of a rename, move, extraction, or split so related interfaces, implementations, callers, and tests can be updated safely.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/fo0/clawstash/gitnexus-refactoring
Any agent
npx skills add fo0/clawstash --skill gitnexus-refactoring
Clone the repo
git clone --depth 1 https://github.com/fo0/clawstash

Made for: Claude Code, Codex.

Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,184 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00051 $0.01184
Opus 5 $0.00026 $0.00592
Sonnet 5 $0.00010 $0.00237
Haiku 4.5 $0.00005 $0.00118

Measured 2d ago against content hash cf708d7c9abf, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gitnexus-refactoring scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/gitnexus/gitnexus-refactoring/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Refactoring with GitNexus (read-only analysis)

GitNexus is read-only. Use it to plan and verify refactors — map references, blast radius, and affected flows. It must never edit files: there is no gitnexus_rename step here. You perform all edits yourself with normal tools, then use gitnexus_detect_changes to verify scope. See the Read-Only Analysis Policy in CLAUDE.md / AGENTS.md.

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

Workflow

1. gitnexus_impact({target: "X", direction: "upstream"})  → Map all dependents
2. gitnexus_query({query: "X"})                            → Find execution flows involving X
3. gitnexus_context({name: "X"})                           → See all incoming/outgoing refs
4. Plan update order: interfaces → implementations → callers → tests

If the index is reported stale, rebuilding is not routine — run npx gitnexus analyze --skip-agents-md only if the task needs a fresh index, then git status + git checkout -- any tracked file it touched (read-only policy).

Checklists

Rename Symbol

- [ ] gitnexus_context({name: "oldName"}) — list every incoming/outgoing reference
- [ ] gitnexus_impact({target: "oldName", direction: "upstream"}) — find all callers/importers
- [ ] gitnexus_query({query: "oldName"}) — catch string/dynamic references the graph may miss
- [ ] Edit every reference yourself (normal Edit tool): interfaces → implementations → callers → tests
- [ ] gitnexus_detect_changes() — verify only expected files changed
- [ ] Run tests for affected processes

Extract Module

- [ ] gitnexus_context({name: target}) — see all incoming/outgoing refs
- [ ] gitnexus_impact({target, direction: "upstream"}) — find all external callers
- [ ] Define new module interface
- [ ] Extract code, update imports
- [ ] gitnexus_detect_changes() — verify affected scope
- [ ] Run tests for affected processes

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 121 lines · 51 tokens per session scan A cf708d7c9abf

Subscribe to this mod's changes

gitnexus-refactoring is a skill published in the GitHub repository fo0/clawstash (1 stars, last pushed yesterday), licensed MIT. It adds 51 tokens to every session and 1,184 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

user-usecases

Database of real user use cases for APIbase platform. Contains detailed examples of how specific APIs are onboarded, wrapped, and served to AI agents. Use this skill when you need to reference real integration examples, explain the APIbase onboarding process, or design new API wrappers based on proven patterns.

whiteknightonhorse/APIbase · 63 tokens

business-model-validator

Use when a prospect, new customer, or existing operator wants to know whether Zooza fits their business, or which Zooza features map to how they operate. No Zooza account required — works as a pure knowledge interview.

zooza-dev/zooza-mcp-server · 49 tokens

spotify-mcp-doctor

Diagnose and repair NovaLux12/spotify-mcp-server failures — auth, permissions, devices, rate limits, OpenClaw wiring. Use when Spotify tool calls fail or setup stalls.

NovaLux12/spotify-mcp-server · 44 tokens

delegacion-local

Regla y catálogo para delegar pasos mecánicos (resumir, clasificar, extraer, boilerplate, mensaje de commit desde un diff, traducir texto o archivo, resumir salida de lint/tests/CI, explicar código, describir una imagen, verificar si el backend local está disponible) a modelos locales vía las tools local del MCP…

ZahiriNatZuke/local-delegate · 137 tokens

class-management

Use when the user wants to create a new class, group, or course in Zooza — e.g. "set up a Monday yoga class", "add a new group", "schedule a course". Guides through programme selection, venue, trainer, session pattern, and commits.

zooza-dev/zooza-mcp-server · 56 tokens

feedback-nudge

Use when the user wants to report a bug, request a feature, or send feedback to the Zooza engineering team. Also offer proactively after a successful commit operation (max once per week).

zooza-dev/zooza-mcp-server · 38 tokens