refactor-expert

refactor-expert is a skill for Claude Code from nguyenthienthanh/aura-frog. It costs 19 tokens per session (640 once invoked), scanned A, original, MIT.

A guide for improving existing code in small steps while keeping its behavior unchanged. Refactoring means changing the code's structure or clarity without adding new functionality.

In plain words
What is it for?
Use it to analyze, plan, document, or carry out structure- or performance-focused refactoring, especially when tests can verify the result.
Why use it?
It helps reduce code smells and improve maintainability while lowering the risk of breaking working behavior.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is Human-readable explanation: see [docs/architecture/HIERARCHICAL_PLANNING.md](../../../docs/architecture/HIERARCHICAL_PLANNING.md).

Part of the aura-frog plugin — 43 skills, 24 commands, 15 agents, 10 hooks, 6 MCP servers shipped together

Good fit Use it to analyze, plan, document, or carry out structure- or performance-focused refactoring, especially when tests can verify the result.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/nguyenthienthanh/aura-frog
agentmods
npx agentmods add skills/nguyenthienthanh/aura-frog/refactor-expert

Made for: Claude Code.

Or install aura-frog, the plugin that ships this one along with the rest of its 43 skills, 24 commands, 15 agents, 10 hooks, 6 MCP servers.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/nguyenthienthanh/aura-frog/refactor-expert"><img src="https://agentmods.dev/badge/skills/nguyenthienthanh/aura-frog/refactor-expert.svg" alt="Reviewed on agentmods" width="80" 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 640 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 2 findings, up to medium

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • medium Excessive Agency · line 33
    Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.
    Fix: Add human-in-the-loop confirmation for destructive, irreversible, or high-impact operations. Never auto-execute commands that modify files, send data, or alter system state.
  • medium Agent Snooping · line 95
    Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
    Fix: Remove all code or instructions that list or read other skills' files or directories. Skills should operate independently; cross-skill access is a privilege escalation.
How audits are shown
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.00640
Opus 5 $0.00010 $0.00320
Sonnet 5 $0.00004 $0.00128
Haiku 4.5 $0.00002 $0.00064

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

Security

Grade A, and why

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 5d 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.

aura-frog/skills/refactor-expert/SKILL.md · 98 lines

How it starts

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

AI-consumed reference. Optimized for Claude to read during execution. Human-readable explanation: see docs/architecture/HIERARCHICAL_PLANNING.md or docs/getting-started/ depending on topic.

Skill: Refactor Expert

Safe, incremental refactoring. Improve quality without changing behavior.


Commands

Command Output
refactor:analyze <file> .claude/logs/refactors/{target}-analysis.md
refactor:plan <file> .claude/logs/refactors/{target}-plan.md
refactor:docs <file> Analysis + Plan + Summary
refactor:quick <file> Skip approvals
refactor:performance <file> Performance-focused
refactor:structure <file> Structure-focused

Decision

Signal Action
Code smell detected Identify specific smell
Tests passing Safe to refactor
No tests Write tests FIRST
Large change Break into small steps

Golden Rule: Never refactor and add features simultaneously.


Code Smells -> Refactoring

Smell Refactoring
Long Method Extract Method
Large Class Extract Class
Long Parameter List Parameter Object
Duplicate Code Extract Method/Class
Feature Envy Move Method
Primitive Obsession Replace with Object
Switch Statements Polymorphism
Dead Code Delete it

Safe Process

1. Ensure tests pass
2. ONE small change
3. Run tests
4. Commit
5. Repeat

Never multiple changes between test runs.


Checklist

Before: Tests exist and pass, understand current behavior, identify smell. During: One change at a time, test after each, commit frequently. After: All tests pass, code cleaner, behavior unchanged.


  • rules/core/simplicity-over-complexity.md — the point of refactoring: Rule of 3 before abstracting, delete before extracting, flatten before nesting
  • rules/core/tdd-workflow.md — refactor only when tests are green
  • rules/core/verification.md — tests must still pass after every step
  • rules/workflow/cross-review-workflow.md — refactorer ≠ reviewer
  • skills/code-simplifier/SKILL.md — companion skill for pure simplification passes

Read the full file on GitHub · 98 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. 5d ago First seen · 98 lines · 19 tokens per session scan A a6fcb07ffc9f

Subscribe to this mod's changes

refactor-expert is a skill published in the GitHub repository nguyenthienthanh/aura-frog (24 stars, last pushed 4d ago), licensed MIT. It adds 19 tokens to every session and 640 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-09-03.

Related

Other skills, from other repositories

chrome-cdp

Drive a headless Chrome over the Chrome DevTools Protocol (CDP) for browser QA — navigate, click, fill forms, read the DOM/accessibility tree, screenshot, and assert. Use whenever a task requires loading a web page and interacting with it like a user. Chrome is launched by a bash step (recipe below); this skill…

mattzcarey/shippie · 91 tokens

software-code-refactoring

Improve production code quality while preserving all existing test behavior. Commonly used for the Refactor phase of TDD red-green-refactor, but applicable to any codebase with tests. Use when production code works but needs cleanup — reducing duplication, improving naming, simplifying complexity, aligning with…

stencila/stencila · 102 tokens

brooks-health

Combined codebase health dashboard that scores a project across all four quality dimensions — PR quality, architecture, tech debt, and test quality — in a single pass, drawing on twelve classic engineering books. Triggers when: user wants an overall quality assessment, asks "how healthy is this codebase?", "run all…

hyhmrright/brooks-lint · 156 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

brooks-test

Test quality review drawing on twelve classic engineering books — with primary focus on xUnit Test Patterns, The Art of Unit Testing, How Google Tests Software, and Working Effectively with Legacy Code — that diagnoses structural problems in an existing test suite: brittleness, mock abuse, coverage illusions, slow…

hyhmrright/brooks-lint · 161 tokens

openspec-plus-tdd

MANDATORY skill that activates whenever code is written to implement an OpenSpec change task. Triggers: openspec-plus-apply is active, /opsx-apply is running, the user is implementing tasks from an OpenSpec change, an implementer subagent dispatched by openspec-plus-apply is starting work, or the user invokes phrases…

sudokar/openspec-plus · 190 tokens