swe:refactor-opportunities

swe:refactor-opportunities is a skill for Claude Code from ckorhonen/swe-skills. It costs 100 tokens per session (1,414 once invoked), scanned A, original, MIT.

A review that turns repository inspection into a shortlist of small, low-risk refactoring tickets. Refactoring means improving code structure without intentionally changing its behavior.

In plain words
What is it for?
Use it to find duplicated logic, narrow maintainability improvements, and parallelizable cleanup tasks.
Why use it?
It helps replace broad cleanup discussions with clearly bounded work that can be reviewed and assigned independently.

Skill for Claude Code

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

Part of the swe-skills plugin — 17 skills shipped together

Good fit Use it to find duplicated logic, narrow maintainability improvements, and parallelizable cleanup tasks.

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

Made for: Claude Code.

Or install swe-skills, the plugin that ships this one along with the rest of its 17 skills.

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 swe:refactor-opportunities

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/ckorhonen/swe-skills/refactor-opportunities"><img src="https://agentmods.dev/badge/skills/ckorhonen/swe-skills/refactor-opportunities.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 100 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,414 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.00100 $0.01414
Opus 5 $0.00050 $0.00707
Sonnet 5 $0.00020 $0.00283
Haiku 4.5 $0.00010 $0.00141

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

Security

Grade A, and why

swe:refactor-opportunities 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 10d 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-opportunities/SKILL.md · 221 lines

How it starts

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

SWE Refactor Opportunities

What This Skill Does

Use this skill to produce a concrete shortlist of small refactor tickets, not a broad cleanup strategy.

Each recommendation should already look like a ticket someone could execute without re-scoping it.

When To Use

Use this skill when the user wants:

  • A shortlist of narrow refactors
  • Tickets that can be handed to multiple agents in parallel
  • Low-risk maintainability improvements with bounded write surfaces
  • Concrete suggestions rather than an open-ended cleanup brainstorm

Do Not Use

Do not use this skill for:

  • Architecture rewrites
  • Broad modernization plans
  • Style-only cleanup work
  • Bug hunting for recent regressions

Inputs To Confirm

Confirm or infer:

  • Repository or package scope
  • Whether the user wants suggestions tailored to a specific contributor
  • Any no-touch areas
  • Whether recent contribution history is available

What To Optimize For

  • Small scope
  • Low behavioral risk
  • Clear write boundaries
  • High leverage for maintainability
  • Concrete tickets that can be executed independently

Prefer refactors that:

  • De-duplicate repeated logic into a small helper or local module
  • Extract a cohesive piece from an oversized file without large-scale splitting
  • Consolidate repeated validation, mapping, or error-handling patterns
  • Remove dead, redundant, or obviously obsolete code
  • Simplify a confusing conditional or awkward interface boundary
  • Standardize a tiny repeated pattern inside one local area

Avoid:

  • Giant refactors
  • Architecture rewrites
  • Large-scale file splitting
  • Cross-repo cleanup campaigns
  • Renames done only for style
  • Suggestions that require deep domain knowledge in untouched areas
  • Vague advice that cannot be turned into a ticket immediately

Instructions

Step 1: Inspect The Repository Before Suggesting Anything

Review the repository structure, relevant files, and local patterns before forming suggestions.

Step 2: Find Candidate Refactor Surfaces

Read the full file on GitHub · 221 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. 10d ago First seen · 221 lines · 100 tokens per session scan A d01a58896b61

Subscribe to this mod's changes

swe:refactor-opportunities is a skill published in the GitHub repository ckorhonen/swe-skills (3 stars, last pushed 1mo ago), licensed MIT. It adds 100 tokens to every session and 1,414 once invoked, about $0.0005 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

improve

Autonomous quality improvement loop. Scores a target against a rubric, selects the highest-leverage axis, attacks it, verifies, documents, and loops. No pre-planning between iterations — each loop re-scores from scratch.

SethGammon/Citadel · 48 tokens

triage

GitHub issue and PR investigator. Pulls open issues/PRs, classifies them, searches the codebase for root cause or reviews contributed code, proposes fixes with file:line references, and optionally implements fixes. Use for investigating GitHub issues and reviewing PRs; do NOT use for general code review unrelated to…

SethGammon/Citadel · 71 tokens

review

5-pass structured code review — correctness, security, performance, readability, consistency.

SethGammon/Citadel · 17 tokens

create-pull-request

Use when asked to create or update a PR, revise its description, or link issue references to its body. Not for multi-PR stacks: use gate-and-merge. Not for releases: use git-workflow-and-versioning.

OutlineDriven/odin-claude-plugin · 52 tokens

audit-project

Run an iterative multi-agent code audit until critical and high findings are resolved. Use when the user says "audit my code", "find all the bugs", "deep code audit", "iterative review", or "review until clean".

OutlineDriven/odin-claude-plugin · 50 tokens

review-pr

Multi-agent PR review with four modes (review, re-review, self-review, address-feedback) - spawns parallel subagents, saves diff to /tmp for context efficiency, supports file exclusion patterns.

hoblin/claude-ruby-marketplace · 39 tokens