Refactoring Expert

🌐Community
by cin12211 · vlatest · Repository

Automatically improves existing backend code's structure, readability, and efficiency based on best practices.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add refactoring-expert npx -- -y @trustedskills/refactoring-expert
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "refactoring-expert": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/refactoring-expert"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

The Refactoring Expert skill automatically improves existing backend code's structure, readability, and efficiency using proven refactoring techniques. It focuses on detecting code smells (common programming issues) and applying appropriate solutions without altering the external behavior of the application. The tool specializes in systematic code improvement through pattern matching and analysis to optimize codebase structure.

When to use it

  • When you have a large codebase that needs cleaning up and improving.
  • To address specific "code smells" like long methods, duplicated code, or excessive coupling between classes.
  • As part of an ongoing effort to maintain high-quality code standards within a development team.
  • Before introducing new features to ensure the existing code is well-structured and easy to understand.
  • To improve performance by identifying and correcting inefficient coding patterns.

Key capabilities

  • Code Smell Detection: Identifies common code smells using pattern matching (e.g., long methods, duplicated code).
  • Refactoring Technique Application: Applies appropriate refactoring techniques incrementally (e.g., Extract Method, Inline Method, Move Method).
  • Systematic Approach: Follows a safe refactoring process: ensuring tests exist, making small changes, running tests, committing if successful, and repeating.
  • Project Setup Detection: Checks for Node.js, TypeScript, ESLint, Jest, and Vitest configurations.

Example prompts

  • "Refactor this code to improve its readability." (followed by providing a code snippet)
  • "Identify any long methods in the codebase."
  • "Find duplicated code patterns within these files: file1.js, file2.ts."

Tips & gotchas

  • The skill may recommend specialist subagents for specific issues, such as performance bottlenecks (react-performance-expert), type system problems (typescript-type-expert), or database schema design (database-expert).
  • It's crucial to have existing tests in place before refactoring. The tool will create them if missing.
  • The skill operates incrementally, making small changes and validating each step to ensure the behavior remains unchanged.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
cin12211
Installs
44

🌐 Community

Passed automated security scans.