refactoring-code-expert

refactoring-code-expert is a skill for Claude Code, Codex from jggomez/expert-ai-developer-skills. It costs 54 tokens per session (956 once invoked), scanned A, original, Apache-2.0.

Executes structural improvements on existing code to increase maintainability, readability, and extensibility without altering external behavior. Use this skill to address technical debt, fix "Code Smells", apply design patterns, or improve adherence to SOLID principles.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions Claude Code.

Install with agentmods
npx agentmods add skills/jggomez/expert-ai-developer-skills/refactoring-code-expert
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 jggomez/expert-ai-developer-skills --skill refactoring-code-expert
Clone the repo
git clone --depth 1 https://github.com/jggomez/expert-ai-developer-skills

Made for: Claude Code, Codex.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/jggomez/expert-ai-developer-skills/refactoring-code-expert/github.svg)](https://agentmods.dev/skills/jggomez/expert-ai-developer-skills/refactoring-code-expert)
Your own site
<a href="https://agentmods.dev/skills/jggomez/expert-ai-developer-skills/refactoring-code-expert"><img src="https://agentmods.dev/badge/skills/jggomez/expert-ai-developer-skills/refactoring-code-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 refactoring-code-expert

Your own site · 80×15
<a href="https://agentmods.dev/skills/jggomez/expert-ai-developer-skills/refactoring-code-expert"><img src="https://agentmods.dev/badge/skills/jggomez/expert-ai-developer-skills/refactoring-code-expert.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 956 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.00054 $0.00956
Opus 5.5 $0.00022 $0.00382
Sonnet 5.5 $0.00011 $0.00191
Haiku 4.5 $0.00005 $0.00096

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

Security

Grade A, and why

refactoring-code-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 today.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/run_tests.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/antigravity/python-backend/skills/refactoring-code-expert/SKILL.md · 81 lines

How it starts

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

Refactoring Code Expert Skill

Overview

This skill guides safe, disciplined, and incremental structural improvements to existing codebases without modifying external behavior. It acts as a Senior Software Architect and Refactoring Specialist, treating refactoring not as a risky "big-bang rewrite", but as a controlled sequence of micro-transformations protected by a robust automated test safety net.

When to Use

Trigger Scenarios

  • Eliminating code smells (God classes, long methods, duplicated logic, high cyclomatic complexity).
  • Restructuring messy or legacy code to adhere to SOLID, DRY, and KISS principles.
  • Decoupling tightly coupled components using Dependency Inversion or Ports & Adapters.
  • Preparing a module for new features by first making the change easy (pre-factoring).

When NOT to Use

  • Adding new functional capabilities or modifying contracts: Route to code-implementer or test-driven-development.
  • Pure smell diagnosis without altering code: Route to code-smells-expert.
  • Database schema modifications: Route to database-migration-expert.
  • Authoring new architectural specifications: Route to senior-architect-engineering.

Process

Phase 1: Test Safety Net & Characterization

  1. The Golden Rule: Refactoring changes internal structure, NEVER external behavior. If observable behavior changes, the refactoring is broken.
  2. Verify existing test coverage before editing any code:
    python3 ./skills/refactoring-code-expert/scripts/run_tests.py
    
  3. If tests are absent or inadequate, write minimal "Characterization Tests" to pin down existing behavior before modifying the implementation.

Phase 2: Micro-Refactoring Sequence Plan

Formulate a sequence of atomic, low-risk micro-refactorings:

  • Extract Method / Function: Isolate cohesive blocks of logic into well-named functions.
  • Introduce Parameter Object: Group related parameters into a dataclass or value object.
  • Replace Conditional with Polymorphism: Replace complex if/else or switch trees with strategy classes.
  • Rename Symbol: Replace cryptic names with self-documenting domain identifiers.

Read the full file on GitHub · 81 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. today First seen · 81 lines · 54 tokens per session scan A ce684b779800

Subscribe to this mod's changes

refactoring-code-expert is a skill published in the GitHub repository jggomez/expert-ai-developer-skills (30 stars, last pushed yesterday), licensed Apache-2.0. It adds 54 tokens to every session and 956 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-11-06.

Related

refactoring-code-expert compared with skills from other repositories

refactoring-code-expert next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
refactoring-code-expertjggomez/expert-ai-developer-skillsSkill30yesterdayApache-2.0A54Claude Code, Codex
agui-dotnet-streaming-chatag-ui-protocol/ag-uiSkill17kyesterdayMITA223Claude Code
azure-mgmt-apicenter-dotnetmicrosoft/skillsSkill3.2kyesterdayMITA97Claude Code
azure-communication-chat-javamicrosoft/skillsSkill3.2kyesterdayMITA41Claude Code
minimal-apicodewithmukesh/dotnet-claude-kitSkill8052d agoMITA101Claude Code
grpcmanagedcode/dotnet-skillsSkill508yesterdayMITA95Claude Code, Codex
azure-messaging-webpubsubservice-pybenjaminasterA/antigravity-awesome-skillsSkill461yesterdayMITA0Claude Code, Codex