Agent skill · Audited from source
Refactoring Patterns
skill · wondelai/skillsMIT licenceAudited 10 Oct 2026 · source c502026d022a
Is it safe? With care — CAUTION, grade B (89/100). We read this skill's source at commit c502026d022a and found no filesystem, network or shell access and no hard-coded secrets. The audit raised 5 findings, 0 critical or high. What it does: Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions "refactor this", "code smells", "extract method", "replace conditional", "technical debt", "move…
Cite
Cite this page
ModelsAtlas. “Refactoring Patterns (wondelai/skills)”. Retrieved 10 Oct 2026. https://modelsatlas.com/skills/wondelai/refactoring-patterns
Trust audit
Audit 0.4.1 · source read 10 Oct 2026
CAUTION means the audit found things worth knowing before you trust this skill. Grade B is shared by 17,406 of 18,389 audited skills.
What the source does
- FilesystemNone observedNo reads or writes in the source
- NetworkNone observedNo outbound calls in the source
- ShellNone observedNo commands run in the source
- DependenciesPinnedNothing floats
- SecretsNone foundNo keys in source
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | WARN | 5 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | NA | 0 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 0 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (5)
MEDIUMInventory / provenanceinv.symlink · .agents/skills/37signals-way
.agents/skills/37signals-way
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · .agents/skills/architecture-optimization
.agents/skills/architecture-optimization
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · .agents/skills/blue-ocean-strategy
.agents/skills/blue-ocean-strategy
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · .agents/skills/clean-architecture
.agents/skills/clean-architecture
- Why
- link not followed
- Fix
- —
MEDIUMInventory / provenanceinv.symlink · .agents/skills/clean-code
.agents/skills/clean-code
- Why
- link not followed
- Fix
- —
Audit 0.4.1 · source sha c502026d022a · 10 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publisherwondelai GitHub organizationOwner of the repository this skill is read from
- Source folderwondelai/skills/refactoring-patternsThe exact folder we audited
- LicenceMITAs the repository states it
- Commit pinned for this verdictc502026d022aA new audit runs when the source changes
- Repository statusNot archivedLast push 30 days ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions "refactor this", "code smells", "extract method", "replace conditional", "technical debt", "move…
--- name: refactoring-patterns description: 'Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions "refactor this", "code smells", "extract method", "replace conditional", "technical debt", "move method", "inline variable", "decompose conditional", or "clean up this messy code". Also trigger when cleaning up legacy code, preparing code for new features by restructuring, or identifying which transformation fits a specific code smell. Covers smell-driven refactoring, safe transformation sequences, and testing guards. For code-quality foundations, see clean-code. For managing complexity, see software-design-philosophy.' license: MIT metadata: author: wondelai version: "1.4.1" --- # Refactoring Patterns Framework A disciplined approach to improving the internal structure of existing code without changing its observable behavior. Every refactoring follows the same loop: verify tests pass, apply one small structural change, verify tests still pass. ## Core Principle **Refactoring is not rewriting. It is a sequence of small, behavior-preserving transformations, each backed by tests.** You never change what the code does — only how it is organized. Big-bang rewrites fail because they combine structural change with behavioral change, making it impossible to know which broke things. **The foundation:** Bad code is a natural consequence of delivering under time pressure, not a character flaw. Code smells are objective signals of degraded structure; the smell catalog tells you *where* to look, and the refactoring catalog tells you *what to do*. ## Scoring **Goal: 10/10.** Score structural quality by how many of the eight [Quick Diagnostic](#quick-diagnostic) rows pass — `score = round(passed / 8 × 10)`, adjusting down when a single smell is severe. Bands: - **9-10**: no obvious smells remain, each function does one thing, names reveal intent, duplication is eliminated, conditionals use polymorphism where apt, and tests cover the refactored paths. - **5-6**: a few smells remain (a Long Method, some duplication) but structure is mostly sound. - **≤3**: pervasive smells — tangled conditionals, God classes, duplication everywhere — or no tests to refactor safely. Always state the current score, name the smells driving it down, and list the specific refactorings needed to reach 10/10. ## The Refactoring Patterns Framework Six areas of focus for systematically improving code structure: ### 1. Code Smells as Triggers **Core concept:** Code smells are surface indicators of deeper structural problems — not bugs, but signals that the design makes code harder to understand, extend, or maintain. Each smell maps to named refactorings that fix it. **Why it works:** Named smells give teams objective criteria instead of subjective "I don't like this" — "This is Feature Envy" points directly at the fix. **Key insights:** - Smells cluster into five families: Bloaters, Object-Orientation Abusers, Change Preventers, Dispensables, Couplers - Long Method is the most common smell; Duplicate Code is the most expensive - A method that needs a comment to explain *what* it does is a smell — extract and name the block instead - Shotgun Surgery (one change, many classes) and Divergent Change (one class, many reasons to change) are opposite signals of misplaced responsibilities - Primitive Obsession — raw strings/ints instead of small domain objects — spreads errors and duplication **Code applications:** | Context | Pattern | Example | |---------|---------|---------| | Method > 10 lines | Extract Method | Pull loop body into `calculateLineTotal()` | | One change touches many classes (Shotgun Surgery) | Move Method/Field | Gather the scattered behavior into one class | | Same params in many methods | Introduce Parameter Object | `startDate, endDate` → `DateRange` | | Copy-pasted logic | Extract Method + Pull Up Method | Share via common method or base class | See [references/smell-catalog.md](references/smell-catalog.md) when you need to name a smell and its fix — all five families (Bloaters, OO Abusers, Change Preventers, Dispensables, Couplers) with detection heuristics and the refactoring each maps to. ### 2. Composing Methods **Core concept:** Most refactoring starts here: break long methods into smaller, well-named pieces that read like prose — high-level steps delegating to clearly named helpers. **Why it works:** Short methods with intention-revealing names eliminate comments, make bugs obvious at a glance, and enable reuse; a method call costs nothing to read when the name says everything. **Key insights:** - Extract Method is the single most important refactoring — master it first - Urge to write a comment? Extract the block and use the comment as the method name - Inline Method when the body is as clear as the name — indirection without value is noise - Replace Temp with Query for computed values used in multiple places; Split Temporary Variable when one temp serves two purposes - Replace Method with Method Object when locals are too tangled to extract — they become fields **Code applications:** | Context | Pattern | Example | |---------|---------|---------| | Block with a comment | Extract Method | `// check eligibility` → `isEligible()` | | Temp used once | Inline Variable | Drop `const price = order.getPrice()` | | Trivial delegating method | Inline Method | Inline `return deliveries > 5` if used once | | Method with many tangled locals | Replace Method with Method Object | Locals become fields in a new class | See [references/composing-methods.md](references/composing-methods.md) when applying any method-level transformation — step-by-step mechanics and before/after code for Extract/Inline Method, Extract/Inline Variable, Replace Temp with Query, Split Temporary Variable, and Replace Method with Method Object. ### 3. Moving Features Between Objects **Core concept:** The key OO design decision is where responsibilities liv
Excerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit c502026
git clone https://github.com/wondelai/skills git -C skills checkout c502026d022a
The author documents no install command, so this uses the repository directly. Our verdict covers commit c502026d022a only.
Works in
The author has not said which agents this skill supports, and we have not tested it in any.
Audit history
Every audit, every source change
- !CAUTION B 89 / 100
first audit · source
c502026d022a
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/wondelai/refactoring-patterns/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All coding & review skills →wondelai/skills
Create irresistible offers using the Value Equation, bonus stacking, risk-reversing guarantees, and ethical scarcity. Use when the user mentions "grand slam offer", "make my offer more compelling", "what bonuses should…
wondelai/skills
Diagnose and fix retention problems using behavior design (B=MAP). Use when the user mentions "users sign up but dont stick around", "activation rate", "onboarding friction", "retention metrics", "why users dont…
wondelai/skills
Apply the seven principles of ethical persuasion (reciprocity, commitment, social proof, authority, liking, scarcity, unity) to product design, copy, and sales. Use when the user mentions "social proof", "persuasive…
wondelai/skills
Build empowered product teams using discovery and delivery dual-track. Use when the user mentions "product discovery", "empowered teams", "feature factory", "opportunity assessment", "product vision", "product…
wondelai/skills
Design native iOS interfaces following Apple Human Interface Guidelines. Use when the user mentions "iPhone app", "iPad layout", "SwiftUI", "UIKit", "Dynamic Island", "safe areas", "HIG compliance", "SF Symbols",…
wondelai/skills
Discover what customers truly need by analyzing the "job" they hire your product to do. Use when the user mentions "customer discovery", "why customers churn", "what job does this solve", "competing against luck",…
Add this badge to your README
[](https://modelsatlas.com/skills/wondelai/refactoring-patterns/)
<a href="https://modelsatlas.com/skills/wondelai/refactoring-patterns/"><img src="https://modelsatlas.com/skills/wondelai/refactoring-patterns/badge.svg" alt="ModelsAtlas: CAUTION B"></a>
Questions about Refactoring Patterns
What does the Refactoring Patterns skill do?
Is Refactoring Patterns safe to install?
What can Refactoring Patterns access on my machine?
How current is this page?
Sources
- github.com/wondelai/skills/tree/main/refactoring-patterns — the audited source at commit c502026d022a and every finding aboveObserved · 10 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the Refactoring Patterns skill do?
- Is Refactoring Patterns safe to install?
- What can Refactoring Patterns access on my machine?