refactoring-expert

Detect code smells and guide safe refactoring in JavaScript and TypeScript projects.

Updated Apr 9, 2024
One-click install
npx skills add https://github.com/nhonvo/Powershell --skill refactoring-expert-nhonvo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring-expert
Source: https://github.com/nhonvo/Powershell/tree/main/antigrafity-config/.agent/skills/refactoring-expert
Command: npx skills add https://github.com/nhonvo/Powershell --skill refactoring-expert-nhonvo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detects code smells and guides safe refactoring to improve maintainability without altering external behavior.

Core Features & Use Cases

  • Detects common smells (long methods, duplicated code, complex conditionals) and suggests targeted refactorings.
  • Provides a safe, incremental workflow with testing prerequisites, extraction techniques, and a review checklist.
  • Supports documentation of rationale and preserves behavioral contracts during refactors.

Quick Start

Review a target project, identify a long function, and apply an Extract Method refactoring while preserving behavior.

Frequently Asked Questions about refactoring-expert

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

FAQPage Schema
How do I refactor long methods and duplicated logic without changing external behavior?

Code smells like long methods, duplicated logic, and complex conditionals signal when refactoring is needed. They indicate areas where applying targeted extraction techniques can improve maintainability without altering external behavior.

What's the best way to start refactoring complex conditionals in JavaScript and TypeScript?

To safely refactor JavaScript and TypeScript, establish testing prerequisites first, then apply incremental extraction techniques like Extract Method, and finish with a review checklist to verify the external behavior remains unchanged.

Does this refactoring workflow support JavaScript and TypeScript projects?

Yes, this refactoring workflow supports JavaScript and TypeScript projects. It detects code smells and applies proven extraction techniques to guide incremental improvements across these languages.

When do I need to preserve a behavioral contract during a code refactor?

You must preserve behavioral contracts throughout any refactoring process to ensure external behavior remains unchanged. This is maintained by following an incremental workflow with testing prerequisites and a final review checklist.