weavatrix-refactor-js

weavatrix-refactor-js is a skill for Claude Code, Codex from Weavatrix/weavatrix-refactor-js. It costs 70 tokens per session (1,492 once invoked), scanned A, original, MIT.

A controlled code-refactoring tool that applies precomputed, verified edit plans to JavaScript code.

In plain words
What is it for?
Use it to preview and apply JavaScript refactoring plans, confirm edits, and verify the resulting changes.
Why use it?
It limits code changes to plans that were computed, checked, and approved, with rollback if applying them fails.

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

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for weavatrix-refactor-js

README.md
[![agentmods](https://agentmods.dev/badge/skills/weavatrix/weavatrix-refactor-js/skill.svg)](https://agentmods.dev/skills/weavatrix/weavatrix-refactor-js/skill)
Your own site
<a href="https://agentmods.dev/skills/weavatrix/weavatrix-refactor-js/skill"><img src="https://agentmods.dev/badge/skills/weavatrix/weavatrix-refactor-js/skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,492 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.00070 $0.01492
Opus 5 $0.00035 $0.00746
Sonnet 5 $0.00014 $0.00298
Haiku 4.5 $0.00007 $0.00149

Measured 3d ago against content hash d692ea40d38d, 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-js 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 3d 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.

skill/SKILL.md · 90 lines

How it starts

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

weavatrix-refactor-js MCP

The write-side layer of the Weavatrix stack. The MIT weavatrix-js core is safe by design: its published artifact contains no source-writing paths. This package's read-only plan producers compute and prove a refactoring against the core's weavatrix-js/analysis-kit surface, and its apply tools are the only thing in the family that writes — applying only plans it computed, proved, and hashed, never inventing edits of its own.

Step 0 — if the tools are missing

Tools are named mcp__weavatrix__… (one merged catalog: core tools plus this extension). If apply_edit_plan is absent, either this package is not installed, its refactor profile is not selected, or the write gate is closed. Register with: claude mcp add -s user weavatrix -- npx -y weavatrix-refactor-js <repoRoot> (the bin defaults to the refactor profile: all seven offline core capabilities plus edit).

The write gates

Writing source needs the first two gates for either tool; apply_edit_plan adds the third:

  1. This package is installed and the refactor profile (or a custom list naming edit) is selected.
  2. The server environment has WEAVATRIX_ALLOW_SOURCE_EDITS=1.
  3. For apply_edit_plan (mode="apply") only: a valid, unexpired confirm_token bound to the exact file hashes of the plan (5-minute TTL, issued by apply_edit_plan's own preview step, stored outside the repository). rollback_last_apply takes no token.

A missing gate is a normal state, not an error to work around: fall back to applying the plan's edits with your own editor, then run verified_change phase=verify as usual.

Tools

  • apply_edit_plan plan=<envelope> [mode] [confirm_token] — two modes over the same plan. mode="preview" (default) re-verifies every planned file's sha256 and the exact before text and, on a clean match, issues a single-use confirm_token. mode="apply" confirm_token=<token> consumes it under the core file lock, writes a rollback bundle, applies edits bottom-up, and reports APPLIED / STALE (hash drift — nothing written) / ROLLED_BACK (mid-apply failure — originals restored). It never applies a subset silently.
  • rollback_last_apply — restores the pre-apply state from the most recent rollback bundle.

Read the full file on GitHub · 90 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. 3d ago First seen · 90 lines · 70 tokens per session scan A d692ea40d38d

Subscribe to this mod's changes

weavatrix-refactor-js is a skill published in the GitHub repository Weavatrix/weavatrix-refactor-js (0 stars, last pushed 10d ago), licensed MIT. It adds 70 tokens to every session and 1,492 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

weavatrix-js

Use the Weavatrix MCP as a reusable local repository-intelligence layer: understand unfamiliar applications with a bounded code graph, reduce repeated context, review Health, dead code, duplicates and history, trace endpoints and blast radius, enforce target architecture, and verify changes before a PR.

Weavatrix/weavatrix-js · 60 tokens

weavatrix-refactor

Use Weavatrix Refactor only when the user explicitly requests repository source changes that benefit from a proven refactor workflow: symbol rename, coordinated rename, signature change, symbol edit, selected replacement, import cleanup, file or symbol move planning, deletion readiness, exact plan application, or…

Weavatrix/weavatrix-refactor · 83 tokens

weavatrix-refactor

Use Weavatrix Refactor only when the user explicitly requests repository source changes that benefit from a proven refactor workflow: symbol rename, coordinated rename, signature change, symbol edit, selected replacement, import cleanup, file or symbol move planning, deletion readiness, exact plan application, or…

Weavatrix/weavatrix-refactor · 83 tokens

lint-js

Lint JS/TS code only. Use before opening a PR when only JavaScript or TypeScript files were changed (no Rust).

denoland/deno · 29 tokens

git-cleanup

Clean up local git branches and remotes accumulated from PR reviews. Use when the user asks to clean branches, remove stale remotes, or tidy up the local git state.

alibaba/page-agent · 39 tokens

Shade dropdown surface contract

DropdownMenu, Select, and Popover share one visual recipe (bg-surface-elevated-2 + border-border/60 dark:border-border/30 + shadow-md). Change them together. Trigger when editing any of those three Shade files.

TryGhost/Ghost · 54 tokens