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 medy-gribkov/arcana --skill refactoring-patternsgit clone --depth 1 https://github.com/medy-gribkov/arcanaWrote 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/medy-gribkov/arcana/refactoring-patterns)<a href="https://agentmods.dev/skills/medy-gribkov/arcana/refactoring-patterns"><img src="https://agentmods.dev/badge/skills/medy-gribkov/arcana/refactoring-patterns.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.00040 | $0.01304 |
| Opus 5 | $0.00020 | $0.00652 |
| Sonnet 5 | $0.00008 | $0.00261 |
| Haiku 4.5 | $0.00004 | $0.00130 |
Grade A, and why
refactoring-patterns 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 7d 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 — 233 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Extract Method
When: A code block does one logical thing within a function that does more.
BEFORE:
function processOrder(order: Order) {
// Validate order
if (!order.items || order.items.length === 0) {
throw new Error('Order must have items');
}
if (order.total <= 0) {
throw new Error('Order total must be positive');
}
// Calculate tax
let tax = 0;
for (const item of order.items) {
tax += item.price * item.quantity * 0.08;
}
// Save to database
db.orders.insert({ ...order, tax });
}
AFTER:
function processOrder(order: Order) {
validateOrder(order);
const tax = calculateTax(order.items);
saveOrder(order, tax);
}
function validateOrder(order: Order) {
if (!order.items || order.items.length === 0) {
throw new Error('Order must have items');
}
if (order.total <= 0) {
throw new Error('Order total must be positive');
}
}
function calculateTax(items: OrderItem[]): number {
return items.reduce((sum, item) => sum + item.price * item.quantity * 0.08, 0);
}
function saveOrder(order: Order, tax: number) {
db.orders.insert({ ...order, tax });
}
Why: Each function has a single responsibility. Method names replace comments.
Extract Class
When: A class has multiple responsibilities or a group of fields are always used together.
BEFORE:
class User {
id: number;
name: string;
email: string;
street: string;
city: string;
zipCode: string;
country: string;
getFullAddress(): string {
return `${this.street}, ${this.city}, ${this.zipCode}, ${this.country}`;
}
}
AFTER:
class Address {
constructor(
public street: string,
public city: string,
public zipCode: string,
public country: string
) {}
getFullAddress(): string {
return `${this.street}, ${this.city}, ${this.zipCode}, ${this.country}`;
}
}
class User {
id: number;
name: string;
email: string;
address: Address;
}
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 7d ago First seen · 233 lines · 40 tokens per session scan A 561e48e7a3b3
refactoring-patterns is a skill published in the GitHub repository medy-gribkov/arcana (1 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 40 tokens to every session and 1,304 once invoked, about $0.0002 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
analyze
Analyzes code quality, complexity, patterns across codebase. Triggers: quality report, hotspot scan, code analysis, architecture signal.
predict
Analyzes diffs for regression risk and blast radius, generates risk-scored impact report. Triggers: PR review, code change risk, breaking change, blast radius, regression check.
audit-and-fix
Audit an existing codebase, then autonomously implement the fixes it judges worth making against your next goal — composing deep-dive → triage → prompt-pack → build-loop to turn "here's what's wrong" into verified, receipted local commits + an honest ledger. ALWAYS invoke when the user says any of "audit this repo and…
senior-engineering-partner
A strict code reviewer, pair programmer, debugger, and mentor for Python, Bash, Google Apps Script, JavaScript, and Swift/Apple platforms. Use when writing, reviewing, debugging, planning, or securing code, or for senior-level rigor, a security review, or mentoring. Mode triggers — REVIEW: (critique + refactor)…
code
Use BEFORE generating, refactoring, reviewing, or debugging code. Trigger phrases include "write a function/script/class for X", "review this code/diff/PR", "refactor this", "debug this error", "is this implementation correct", "what's wrong with this code", "improve this code", "translate from X to Y", or any prompt…
emergence
Analyzes what components create together that none intended — feedback loops, contention, timing bugs, and assumption collisions.