refactor SKILL.md skillA

refactor from gufranco/claude-engineering-rules is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.

Install it, pinned
mdr add gufranco/claude-engineering-rules/refactor@git:20261013.7233f74

Pins git:20261013.7233f74 in mdr.lock. Pin the fingerprint instead.

Audit grade
A, 17 of 17 checks passed
Kind
SKILL.md skill
Repository
gufranco/claude-engineering-rules
Path
skills/refactor/SKILL.md
Versions recorded
5
Latest version
git:20261013.7233f74, committed Oct 13, 2026
First version recorded
Apr 4, 2026
Size
7,945 bytes
Repository stars
3
License
MIT

Guided refactoring with behavior preservation verification. Identifies candidates (long functions, deep nesting, duplicated logic, god classes), proposes a refactoring plan, executes incrementally with tests between steps, and verifies no behavior change. Use when user says "refactor", "clean up this code", "simplify", "extract", "restructure", "reduce complexity", "split this file", or wants to improve code structure without changing behavior. For new features, use /plan; for bug fixes, use…

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

## Overview

Incremental refactoring workflow that enforces behavior preservation at every step. Each refactoring is a separate commit with test verification before and after.

The refactoring principles follow [`../../rules/code-style.md`](../../rules/code-style.md). This skill provides the execution workflow.

## When to Use

- Tests pass, and a function, file, or class crosses one of the Phase 2 thresholds.
- A feature is next, and the code it lands in has to be made easy to change first.
- `/module-audit` produced a consolidation the user picked.
- For new behavior, use `/plan`; for a bug, use `/investigate`; for feedback on a diff, use `/review`.

## Arguments

- No arguments: analyze the current branch diff for refactoring candidates.
- `<path>`: refactor the specified file or directory.
- `--plan-only`: identify and rank candidates without executing any changes.

## Process

### Phase 1: Establish Baseline

1. **Run the full test suite.** Record the result. If tests fail, stop. Do not refactor code with a failing test suite. The user must fix tests first.
…

Read the whole file at its exact version.

How to install

The exact contents, by fingerprint
mdr add gufranco/claude-engineering-rules/refactor@sha256:3a1ab5eb48cfaaf6

The line at the top of this page pins the label git:20261013.7233f74, 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_bwpsac4ogvx7et6h.svg)](https://markdownregistry.com/a/art_bwpsac4ogvx7et6h)

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

Versions

The registry has recorded 5 versions of this file, between Apr 4, 2026 and Oct 13, 2026, about one every 48 days.

versioncommittedcommitsizeaudit
git:20261013.7233f74 latest2026-10-13 7233f74 7,945 BA view · diff
git:20261012.d0865132026-10-12 d086513 7,812 BA view · diff
git:20260522.a91f3842026-05-22 a91f384 4,948 BA view · diff
git:20260521.81b3d412026-05-21 81b3d41 4,942 BA view · diff
git:20260404.b38d04f2026-04-04 b38d04f 4,919 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 (7945 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

gufranco/claude-engineering-rules · 3 stars · license MIT · pushed 2026-10-30 · branch main

API

GET https://markdownregistry.com/api/v1/artifacts/art_bwpsac4ogvx7et6h
GET https://markdownregistry.com/api/v1/resolve?ref=gufranco/claude-engineering-rules/refactor
GET https://markdownregistry.com/api/v1/blob/3a1ab5eb48cfaaf6a77174f0773c2f3cba115b89c5e45845dd747c570cbb315d

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 gufranco/claude-engineering-rules

CLAUDE.md CLAUDE.md file
gufranco/claude-engineering-rules · CLAUDE.md
git:20261029.8b030ee · audit A · 3 stars
aside SKILL.md skill
gufranco/claude-engineering-rules · skills/aside/SKILL.md · Mid-task side question handler. Freezes the active task state, answers a side question without state mutation, then…
git:20261012.84ebb18 · audit A · 3 stars
assessment SKILL.md skill
gufranco/claude-engineering-rules · skills/assessment/SKILL.md · Audit an implementation's architecture for completeness, missing patterns, and planted defects before a take-home or…
git:20261029.efb0280 · audit A · 3 stars
audit SKILL.md skill
gufranco/claude-engineering-rules · skills/audit/SKILL.md · Security audit across dependencies, secrets, Docker, code patterns, images, STRIDE, and OWASP. Covers dependency…
git:20261029.9c8290b · audit B · 3 stars
benchmark SKILL.md skill
gufranco/claude-engineering-rules · skills/benchmark/SKILL.md · Measure API latency, bundle size, and database query time, and compare them against saved baselines to catch…
git:20261013.02cb8cd · audit A · 3 stars
brain SKILL.md skill
gufranco/claude-engineering-rules · skills/brain/SKILL.md · Read from and write to the second brain vault. Subcommands - capture (default), ingest, ask, link, health, refresh…
git:20261022.be3b951 · audit A · 3 stars
checkpoint SKILL.md skill
gufranco/claude-engineering-rules · skills/checkpoint/SKILL.md · Save and resume working state across sessions, with subcommands save, resume, and list. Captures git state, decisions…
git:20261013.02cb8cd · audit A · 3 stars
cleanup SKILL.md skill
gufranco/claude-engineering-rules · skills/cleanup/SKILL.md · List stale branches, long-open PRs, merged branches, and orphaned worktrees, then close or delete each one with…
git:20261013.02cb8cd · audit A · 3 stars
concise-mode SKILL.md skill
gufranco/claude-engineering-rules · skills/concise-mode/SKILL.md · Opt-in terse-reply mode that drops articles, pleasantries, filler, and hedging while keeping full technical accuracy…
git:20261012.84ebb18 · audit A · 3 stars
cross-model SKILL.md skill
gufranco/claude-engineering-rules · skills/cross-model/SKILL.md · Consult a different model for orthogonal reasoning on a consequential decision, especially when confident. Discovers…
git:20261012.84ebb18 · audit A · 3 stars
deploy SKILL.md skill
gufranco/claude-engineering-rules · skills/deploy/SKILL.md · Merge a shipped PR, verify the deployment, and monitor post-deploy health, with land and canary subcommands.
git:20261013.02cb8cd · audit A · 3 stars
design SKILL.md skill
gufranco/claude-engineering-rules · skills/design/SKILL.md · Design consultation, variant exploration, and design system scaffolding, with subcommands consult (default), variants…
git:20261013.02cb8cd · audit A · 3 stars

Every file in gufranco/claude-engineering-rules

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:20261023.af359db · audit A · 70,648 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 · 929 stars
refactor SKILL.md skill
dcouple/pane · main/src/services/paneChatBundle/skills/refactor/SKILL.md · Post-PR refactor pass. Sizes the diff against the remote default branch, fans out refactor-simple (and refactor-deep on…
git:20260924.c3bd4b5 · audit A · 601 stars
refactor SKILL.md skill
greenfield-inc/pane · main/src/services/paneChatBundle/skills/refactor/SKILL.md · Post-PR refactor pass. Sizes the diff against the remote default branch, fans out refactor-simple (and refactor-deep on…
git:20260924.c3bd4b5 · audit A · 600 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:20261021.71bc1e4 · audit A · 450 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 · 450 stars
refactor SKILL.md skill
justxor/claude-code-pro-course · starter-kit/.claude/skills/refactor/SKILL.md · Безопасный рефакторинг маленькими шагами без изменения поведения. Используй, когда просят отрефакторить, упростить…
git:20260930.76c4189 · audit A · 334 stars

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