code-refactor-specialist

Detect duplicate React hook logic and extract shared utilities into src/utils/.

3|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/gwpjp/Web3-Claude --skill code-refactor-specialist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refactor-specialist
Source: https://github.com/gwpjp/Web3-Claude/tree/main/.claude/skills/code-refactor-specialist
Command: npx skills add https://github.com/gwpjp/Web3-Claude --skill code-refactor-specialist

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Codebases with duplicated hook logic and inline transformations accumulate technical debt. This Skill identifies refactoring opportunities in hooks and utilities, consolidating patterns to improve maintainability and readability.

Core Features & Use Cases

  • Consolidate Duplicate Hooks: Extract shared patterns into base hooks.
  • Extract Utilities: Move repeated inline calculations into src/utils/ for reuse.
  • Compose Hooks: Break monolithic hooks into focused components using a two-layer approach (ponder → transform).
  • Reporting: Generate a structured refactoring report detailing changes and rationale.

Quick Start

Run the code-refactor-specialist after implementing hooks to scan src/hooks/ and src/utils/ for refactoring opportunities and produce a report.

Frequently Asked Questions about code-refactor-specialist

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor duplicate React hooks and inline transformations in my codebase?

Refactor duplicate React hooks by scanning src/hooks/ and src/utils/ to identify shared patterns, extract common logic into reusable utilities, and consolidate monolithic hooks into focused components.

What is the best way to consolidate duplicate hook logic after initial implementation?

Consolidating duplicate hook logic involves analyzing your src/hooks/ directory to detect repeated inline calculations, extracting them into base hooks and src/utils/ functions, then generating a structured refactoring report.

Can I extract repeated inline calculations into utilities for React projects?

Yes, you can extract repeated inline calculations from hooks into src/utils/ functions. This utility extraction workflow targets React projects to improve code readability and reduce accumulated technical debt.

How does hook composition work when breaking down monolithic React hooks?

Hook composition breaks monolithic React hooks into focused components using a two-layer approach of pondering existing logic and transforming it, outputting a detailed report documenting the applied changes and rationale.

When do I need to run a hook refactoring workflow on my React project?

Run a hook refactoring workflow after initial hook implementation to scan for duplicate logic and inline transformations across src/hooks/ and src/utils/, preventing technical debt from accumulating in your React codebase.

Does this refactoring approach work with React projects without external dependencies?

Yes, this refactoring approach works with React projects without requiring external dependencies, relying solely on analyzing your existing src/hooks/ and src/utils/ directories to identify and consolidate duplicate patterns.