Syntic
← All skills
Developer ExperienceFreeCommunityv1.0.0

Refactoring Specialist

Use when transforming codebases through systematic, behavior-preserving refactorings and structural improvements

About this skill

Use when transforming codebases through systematic, behavior-preserving refactorings and structural improvements

SKILL.md

refactoring-specialist.SKILL.md

Place it in your Syntic skills folder. For Syntic Code, install in your local skills directory, review the contents and run it in a controlled environment first.

SKILL.md
---
name: Refactoring Specialist
description: Use when transforming codebases through systematic, behavior-preserving refactorings and structural improvements
category: Developer Experience
version: 1.0.0
tools: []
---

# Refactoring Specialist

Perform behavior-preserving transformations: identify code smells, extract abstractions, eliminate duplication, simplify control flow. Every step is small, tested, reversible. Never mix refactoring with features.

## Process

1. Establish test coverage and write characterization tests for uncovered behavior before structural changes
2. Scan for code smells: methods >30 lines, nesting >3 levels, parameter lists >4, logic duplication, feature envy
3. Trace call graphs from entry points to find dead code, unreachable branches, unused exports, commented code
4. Plan atomic refactoring sequence producing compilable, testable intermediate states; minimize merge conflicts
5. Extract repeated logic into well-named functions describing intent, not implementation
6. Simplify conditionals: replace nested if-else chains with guard clauses, strategy patterns, lookup tables
7. Decompose large modules: extract cohesive function groups operating on same data into focused modules
8. Replace primitive obsession with domain types: emails, currencies, identifiers, validated strings get their own types with construction-time validation
9. Commit each refactoring step individually with the specific pattern name applied
10. Run full test suite after each commit to confirm behavior preservation

## Standards

- Pure structural changes only, zero behavioral modification verified by unchanged tests
- Extract Method preserves original signature, calls extracted function, enables incremental caller migration
- Renamed symbols updated across entire codebase in single atomic commit including tests and docs
- Dead code deleted, not commented, since version control preserves history
- Type signatures become more precise, never less precise, never widen from specific to any
- Module boundaries enforce access control; internal helpers not exported
- Performance-critical paths benchmarked before/after to confirm no regression

Install

Syntic App

  1. 1Create a dedicated folder for this skill in your local skills library.
  2. 2Place SKILL.md into that folder.
  3. 3Restart Syntic and invoke this skill on matching tasks.

Syntic Code (CLI)

  1. 1Save SKILL.md in your local Syntic Code skills directory.
  2. 2Keep related files in the same skill folder.
  3. 3Run in a safe environment and validate outputs.