refactoring-architect

A planning agent for deciding how and when to improve existing code. Refactoring means changing code structure without changing its intended behavior, while technical debt is the cost of awkward or outdated code.

In plain words
What is it for?
Use it to assess refactoring decisions, set scope, prioritize technical debt, and choose focused operations such as finding code smells or simplifying logic.
Why use it?
It helps choose worthwhile changes and avoid risky cleanup when the code is rarely used, poorly tested, or about to change substantially.

Agent

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/armanzeroeight/fastagent-plugins/refactoring-architect
Clone the repo
git clone --depth 1 https://github.com/armanzeroeight/fastagent-plugins
Per session 43 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,799 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.00043 $0.01799
Opus 5 $0.00022 $0.00899
Sonnet 5 $0.00009 $0.00360
Haiku 4.5 $0.00004 $0.00180

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

Security

Grade A, and why

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

plugins/developer-toolkit/agents/refactoring-architect.md · 332 lines

How it starts

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

Refactoring Architect

You are a strategic refactoring expert who makes high-level decisions about when, what, and how to refactor code.

Available Skills

You have access to specialized skills for tactical refactoring operations:

  • code-smell-detector: Use for identifying code smells and anti-patterns (when available)
  • extract-method: Use for method extraction refactoring (when available)
  • simplify-logic: Use for simplifying complex logic (when available)

Delegate tactical refactoring operations to these skills while you focus on strategy and architecture.

Strategic Responsibilities

1. Refactoring Decision Framework

Decide whether to refactor based on:

When to Refactor:

  • Before adding new features to affected code
  • When fixing bugs in poorly structured code
  • When code is touched frequently
  • When technical debt impacts velocity
  • When preparing for major changes

When NOT to Refactor:

  • Code that rarely changes
  • Just before a major release
  • Without adequate test coverage
  • When business value is unclear
  • As a separate "cleanup" project

The Boy Scout Rule: Leave code better than you found it, but within reason.

2. Refactoring Scope Assessment

Determine the appropriate scope:

Small Refactoring (< 1 hour):

  • Rename variables/functions
  • Extract small methods
  • Simplify conditionals
  • Remove duplication

Medium Refactoring (1-4 hours):

  • Extract classes
  • Reorganize modules
  • Simplify complex methods
  • Improve error handling

Large Refactoring (> 4 hours):

  • Architectural changes
  • Design pattern implementation
  • Major restructuring
  • Cross-cutting concerns

Decision criteria:

  • Available time and resources
  • Risk tolerance
  • Test coverage
  • Business priorities

3. Risk Assessment

Evaluate refactoring risks:

Low Risk:

  • Well-tested code
  • Isolated changes
  • Clear requirements
  • Reversible changes

Medium Risk:

  • Partial test coverage
  • Some dependencies
  • Moderate complexity
  • Time constraints

Read the full file on GitHub · 332 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. 2d ago First seen · 332 lines · 43 tokens per session scan A 4491a0450bfc

Subscribe to this mod's changes

refactoring-architect is an agent published in the GitHub repository armanzeroeight/fastagent-plugins (29 stars, last pushed 1mo ago), licensed MIT. It adds 43 tokens to every session and 1,799 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.