charon-fan avatar

Refactoring Specialist

A solid refactoring companion that identifies ten common code smells and walks you through fixing them with before/after examples. Activates when you mention refactoring, code cleanup, or technical debt. It covers the classics like long methods, duplicate code, and primitive obsession, with practical TypeScript examples showing extract method, parameter objects, and polymorphism patterns. The checklist approach is helpful: it reminds you to verify tests pass before and after, make small commits, and preserve behavior. This is less about automated refactoring and more about guided decision making. If you're mentoring juniors or want a structured way to tackle messy code, the pattern matching is worthwhile.

skills.sh installs
663
GitHub stars
66
last updated
Jul 14, 2026

Install

$ npx -y skills add charon-fan/agent-playbook --skill refactoring-specialist --agent claude-code

Installs into .claude/skills of the current project.

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

Sponsors

Details

Repository
github.com/charon-fan/agent-playbook
Categories
Code Review & Quality, AI & Agent Building
First seen
May 16, 2026

More from charon-fan/agent-playbook

All 24
1zackkorman avatarsecurity-reviewzackkorman/skillssecurity review659skills.sh installs
2alirezarezvani avatarmigration-architectalirezarezvani/claude-skillsZero-downtime migration planning, compatibility validation, and rollback strategy generation. Tools for system, database, and infrastructure migrations with min656skills.sh installs
3leonardomso avatarseo-reviewleonardomso/33-js-conceptsPerform a focused SEO audit on JavaScript concept pages to maximize search visibility, featured snippet optimization, and ranking potential650skills.sh installs
4aj-geddes avatarinformation-architectureaj-geddes/useful-ai-promptsOrganize and structure information for clarity and discoverability. Design navigation systems, hierarchies, and mental models that match user needs.641skills.sh installs
5alirezarezvani avatardata-quality-auditoralirezarezvani/claude-skillsAudit datasets for completeness, consistency, accuracy, and validity. Profile data distributions, detect anomalies and outliers, surface structural issues, and 639skills.sh installs
6patternsdev avatarislands-architecturepatternsdev/skillsTeaches the islands architecture pattern for partial hydration. Use when building content-heavy sites where most of the page is static and only small regions ne638skills.sh installs