refactor

refactor is a skill for Claude Code from FlorianBruniaux/claude-code-plugins. It costs 13 tokens per session (1,359 once invoked), scanned A, original, MIT.

A code review helper that looks for SOLID design violations, repeated code, overly complex code, and other design problems.

In plain words
What is it for?
It reviews a file, directory, function, or class and suggests focused improvements such as separating mixed responsibilities or extracting shared logic.
Why use it?
It points out places where code may be hard to change or maintain without requiring an immediate rewrite.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter. Also seen: positional $N argument.

Part of the code-quality plugin — 14 skills, 6 agents shipped together

Good fit It reviews a file, directory, function, or class and suggests focused improvements such as separating mixed responsibilities or extracting shared logic.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/florianbruniaux/claude-code-plugins/refactor
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 FlorianBruniaux/claude-code-plugins --skill refactor
Clone the repo
git clone --depth 1 https://github.com/FlorianBruniaux/claude-code-plugins

Made for: Claude Code.

Or install code-quality, the plugin that ships this one along with the rest of its 14 skills, 6 agents.

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 refactor

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/florianbruniaux/claude-code-plugins/refactor"><img src="https://agentmods.dev/badge/skills/florianbruniaux/claude-code-plugins/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,359 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.00013 $0.01359
Opus 5.5 $0.00005 $0.00544
Sonnet 5.5 $0.00003 $0.00272
Haiku 4.5 $0.00001 $0.00136

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

Security

Grade A, and why

refactor 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 8d 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/skills/refactor/SKILL.md · 219 lines

How it starts

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

SOLID refactoring assistant

Analyze code for SOLID violations and suggest targeted improvements.

Purpose

Identify refactoring opportunities based on:

  • SOLID principle violations
  • Code smells and anti-patterns
  • Complexity metrics
  • Duplication detection

Instructions

Step 1: Scope analysis

Determine the refactoring scope from user input:

  • Single file: Deep analysis
  • Directory: Pattern detection across files
  • Function/class: Focused extraction suggestions
# Get file/directory stats
if [ -f "$TARGET" ]; then
  wc -l "$TARGET"
  echo "Single file analysis"
elif [ -d "$TARGET" ]; then
  find "$TARGET" -type f \( -name "*.ts" -o -name "*.js" -o -name "*.py" \) | wc -l
  echo "Directory analysis"
fi

Step 2: SOLID violations detection

S - single responsibility

Look for:

  • Files > 300 lines
  • Functions > 50 lines
  • Classes with > 10 methods
  • Mixed concerns (data + UI + business logic)
# Find large files
find . -name "*.{ts,js,py}" -exec wc -l {} + 2>/dev/null | sort -rn | head -10

# Functions with high line count (approximate)
grep -rn "function\|def \|fn " --include="*.{ts,js,py,rs}" . | head -20
O - open/closed principle

Look for:

  • Switch/case statements on types
  • Repeated if/else type checking
  • Direct modifications vs extensions
L - liskov substitution

Look for:

  • Overridden methods that throw "not implemented"
  • Type checks before method calls
  • Empty method overrides
I - interface segregation

Look for:

  • Large interfaces (> 10 methods)
  • Classes implementing unused interface methods
  • Fat service classes
D - dependency inversion

Look for:

  • Direct instantiation of dependencies (new Service())
  • Hardcoded class references
  • Missing dependency injection

Step 3: Code smells

# Duplication patterns
grep -rn --include="*.{ts,js,py}" . 2>/dev/null | \
  awk -F: '{print $3}' | sort | uniq -c | sort -rn | head -10

# Long parameter lists (> 4 params)
grep -rn "function.*,.*,.*,.*," --include="*.{ts,js}" . 2>/dev/null | head -10

# Deep nesting (4+ levels)
grep -rn "^\s\{16,\}" --include="*.{ts,js,py}" . 2>/dev/null | head -10

Read the full file on GitHub · 219 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. 8d ago First seen · 219 lines · 13 tokens per session scan A c317243a8aea

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository FlorianBruniaux/claude-code-plugins (44 stars, last pushed yesterday), licensed MIT. It adds 13 tokens to every session and 1,359 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-10-29.

Related

refactor compared with skills from other repositories

refactor next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refactorFlorianBruniaux/claude-code-pluginsSkill44yesterdayMITA13Claude Code
pr-triageaeonfun/aeonSkill788yesterdayMITA26Claude Code, Codex
feedback-builderaeonfun/aeonSkill788yesterdayMITA45Claude Code, Codex
[REPLACE: SKILL_NAME]aeonfun/aeonSkill788yesterdayMITA0Claude Code, Codex
review-loopsangrokjung/claude-forgeSkill8732mo agoMITA100Claude Code
generic-code-reviewertravisjneuman/.claudeSkill107yesterdayMITA70Claude Code, Codex
go-observability-reviewjohnqtcg/awesome-skillsSkill3028d agoMITA80Claude Code