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 furkangonel/cowrangler --skill refactoringgit clone --depth 1 https://github.com/furkangonel/cowranglerWrote 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/furkangonel/cowrangler/refactoring)<a href="https://agentmods.dev/skills/furkangonel/cowrangler/refactoring"><img src="https://agentmods.dev/badge/skills/furkangonel/cowrangler/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/furkangonel/cowrangler/refactoring"><img src="https://agentmods.dev/badge/skills/furkangonel/cowrangler/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.00015 | $0.00913 |
| Opus 5.5 | $0.00006 | $0.00365 |
| Sonnet 5.5 | $0.00003 | $0.00183 |
| Haiku 4.5 | $0.00002 | $0.00091 |
Grade A, and why
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 3mo 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 — 139 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Refactoring SOP
Golden Rule
Refactoring must not change observable behavior. Tests must pass before AND after every refactoring step.
Pre-Refactoring Checklist
- Tests exist for the code being refactored (write them first if not)
- The current behavior is clearly understood
- A clear goal for the refactoring is defined
- Changes are isolated to one concern at a time
Refactoring Catalog
Extract Function
When: A block of code does one identifiable thing; the block is too long; code is duplicated.
// BEFORE
function printReport(data: ReportData) {
// ... 20 lines of calculation ...
const total = data.items.reduce((sum, i) => sum + i.price * i.qty, 0);
const tax = total * 0.18;
// ... 20 lines of formatting ...
}
// AFTER
function calculateTotal(items: Item[]) {
return items.reduce((sum, i) => sum + i.price * i.qty, 0);
}
function calculateTax(total: number, rate = 0.18) {
return total * rate;
}
Replace Magic Numbers with Named Constants
// BEFORE
if (user.sessionAge > 86400) { logout(); }
// AFTER
const SESSION_EXPIRY_SECONDS = 86400; // 24 hours
if (user.sessionAge > SESSION_EXPIRY_SECONDS) { logout(); }
Simplify Conditionals — Early Return / Guard Clauses
// BEFORE (arrow-shaped code)
function processOrder(order: Order) {
if (order) {
if (order.items.length > 0) {
if (order.status === "pending") {
// actual logic...
}
}
}
}
// AFTER (flat, readable)
function processOrder(order: Order) {
if (!order) return;
if (order.items.length === 0) return;
if (order.status !== "pending") return;
// actual logic...
}
Remove Duplication (DRY)
// BEFORE
function validateEmail(email: string) {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
}
function validateLoginEmail(email: string) {
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); // duplicated!
}
// AFTER
const EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
function isValidEmail(email: string) {
return EMAIL_REGEX.test(email);
}
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.
- 3mo ago First seen · 139 lines · 15 tokens per session scan A 93fea8bc97e5
refactoring is a skill published in the GitHub repository furkangonel/cowrangler (1 stars, last pushed 2mo ago), licensed MIT. It adds 15 tokens to every session and 913 once invoked, about $0.0001 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.
refactoring compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| refactoringfurkangonel/cowrangler | Skill | 1 | 2mo ago | MIT | A | 15 | Claude Code, Codex |
| clinicaltrials-databasesynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 47 | Claude Code, Codex |
| openalex-databasesynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 76 | Claude Code, Codex |
| glycoengineeringsynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 75 | Claude Code, Codex |
| esmsynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 86 | Claude Code, Codex |
| pysamsynthetic-sciences/openscience | Skill | 4.5k | yesterday | Apache-2.0 | A | 47 | Claude Code, Codex |
| session-investigatorevalstate/fast-agent | Skill | 4.0k | yesterday | Apache-2.0 | A | 68 | Claude Code, Codex |