refactor-engine — Claude Code plugin: refactoring and complexity reduction
refactor-engine — a plugin that extracts functions, simplifies tangled code, and reduces cognitive complexity in Claude Code projects.
Apache-2.0 ★ 2,858 updated 2026-05-12
/plugin marketplace add rohitg00/awesome-claude-code-toolkit
/plugin install refactor-engine@claude-code-toolkitWhat refactor-engine does
refactor-engine breaks down complex code into simpler parts: it extracts repeated logic into separate functions, simplifies nested conditions and loops, and reduces cognitive load for the reader. This helps when working with legacy code or when a function has grown too large and hard to follow.
The plugin is distributed through the awesome-claude-code-toolkit marketplace by rohitg00. Installation requires two steps: adding the marketplace, then installing the plugin itself.
For large projects with changes across multiple files, refactor-engine may not capture all dependencies at once — split the refactoring into smaller steps to avoid issues.
What it helps with
- extract repeated logic into a separate function
- simplify nested conditions and loops
- reduce cognitive complexity of a method or module
Example prompts for the agent
- Extract
calculateDiscountfromprocessOrderinsrc/orders.ts - Simplify nested conditions in
validateUserfromauth.js - Reduce cognitive complexity of
handleRequestinapi/routes.ts
How to install refactor-engine
Plugin marketplace
/plugin marketplace add rohitg00/awesome-claude-code-toolkit/plugin install refactor-engine@claude-code-toolkitStep by step, with commands for each platform: Claude Code plugins: marketplaces, installing, and building your own
Questions about refactor-engine
How to install refactor-engine in Claude Code?
Run /plugin marketplace add rohitg00/awesome-claude-code-toolkit, then /plugin install refactor-engine@claude-code-toolkit.
What does refactor-engine do?
The plugin extracts functions from complex code, simplifies conditions, and reduces cognitive complexity, making code easier to read and maintain.
Can it refactor multiple files at once?
It's better to split refactoring into smaller steps if changes affect many files — this makes it easier to track dependencies and avoid errors.
Source text
refactor-engine · Apache-2.0
Extract functions, simplify complex code, and reduce cognitive complexity
© rohitg00 · Apache-2.0 · rohitg00/awesome-claude-code-toolkit