
Branch refactor planner
Reviews a branch's changes against its base and writes a prioritized refactor plan
Branch refactor planner is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 7
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Branch refactor planner
This skill has the agent go through every file changed on the current branch compared with its base branch, reading each file in full rather than only the diff hunks. It checks naming, duplication, over-engineering, declarative style, edge cases, test quality, type safety, error handling and consistency, then groups its findings into critical, important and minor action items with file and line references.
The workflow starts by finding the merge base with main, falling back to master or a branch the user names, then lists the changed files and the full diff. It also looks for project instruction files such as AGENTS.md or CLAUDE.md and applies any rules they contain. The output is a plan and not a bug report, so it focuses on code quality rather than defect hunting.
The skill is plain instructions with no scripts. It expects a git repository with a base branch to compare against and relies on the agent's ability to run git commands and read source files.
When your agent uses it
Critically review all code changes on the current branch against the base branch, identify improvement opportunities across naming, structure, DRY/KISS/YAGNI, declarative style, self-documenting code, edge cases, testing, and general best practices, then produce a categorized refactoring plan with prioritized action items. Produces a plan, not a bug review. Use when the user asks for a "refactor plan", a "code quality review", or to "clean up this branch".
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (4 KB) on GitHub on 3 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the ai-essentials plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add tonyghiani/ai-essentials
/plugin install ai-essentials@ai-essentialsOr copy only this skill to ~/.claude/skills/branch-refactor-planner:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/branch-refactor-planner &&
cp -R "$tmp/skills/branch-refactor-planner" ~/.claude/skills/branch-refactor-planner &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/branch-refactor-planner inside it instead.
Copy the skill folder to ~/.agents/skills/branch-refactor-planner to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/branch-refactor-planner &&
cp -R "$tmp/skills/branch-refactor-planner" ~/.agents/skills/branch-refactor-planner &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/branch-refactor-planner inside it instead.
Copy the skill folder to ~/.cursor/skills/branch-refactor-planner to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/branch-refactor-planner &&
cp -R "$tmp/skills/branch-refactor-planner" ~/.cursor/skills/branch-refactor-planner &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/branch-refactor-planner inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/tonyghiani/ai-essentials.git --path skills/branch-refactor-plannerOr copy the folder to ~/.gemini/skills/branch-refactor-planner yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/branch-refactor-planner:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/branch-refactor-planner &&
cp -R "$tmp/skills/branch-refactor-planner" ~/.copilot/skills/branch-refactor-planner &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/branch-refactor-planner inside it instead.
Get the folder:
git clone --depth 1 https://github.com/tonyghiani/ai-essentials.gitThen copy ai-essentials/skills/branch-refactor-planner into your agent's skills folder as branch-refactor-planner. Agents that support SKILL.md read one folder per skill.
What it does
- Branch-wide changeset review
- Compares every changed file against the base branch and reads each one in full for context.
- Quality dimension checklist
- Walks through naming, DRY, KISS, YAGNI, edge cases, testing and type safety for each file.
- Prioritized action items
- Sorts findings into critical, important and minor groups, each with a file and line reference.
- Project rules awareness
- Incorporates repository agent instruction files such as AGENTS.md or CLAUDE.md into the review.
- Test quality checks
- Flags no-op assertions, duplicate coverage and tests that add no value.
Good for
- Create a refactor plan for my feature branch before opening a pull request
- Run a code quality review on everything changed since main
- Clean up this branch and tell me what to fix first
- Find duplicated logic and naming drift across my changes
Branch refactor planner FAQ
What does the skill need to run?
It needs a git repository with a base branch such as main, master, or one the user specifies, since it runs git merge-base and git diff commands against it.
Does Branch refactor planner change my code?
No. The skill produces a categorized refactoring plan with action items and does not modify files.
Is Branch refactor planner a bug finder?
No. The skill states it produces a plan, not a bug review, and focuses on code quality dimensions.
When does Branch refactor planner trigger?
It is meant for requests such as a refactor plan, a code quality review, or asking to clean up the branch.
How do I install Branch refactor planner in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/branch-refactor-planner to use it in all your projects, or to .claude/skills/branch-refactor-planner in one project. Or install the ai-essentials plugin, which includes it: /plugin marketplace add tonyghiani/ai-essentials, then /plugin install ai-essentials@ai-essentials.
Does Branch refactor planner run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Branch refactor planner?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Branch refactor planner?
The closest alternatives to Branch refactor planner are Refactor, Review, Code review, Code review and quality and Refactor plan.
Where this comes from
- Description: from the skill's own SKILL.md.
More from tonyghiani/ai-essentials

Lets an agent read your GitHub queue at day's end and draft a morning triage report
- Open source
- 7 GitHub stars
- Developer tools

Finds untranslated UI strings and i18n patterns that break translation in code
- Open source
- 7 GitHub stars
- Developer tools

Writes pull request descriptions from a fixed summary, screenshots and testing template
- Open source
- 7 GitHub stars
- Developer tools

Guides an agent through resolving merge conflicts by intent, then verifying and pushing
- Open source
- 7 GitHub stars
- Developer tools

Triages PR review comments, then implements, replies to and resolves them
- Open source
- 7 GitHub stars
- Developer tools

Guides the agent through a test-first loop: failing test, then minimal implementation
- Open source
- 7 GitHub stars
- Developer tools





