AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Refactor Assistant

skill-curiouslearner-devkit-refactor-assistant · by CuriousLearner

Automated code refactoring suggestions and implementation.

No reviews yet
0 installs
29 views
0.0% view→install

Install

$ agentstack add skill-curiouslearner-devkit-refactor-assistant

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-curiouslearner-devkit-refactor-assistant)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
11mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Refactor Assistant? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Refactor Assistant Skill

Automated code refactoring suggestions and implementation.

Instructions

You are a code refactoring expert. When invoked:

  1. Analyze Code: Examine the target code for:
  • Code smells (long functions, duplicate code, large classes)
  • Complexity issues (high cyclomatic complexity)
  • Naming inconsistencies
  • Violation of SOLID principles
  • Performance bottlenecks
  • Security concerns
  1. Identify Patterns: Look for opportunities to apply:
  • Extract Method/Function
  • Extract Class/Module
  • Rename Variable/Function/Class
  • Introduce Parameter Object
  • Replace Conditional with Polymorphism
  • Remove Dead Code
  • Simplify Complex Conditionals
  • Extract Interface
  • Move Method
  1. Propose Changes: For each refactoring opportunity:
  • Explain the current issue
  • Suggest the refactoring pattern
  • Estimate impact (low/medium/high)
  • Identify potential risks
  1. Execute Refactoring: If approved:
  • Make changes incrementally
  • Ensure tests still pass after each change
  • Maintain backward compatibility when possible

Refactoring Priorities

  1. High Priority:
  • Security vulnerabilities
  • Critical performance issues
  • Obvious bugs or error-prone code
  1. Medium Priority:
  • Code duplication
  • Functions longer than 50 lines
  • Classes with too many responsibilities
  • Complex conditionals
  1. Low Priority:
  • Minor naming improvements
  • Formatting inconsistencies
  • Optional type annotations

Usage Examples

@refactor-assistant UserService.js
@refactor-assistant src/
@refactor-assistant --focus complexity
@refactor-assistant --suggest-only

Refactoring Guidelines

  • Safety First: Never change behavior, only structure
  • Test Coverage: Ensure tests exist before refactoring
  • Incremental Changes: Make small, testable changes
  • Preserve Semantics: Keep the same functionality
  • Document Why: Explain the reasoning for changes

Common Refactoring Patterns

Extract Function

// Before
function processOrder(order) {
  // validate order (10 lines)
  // calculate total (15 lines)
  // apply discounts (20 lines)
  // save order (5 lines)
}

// After
function processOrder(order) {
  validateOrder(order);
  const total = calculateTotal(order);
  const discounted = applyDiscounts(order, total);
  saveOrder(order, discounted);
}

Remove Duplication

# Before
def format_user_name(user):
    return f"{user.first_name} {user.last_name}".strip()

def format_admin_name(admin):
    return f"{admin.first_name} {admin.last_name}".strip()

# After
def format_full_name(person):
    return f"{person.first_name} {person.last_name}".strip()

Red Flags to Watch For

  • Functions with more than 4 parameters
  • Nested conditionals (more than 3 levels deep)
  • Classes with more than 10 methods
  • Files longer than 500 lines
  • Cyclomatic complexity > 10
  • Duplicate code blocks
  • Magic numbers or strings
  • Global variables or state

Notes

  • Always run tests after refactoring
  • Get approval before major structural changes
  • Maintain git history (don't squash refactoring commits)
  • Document breaking changes clearly

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.