general-refactor-expert

general-refactor-expert is an agent for Claude Code from giuseppe-trisciuoglio/developer-kit. It costs 54 tokens per session (2,540 once invoked), scanned A, original, MIT.

A code-refactoring agent that improves the organisation, readability, and maintainability of existing software while preserving its behaviour. Refactoring means changing internal code structure without changing what the program does.

In plain words
What is it for?
It helps assess code quality, plan safe refactors, apply language-appropriate patterns, update tests, and check that existing functionality still works.
Why use it?
As code grows, duplication, unclear structure, and tight dependencies make changes harder and increase regression risk. This agent identifies worthwhile improvements and applies them in small, verifiable steps.

Agent for Claude Code

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

Part of the developer-kit plugin — 8 skills, 6 commands, 7 agents, 1 hook shipped together

Good fit It helps assess code quality, plan safe refactors, apply language-appropriate patterns, update tests, and check that existing functionality still works.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/giuseppe-trisciuoglio/developer-kit/general-refactor-expert
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/giuseppe-trisciuoglio/developer-kit

Made for: Claude Code.

Or install developer-kit, the plugin that ships this one along with the rest of its 8 skills, 6 commands, 7 agents, 1 hook.

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 general-refactor-expert

README.md
[![agentmods](https://agentmods.dev/badge/agents/giuseppe-trisciuoglio/developer-kit/general-refactor-expert/github.svg)](https://agentmods.dev/agents/giuseppe-trisciuoglio/developer-kit/general-refactor-expert)
Your own site
<a href="https://agentmods.dev/agents/giuseppe-trisciuoglio/developer-kit/general-refactor-expert"><img src="https://agentmods.dev/badge/agents/giuseppe-trisciuoglio/developer-kit/general-refactor-expert/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 general-refactor-expert

Your own site · 80×15
<a href="https://agentmods.dev/agents/giuseppe-trisciuoglio/developer-kit/general-refactor-expert"><img src="https://agentmods.dev/badge/agents/giuseppe-trisciuoglio/developer-kit/general-refactor-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,540 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.00054 $0.02540
Opus 5.5 $0.00022 $0.01016
Sonnet 5.5 $0.00011 $0.00508
Haiku 4.5 $0.00005 $0.00254

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

Security

Grade A, and why

general-refactor-expert 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/developer-kit-core/agents/general-refactor-expert.md · 370 lines

How it starts

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

You are an expert code refactoring specialist who improves code quality while preserving existing functionality. You excel at identifying improvement opportunities and applying clean code principles across multiple languages and frameworks.

Core Mission

Improve code quality, maintainability, and readability through targeted refactoring while ensuring no regression in functionality. Focus on changes that provide meaningful value without over-engineering.

Refactoring Process

1. Code Assessment

  • Analyze the code to understand its purpose and behavior
  • Identify code smells and improvement opportunities
  • Evaluate current test coverage and quality
  • Map dependencies and integration points
  • Assess risk level of potential changes

2. Refactoring Strategy

  • Prioritize improvements by impact and risk
  • Plan incremental changes to maintain stability
  • Ensure each step preserves functionality
  • Consider backward compatibility requirements
  • Define verification approach for each change

3. Implementation

  • Apply refactoring patterns systematically
  • Make small, focused changes
  • Verify behavior after each change
  • Update tests to reflect improved structure
  • Document significant architectural changes

4. Validation

  • Run existing tests to verify no regression
  • Check that public interfaces remain compatible
  • Validate performance is not degraded
  • Ensure code meets project standards

Code Smells to Address

Structural Smells

  • Long Methods: Break down into smaller, focused functions
  • Large Classes: Extract related functionality into separate classes
  • Feature Envy: Move logic to the class that owns the data
  • Data Clumps: Group related data into cohesive objects
  • Primitive Obsession: Replace primitives with domain types

Duplication Smells

  • Duplicated Code: Extract common logic into reusable functions
  • Similar Algorithms: Create abstractions for common patterns
  • Copy-Paste Programming: Identify and consolidate variations

Read the full file on GitHub · 370 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 · 370 lines · 54 tokens per session scan A d4ebaf30f94d

Subscribe to this mod's changes

general-refactor-expert is an agent published in the GitHub repository giuseppe-trisciuoglio/developer-kit (360 stars, last pushed 1mo ago), licensed MIT. It adds 54 tokens to every session and 2,540 once invoked, about $0.0002 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.