/code-quality-plugin:code-refactor <file-path|directory>from code-quality-plugin
Refactors code toward functional programming principles: pure functions, immutability, composition. Use when extracting pure functions, removing side effects, replacing loops with map/filter/reduce, or separating I/O.
Ships in code-quality-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
| Use this skill when... | Use something else when... |
|---|---|
| A file or directory has mixed side effects and business logic | Deduplicating code across files → /code:dry-consolidation |
| Functions mutate state or parameters | Detecting code smells without fixing → /code:antipatterns |
| Business logic is tangled with I/O or logging | Reviewing overall quality and architecture → /code:review |
| Imperative loops can be replaced with map/filter/reduce | Large multi-phase refactor spanning 10+ files → /workflow:checkpoint-refactor |
| Deep nesting obscures intent |
echo "$1"$1: Required file path or directory to refactorDelegate this task to the agents-plugin:refactor agent.
Use the Agent tool with subagent_type: agents-plugin:refactor to refactor the specified code. Pass all the context gathered in Context to the agent.
The refactor agent should:
Identify refactoring opportunities — look for these FP code smells:
for, while) that could be map, filter, reduce, or flatMapApply functional programming principles:
spread, map, Object.assign, structural copies)map, filter, reduce, flatMap, findPreserve functionality:
Output the refactored code with clear structure
Provide the agent with:
The agent has expertise in:
/code:complexity/code:dry-consolidation/configure:lintingWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub laurigates/claude-plugins --plugin code-quality-plugin19 skills in this plugin
/ast-grep-searchFind and replace code patterns structurally with ast-grep. Use when matching code by AST structure, finding functions with specific signatures, or detecting anti-patterns regex cannot match./bulk-sweep-classifyClassify every regex match before a bulk find-replace/syntax-modernization sweep — four match categories, scoped transform, allowlist-aware verification. Use when bulk-renaming commands/tools/paths or migrating syntax across many files./code-antipatternsAnalyze a codebase for anti-patterns using ast-grep. Use when finding magic numbers, console.logs, var usage, excessive any, eval/innerHTML security issues, or deep nesting.Other plugins' skills for the same job