code-refactor-review — Claude Code skill: review changes
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.
no license 181 installs ★ 107 updated 2026-10-05
npx skills add jnsahaj/skills --skill code-refactor-review -a claude-codeWhat code-refactor-review 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.
What it helps with
- 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 for the agent
- Review the current changes with
git diffand 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.
How to install code-refactor-review
1Skills CLI (Vercel)
npx skills add jnsahaj/skills --skill code-refactor-review -a claude-code2Manually: put the files in place
~/.claude/skills/code-refactor-review/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/code-refactor-review/
1Skills CLI (Vercel)
npx skills add jnsahaj/skills --skill code-refactor-review -a codex2Manually: put the files in place
.agents/skills/code-refactor-review/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add jnsahaj/skills --skill code-refactor-review -a cursor2Manually: put the files in place
.cursor/skills/code-refactor-review/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install jnsahaj/skills skills/code-refactor-review2Manually: put the files in place
.github/skills/code-refactor-review/SKILL.md1Skills CLI (Vercel)
npx skills add jnsahaj/skills --skill code-refactor-review -a gemini-cli2Platform CLI
gemini skills install https://github.com/jnsahaj/skills --path skills/code-refactor-reviewManually: put the files in place
.devin/skills/code-refactor-review/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add jnsahaj/skills --skill code-refactor-review -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about code-refactor-review
How do I install code-refactor-review in Claude Code?
Run npx skills add jnsahaj/skills --skill code-refactor-review -a claude-code, then check ~/.claude/skills/code-refactor-review/SKILL.md.
What does code-refactor-review do?
It reviews diffs and pull requests for duplicated code, poor composition, unnecessary indirection, and mismatches with local project patterns. It returns a short verdict followed by actionable findings.
What does it inspect in React and Next.js code?
It checks for redundant state, effects used for derived values, unjustified useMemo or useCallback, awkward component boundaries, and avoidable sequential server work.