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 replace-temp-with-querygit 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/replace-temp-with-query)<a href="https://agentmods.dev/skills/msbaek/msbaek-claude-plugins/replace-temp-with-query"><img src="https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/replace-temp-with-query/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/replace-temp-with-query"><img src="https://agentmods.dev/badge/skills/msbaek/msbaek-claude-plugins/replace-temp-with-query.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.00098 | $0.01185 |
| Opus 5.5 | $0.00039 | $0.00474 |
| Sonnet 5.5 | $0.00020 | $0.00237 |
| Haiku 4.5 | $0.00010 | $0.00119 |
Grade A, and why
replace-temp-with-query 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 — 133 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Replace Temp with Query
GOAL
한 번만 대입되고 여러 곳에서 사용되는 임시 변수를 의미 있는 이름의 메서드로 추출하여:
- 중복된 계산 로직 제거
- 표현식의 의미를 명확한 메서드명으로 전달
- Extract Method의 전제 조건 충족 (임시 변수 제거)
CONSTRAINTS
- 계열: Tidy — 후보 보고 후 승인 없이 적용 (
../../references/refactoring-procedure.md§0·§3-A) - 동작 변경 금지: 구조 개선만 수행 (기능 변경 없음)
- 테스트 수정 금지: 구조 변경이 테스트를 실패시키면 되돌리기
- 명시적 git add:
git add -A금지, 변경된 파일만 명시
적용 패턴
Before
double basePrice = quantity * itemPrice;
if (basePrice > 1000) {
return basePrice * 0.95;
} else {
return basePrice * 0.98;
}
After
if (basePrice() > 1000) {
return basePrice() * 0.95;
} else {
return basePrice() * 0.98;
}
private double basePrice() {
return quantity * itemPrice;
}
추가 예시: 복잡한 조건식
// Before
double tax = order.getTotal() * 0.1;
double shipping = order.getTotal() > 100 ? 0 : 10;
return order.getTotal() + tax + shipping;
// After
return order.getTotal() + tax() + shipping();
private double tax() { return order.getTotal() * 0.1; }
private double shipping() { return order.getTotal() > 100 ? 0 : 10; }
적용 기준
적용 대상
- 한 번만 대입되는 임시 변수
- 여러 곳에서 참조되는 변수
- 복잡한 표현식을 담은 변수 (의미 부여 가치 높음)
- Extract Method 전 단계로 사용
적용 제외
- 루프 내 누적 변수 (accumulator):
sum += value; - 부수효과 있는 표현식: 메서드 호출이 상태 변경하는 경우
- 여러 번 대입되는 변수: 값이 변경되는 경우
- 성능 크리티컬 구간: 측정된 성능 문제가 있는 경우만
OUTPUT FORMAT
실행 절차
공통 골격(대상 파일 수집 → 후보 제시(계열별 승인 규칙) → 적용 → 테스트 → 커밋/되돌리기, 브랜치·PR이
필요한 조건)은 이 스킬 디렉터리 기준 ../../references/refactoring-procedure.md가 정본이다.
아래는 이 기법에 고유한 부분만 규정한다.
후보 식별 (공통 절차 2단계)
- 임시 변수 패턴 탐지 (한 번 대입, 여러 번 참조)
- 적용 제외 조건 필터링
- 각 후보에 대해:
- 파일명 및 라인 번호
- Before/After 코드 미리보기
- 적용 근거 (참조 횟수, 표현식 복잡도)
후보 제시 예시 (공통 절차 3단계)
발견된 후보 3개:
1. OrderService.java:45
basePrice = quantity * itemPrice
→ private double basePrice() { return quantity * itemPrice; }
(참조 3회, 복잡도 낮음)
→ 승인 없이 적용 (Tidy 계열)
리팩토링 적용 (공통 절차 4단계)
- 메서드 추출 (private, 원본 표현식)
- 임시 변수 참조를 메서드 호출로 치환
- 임시 변수 선언 제거
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 · -1 lines · +63 tokens per session 19a183916afd
- 2mo ago Changed 413875667b5a
- 3mo ago First seen · 134 lines · 35 tokens per session scan A 6863dd4f6efb
replace-temp-with-query is a skill published in the GitHub repository msbaek/msbaek-claude-plugins (8 stars, last pushed 1mo ago), licensed MIT. It adds 98 tokens to every session and 1,185 once invoked, about $0.0004 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.
replace-temp-with-query compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| replace-temp-with-querymsbaek/msbaek-claude-plugins | Skill | 8 | 1mo ago | MIT | A | 98 | Claude Code |
| systematic-debuggingopen-metadata/OpenMetadata | Skill | 16k | today | Apache-2.0 | A | 37 | Claude Code |
| log-error-digestzebbern/claude-code-guide | Skill | 4.7k | today | MIT | A | 71 | Claude Code, Codex |
| observability-audit-sessionsIBM/mcp-context-forge | Skill | 4.9k | today | Apache-2.0 | A | 64 | Claude Code, Codex |
| cwv-optimizeradobe/skills | Skill | 343 | today | Apache-2.0 | A | 112 | Claude Code |
| performance-verificationvalkor-ai/loom | Skill | 1.6k | 3d ago | Apache-2.0 | A | 45 | Claude Code, Codex |
| loop-engineeringhuytieu/COG-second-brain | Skill | 1.6k | yesterday | MIT | A | 63 | Claude Code |