refactoring-guide

A Chinese reference guide covering 66 techniques for restructuring existing code. Refactoring means changing code’s internal structure without changing what it does.

In plain words
What is it for?
It is for improving code structure and readability, removing code smells, and applying changes such as extracting functions, moving functions, simplifying conditions, or reorganizing inheritance.
Why use it?
It helps address code smells, which are patterns that make code harder to understand, change, or maintain.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/dwsy/agent/refactoring-guide
Any agent
npx skills add Dwsy/agent --skill refactoring-guide
Clone the repo
git clone --depth 1 https://github.com/Dwsy/agent

Made for: Claude Code, Codex.

Per session 96 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,227 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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 $0.00096 $0.04227
Opus 5 $0.00048 $0.02114
Sonnet 5 $0.00019 $0.00845
Haiku 4.5 $0.00010 $0.00423

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

Security

Grade A, and why

refactoring-guide 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 2d 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/refactoring-guide/SKILL.md · 376 lines

The source is not reproduced here

No licence file

A repository with no LICENSE is all rights reserved by default, so the body is not copied here. The metadata, the measurements and the link are.

Read it on GitHub

Files

What ships with it

6 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. 2d ago First seen · 376 lines · 96 tokens per session scan A b5b6a89719df

Subscribe to this mod's changes

refactoring-guide is a skill published in the GitHub repository Dwsy/agent (22 stars, last pushed 14d ago), with no licence file. It adds 96 tokens to every session and 4,227 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-30.

Related

Other skills, from other repositories

project-orchestration

Orchestrate multi-agent workflows for feature development using planning agents, context handoff, and stage management.

darrenhinde/OpenAgentsControl · 25 tokens

foundry-config-setup

Resolve missing setup caused by a hardcoded Foundry project endpoint or model in a sample. Use when a sample fails because it uses a placeholder/hardcoded projectendpoint (for example "https://your-project.services.ai.azure.com") or a hardcoded model instead of reading them from the environment.

microsoft/agent-framework · 65 tokens

reflect

Review recent work, find repeated workflow patterns, and suggest reusable skills, agents, commands, config changes, or playbooks. Use when the user asks to learn from past sessions, improve recurring workflows, or identify what should be turned into reusable agent instructions.

alvinunreal/oh-my-opencode-slim · 53 tokens

codemap

Generate comprehensive hierarchical codemaps for UNFAMILIAR repositories. Expensive operation - only use when explicitly asked for codebase documentation or initial repository mapping.

alvinunreal/oh-my-opencode-slim · 34 tokens

length-converter

Convert between common length units (miles, km, feet, meters) using a multiplication factor.

microsoft/agent-framework · 24 tokens

background

Use when the user wants to see, inspect, cancel, or prune background agents fired during prior chain runs. Read/manage .hyperflow/background/registry.json and the per-agent output buffers at .hyperflow/background/ .md. Standalone — never auto-invoked. Trigger with /hyperflow:background, "list background agents"…

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