Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
laurigates avatar

Code Refactor

  • 70 installs
  • 49 repo stars
  • Updated August 4, 2026
  • laurigates/claude-plugins

Helps with code review & quality tasks.

About

code-refactor is a Claude Code skill for code review & quality. It helps solo builders move faster with AI-assisted development.

  • code-refactor
  • Code Review & Quality
  • AI-coding skill

Code Refactor by the numbers

  • 70 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #520 of 1,352 Code Review & Quality skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/laurigates/claude-plugins --skill code-refactor

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs70
repo stars49
Last updatedAugust 4, 2026
Repositorylaurigates/claude-plugins

What it does

Helps with code review & quality tasks.

Files

SKILL.mdMarkdownGitHub ↗

When to Use This Skill

Use this skill when...Use something else when...
A file or directory has mixed side effects and business logicDeduplicating code across files → /code:dry-consolidation
Functions mutate state or parametersDetecting code smells without fixing → /code:antipatterns
Business logic is tangled with I/O or loggingReviewing overall quality and architecture → /code:review
Imperative loops can be replaced with map/filter/reduceLarge multi-phase refactor spanning 10+ files → /workflow:checkpoint-refactor
Deep nesting obscures intent

Context

  • Target path: !echo "$1"

Parameters

  • $1: Required file path or directory to refactor

Your task

Delegate 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:

1. Identify refactoring opportunities — look for these FP code smells:

  • Side effects (mutation, I/O, logging) mixed into computation functions
  • Parameters or external state mutated in place
  • Imperative loops (for, while) that could be map, filter, reduce, or flatMap
  • Shared mutable state accessed across functions
  • Deep nesting where early returns or guard clauses would clarify intent
  • Business logic entangled with I/O at call sites
  • Duplicated transformation logic

2. Apply functional programming principles:

  • Pure functions: Extract computation into functions with no side effects — same input always produces same output
  • Immutability: Replace in-place mutation with data transformations (spread, map, Object.assign, structural copies)
  • Composition: Build complex behavior from small, focused, single-purpose functions
  • Higher-order functions: Replace imperative loops with map, filter, reduce, flatMap, find
  • Explicit effects: Push I/O, logging, and mutations to the outermost boundary; keep inner functions pure
  • Early returns / guard clauses: Validate preconditions at the top, return early to avoid deep nesting
  • DRY / KISS: Eliminate repetition; prefer the simplest shape that works

3. Preserve functionality:

  • Ensure all existing tests pass
  • Maintain the external API contract
  • No behavioral changes

4. Output the refactored code with clear structure

Provide the agent with:

  • The target file or directory path
  • The detected programming language
  • Any style guide examples from the project

The agent has expertise in:

  • Behavior-preserving code transformations
  • Functional refactoring patterns
  • Code smell detection and remediation
  • Semantic code search for similar patterns

Related Skills

  • If complexity metrics needed before refactoring → /code:complexity
  • If duplicated code needs consolidation → /code:dry-consolidation
  • If linting standards not configured → /configure:linting

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.