Refactor.
When the code is rotting but the tests are thin. The skill that pins behavior with characterization tests, then changes structure under green, without ever shipping a regression.
4 reference docs · 76 KB installed · stryx-refactor
Smells, Migrations, Dead Code, Verification Gates.
Refactoring fails when behavior changes by accident. This skill enforces a strict order: characterize current behavior with tests first, then move structure under green, then re-verify. Covers the code smell taxonomy with named refactorings (long method, feature envy, primitive obsession, shotgun surgery), the incremental TypeScript-from-JS migration playbook (allowJs to ts-check to per-file strict to global strict), and dead code removal that survives string-based dynamic imports.
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.