refactor-suggester

refactor-suggester is a skill for Claude Code from lyupro/skillforge-mcp. It costs 19 tokens per session (345 once invoked), scanned A, original, MIT.

A code-review helper that suggests small, focused improvements to a code snippet while aiming to keep its behavior unchanged. It names the underlying code smell, such as an overly long function or repeated logic.

In plain words
What is it for?
Use it to identify refactoring opportunities, propose concrete small changes, and note whether tests may need updating.
Why use it?
It helps improve difficult code without pushing you toward a risky rewrite or unnecessary abstraction.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the skillforge plugin — 10 skills, 1 MCP server shipped together

Good fit Use it to identify refactoring opportunities, propose concrete small changes, and note…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/lyupro/skillforge-mcp/refactor-suggester
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 lyupro/skillforge-mcp --skill refactor-suggester
Clone the repo
git clone --depth 1 https://github.com/lyupro/skillforge-mcp

Made for: Claude Code.

Or install skillforge, the plugin that ships this one along with the rest of its 10 skills, 1 MCP server.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/lyupro/skillforge-mcp/refactor-suggester.svg)](https://agentmods.dev/skills/lyupro/skillforge-mcp/refactor-suggester)
Your own site
<a href="https://agentmods.dev/skills/lyupro/skillforge-mcp/refactor-suggester"><img src="https://agentmods.dev/badge/skills/lyupro/skillforge-mcp/refactor-suggester.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 345 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.00019 $0.00345
Opus 5 $0.00010 $0.00172
Sonnet 5 $0.00004 $0.00069
Haiku 4.5 $0.00002 $0.00034

Measured 6d ago against content hash 4c5e89e3c5b6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

refactor-suggester 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 6d 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.

skills/refactor-suggester/SKILL.md · 32 lines

What it actually says

You are a senior engineer asked to suggest refactors for the code snippet supplied as user input. Apply this discipline:

  1. Minimal change first. Prefer extracting one function, renaming one variable, or deleting one dead branch over a rewrite. Each suggestion should be defensible as "smaller blast radius than the alternative."
  2. Behavior preserved. Every refactor must keep externally observable behavior identical. Flag any suggestion that requires test updates explicitly.
  3. No premature abstraction. Three similar lines is better than a premature class hierarchy. Only suggest abstractions when the duplication is real and load-bearing.
  4. Cite the smell. Each suggestion names the underlying smell (long method, primitive obsession, feature envy, shotgun surgery, etc.) so the reviewer can decide if the diagnosis fits.

Output format:

## Findings

1. **Smell:** <name>
   **Location:** <line numbers or function name>
   **Why it matters:** <one sentence>
   **Suggested change:** <concrete diff or pseudocode>
   **Test impact:** <none / one new test for X / existing test Y must update>
   **Priority:** <high — fix soon / medium — fix when touching this area / low — opportunistic>

2. ...

Sort findings by priority desc. If the code is genuinely clean, say so and explain what would have to change before refactoring is justified — don't manufacture findings.

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. 6d ago First seen · 32 lines · 19 tokens per session scan A 4c5e89e3c5b6

Subscribe to this mod's changes

refactor-suggester is a skill published in the GitHub repository lyupro/skillforge-mcp (2 stars, last pushed 22d ago), licensed MIT. It adds 19 tokens to every session and 345 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.

Related

Other skills, from other repositories

coding

Use when five specialized coding agents (linter, perf, refactor, security, test) that enforce quality gates across the development lifecycle. From lint enforcement through performance profiling, refactoring, security auditing, and test coverage. Use when working with coding agents.

oyi77/1ai-skills · 54 tokens

sage-review

Deep, platform-neutral code review for PRs and CRs in ONE thorough single pass — design reasoning (Problem Worth Solving & Solution Fit) as one dimension alongside the 9 code-level dimensions, with chain-of-consequences, self-critique, and draft-only comments. The single app-owned source of truth.

kirodotdev/KiroCrew · 68 tokens

audit

Use when the user wants a code review on recent changes — quality, spec, security, or performance feedback. Triggers a multi-level (L1-L5) review with a standalone Reviewer; on NEEDSFIX, offers to apply findings via /hyperflow:plan. Trigger with /hyperflow:audit, "review this change", "review my PR", "audit the diff"…

jeremylongshore/tons-of-skills-marketplace · 84 tokens

stage-coach

Consume CocoSentinel per-stage external coach requests and produce stage quality scores.

Snowflake-Labs/cocoplus · 19 tokens

quality-gate

Orchestrates the QUALITY pipeline stage for egregore work items, running code review, unbloat, and test updates. Use when running quality checks before a PR.

athola/claude-night-market · 39 tokens

plugin-review

Review plugin quality with tiered checks and dependency scoping. Use for PR and pre-release audits.

athola/claude-night-market · 23 tokens