Refactor.
Code smell detection, TypeScript migration, dead code removal, pre/post verification gates. Never change behavior, only structure.
Safe Refactoring with Verification.
Refactoring fails when behavior changes accidentally. This skill enforces the discipline: characterize the current behavior with tests FIRST, then change structure with green tests, then re-verify. Includes code smell taxonomy (long method, feature envy, primitive obsession, etc.), TypeScript-from-JS migration playbook, and dead code identification (the safe removal kind, not just static analysis).
Four recipes.
Characterization tests
Before refactoring untested code: write tests that capture CURRENT behavior (even if it is buggy). Then refactor with green tests. Then fix the bugs separately.
Code smell taxonomy
Long Method (extract). Feature Envy (move method). Primitive Obsession (extract value object). Shotgun Surgery (consolidate change locus). Each smell has a named refactoring.
TypeScript migration
allowJs: true, then annotate by file, then flip strict per file, then enable strict globally. Do not big-bang. Use //@ts-check incremental adoption.
Dead code removal
Static analysis (knip, ts-prune) PLUS grep verification. Some code is used by string-based dynamic imports. Always verify with runtime traces before deleting.
It composes.
Skills compose into workflows. Refactor is rarely the only skill you will use — it pairs naturally with these others in the library.
One command.
Installs only stryx-refactor (skip the other 19) into ~/.claude/skills/stryx-refactor/.
Free for all use.
Stryx Labs License v1.0. Use Refactor in personal, commercial, internal, and production work. No attribution required.