refactor SKILL.md skillA

refactor from duthaho/skillhub is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add duthaho/skillhub/refactor@git:20260714.f7ff09b

Pins git:20260714.f7ff09b in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
duthaho/skillhub
Path
.claude/skills/refactor/SKILL.md
Versions recorded
3
Latest version
git:20260714.f7ff09b, committed Jul 14, 2026
First version recorded
Jul 11, 2026
Size
8,386 bytes
Repository stars
9
License
MIT

Evidence-driven refactoring — where does structural improvement actually pay off, then make that change without changing behavior. Survey mode diagnoses by evidence, not aesthetics — git churn × complexity hotspots, the recurring-bug log, upcoming work — and verdicts each candidate REFACTOR/PREP/LEAVE/WATCH, where LEAVE is the default and "the textbook recommends it" is never a reason. Execute mode takes one approved candidate in small behavior-preserving moves, suite green after each. Keeps a…

Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.

What the file says

# refactor — earn it first, then preserve behavior

`/refactor` — survey the repo, emit a brief of where improvement pays off
`/refactor <target or goal>` — execute one candidate, safely

Answer one question: **where does structural improvement actually pay for
itself in this codebase — and how is that change made without changing
behavior?** The skill exists to prevent the two documented failure modes of
"improve the architecture": refactoring the wrong code (most ugly code is
never touched again, so cleaning it returns nothing), and **pattern-itis** —
applying design patterns because they're best practices rather than because
a problem here demands them, turning straight-line code into abstraction
lasagna.

## Survey mode — `/refactor`

### Step 1 — Evidence, not aesthetics

Candidates come from signals, never from "this code looks bad":

- **Hotspots** — churn × complexity. Churn from git itself:
  `git log --format= --name-only --since="12 months ago" | sort | uniq -c |
  sort -rn | head -30`, crossed with a complexity proxy (file length,
  indentation depth). Code that is both complex *and* frequently edited is
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add duthaho/skillhub/refactor@sha256:eb33f09f569365fe

The line at the top of this page pins the label git:20260714.f7ff09b, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.

Badge

mdr badge

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

4 badge image fetches in 30 days. What the badge shows.

Versions

The registry has recorded 3 versions of this file, between Jul 11, 2026 and Jul 14, 2026, about one every day.

versioncommittedcommitsizeaudit
git:20260714.f7ff09b latest2026-07-14 f7ff09b 8,386 BA view · diff
git:20260714.429242b2026-07-14 429242b 7,678 BA view · diff
git:20260711.e00cba72026-07-11 e00cba7 7,940 BA view

Audit of the latest version

A  17 of 17 checks passed. Fixed automatic checks with no AI involved, so the same checks give the 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 (8386 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

duthaho/skillhub · 9 stars · license MIT · pushed 2026-10-31 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_7vcbhkbxirtam5yv
GET https://markdownregistry.com/api/v1/resolve?ref=duthaho/skillhub/refactor
GET https://markdownregistry.com/api/v1/blob/eb33f09f569365fe03a458d8c0c23f1a52fe74ca67e9f04e593645a0924b9b74

Your AI assistant 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.

Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.

More from duthaho/skillhub

archdeck SKILL.md skill
duthaho/skillhub · .claude/skills/archdeck/SKILL.md · Animated explainer slides for programming videos — turns one technical problem (backend, database, system design…
git:20261031.6e2d2c5 · audit A · 9 stars
autopilot SKILL.md skill
duthaho/skillhub · .claude/skills/autopilot/SKILL.md · The whole coding loop on one deliberate yes: map, spec, critic-hardened plan, GitHub issues, parallel worktree…
git:20260718.589e792 · audit A · 9 stars
blueprint SKILL.md skill
duthaho/skillhub · .claude/skills/blueprint/SKILL.md · Human-facing documentation, architecture docs, and mermaid diagrams for a codebase, a module, or a feature — "draw me…
git:20260908.b98f098 · audit A · 9 stars
bugfix SKILL.md skill
duthaho/skillhub · .claude/skills/bugfix/SKILL.md · Lightweight bug-fixing loop — reproduce → root-cause → fix test-first → verify — deliberately separate from the…
git:20260811.fdc967e · audit A · 9 stars
cachewise SKILL.md skill
duthaho/skillhub · .claude/skills/cachewise/SKILL.md · Prompt-cache economics forensics — why your Claude Code tokens burn so fast, with the numbers to prove it. Parses local…
git:20260908.9f72705 · audit A · 9 stars
daybrief SKILL.md skill
duthaho/skillhub · .claude/skills/daybrief/SKILL.md · Morning work briefing — "what does my day look like, in one scan?" Gathers today's calendar and emails needing…
git:20260719.7789d04 · audit A · 9 stars
done SKILL.md skill
duthaho/skillhub · .claude/skills/done/SKILL.md · End-of-session shipping gate — "prove it works, then ship it." Runs an evidence checklist (full test suite…
git:20260811.fdc967e · audit A · 9 stars
factcheck SKILL.md skill
duthaho/skillhub · .claude/skills/factcheck/SKILL.md · Adversarial citation and claim audit for any document — "do these sources actually say what the text claims?" Takes a…
git:20260710.eb7764e · audit A · 9 stars
feature SKILL.md skill
duthaho/skillhub · .claude/skills/feature/SKILL.md · End-to-end feature workflow around the agent — spec by interview, a plan of 2–5-minute tasks, test-first execution with…
git:20260714.463e996 · audit A · 9 stars
ideate SKILL.md skill
duthaho/skillhub · .claude/skills/ideate/SKILL.md · Structured idea generation for a project or a blank-slate problem — ideas worth pursuing, not the first one that…
git:20260716.ac81253 · audit A · 9 stars
jobfit SKILL.md skill
duthaho/skillhub · .claude/skills/jobfit/SKILL.md · Job-fit evaluation and discovery for job seekers — "find roles that fit me" and "should I apply to this one?" DISCOVER…
git:20260714.dbe7dc7 · audit A · 9 stars
learn SKILL.md skill
duthaho/skillhub · .claude/skills/learn/SKILL.md · Personalized tutor with memory across sessions — "teach me X, at my pace." Builds a syllabus with a pass rubric per…
git:20260817.aedd39a · audit A · 9 stars

Every file in duthaho/skillhub

Other files named refactor

refactor SKILL.md skill
code-yeongyu/oh-my-openagent · packages/shared-skills/skills/refactor/SKILL.md · Guides a refactor, cleanup, or restructure with the right decomposition. Use when the user asks to refactor, simplify…
git:20261106.b98a091 · audit A · 70,763 stars
refactor SKILL.md skill
sethgammon/citadel · skills/refactor/SKILL.md · Safe multi-file refactoring with automatic rollback. Establishes a type/test baseline, plans all changes, executes…
git:20260611.0f3f8e7 · audit A · 927 stars
refactor SKILL.md skill
greenfield-inc/pane · main/src/services/paneChatBundle/skills/refactor/SKILL.md · Quality pass on a branch against its remote default branch. Runs a simple analysis (conventions and smells) and, on…
git:20261105.60e9622 · audit A · 603 stars
refactor SKILL.md skill
dcouple/pane · main/src/services/paneChatBundle/skills/refactor/SKILL.md · Quality pass on a branch against its remote default branch. Runs a simple analysis (conventions and smells) and, on…
git:20261105.60e9622 · audit A · 603 stars
refactor SKILL.md skill
rsmdt/the-startup · plugins/start/skills/refactor/SKILL.md · Refactor, simplify, or clean up code for improved maintainability without changing business logic
git:20261011.48bd3ee · audit A · 577 stars
refactor SKILL.md skill
boshu2/agentops · skills/refactor/SKILL.md · Restructure or clean up code with no behavior change, proved by before-and-after checks. Use when: asked to clean up…
git:20261031.73cbeae · audit A · 453 stars
refactor SKILL.md skill
boshu2/agentops · plugin/skills/refactor/SKILL.md · Restructure or clean up code with no behavior change, proved by before-and-after checks. Use when: asked to clean up…
git:20261026.1b5f59a · audit A · 453 stars
refactor SKILL.md skill
justxor/claude-code-pro-course · starter-kit/.claude/skills/refactor/SKILL.md · Безопасный рефакторинг маленькими шагами без изменения поведения. Используй, когда просят отрефакторить, упростить…
git:20260930.76c4189 · audit A · 341 stars

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