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.
npx skills add msbaek/msbaek-claude-plugins --skill system-wide-refactoringgit clone --depth 1 https://github.com/msbaek/msbaek-claude-pluginsWrote 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.
[](https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/system-wide-refactoring)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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단계:
- 전제: 모든 로직이 테스트에 구현되어 있다 (이 전제가 없으면 2~7의 순서가 성립하지 않는다)
- AAA 구조의 테스트에서 Act 부분을 Extract Method한다
- Act가 의존성 객체를 쓰면: ① Introduce Parameter로 의존성을 파라미터로 → ② Introduce Parameter Object로 파라미터들을 객체(Application Service)로 묶는다 (Application Service에 그대로 전달될 파라미터는 제외) → ③ Move Instance Method to Application Service. 의존성이 Application Service 생성자로 전달된다. 의존성 주입(DI)이 가능해진다
- Act가 의존성 객체를 쓰지 않으면: Extract Delegate로 Application Service를 추출한다
- Application Service에서 Slide Statements로 I/O → 계산 → I/O 구조(Functional Core / Imperative Shell)를 확보한다
- Application Service에서 Extract Method로 도메인 로직을 메서드로 추출한다
- 추출된 도메인 로직을 Extract Delegate·Move Instance Method로 domain 계층에 옮긴다
B. 기존 트랜잭션 스크립트 → 도메인 모델 (Jimmy Bogard 9단계):
- Composed Method — 긴 메서드를 같은 추상화 수준의 작은 메서드로 분해
- Extract Methods — 주석 기준으로 블록 추출
- Introduce Parameter — 의존성 명시화
- Extract Class — seam 생성
- Extract Interface — 테스트 용이성
- Make Method Non-Static — Feature Envy 해소를 위한 인스턴스 메서드 전환
- Move Method — 데이터를 가진 객체로 이동
- Inline (Undo) — 이동 결과가 불균형하면 되돌리고 재추출한다. 리팩터링은 되돌릴 수 있어야 한다
- Reduce Setter Scope — private setter로 캡슐화 강화
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.
- 2mo ago Changed · +97 lines · +84 tokens per session b624939fe22c
- 2mo ago Changed 2547529c6604
- 3mo ago First seen · 175 lines · 37 tokens per session scan A f1ceff5b346e
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.
system-wide-refactoring compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| system-wide-refactoringmsbaek/msbaek-claude-plugins | Skill | 8 | 1mo ago | MIT | A | 121 | Claude Code |
| local-ai-agentsmicrosoft/ai-agents-for-beginners | Skill | 82k | today | MIT | A | 200 | Claude Code, Codex |
| imagegenopenai/codex | Skill | 137k | today | Apache-2.0 | A | 113 | Codex |
| playwright-climicrosoft/playwright | Skill | 102k | today | Apache-2.0 | A | 19 | Claude Code |
| browser-automationopenclaw/openclaw | Skill | 396k | today | MIT | A | 36 | Claude Code |
| free-llm-apismnfst/awesome-free-llm-apis | Skill | 15k | today | CC0-1.0 | A | 113 | Claude Code, Codex |
| systematic-debuggingobra/superpowers | Skill | 333k | 7d ago | MIT | A | 21 | Claude Code |