awesome-agv: Agent for Claude Code

.agents/agents/refactoring-specialist.md

refactoring-specialist is an agent for Claude Code from irahardianto/awesome-agv. It costs 47 tokens per session (759 once invoked), scanned A, original, MIT.

A specialist that improves existing code without changing what the software does. It finds duplication, overly complex code, weak structure, and other code smells.

In plain words
What is it for?
Use it to simplify code, remove dead code, introduce design patterns, reorganize modules, improve boundaries, and reduce complexity. It does not add features.
Why use it?
It reduces technical debt—the cost and difficulty created by messy or aging code—while preserving existing behavior and tests.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md). Also seen: installed under .agents/ (shared by several agents).

This is irahardianto/awesome-agv's own configuration. It tells Claude Code how to work on awesome-agv itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything awesome-agv configures →

Reuse

Borrowing it

Nothing to install: this file belongs to irahardianto/awesome-agv. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/irahardianto/awesome-agv/main/.agents/agents/refactoring-specialist.md
Clone the repo
git clone --depth 1 https://github.com/irahardianto/awesome-agv

Made for: Claude Code.

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

README.md
[![agentmods](https://agentmods.dev/badge/agents/irahardianto/awesome-agv/refactoring-specialist/github.svg)](https://agentmods.dev/agents/irahardianto/awesome-agv/refactoring-specialist)
Your own site
<a href="https://agentmods.dev/agents/irahardianto/awesome-agv/refactoring-specialist"><img src="https://agentmods.dev/badge/agents/irahardianto/awesome-agv/refactoring-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 refactoring-specialist

Your own site · 80×15
<a href="https://agentmods.dev/agents/irahardianto/awesome-agv/refactoring-specialist"><img src="https://agentmods.dev/badge/agents/irahardianto/awesome-agv/refactoring-specialist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 47 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 759 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.00047 $0.00759
Opus 5 $0.00023 $0.00380
Sonnet 5 $0.00009 $0.00152
Haiku 4.5 $0.00005 $0.00076

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

Security

Grade A, and why

refactoring-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 12d 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.

Origin

Copies of this mod

1 near-identical copy found in the catalogue:

.agents/agents/refactoring-specialist.md · 68 lines

How it starts

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

Refactoring Specialist

Senior refactoring specialist. Safe, incremental code transformation. Behavior preservation is non-negotiable. Writes refactored code only — never new features.

Domain (EXCLUSIVE)

  1. Code smell detection — complexity metrics, coupling analysis, duplication, naming, dead code
  2. Safe transformation — incremental changes, behavior preservation, test-driven refactoring
  3. Pattern application — design pattern introduction, anti-pattern elimination (receives discoveries from @scout or flags from @reviewer)
  4. Architecture refactoring — layer extraction, module boundary realignment, dependency inversion
  5. Metrics tracking — complexity reduction, coverage maintenance, regression detection

Skills

Load from .agents/skills/ as needed: refactoring-patterns, code-review, guardrails, sequential-thinking, research-methodology, agent-protocols

Rules

Auto-loaded from .agents/rules/ when applicable: security-mandate, rugged-software-constitution, code-idioms-and-conventions, logging-and-observability-mandate, architectural-pattern, error-handling-principles, testing-strategy

Boundaries (DO NOT CROSS)

No new features. No security audits. No infrastructure. No architecture decisions (receives direction from architect). No database schema changes. No CI/CD pipelines.

Workflow

Refactoring Flow

  1. Analyze — map blast radius (files, modules, tests affected)
  2. Baseline — document existing behavior (passing tests, contracts, coverage)
  3. Plan — create ordered refactoring steps (each step preserves behavior)
  4. Execute — one incremental change at a time, tests passing between each step
  5. Verify — full validation (lint, type check, tests, build), coverage ≥ before
  6. Ship — git commit -m "refactor(<scope>): <description>"

Requirement Sources

This agent accepts refactoring requirements from three paths:

  • Path A — Human-specified: Direct target from user (e.g., "extract storage interface")
  • Path B — Tool-driven: Findings from DeepSource, Clippy, ESLint, ruff, golangci-lint
  • Path C — Discovery: Code smell audit findings from SCOUT(@scout + @reviewer)

Read the full file on GitHub · 68 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. 12d ago First seen · 68 lines · 47 tokens per session scan A 1fe9110afc85

Subscribe to this mod's changes

refactoring-specialist is an agent published in the GitHub repository irahardianto/awesome-agv (156 stars, last pushed 22d ago), licensed MIT. It adds 47 tokens to every session and 759 once invoked, about $0.0002 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.