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 YYH211/Claude-meta-skill --skill dry-refactoringgit clone --depth 1 https://github.com/YYH211/Claude-meta-skillWrote 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/yyh211/claude-meta-skill/dry-refactoring)<a href="https://agentmods.dev/skills/yyh211/claude-meta-skill/dry-refactoring"><img src="https://agentmods.dev/badge/skills/yyh211/claude-meta-skill/dry-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/yyh211/claude-meta-skill/dry-refactoring"><img src="https://agentmods.dev/badge/skills/yyh211/claude-meta-skill/dry-refactoring.svg" alt="Reviewed on agentmods" width="80" height="20"></a>- NVIDIA SkillSpector pass
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.00070 | $0.07186 |
| Opus 5 | $0.00035 | $0.03593 |
| Sonnet 5 | $0.00014 | $0.01437 |
| Haiku 4.5 | $0.00007 | $0.00719 |
Grade A, and why
dry-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 10d 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 — 965 lines — stays where its author put it; the contents beside it link to each section on GitHub.
DRY 标准化流程:从识别到重构
这个技能指导你系统性地应用 DRY (Don't Repeat Yourself) 原则,通过四步标准化流程消除代码重复,提升代码质量和可维护性。
When to Use This Skill
使用此技能当用户请求:
- 消除代码重复或冗余
- 重构有明显复制粘贴痕迹的代码
- 应用 DRY 原则优化代码库
- 识别并修复"代码坏味道"(如魔术数字、重复逻辑)
- 提取公共逻辑为可复用单元
- 改善代码的可维护性
关键触发词: DRY, 重复代码, 代码重复, 重构, 消除重复, 复制粘贴, 魔术数字, 代码坏味道, 抽象, 提取函数
核心思想
系统中的每一处知识都必须拥有一个单一、明确、权威的表示。
这意味着:
- 任何业务逻辑、算法或配置信息都应该只存在于代码库的一个地方
- 如果需要修改,你只需改这一个地方
- 修改会自动反映到所有使用该逻辑的地方
两次法则 (Rule of Two): 当你第二次写下几乎相同的代码块时,警钟就应该敲响。这是开始重构的信号。
四步标准化流程
这是一个可在编码任何阶段应用的微循环。严格按照步骤执行,确保重构的安全性和有效性。
第一步:识别重复 (Identify Repetition)
目标: 像侦探一样,对代码中的"坏味道"保持警惕,找出所有重复。
1.1 明显的重复
直接复制粘贴:
- 两块或多块代码长得几乎一模一样
- 只有变量名或少数值不同
- 这是最明显、最需要被消除的重复
示例:
// 重复 1
function calculateOrderDiscount(orderTotal) {
if (orderTotal > 100) {
return orderTotal * 0.1;
}
return 0;
}
// 重复 2
function calculateCouponDiscount(couponTotal) {
if (couponTotal > 100) {
return couponTotal * 0.1;
}
return 0;
}
"魔术数字"或字符串:
- 同一个配置值或字符串在多处以字面量形式出现
- 例如:
0.08、"http://api.example.com"、100
示例:
# 魔术数字重复
def calculate_tax_1(amount):
return amount * 0.08 # ❌ 魔术数字
def calculate_tax_2(amount):
return amount * 0.08 # ❌ 再次出现
def calculate_total(amount):
tax = amount * 0.08 # ❌ 第三次
return amount + tax
1.2 语义上的重复
结构性重复:
- 代码结构相似,但具体变量名或值不同
- 多个 if-else 结构都在做类似的条件判断和赋值
示例:
// 结构性重复
function processUserData(user: User) {
if (user.age >= 18) {
user.status = 'adult';
} else {
user.status = 'minor';
}
}
function processProductData(product: Product) {
if (product.price >= 100) {
product.category = 'premium';
} else {
product.category = 'standard';
}
}
逻辑重复:
- 两个不同的函数,代码看起来不一样
- 但它们在业务逻辑层面实现的是同一个目标
示例:
// 逻辑重复:都在计算折扣,只是来源不同
function applyMembershipDiscount(price, memberLevel) {
const discountRates = { gold: 0.2, silver: 0.1, bronze: 0.05 };
return price * (1 - (discountRates[memberLevel] || 0));
}
function applySeasonalDiscount(price, season) {
const discountRates = { winter: 0.2, spring: 0.1, summer: 0.05 };
return price * (1 - (discountRates[season] || 0));
}
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.
- 10d ago First seen · 965 lines · 70 tokens per session scan A c81091c2d9b2
dry-refactoring is a skill published in the GitHub repository YYH211/Claude-meta-skill (277 stars, last pushed 3mo ago), licensed MIT. It adds 70 tokens to every session and 7,186 once invoked, about $0.0003 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.
Other skills, from other repositories
autoreview
Pre-commit/ship code review: Codex default; optional Claude or Pi.
rework-rate
Measure and interpret PR rework rate — the emerging 5th DORA metric.
omh-code-review
This is a Hermes-native code-review workflow skill.
revdiff-plan
Review the last Codex assistant message (plan, analysis, or proposal) with inline annotations in a TUI overlay. Extracts the most recent response from Codex rollout files and opens it in revdiff for review and annotation. Activates on "revdiff-plan", "review plan with revdiff", "annotate plan", "review last response"…
code-reviewer
Code review specialist focused on patterns, bugs, security, and performance.
full-repo-review
Comprehensive four-wave review of all repo source files, producing a prioritized issue backlog.