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.svg" alt="Measured on agentmods" 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 | $0.00008 | $0.00456 |
| Sonnet 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 6d 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.
- 6d ago First seen · 139 lines · 15 tokens per session scan A 93fea8bc97e5
refactoring is a skill published in the GitHub repository furkangonel/cowrangler (2 stars, last pushed today), licensed MIT. It adds 15 tokens to every session and 913 once invoked, about $0.0001 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-31.
Other skills, from other repositories
datamol
Pythonic wrapper around RDKit with simplified interface and sensible defaults. Preferred for standard drug discovery including SMILES parsing, standardization, descriptors, fingerprints, clustering, 3D conformers, parallel processing. Returns native rdkit.Chem.Mol objects. For advanced control or custom parameters…
session-investigator
Investigate fast-agent session and history files to diagnose issues. Use when a session ended unexpectedly, when debugging tool loops, when correlating sub-agent traces with main sessions, or when analyzing conversation flow and timing. Covers session.json metadata, history JSON format, message structure, tool…
x-uptime
Enhanced uptime with structured YAML output showing uptime, users, and 1/5/15-minute load averages. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.
clinicaltrials-database
Query ClinicalTrials.gov via API v2. Search trials by condition, drug, location, status, or phase. Retrieve trial details by NCT ID, export data, for clinical research and patient matching.
openalex-database
Query and analyze scholarly literature using the OpenAlex database. This skill should be used when searching for academic papers, analyzing research trends, finding works by authors or institutions, tracking citations, discovering open access publications, or conducting bibliometric analysis across 240M+ scholarly…
x-mankier
Search and browse man pages from ManKier.com. Command line interface for ManKier man page repository. Dependency: This is an x-cmd module. Install x-cmd first (see x-cmd skill for installation options). see x-cmd skill for installation.