Home / kunanonj / ai-skills-hub · .agents/skills/refactoring-patterns/SKILL.md · GitHub

refactoring-patterns skillA

refactoring-patterns is agent-read markdown (skill) from kunanonj/ai-skills-hub: 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", or "decompose conditional". Also trigger when cleaning up legacy code, preparing code for new features by restructuring, or identifying which transformation to apply to a specific code smell. Covers smell-driven refactoring, safe transformation sequences,.

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 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
…

Read the whole file at its exact version.

How to install

Latest version
mdr add kunanonj/ai-skills-hub/refactoring-patterns@v1.2.0
Exact content
mdr add kunanonj/ai-skills-hub/refactoring-patterns@sha256:e8dfc30cac2bb284

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.

Badge

mdr badge

[![mdr](https://markdownregistry.com/badge/art_6n35fwo5xqjs3qmt.svg)](https://markdownregistry.com/a/art_6n35fwo5xqjs3qmt)

1 badge views in 30 days

Versions

versioncommittedcommitsizeaudit
v1.2.0 latest2026-06-28 caecf60 15,685 BA view

Audit of the latest version

A  17 of 17 checks passed. Deterministic, no model, same answer every run.
  • pass: Frontmatter block present
  • pass: Frontmatter declares a name
  • pass: Frontmatter declares a description
  • pass: Size between 200 bytes and 200 KB (15685 bytes)
  • pass: No zero-width or bidi control characters
  • pass: No instruction hidden inside an HTML comment
  • pass: No link to an exfiltration or paste host
  • pass: No credential-shaped string
  • pass: No instruction to send local credentials anywhere
  • pass: No text hidden with inline styles
  • pass: No prompt-injection phrasing
  • pass: No curl or wget piped into a shell
  • pass: No recursive delete of root, home or parent
  • pass: No instruction to read or print local credentials
  • pass: No base64 blob over 200 characters
  • pass: No link to a raw IP address
  • pass: No script tag

Source

GitHub

kunanonj/ai-skills-hub · 5 stars · license MIT · pushed 2026-09-14 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_6n35fwo5xqjs3qmt
GET https://markdownregistry.com/api/v1/resolve?ref=kunanonj/ai-skills-hub/refactoring-patterns
GET https://markdownregistry.com/api/v1/blob/e8dfc30cac2bb2848615b18b32602d421a5cd99f480d3eb73cdadd32806c1ee9

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.

More from kunanonj/ai-skills-hub

analyze-codebase-for-mcp skill
kunanonj/ai-skills-hub · .agents/skills/analyze-codebase-for-mcp/SKILL.md · Analyze an arbitrary codebase to identify functions, APIs, and data sources suitable for exposure as MCP tools…
v1.0 · audit A · 5 stars
api-analyzer skill
kunanonj/ai-skills-hub · .agents/skills/api-analyzer/SKILL.md · Validates whether an API request is correct based on provided inputs (method, URL, headers, body, auth, query params)…
v1.0 · audit A · 5 stars
api-design-principles skill
kunanonj/ai-skills-hub · .agents/skills/api-design-principles/SKILL.md · Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight…
git:20260628.caecf60 · audit A · 5 stars
api-documentation-generator skill
kunanonj/ai-skills-hub · .agents/skills/api-documentation-generator/SKILL.md · Generate comprehensive, developer-friendly API documentation from code, including endpoints, parameters, examples, and…
git:20260628.caecf60 · audit A · 5 stars
api-security-best-practices skill
kunanonj/ai-skills-hub · .agents/skills/api-security-best-practices/SKILL.md · Implement secure API design patterns including authentication, authorization, input validation, rate limiting, and…
git:20260628.caecf60 · audit A · 5 stars
architecture-decision-records skill
kunanonj/ai-skills-hub · .agents/skills/architecture-decision-records/SKILL.md · Comprehensive patterns for creating, maintaining, and managing Architecture Decision Records (ADRs) that capture the…
git:20260628.caecf60 · audit A · 5 stars
architecture-patterns skill
kunanonj/ai-skills-hub · .agents/skills/architecture-patterns/SKILL.md · Master proven backend architecture patterns including Clean Architecture, Hexagonal Architecture, and Domain-Driven…
git:20260628.caecf60 · audit A · 5 stars
backend-api-design skill
kunanonj/ai-skills-hub · .agents/skills/backend-api-design/SKILL.md · Design RPC-style APIs with layered architecture (Controller → Manager → Repository). Use when creating new API…
git:20260628.caecf60 · audit A · 5 stars
backend-dev-guidelines skill
kunanonj/ai-skills-hub · .agents/skills/backend-dev-guidelines/SKILL.md · You are a senior backend engineer operating production-grade services under strict architectural and reliability…
git:20260628.caecf60 · audit A · 5 stars
backend-security-coder skill
kunanonj/ai-skills-hub · .agents/skills/backend-security-coder/SKILL.md · Expert in secure backend coding practices specializing in input validation, authentication, and API security. Use…
git:20260628.caecf60 · audit A · 5 stars
browser-screenshot-diff skill
kunanonj/ai-skills-hub · .agents/skills/browser-screenshot-diff/SKILL.md · Visual + DOM diff between two recorded sessions at matching trajectory step ids; used for visual regression and replay…
git:20260628.caecf60 · audit A · 5 stars
browser-testing-with-devtools skill
kunanonj/ai-skills-hub · .agents/skills/browser-testing-with-devtools/SKILL.md · Tests in real browsers via Chrome DevTools MCP. Use when building or debugging anything that runs in a browser. Use…
git:20260628.caecf60 · audit B · 5 stars

Every file in kunanonj/ai-skills-hub

Other files named refactoring-patterns

refactoring-patterns skill
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…
v1.4.1 · audit A · 2,253 stars
refactoring-patterns skill
wondelai/skills · refactoring-patterns/SKILL.md · Apply named refactoring transformations to improve code structure without changing behavior. Use when the user mentions…
v1.4.1 · audit A · 2,253 stars
refactoring-patterns skill
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…
v1.4.1 · audit A · 2,253 stars
refactoring-patterns skill
akaszubski/autonomous-dev · plugins/autonomous-dev/skills/refactoring-patterns/SKILL.md · Safe refactoring techniques — extract, inline, rename, move, simplify conditionals, and decompose functions. Use when…
git:20260317.e64d556 · audit A · 34 stars
refactoring-patterns skill
benkapner/claude-code-basecamp · skills/refactoring-patterns/SKILL.md · Measurement-driven code refactoring — profile before changing, measure after, keep only if metrics improve. Covers…
v1.0 · audit A · 16 stars
refactoring-patterns skill
fabioc-aloha/alex_skill_mall · plugins/code-quality/refactoring-patterns/skills/refactoring-patterns/SKILL.md · Safe transformations — same behavior, better structure.
git:20260728.80a7ab6 · audit A · 4 stars

Browse by kind, by grade A, or by owner.