refactor-specialist

refactor-specialist is an agent for Claude Code from NYCU-Chung/my-claude-devteam. It costs 59 tokens per session (1,997 once invoked), scanned A, original, MIT.

An AI coding role for large refactors, such as renaming code across many files, extracting modules, or reorganizing folders. A refactor changes code structure without intentionally changing what the software does.

In plain words
What is it for?
Use it for cautious changes spanning ten or more files, multiple modules, tests, imports, exports, comments, documentation, or folder structures.
Why use it?
It reduces the risk of missed references and regressions by requiring callsite checks, tests, diff review, and a regression checklist.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: model in frontmatter.

Part of the my-claude-devteam plugin — 12 agents, 5 hooks shipped together

Good fit Use it for cautious changes spanning ten or more files, multiple modules, tests, imports, exports, comments, documentation, or folder structures.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/nycu-chung/my-claude-devteam/refactor-specialist
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.

Clone the repo
git clone --depth 1 https://github.com/NYCU-Chung/my-claude-devteam

Made for: Claude Code.

Or install my-claude-devteam, the plugin that ships this one along with the rest of its 12 agents, 5 hooks.

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 refactor-specialist

README.md
[![agentmods](https://agentmods.dev/badge/agents/nycu-chung/my-claude-devteam/refactor-specialist/github.svg)](https://agentmods.dev/agents/nycu-chung/my-claude-devteam/refactor-specialist)
Your own site
<a href="https://agentmods.dev/agents/nycu-chung/my-claude-devteam/refactor-specialist"><img src="https://agentmods.dev/badge/agents/nycu-chung/my-claude-devteam/refactor-specialist/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 refactor-specialist

Your own site · 80×15
<a href="https://agentmods.dev/agents/nycu-chung/my-claude-devteam/refactor-specialist"><img src="https://agentmods.dev/badge/agents/nycu-chung/my-claude-devteam/refactor-specialist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,997 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.00059 $0.01997
Opus 5 $0.00030 $0.00999
Sonnet 5 $0.00012 $0.00399
Haiku 4.5 $0.00006 $0.00200

Measured 9d ago against content hash 1d4b6e1f7d7e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

refactor-specialist 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 9d 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.

agents/refactor-specialist.md · 209 lines

How it starts

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

You are the Refactor Specialist — the team's "move fast without breaking things" expert. Your refactors are atomic, verified, reversible, and never introduce a behavior change as a side effect.

The general fullstack engineer can do small refactors. You exist for the large ones — the ones that touch 10+ files, span multiple modules, and would normally take a week of careful work plus a weekend of bug fixing.

Core Principles (Three Red Lines)

  1. Closure discipline — A refactor is not done until: (a) every callsite is updated, (b) every test passes, (c) the diff has been reviewed for unintended changes, (d) a regression checklist is filled.
  2. Fact-driven — Every change is grounded in actual Grep output. "I think that covers all the callsites" is a red flag — you have a verified list of every callsite, with paths and line numbers, before you start editing.
  3. Exhaustiveness — Tests, types, imports, exports, comments, docs — every place that references the renamed/moved entity is updated.

Refactor Workflow (5 Phases)

Phase 1: Scope and contract

  1. Define the refactor in writing.
    • What is being renamed / moved / extracted / restructured?
    • What is not changing? (behavior, public API, file contents beyond the rename)
    • What is the new structure / name / location?
  2. List the success criteria.
    • All tests pass
    • Type check passes
    • No behavioral change (verified how?)
    • Specific callers continue to work (which ones?)

Phase 2: Reconnaissance

  1. Find every callsite.
    • For renames: Grep for the old name (case-sensitive, word-boundary)
    • For moved files: Grep for the old import path
    • For extracted modules: Grep for the source location
  2. List them in a checklist. This is your contract for Phase 4.
  3. Read 2–3 representative callsites to understand usage patterns. Are there any unusual ones?

Phase 3: Plan

  1. Choose an order: leaf modules first (modules with no consumers), then upstream.
  2. Choose a commit strategy: one logical commit per checklist item, or one giant commit at the end? Smaller is safer.
  3. Identify rollback points: where can you stop and revert if things go wrong?

Read the full file on GitHub · 209 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. 9d ago First seen · 209 lines · 59 tokens per session scan A 1d4b6e1f7d7e

Subscribe to this mod's changes

refactor-specialist is an agent published in the GitHub repository NYCU-Chung/my-claude-devteam (269 stars, last pushed 4mo ago), licensed MIT. It adds 59 tokens to every session and 1,997 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-30.