weavatrix-refactor

A controlled workflow for changing source code across a repository. It supports tasks such as renaming symbols, changing function signatures, moving files, cleaning imports, and checking whether deletion is safe.

In plain words
What is it for?
Use it to plan and apply coordinated refactors, review cross-file references, rename or move code, remove unused imports, and verify the result with the repository's formatter and tests.
Why use it?
It reduces mistakes in changes that affect multiple files by showing a preview, affected locations, warnings, and uncertain references before applying anything. Changes require an explicit apply step and can be rolled back.

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/weavatrix/weavatrix-refactor/skill
Any agent
npx skills add Weavatrix/weavatrix-refactor --skill skill
Clone the repo
git clone --depth 1 https://github.com/Weavatrix/weavatrix-refactor

Made for: Claude Code, Codex.

Per session 83 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 412 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00083 $0.00412
Opus 5 $0.00042 $0.00206
Sonnet 5 $0.00017 $0.00082
Haiku 4.5 $0.00008 $0.00041

Measured yesterday against content hash 94b511091a08, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

weavatrix-refactor 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 yesterday.

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.

Origin

This is a copy

100% identical to weavatrix-refactor — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skill/SKILL.md · 43 lines

What it actually says

Weavatrix Refactor

Use this extension on demand after the target symbol, file, or change is clear. The plugin exposes only 11 refactor methods; use the separate weavatrix skill for the 43 read-only repository-intelligence methods.

Workflow

  1. Identify an exact symbol or bounded target. Use Weavatrix core first when cross-file graph evidence is needed.
  2. Call the narrowest Refactor method in its default preview/planning mode.
  3. Review exact files, hashes, edits, completeness, warnings, and uncertainReferences.
  4. Apply only when the user requested the source change and the plan matches that request. Repeat the identical operation with mode:"apply" and its single-use confirm_token.
  5. Run repository-native formatting and tests. Use rollback_last_apply if the applied transaction must be reverted before files drift.

Read references/tool-routing.md to choose a method, then open only that method's card.

Safety

  • Installing the plugin opens the process write gate, but no edit can apply without a matching preview token.
  • PARTIAL, UNPROVEN, uncertain references, and advisory move results are review states, not permission to guess.
  • Never invent a symbol id, silently broaden a selected occurrence set, or convert an advisory plan into an automatic source write.
  • Rollback is all-or-nothing and refuses post-apply drift.
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. yesterday First seen · 43 lines · 83 tokens per session scan A 94b511091a08

Subscribe to this mod's changes

weavatrix-refactor is a skill published in the GitHub repository Weavatrix/weavatrix-refactor (1 stars, last pushed 8d ago), licensed MIT. It adds 83 tokens to every session and 412 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to weavatrix-refactor, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

weavatrix-refactor-js

Apply hash-verified refactoring edit plans: a weavatrix-refactor-js plan producer computes and proves a plan against the read-only core, then applyeditplan previews it (issuing a confirm token), applies with automatic rollback, and verifiedchange proves it. The only Weavatrix component that writes code.

Weavatrix/weavatrix-refactor-js · 70 tokens

tbd

Git-native issue tracking (beads), coding guidelines, knowledge injection, and spec-driven planning for AI agents. Drop-in replacement for bd/Beads with simpler architecture. Use for: tracking issues/beads with dependencies, creating bugs/features/tasks, planning specs, implementing features from specs, code reviews…

jlevy/repren · 262 tokens

software-code-refactoring

Improve production code quality while preserving all existing test behavior. Commonly used for the Refactor phase of TDD red-green-refactor, but applicable to any codebase with tests. Use when production code works but needs cleanup — reducing duplication, improving naming, simplifying complexity, aligning with…

stencila/stencila · 102 tokens

simplify-codebase

Simplification audit or authorized codebase simplification whose stated objective is to remove accidental complexity. Use for evidence-backed deletion or consolidation of dead code, duplicate state, redundant APIs or layers, ownerless abstractions, obsolete compatibility or design records, and over-engineering in any…

tt-a1i/simplify-codebase · 93 tokens

flowmark

Fast, consistent Markdown auto-formatter for typographic cleanup, normalization, and clean semantic line breaks. Use when creating, editing, or cleaning Markdown; formatting LLM-generated docs; adopting Flowmark in a repository; adding Markdown format scripts or commit hooks; or replacing Prettier or another Markdown…

jlevy/repren · 64 tokens

cyclomatic-complexity

Refactor code to reduce cyclomatic complexity so it stays readable, maintainable, and aligned with the long-term vision of the codebase, not just optimized for AI comprehension. Use whenever the user asks to refactor, simplify, clean up, or review code quality; mentions complexity, maintainability, readability…

saurabhkumar8112/cyclomatic-complexity-skill · 103 tokens