
refactor
Improve the shape of existing code without changing behavior.
- Installs
- 362
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/owainlewis/blueprint --skill refactor- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads refactor automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Refactor
- Identify the target from
$ARGUMENTS, the current diff, latest commit, or recently touched files. - Read the code and tests. Understand what behavior must not change. For risky refactors, run focused tests first.
- Make small behavior-preserving edits: delete, deduplicate, rename, simplify, extract or inline.
- Don't change public interfaces, data shapes, errors, or user-visible output unless the user asks.
- Run relevant checks, wider ones when shared behavior was touched.
- Report what changed, what stayed the same, and checks run.
Rules
- Refactoring is not feature work. Don't expand into unrelated cleanup.
- Don't change behavior to make the refactor easier.
- Keep an abstraction only when it reduces complexity or duplication.
FAQ
What does the refactor skill do?
Improve the shape of existing code without changing behavior.
How do I install refactor?
Run npx skills add https://github.com/owainlewis/blueprint --skill refactor in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/refactor/ (personal) or .claude/skills/refactor/ (project).
Which AI agents can use refactor?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is refactor safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains refactor?
It is published by owainlewis in owainlewis/blueprint. It has 362 recorded installs.
More from owainlewis/blueprint
review
owainlewis/blueprint
Uses a fresh agent to review an implementation change without editing it. Checks behavior, security, regressions, complexity, tests, docs, and missing proof. Use for code, PR, diff, security, second-opinion, or pre-merge reviews.
plan
owainlewis/blueprint
Turns a reviewed spec or decided brief into ordered tasks for separate agent runs. Use for implementation tasks, tracker tickets, or useful milestones. Do not use for one coding task or its short execution outline.
task-to-pr
owainlewis/blueprint
Open the skill to read its SKILL.md instructions.
spec
owainlewis/blueprint
Open the skill to read its SKILL.md instructions.
improve
owainlewis/blueprint
Makes existing code easier to understand without changing behavior. Use to simplify structure, remove duplication or dead code, improve names, or remove unnecessary abstractions.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.