refactoring-patterns is agent-read markdown (skill) from fabioc-aloha/alex_skill_mall: Safe transformations — same behavior, better structure..
Indexed from public GitHub and served as immutable, content-addressed versions. Install it pinned to an exact SHA-256 with the mdr CLI, and every file is verified against the hash recorded here before it reaches your agent. The deterministic audit below grades the latest version, and the same file always earns the same grade.
What the file says
# Refactoring Patterns Skill
> Safe transformations — same behavior, better structure.
## Golden Rule
Tests pass before AND after. Never refactor and add features in the same commit.
## When to Refactor
| Trigger | Action |
| ------- | ------ |
| Feature is hard to add | Refactor first, then add feature |
| Same bug twice | Refactor to prevent recurrence |
| "I don't understand" | Refactor for clarity |
| Duplicate code | Extract and reuse |
| Long function (>30 lines) | Extract logical units |
## When NOT to Refactor
- No tests + time pressure
- Code won't change again
- Right before release (deadline pressure)
- Should rewrite instead (>70% changes needed)
- Exploratory/prototype code
## Core Refactoring Moves
### Extract Function
When a block does one logical thing, give it a name.
```typescript
// Before
function processOrder(order: Order) {
// Validate order
if (!order.items.length) throw new Error('Empty order');
if (!order.customer) throw new Error('No customer');
if (order.total < 0) throw new Error('Invalid total');
// Calculate tax
const taxRate = order.region === 'EU' ? 0.20 : 0.10;
const tax = order.total * taxRate;
// Apply discount
…
Pin to a label to follow the author's releases, or to a sha256 to freeze the exact bytes forever. Either way the resolved hash is written to mdr.lock, and mdr install reproduces it on any machine.
GET https://markdownregistry.com/api/v1/artifacts/art_aottfqy4hd47x6by
GET https://markdownregistry.com/api/v1/resolve?ref=fabioc-aloha/alex_skill_mall/refactoring-patterns
GET https://markdownregistry.com/api/v1/blob/8762e68c2c0b3e577ce9614b648b31bc150f5abb32ef51951e8fe9fe4b2fa036
Your agent does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
fabioc-aloha/alex_skill_mall · .github/skills/source-inventory/SKILL.md · Maintain the source registry in sources/supported-stores.json — add a new third-party plugin store, retire one, refresh…
fabioc-aloha/alex_skill_mall · .github/skills/staleness-discipline/SKILL.md · Detect, classify, and prune stale source stores in the Mall — define what stale means and how to remove gracefully…
fabioc-aloha/alex_skill_mall · .github/skills/store-evaluation/SKILL.md · Evaluate a proposed store for inclusion in Alex_ACT_Plugin_Mall using a quality scorecard
fabioc-aloha/alex_skill_mall · plugins/3d-graphics/spline-3d-integration/skills/spline-3d-integration/SKILL.md · Use when adding interactive 3D scenes from Spline.design to web projects, including React embedding and runtime control…
fabioc-aloha/alex_skill_mall · plugins/academic-research/academic-paper-drafting/skills/academic-paper-drafting/SKILL.md · End-to-end academic paper drafting for CHI, HBR, journals, and conferences with venue-specific templates, drafting…
fabioc-aloha/alex_skill_mall · plugins/academic-research/academic-research/skills/academic-research/SKILL.md · Research project scaffolding, thesis/dissertation writing, literature reviews, publication workflows, and the AI…
wondelai/skills · plugins/wondelai-skills/skills/refactoring-patterns/SKILL.md · Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions…
wondelai/skills · refactoring-patterns/SKILL.md · Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions…
wondelai/skills · plugins/code-craftsmanship/skills/refactoring-patterns/SKILL.md · Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions…
kunanonj/ai-skills-hub · .agents/skills/refactoring-patterns/SKILL.md · Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions…