refactor

refactor is a skill for Claude Code from rjroy/vibe-garden. It costs 38 tokens per session (527 once invoked), scanned A, original, MIT.

A read-only code inspection skill for finding code smells, which are patterns that can make software harder to change or understand. It discusses whether a behavior-preserving refactor is worthwhile without changing the code.

In plain words
What is it for?
Reviewing related code, tests, callers, and consumers; identifying duplication, overly long methods, and other design problems; and deciding whether cleanup is justified.
Why use it?
Maintenance problems can be investigated too broadly or fixed before their value is clear. This skill keeps the diagnosis focused on the requested area and leaves implementation for a separate step.

Skill for Claude Code

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

Part of the lore-development plugin — 14 skills, 6 agents shipped together

Good fit Reviewing related code, tests, callers, and consumers; identifying duplication, overly long methods, and other design problems; and deciding whether cleanup is justified.

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

Made for: Claude Code.

Or install lore-development, 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/rjroy/vibe-garden/refactor/github.svg)](https://agentmods.dev/skills/rjroy/vibe-garden/refactor)
Your own site
<a href="https://agentmods.dev/skills/rjroy/vibe-garden/refactor"><img src="https://agentmods.dev/badge/skills/rjroy/vibe-garden/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/rjroy/vibe-garden/refactor"><img src="https://agentmods.dev/badge/skills/rjroy/vibe-garden/refactor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 527 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.00038 $0.00527
Opus 5.5 $0.00015 $0.00211
Sonnet 5.5 $0.00008 $0.00105
Haiku 4.5 $0.00004 $0.00053

Measured 9d ago against content hash 2ffd6e53dc9f, 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 9d 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.

lore-development/skills/refactor/SKILL.md · 50 lines

How it starts

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

Refactor

Begin with read-only diagnosis. The goal is to help the user decide whether a concrete refactoring is worth doing, not to produce a checklist or change code.

Scope and investigation

Establish the area or upcoming change from the user's request and conversation. If it is unclear, ask one bounded question before exploring. Do not infer a large scope from Git state or sweep the repository by default.

Inspect the relevant implementation, tests, callers, and consumers to understand what the code does and where maintenance friction occurs. Use code search, exploration, or a suitable review agent in proportion to the scope. Treat old plans, designs, and other work artifacts as context only; current user intent governs.

Use Fowler's code-smell vocabulary as a set of diagnostic cues, not a required catalog to complete. For example, duplication can cause fixes to diverge; shotgun surgery can make one change touch many places; speculative generality can impose abstraction costs without a demonstrated need; lazy elements, middle men, data clumps, and primitive obsession can obscure responsibilities or concepts. Long methods, feature envy, message chains, global or mutable state, and other familiar smells may also be relevant. A loop, switch, data class, comment, or simple name is not inherently a defect. Consider conflicting cues and the actual design context rather than treating any pattern as proof.

Findings and user choice

Report only findings supported by concrete file and code evidence. Explain the actual maintenance or future-change cost, then offer a bounded, behavior-preserving correction option. Ordinary naming or formatting concerns are not findings unless they cause meaningful cost. No finding is a valid result; do not invent work to fill a quota.

Present findings to the user and let them choose whether, and which, to address. Do not edit files, apply fixes, or begin implementation during this diagnosis. If the user asks to proceed, hand /simplify only the selected findings and compact scope: affected files/surface, evidence, behavior to preserve, and any explicitly accepted change. Do not create a spec, matrix, or approval document.

Read the full file on GitHub · 50 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. 9d ago First seen · 50 lines · 38 tokens per session scan A 2ffd6e53dc9f

Subscribe to this mod's changes

refactor is a skill published in the GitHub repository rjroy/vibe-garden (6 stars, last pushed 10d ago), licensed MIT. It adds 38 tokens to every session and 527 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-10-08.

Related

Other skills, from other repositories

review

Dispatched after a task lands at inreview to produce a structured CTO-grade verdict on the work and its PR. Two invocation paths: composer Phase 4 (orchestrator dispatches after the implementer's inreview write, surfaces the verdict to HOTL, stops), and direct mode from the piyaz skill on requests ("review VF-N"…

FrkAk/piyaz · 245 tokens

critical-code-reviewer

Rigorously review code or pull requests for correctness, security, accessibility, maintainability, tests, and edge cases. Use when users request a critical code review, want a guided walkthrough of findings, need implementer-facing feedback, or want to prepare, create, or submit a GitHub pull request review.

posit-dev/skills · 67 tokens

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

genshijin-review

A compact pull-request review format that writes one actionable finding per line in Japanese or English.

InterfaceX-co-jp/genshijin · 78 tokens

triage

Triages a PR comment — from a bot (Copilot, CI) or a human reviewer. Routes to the triagehelper.py helper for identity checks, thread snapshotting, isolated-worktree fixes, and publish/reply/resolve mechanics; you classify the finding and apply a justified fix. --dry-run is fully read-only (investigation and a printed…

nitinjain999/platform-skills · 109 tokens

pr-review

Comprehensive PR review across six dimensions — cost impact, environment drift, ownership gaps, SOC 2 compliance, deprecated API / version hygiene, and rollback feasibility. Each mode inspects the diff and current file state, reports findings with severity, and recommends concrete fixes. Use when preparing a PR for…

nitinjain999/platform-skills · 81 tokens