system-wide-refactoring

system-wide-refactoring is a skill for Claude Code from msbaek/msbaek-claude-plugins. It costs 121 tokens per session (4,030 once invoked), scanned A, original, MIT.

A guided refactoring process for changing code across an entire system. It applies techniques such as extracting methods and moving domain logic, with separate commits for each technique.

In plain words
What is it for?
Use it when improving related code in multiple parts of a system while keeping each refactoring technique separately reviewable.
Why use it?
Large refactoring efforts can become difficult to follow when many kinds of changes are mixed together.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the msbaek-tdd plugin — 28 skills, 10 agents, 2 hooks shipped together

Good fit Use it when improving related code in multiple parts of a system while keeping each refactoring technique separately reviewable.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/msbaek/msbaek-claude-plugins/system-wide-refactoring
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 msbaek/msbaek-claude-plugins --skill system-wide-refactoring
Clone the repo
git clone --depth 1 https://github.com/msbaek/msbaek-claude-plugins

Made for: Claude Code.

Or install msbaek-tdd, the plugin that ships this one along with the rest of its 28 skills, 10 agents, 2 hooks.

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 system-wide-refactoring

README.md
[![agentmods](https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/system-wide-refactoring/github.svg)](https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/system-wide-refactoring)
Your own site
<a href="https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/system-wide-refactoring"><img src="https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/system-wide-refactoring/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 system-wide-refactoring

Your own site · 80×15
<a href="https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/system-wide-refactoring"><img src="https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/system-wide-refactoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 121 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,030 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.00121 $0.04030
Opus 5.5 $0.00048 $0.01612
Sonnet 5.5 $0.00024 $0.00806
Haiku 4.5 $0.00012 $0.00403

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

Security

Grade A, and why

system-wide-refactoring 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 2mo 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.

msbaek-tdd/skills/system-wide-refactoring/SKILL.md · 272 lines

How it starts

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

System-wide Refactoring Skill

코드 분석 → 리팩토링 후보 제시 → 사용자 확인 → 기법별 커밋.

GOAL

  • 성공 = 사용자가 확인한 리팩토링이 기법별 커밋으로 완료됨
  • Extract Method / Extract Delegate / Domain Logic 이동 / SoC(Split Phase, Split by Abstraction Layer, Split by Unrelated Complexity) / 상속 계층(Pull Up Method, Push Down → Delegate) / 유사 기능 통합(Programming by Difference) 후보가 식별됨
  • 사용자와 질의응답으로 방향이 확정됨
  • 모든 테스트 통과

CONSTRAINTS

Hard Rules

  • 동작 변경 금지 — 구조 개선만 수행
  • 테스트 수정 금지 — 구조 변경이 테스트를 실패시키면 되돌리기
  • 사용자 확인 없이 리팩토링 금지 — 모든 후보는 사용자 승인 후 실행
  • 커밋 단위 — 1파일 x 1기법 = 1커밋 (논리적으로 연결된 파일은 함께)
  • git add -A 금지 — 변경된 파일만 명시적으로 추가

OUTPUT FORMAT

실행 절차

공통 골격(대상 파일 수집 → 후보 제시(계열별 승인 규칙) → 적용 → 테스트 → 커밋/되돌리기, 브랜치·PR이 필요한 조건)은 이 스킬 디렉터리 기준 ../../references/refactoring-procedure.md가 정본이다. 아래는 이 기법에 고유한 부분만 규정한다.

적용 순서 — 후보 제시의 기본 순서

후보를 제시할 때 아래 순서를 기본으로 정렬한다. 사용자가 순서를 바꾸면 그에 따른다.

A. TDD 직후(테스트에 로직이 모여 있는 상태) — 초기 리팩터링 7단계:

  1. 전제: 모든 로직이 테스트에 구현되어 있다 (이 전제가 없으면 2~7의 순서가 성립하지 않는다)
  2. AAA 구조의 테스트에서 Act 부분을 Extract Method한다
  3. Act가 의존성 객체를 쓰면: ① Introduce Parameter로 의존성을 파라미터로 → ② Introduce Parameter Object로 파라미터들을 객체(Application Service)로 묶는다 (Application Service에 그대로 전달될 파라미터는 제외) → ③ Move Instance Method to Application Service. 의존성이 Application Service 생성자로 전달된다. 의존성 주입(DI)이 가능해진다
  4. Act가 의존성 객체를 쓰지 않으면: Extract Delegate로 Application Service를 추출한다
  5. Application Service에서 Slide Statements로 I/O → 계산 → I/O 구조(Functional Core / Imperative Shell)를 확보한다
  6. Application Service에서 Extract Method로 도메인 로직을 메서드로 추출한다
  7. 추출된 도메인 로직을 Extract Delegate·Move Instance Method로 domain 계층에 옮긴다

B. 기존 트랜잭션 스크립트 → 도메인 모델 (Jimmy Bogard 9단계):

  1. Composed Method — 긴 메서드를 같은 추상화 수준의 작은 메서드로 분해
  2. Extract Methods — 주석 기준으로 블록 추출
  3. Introduce Parameter — 의존성 명시화
  4. Extract Class — seam 생성
  5. Extract Interface — 테스트 용이성
  6. Make Method Non-Static — Feature Envy 해소를 위한 인스턴스 메서드 전환
  7. Move Method — 데이터를 가진 객체로 이동
  8. Inline (Undo) — 이동 결과가 불균형하면 되돌리고 재추출한다. 리팩터링은 되돌릴 수 있어야 한다
  9. Reduce Setter Scope — private setter로 캡슐화 강화

Read the full file on GitHub · 272 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. 2mo ago Changed · +97 lines · +84 tokens per session b624939fe22c
  2. 2mo ago Changed 2547529c6604
  3. 3mo ago First seen · 175 lines · 37 tokens per session scan A f1ceff5b346e

Subscribe to this mod's changes

system-wide-refactoring is a skill published in the GitHub repository msbaek/msbaek-claude-plugins (8 stars, last pushed 1mo ago), licensed MIT. It adds 121 tokens to every session and 4,030 once invoked, about $0.0005 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-08-31.

Related

system-wide-refactoring compared with skills from other repositories

system-wide-refactoring next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
system-wide-refactoringmsbaek/msbaek-claude-pluginsSkill81mo agoMITA121Claude Code
local-ai-agentsmicrosoft/ai-agents-for-beginnersSkill82ktodayMITA200Claude Code, Codex
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill102ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill396ktodayMITA36Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill15ktodayCC0-1.0A113Claude Code, Codex
systematic-debuggingobra/superpowersSkill333k7d agoMITA21Claude Code