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

Written for no agent in particular: nothing here depends on one.

Good fit Use it to preview and apply JavaScript refactoring plans, confirm edits, and verify the resulting changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/weavatrix/weavatrix-refactor-js/skill
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.

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for weavatrix-refactor-js

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00070 $0.01492
Opus 5.5 $0.00028 $0.00597
Sonnet 5.5 $0.00014 $0.00298
Haiku 4.5 $0.00007 $0.00149

Measured 1mo ago against content hash d692ea40d38d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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 2mo ago), licensed MIT. It adds 70 tokens to every session and 1,492 once invoked, about $0.0003 per session on Opus 5.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

triage-contributor-pr

Triage open pull requests from external contributors to prisma/orm and produce a per-PR verdict with evidence. Use when a maintainer asks to triage, evaluate, assess, or review the queue of incoming contributor PRs, to decide whether a fork PR is safe to run CI on, to check whether a PR is in scope for its version…

prisma/orm · 131 tokens

review-implement-phase

Implements triaged review actions, commits focused fixes, and posts Done plus resolves threads. Use when the user wants only the implementation phase of the review-framework workflow.

prisma/orm · 38 tokens

review-triage-phase

Produces canonical review actions from fetched review state and renders action markdown. Use when the user wants only triage/action-planning for the review-framework workflow.

prisma/orm · 36 tokens

no-bare-casts

Writing as in TypeScript or TSX production code, modifying a file that contains a bare as cast, silencing a type error with a cast, encountering as unknown as, or reviewing a cast site.

prisma/orm · 52 tokens

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits with the [compiler] or [rust-compiler] prefix.

react/react · 42 tokens