refactoring-advisor

refactoring-advisor is a skill for Claude Code from armanzeroeight/fastagent-plugins. It costs 31 tokens per session (958 once invoked), scanned A, original, MIT.

A guide for planning code refactoring, which means changing the internal structure of code without changing what it is meant to do. It recommends patterns and breaks the work into small steps with tests.

In plain words
What is it for?
Use it to assess code smells such as long methods, large classes, duplicated code, or long parameter lists, then create and validate an incremental refactoring plan.
Why use it?
It helps make difficult or messy code easier to maintain while considering dependencies, risk, and whether tests protect the behavior.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the code-quality-toolkit plugin — 2 skills shipped together

Good fit Use it to assess code smells such as long methods, large classes, duplicated code, or long parameter lists, then create and validate an incremental refactoring plan.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/armanzeroeight/fastagent-plugins/refactoring-advisor
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 armanzeroeight/fastagent-plugins --skill refactoring-advisor
Clone the repo
git clone --depth 1 https://github.com/armanzeroeight/fastagent-plugins

Made for: Claude Code.

Or install code-quality-toolkit, the plugin that ships this one along with the rest of its 2 skills.

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 refactoring-advisor

README.md
[![agentmods](https://agentmods.dev/badge/skills/armanzeroeight/fastagent-plugins/refactoring-advisor/github.svg)](https://agentmods.dev/skills/armanzeroeight/fastagent-plugins/refactoring-advisor)
Your own site
<a href="https://agentmods.dev/skills/armanzeroeight/fastagent-plugins/refactoring-advisor"><img src="https://agentmods.dev/badge/skills/armanzeroeight/fastagent-plugins/refactoring-advisor/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 refactoring-advisor

Your own site · 80×15
<a href="https://agentmods.dev/skills/armanzeroeight/fastagent-plugins/refactoring-advisor"><img src="https://agentmods.dev/badge/skills/armanzeroeight/fastagent-plugins/refactoring-advisor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 31 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 958 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.00031 $0.00958
Opus 5.5 $0.00012 $0.00383
Sonnet 5.5 $0.00006 $0.00192
Haiku 4.5 $0.00003 $0.00096

Measured 1mo ago against content hash 4ca44784ee00, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

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

plugins/code-quality-toolkit/skills/refactoring-advisor/SKILL.md · 194 lines

How it starts

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

Refactoring Advisor

Quick Start

Plan refactoring based on identified issues:

  1. Identify the problem (code smell, complexity)
  2. Select appropriate refactoring pattern
  3. Create step-by-step plan
  4. Ensure tests exist
  5. Refactor incrementally

Instructions

Step 1: Assess Current State

Analyze the code:

  • What is the problem? (long method, god class, etc.)
  • What is the impact? (maintainability, testability)
  • What is the risk? (how much code depends on it)

Step 2: Select Refactoring Strategy

Problem Strategy Risk
Long Method Extract Method Low
God Class Extract Class Medium
Duplicated Code Extract Method Low
Switch Statement Replace with Polymorphism High
Long Parameter List Introduce Parameter Object Medium

Step 3: Create Refactoring Plan

Template:

## Refactoring: [Name]

**Problem:** [Description]
**Goal:** [Desired outcome]
**Risk Level:** [Low/Medium/High]

### Prerequisites
- [ ] Tests exist and pass
- [ ] Code is committed
- [ ] Dependencies identified

### Steps
1. [First small change]
2. [Run tests]
3. [Next small change]
4. [Run tests]
...

### Validation
- [ ] All tests pass
- [ ] No functionality changed
- [ ] Code is cleaner

Step 4: Execute Incrementally

Golden Rule: Make the change easy, then make the easy change

  1. Make one small change
  2. Run tests
  3. Commit
  4. Repeat

Refactoring Examples

Extract Method

Before:

function printOwing(invoice) {
  let outstanding = 0;
  
  console.log("***********************");
  console.log("**** Customer Owes ****");
  console.log("***********************");
  
  for (const o of invoice.orders) {
    outstanding += o.amount;
  }
  
  console.log(`name: ${invoice.customer}`);
  console.log(`amount: ${outstanding}`);
}

Plan:

  1. Extract banner printing
  2. Run tests
  3. Extract outstanding calculation
  4. Run tests
  5. Extract details printing
  6. Run tests

Read the full file on GitHub · 194 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 · 194 lines · 31 tokens per session scan A 4ca44784ee00

Subscribe to this mod's changes

refactoring-advisor is a skill published in the GitHub repository armanzeroeight/fastagent-plugins (29 stars, last pushed 3mo ago), licensed MIT. It adds 31 tokens to every session and 958 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories

adk-review

Reviews the uncommitted changes in an adk-python working tree and reports correctness, design, public-API stability, test, sample and documentation gaps as a prioritized findings report, fixing them only when asked. Use when the user asks to review local changes, wants a self-review before opening a pull request, asks…

google/adk-python · 164 tokens

code-review-skill

Reviews code with feedback tailored to the developer's profile in session state.

google/adk-python · 19 tokens

learn-from-sage

Detection-gap (miss) analysis for Code Review Sage. Learn from shipped fixes, acted-on human comments, and design outcomes to close reviewer blind spots. Inline during review stages a candidate; a human triggers a one-shot AI consolidation into the live ruleset.

kirodotdev/KiroCrew · 56 tokens

review-fix-signoff-loop

Use when writing Agent Relay or Ricky workflows that must loop review, fix, and validation with fresh agent context until independent signoff agents, typically Claude and Codex, both agree the work is comprehensively complete. Covers fresh-context iterations, repairable gates, dual reviewer verdict contracts…

AgentWorkforce/relay · 77 tokens

ha-code-review

Hope-native review of uncommitted, staged, commit, branch, or PR changes: discover concrete regressions, independently verify candidates, and report actionable findings first without speculative noise.

shiwenwen/hope-agent · 40 tokens

plugin-quality

A review guide for checking Zhin.js plugins before release. It covers plugin structure, feature declarations, resource cleanup, message sending, and security.

zhinjs/zhin · 49 tokens