Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Refactoring Advisor

ASecurity

Provides refactoring recommendations and step-by-step improvement plans. Use when planning refactoring, improving code structure, or reducing technical debt.

29 stars
0 votes
0 copies
7 views
Added 12/21/2025
code-qualityjavascriptgojavarefactoringdocumentation

Security Analysis

A100/100

Scanned 2/12/2026

$npx -y skills add armanzeroeight/fastagent-plugins --skill refactoring-advisor --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Refactoring Advisor?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Refactoring Advisor
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/armanzeroeight-refactoring-advisor/badge)](https://www.skillsdirectory.com/skills/armanzeroeight-refactoring-advisor)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: refactoring-advisor
description: Provides refactoring recommendations and step-by-step improvement plans. Use when planning refactoring, improving code structure, or reducing technical debt.
---

# Refactoring Advisor

## Quick Start

Plan refactoring based on identified issues:

1. Identify the problem (code smell, complexity)
2. Select appropriate refactoring pattern
3. Create step-by-step plan
4. Ensure tests exist
5. Refactor incrementally

## Instructions

### Step 1: Assess Current State

Analyze the code:
- What is the problem? (long method, god class, etc.)
- What is the impact? (maintainability, testability)
- What is the risk? (how much code depends on it)

### Step 2: Select Refactoring Strategy

| Problem | Strategy | Risk |
|---------|----------|------|
| Long Method | Extract Method | Low |
| God Class | Extract Class | Medium |
| Duplicated Code | Extract Method | Low |
| Switch Statement | Replace with Polymorphism | High |
| Long Parameter List | Introduce Parameter Object | Medium |

### Step 3: Create Refactoring Plan

**Template:**
```markdown
## Refactoring: [Name]

**Problem:** [Description]
**Goal:** [Desired outcome]
**Risk Level:** [Low/Medium/High]

### Prerequisites
- [ ] Tests exist and pass
- [ ] Code is committed
- [ ] Dependencies identified

### Steps
1. [First small change]
2. [Run tests]
3. [Next small change]
4. [Run tests]
...

### Validation
- [ ] All tests pass
- [ ] No functionality changed
- [ ] Code is cleaner
```

### Step 4: Execute Incrementally

**Golden Rule:** Make the change easy, then make the easy change

1. Make one small change
2. Run tests
3. Commit
4. Repeat

## Refactoring Examples

### Extract Method

**Before:**
```javascript
function printOwing(invoice) {
  let outstanding = 0;
  
  console.log("***********************");
  console.log("**** Customer Owes ****");
  console.log("***********************");
  
  for (const o of invoice.orders) {
    outstanding += o.amount;
  }
  
  console.log(`name: ${invoice.customer}`);
  console.log(`amount: ${outstanding}`);
}
```

**Plan:**
1. Extract banner printing
2. Run tests
3. Extract outstanding calculation
4. Run tests
5. Extract details printing
6. Run tests

**After:**
```javascript
function printOwing(invoice) {
  printBanner();
  const outstanding = calculateOutstanding(invoice);
  printDetails(invoice, outstanding);
}

function printBanner() {
  console.log("***********************");
  console.log("**** Customer Owes ****");
  console.log("***********************");
}

function calculateOutstanding(invoice) {
  return invoice.orders.reduce((sum, o) => sum + o.amount, 0);
}

function printDetails(invoice, outstanding) {
  console.log(`name: ${invoice.customer}`);
  console.log(`amount: ${outstanding}`);
}
```

### Extract Class

**Before:**
```javascript
class Person {
  name;
  officeAreaCode;
  officeNumber;
  
  getTelephoneNumber() {
    return `(${this.officeAreaCode}) ${this.officeNumber}`;
  }
}
```

**Plan:**
1. Create TelephoneNumber class
2. Move areaCode field
3. Run tests
4. Move number field
5. Run tests
6. Move getTelephoneNumber method
7. Run tests
8. Update Person to use TelephoneNumber
9. Run tests

**After:**
```javascript
class TelephoneNumber {
  areaCode;
  number;
  
  toString() {
    return `(${this.areaCode}) ${this.number}`;
  }
}

class Person {
  name;
  telephoneNumber;
  
  getTelephoneNumber() {
    return this.telephoneNumber.toString();
  }
}
```

## Safety Checklist

Before refactoring:
- [ ] Tests exist and pass
- [ ] Code is in version control
- [ ] You understand what the code does
- [ ] You have time to complete the refactoring

During refactoring:
- [ ] Make small changes
- [ ] Run tests after each change
- [ ] Commit working states
- [ ] Don't add features while refactoring

After refactoring:
- [ ] All tests pass
- [ ] Code review completed
- [ ] Documentation updated
- [ ] No functionality changed

Attribution

armanzeroeightarmanzeroeight
View sourceSee grades on GitHubMore from armanzeroeight →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman Review

Ultra-compressed code review comments. Cuts noise from PR feedback while preserving the actionable signal. Each comment is one line: location, problem, fix. Use when user says "review this PR", "code review", "review the diff", "/review", or invokes /caveman-review. Auto-triggers when reviewing pull requests.

1100021 votes

Caveman Commit

Ultra-compressed commit message generator. Cuts noise from commit messages while preserving intent and reasoning. Conventional Commits format. Subject ≤50 chars, body only when "why" isn't obvious. Use when user says "write a commit", "commit message", "generate commit", "/commit", or invokes /caveman-commit. Auto-triggers when staging changes.

1100021 votes

Verification Loop

一个全面的 Claude Code 会话验证系统。

2456590 votes

Springboot Verification

Verification loop for Spring Boot projects: build, static analysis, tests with coverage, security scans, and diff review before release or PR.

2456590 votes

Django Verification

Verification loop for Django projects: migrations, linting, tests with coverage, security scans, and deployment readiness checks before release or PR.

2456590 votes
View all in code-quality →