# code-refactor-review

The code-refactor-review skill examines diffs and PRs for reuse, clear boundaries, and fit with the surrounding codebase. Use it when a refactor needs a close review.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 181 installs · ★ 107 repo stars
- Author: jnsahaj
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/jnsahaj/skills/tree/HEAD/skills/code-refactor-review/SKILL.md
- Updated: 2026-10-05
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/code-refactor-review

## What it does

The skill begins with the complete change set, using `git diff` for unstaged work and `git diff HEAD` when staged files are involved. For a pull request, it traces changed files through the feature before judging individual lines. It also searches nearby code for existing utilities, components, hooks, naming, and error-handling patterns.

Its review covers duplicated logic, vague shared helpers, one-off types, excessive callbacks, effects, memoization, and unrelated diff churn. React and Next.js checks include derived state, event handling, component boundaries, and independent server work that could follow an existing concurrent pattern.

The result starts with `clean`, `mostly clean`, or `needs cleanup`, followed by findings that name the file area, the inconsistency, a reusable local pattern, and the smallest fix. A reuse claim should follow an actual codebase search; without that step, the review can mistake unfamiliar code for duplication.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add jnsahaj/skills --skill code-refactor-review -a claude-code
```

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

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add jnsahaj/skills --skill code-refactor-review -a codex
```

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

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add jnsahaj/skills --skill code-refactor-review -a cursor
```

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

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install jnsahaj/skills skills/code-refactor-review
```

2. **Manually: put the files in place**
- File: `.github/skills/code-refactor-review/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add jnsahaj/skills --skill code-refactor-review -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/jnsahaj/skills --path skills/code-refactor-review
```

### Windsurf (Devin Desktop)

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

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add jnsahaj/skills --skill code-refactor-review -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/jnsahaj/skills/tree/HEAD/skills/code-refactor-review/SKILL.md

## When to use it
- review a full pull request diff
- spot duplicated helpers and UI patterns
- question unnecessary effects and memoization
- check new code against neighboring conventions
- reduce unrelated refactor churn

## Example prompts
- Review the current changes with `git diff` and look for code that should reuse existing patterns.
- Inspect this PR for duplicated logic, weak component boundaries, and inconsistent naming.
- Review the React and Next.js changes, focusing on effects, state ownership, and unnecessary wrappers.

## Similar
- [review-and-refactor](https://affpapa.org/en/nevibecode/skills/review-and-refactor.md) — skill · 11056 installs
- [typescript-refactor](https://affpapa.org/en/nevibecode/skills/typescript-refactor.md) — skill · 808 installs
- [react-refactor](https://affpapa.org/en/nevibecode/skills/react-refactor.md) — skill · 801 installs
- [frontend-refactor-planner](https://affpapa.org/en/nevibecode/skills/frontend-refactor-planner.md) — skill · 321 installs
- [refactor-guided](https://affpapa.org/en/nevibecode/commands/refactor-guided.md) — command · ★ 1424 repo stars
- [code-refactor-master](https://affpapa.org/en/nevibecode/agents/code-refactor-master.md) — subagent · ★ 10055 repo stars

From the same set: [jnsahaj/skills](https://affpapa.org/en/nevibecode/by/jnsahaj/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
