# refactoring-analysis

Audits architectural health and Fowler code smells, writing prioritized refactoring plans to docs/_refacs/. Built for planning refactoring while preserving existing behavior.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 404 installs · ★ 643
- Author: Pedro Nauck
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/pedronauck/skills/tree/HEAD/skills/mine/refactoring-analysis/SKILL.md
- Updated: 2026-10-20
- HTML: https://affpapa.org/en/nevibecode/skills/refactoring-analysis

## What it does

This skill reviews codebases for Fowler code smells and structural debt that increase maintenance costs. It rejects abstract textbook labels without demonstrable consequences, requiring source evidence and concrete improvements. For large projects, it maps dependencies and hotspots without pausing for confirmation at 50 files, noting any unsampled areas directly.

The analysis evaluates coupling, ownership, call sites, and public boundaries using built-in catalogs and checklists. SOLID guidelines apply strictly to domain models rather than ordinary utility code. Confirmed refactoring opportunities are ranked by impact, frequency, risk, and effort, then documented in `docs/_refacs/<YYYYMMDD>-<slug>.md`.

Formatting rules, security reviews, and performance profiling are deliberately excluded from this workflow. If a project requires vulnerability scans or memory benchmarks, look elsewhere.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add pedronauck/skills --skill refactoring-analysis -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/refactoring-analysis/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/refactoring-analysis/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add pedronauck/skills --skill refactoring-analysis -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/refactoring-analysis/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add pedronauck/skills --skill refactoring-analysis -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/refactoring-analysis/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install pedronauck/skills refactoring-analysis
```

2. **Manually: put the files in place**
- File: `.github/skills/refactoring-analysis/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add pedronauck/skills --skill refactoring-analysis -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/pedronauck/skills --path skills/mine/refactoring-analysis
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/refactoring-analysis/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add pedronauck/skills --skill refactoring-analysis -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/pedronauck/skills/tree/HEAD/skills/mine/refactoring-analysis/SKILL.md

## When to use it
- identify Fowler code smells backed by concrete source evidence
- generate prioritized refactoring reports in `docs/_refacs/`
- trace ownership, call boundaries, and tight coupling across modules
- plan structural refactoring while preserving existing behavior

## Example prompts
- Run a refactoring analysis on the core modules and write findings to docs/_refacs/
- Audit code smells across recent changes and rank them by maintenance risk
- Map coupling and dependency hotspots in the project before we refactor

## Similar
- [code-refactoring-refactor-clean](https://affpapa.org/en/nevibecode/skills/code-refactoring-refactor-clean.md) — skill · 1200 installs
- [codebase-analysis](https://affpapa.org/en/nevibecode/skills/codebase-analysis.md) — skill · 580 installs
- [domain-analysis](https://affpapa.org/en/nevibecode/skills/domain-analysis.md) — skill · 358 installs
- [guarding-architecture](https://affpapa.org/en/nevibecode/skills/guarding-architecture.md) — skill · 18000 installs
- [software-design-philosophy](https://affpapa.org/en/nevibecode/skills/software-design-philosophy.md) — skill · 6100 installs

From the same set: [pedronauck/skills](https://affpapa.org/en/nevibecode/by/pedronauck/skills.md) — 6 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
