New advertisers: 50% off your first month with code FIRSTMONTHSee slots
zhaono1 avatar

Refactoring Specialist

Guided refactoring for ten named code smells, with before-and-after examples and a step-by-step checklist.

skills.sh installs
663
GitHub stars
89
last updated
Jul 14, 2026
View on GitHub

What it does

  • Covers the refactoring workflow: identify the smell, pick a technique, confirm tests pass, apply the change, rerun tests, and commit
  • Includes 10 smell-to-technique patterns such as Long Method, Duplicate Code, Large Class, Feature Envy, and Switch Statements, each with TypeScript examples
  • Enforces small, atomic commits and a before-and-after checklist requiring passing tests and a rollback plan
  • Activates on requests to refactor, clean up, or mention technical debt or code smells, and logs activity via session-logger

Install

$ npx -y skills add zhaono1/agent-playbook --skill refactoring-specialist -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Refactoring Specialist

Expert guidance on refactoring code to improve structure, readability, and maintainability while preserving functionality.

When This Skill Activates

Activates when you:

  • Ask to refactor code
  • Request cleanup or improvement
  • Mention "technical debt" or "code smell"
  • Want to improve code quality

Refactoring Principles

  1. Preserve Behavior: Refactoring must not change external behavior
  2. Small Steps: Make small, incremental changes
  3. Test Coverage: Ensure tests pass before and after
  4. Commit Often: Commit after each successful refactoring

Code Smells to Address

1. Long Method

Symptom: Function > 20-30 lines

Refactoring: Extract Method

// Before:
function processOrder(order) {
  // 50 lines of code
}

// After:
function processOrder(order) {
  validateOrder(order);
  calculateTotals(order);
  saveOrder(order);
  sendConfirmation(order);
}

2. Duplicate Code

Symptom: Similar code in multiple places

Details

Repository
github.com/zhaono1/agent-playbook
Categories
Code Review & Quality, Testing & QA
First seen
May 16, 2026

More from zhaono1/agent-playbook

All 24

Similar to Refactoring Specialist

More Code Review & Quality