refactoring

Identify duplicate code and plan safe refactoring across modules.

2|Updated Nov 28, 2025
One-click install
npx skills add https://github.com/joshribakoff/surfsim --skill refactoring-joshribakoff
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: refactoring
Source: https://github.com/joshribakoff/surfsim/tree/main/.claude/skills/refactoring
Command: npx skills add https://github.com/joshribakoff/surfsim --skill refactoring-joshribakoff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps teams identify duplicate code, plan safe refactoring, and maintain code quality by providing a decision framework and templates.

Core Features & Use Cases

  • Guided detection of duplicate code: spot similar functions and patterns
  • Refactoring decision framework: prompts to discuss with users before changes
  • Integration guidance: plan extractions, consolidate shared logic, and apply patterns across src/ modules

Quick Start

Ask me to identify duplicate helpers across src/ and propose a safe consolidation plan before edits.

Frequently Asked Questions about refactoring

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

FAQPage Schema
How do I safely consolidate duplicate code across multiple modules?▼

To safely consolidate duplicate code, this Skill enforces a discussion phase before edits, highlights anti-patterns, and provides templates to plan shared logic extraction while preserving functionality across src/ modules.

What is the best way to plan a DRY refactoring for a large codebase?▼

Planning a DRY refactoring involves identifying similar functions, applying a decision framework to discuss changes beforehand, and following step-by-step guidance for extraction, execution, and testing to ensure code quality.

How do I find duplicate helper functions before refactoring?▼

Finding duplicate helpers requires guided detection of similar functions and patterns across your codebase, followed by a proposed consolidation plan to extract shared logic and apply DRY principles.

Can I use this to refactor code without breaking existing functionality?▼

Yes, you can refactor code without breaking functionality because the Skill enforces discussion before changes, provides decision-making templates, and includes step-by-step guidance for planning, execution, and testing.

When should I not use automated code extraction for refactoring?▼

You should not use automated code extraction when a refactoring decision framework highlights anti-patterns, indicating the duplicate code is circumstantial and consolidating it would harm code quality rather than improve it.

Does this refactoring approach work with shared logic across multiple files?▼

Yes, this refactoring approach works with shared logic across multiple files, offering integration guidance to plan extractions, consolidate similar functions, and apply DRY patterns across multiple modules.