refactor

A code-refactoring analysis guide. Refactoring means changing code's structure without changing what it is meant to do.

In plain words
What is it for?
Use it to find refactoring opportunities, assess the affected code, evaluate risks, and plan the order of changes.
Why use it?
It helps identify risky or far-reaching changes before editing the code. It also considers which parts may be affected and suggests an order for the work.

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

Made for: Claude Code, Codex.

Per session 23 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,120 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00023 $0.01120
Opus 5 $0.00012 $0.00560
Sonnet 5 $0.00005 $0.00224
Haiku 4.5 $0.00002 $0.00112

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

Security

Grade A, and why

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 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.

skills/refactor/SKILL.md · 153 lines

The source is not reproduced here

No licence file

A repository with no LICENSE is all rights reserved by default, so the body is not copied here. The metadata, the measurements and the link are.

Read it on GitHub

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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 · 153 lines · 23 tokens per session scan A 644a92df17ed

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository thoreinstein/beads-workflow (10 stars, last pushed 5mo ago), with no licence file. It adds 23 tokens to every session and 1,120 once invoked, about $0.0001 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

excalidraw-diagram

Generate Excalidraw diagrams from text content. Supports three output modes - Obsidian (.md), Standard (.excalidraw), and Animated (.excalidraw with animation order). Triggers on "Excalidraw", "diagram", "standard excalidraw", "animate".

breferrari/obsidian-mind · 67 tokens

qmd

Search the vault using QMD semantic search. Use PROACTIVELY before reading files. Preference order: (1) MCP tools — mcpqmdquery, mcpqmdget, mcpqmdmultiget, mcpqmdstatus — if they appear in your tool menu, use them first; (2) CLI qmd --index ... as fallback; (3) Grep/Glob only when QMD is not installed. Trigger…

breferrari/obsidian-mind · 142 tokens

obsidian-cli

Interact with Obsidian vaults using the Obsidian CLI to read, create, search, and manage notes, tasks, properties, and more. Also supports plugin and theme development with commands to reload plugins, run JavaScript, capture errors, take screenshots, and inspect the DOM. Use when the user asks to interact with their…

breferrari/obsidian-mind · 102 tokens

wiki-ingest

Use when the user wants to ingest external sources into the vault — PDFs, markdown files, transcripts, Readwise exports, or any document. Triggers on "ingest", "process document", "import into vault", "distill this", "add to vault", or "extract knowledge from".

thoreinstein/gemini-obsidian · 64 tokens

cross-linker

Use when the user wants to find and insert missing wikilinks across vault notes. Triggers on "cross-link", "find missing links", "weave links", "unlinked mentions", "add wikilinks", or "link notes together".

thoreinstein/gemini-obsidian · 55 tokens

vault-lint

Use when the user wants a health audit of the vault — stale content, provenance drift, frontmatter compliance, or MOC coverage gaps. Triggers on "lint vault", "vault health", "check vault", "stale notes", "vault audit", "vault quality", or "check conventions".

thoreinstein/gemini-obsidian · 65 tokens