code-refactoring

Analyze codebases for quality issues and implement refactoring changes.

100|9|Updated Feb 6, 2025
One-click install
npx skills add https://github.com/captainflasmr/ollama-buddy --skill code-refactoring-captainflasmr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-refactoring
Source: https://github.com/captainflasmr/ollama-buddy/tree/main/.agents/skills/code-refactoring
Command: npx skills add https://github.com/captainflasmr/ollama-buddy --skill code-refactoring-captainflasmr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Streamlines code quality improvements by providing structured analysis, targeted refactoring, and documentation guidance to enhance readability, maintainability, and performance.

Core Features & Use Cases

  • Analysis Phase: Identify code smells, anti-patterns, and performance bottlenecks; assess maintainability and edge cases.
  • Refactoring Phase: Propose and implement clean code changes while preserving functionality and applying design patterns.
  • Documentation Phase: Explain each change, benefits, trade-offs, and future improvement opportunities.

Quick Start

Provide the code you want refactored and specify any constraints or goals for improvements.

Frequently Asked Questions about code-refactoring

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

FAQPage Schema
How do I refactor code to fix code smells and improve maintainability?

To refactor code and improve maintainability, provide the codebase and specify constraints. The tool identifies code smells and anti-patterns, proposes clean code changes, and applies design patterns while preserving functionality.

What is the best way to analyze a multi-file codebase for anti-patterns?

Analyzing a multi-file codebase for anti-patterns involves an assessment phase that identifies code smells and performance bottlenecks. The tool evaluates maintainability and edge cases across diverse languages and project scales.

Can I use this refactoring approach for small modules and large systems alike?

Yes, this refactoring approach applies to diverse languages and project scales, from small modules to multi-file systems. It guides optimization and maintainability improvements regardless of the codebase size.

How do I ensure functionality is preserved when applying design patterns during refactoring?

To ensure functionality is preserved during refactoring, the tool proposes and implements clean code changes using design patterns while explicitly handling errors safely and documenting the change rationale.

What are the limitations of automated code refactoring for legacy software?

Automated code refactoring limitations are mitigated by clear documentation of trade-offs and future improvement opportunities. The tool explains each change's benefits but requires you to specify constraints and goals upfront.

Why do I need to document trade-offs when refactoring code?

Documenting trade-offs during code refactoring is necessary to explain each change, its benefits, and future improvement opportunities. This documentation phase ensures structured analysis and enhances long-term readability.