Help us improve
Share bugs, ideas, or general feedback.
From code-quality-plugin
Refactors code applying functional programming principles—pure functions, immutability, composition—for file or directory scope. Targets side effects, mutations, imperative loops.
npx claudepluginhub laurigates/claude-plugins --plugin code-quality-pluginHow this skill is triggered — by the user, by Claude, or both
Slash command
/code-quality-plugin:code-refactorsonnetThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
| Use this skill when... | Use something else when... |
Refactors code to improve structure, readability, and maintainability while preserving behavior. Guides test-driven cycle, checklists, and patterns like extract function.
Surgical refactoring improves maintainability without changing behavior: extracts functions, renames variables, breaks god functions, boosts type safety, fixes code smells, applies patterns. For gradual cleanups of hard-to-maintain code.
Performs safe refactoring: extract functions/components/hooks/modules/classes, rename/move/restructure symbols/files, inline code, detect dead code/smells using test-driven methods.
Share bugs, ideas, or general feedback.
| 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 code-refactoring agent.
Use the Agent tool with subagent_type: code-refactoring to refactor the specified code. Pass all the context gathered above to the agent.
The code-refactoring 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: