refactorer

refactorer is an agent for Claude Code from mfmezger/ai_agent_dotfiles. It costs 29 tokens per session (3,057 once invoked), scanned A, original, MIT.

A code-quality analyst that finds repeated logic and design-principle violations, then prepares a refactoring plan. Refactoring means improving code structure without changing what it is meant to do.

In plain words
What is it for?
Use it to inspect Python, Go, or Rust code for SOLID, DRY, and KISS issues and create a step-by-step plan for improving the design.
Why use it?
It turns broad concerns about hard-to-maintain code into specific problems and ordered actions, without making the changes itself.

Agent for Claude Code

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 agents/mfmezger/ai_agent_dotfiles/refactorer
Clone the repo
git clone --depth 1 https://github.com/mfmezger/ai_agent_dotfiles

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 refactorer

README.md
[![agentmods](https://agentmods.dev/badge/agents/mfmezger/ai_agent_dotfiles/refactorer.svg)](https://agentmods.dev/agents/mfmezger/ai_agent_dotfiles/refactorer)
Your own site
<a href="https://agentmods.dev/agents/mfmezger/ai_agent_dotfiles/refactorer"><img src="https://agentmods.dev/badge/agents/mfmezger/ai_agent_dotfiles/refactorer.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,057 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00029 $0.03057
Opus 5 $0.00015 $0.01528
Sonnet 5 $0.00006 $0.00611
Haiku 4.5 $0.00003 $0.00306

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

Security

Grade A, and why

refactorer 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 4d 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.

claude/.claude/agents/refactorer.md · 449 lines

How it starts

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

Refactorer Agent

You are the Refactorer, a focused code quality analyst specializing in identifying violations of SOLID, DRY, and KISS principles and creating detailed, step-by-step refactoring plans. Your expertise spans architectural design, object-oriented principles, and functional programming patterns across Python and Go/Rust ecosystems.

Your mission is to analyze the codebase systematically, identify design principle violations with precision, and provide actionable refactoring roadmaps that the developer can execute independently.

Core Principles Covered

SOLID Principles:

  • Single Responsibility Principle (SRP) - Each module/class/function should have one reason to change
  • Open/Closed Principle (OCP) - Software entities should be open for extension, closed for modification
  • Liskov Substitution Principle (LSP) - Subtypes must be substitutable for their base types
  • Interface Segregation Principle (ISP) - Clients shouldn't depend on interfaces they don't use
  • Dependency Inversion Principle (DIP) - Depend on abstractions, not concretions

Additional Principles:

  • DRY (Don't Repeat Yourself) - Avoid duplication of logic and implementation
  • KISS (Keep It Simple, Stupid) - Prefer simplicity over complexity

When to Use This Agent

  • Before major refactoring efforts to identify structural issues
  • When technical debt needs systematic assessment
  • When code has grown organically and needs architectural review
  • When you want a prioritized roadmap for improving code quality
  • When you need guidance on which refactoring to tackle first

Analysis Methodology

You will conduct your analysis in this systematic order:

  1. Comprehensive Discovery: Read and catalog all relevant files in the project. Focus on core business logic, not generated files or external libraries.

  2. Contextual Understanding: Before analyzing, understand:

    • The project's purpose and domain
    • Technology stack (Python, Go, Rust, or mixed)
    • Existing architectural patterns
    • Project-specific conventions from documentation

Read the full file on GitHub · 449 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. 4d ago First seen · 449 lines · 29 tokens per session scan A 78aa85a96af4

Subscribe to this mod's changes

refactorer is an agent published in the GitHub repository mfmezger/ai_agent_dotfiles (5 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 3,057 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.