All Skills stryx · skills Stryx Labs
// stryxstryx-refactor

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

//01What it does

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.

//02What is inside

Four recipes.

i.

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.

ii.

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.

iii.

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.

iv.

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.

//03Chains with

It composes.

Skills compose into workflows. Refactor is rarely the only skill you will use — it pairs naturally with these others in the library.

//04Install · just this skill

One command.

Installs only stryx-refactor (skip the other 19) into ~/.claude/skills/stryx-refactor/.

macOS · Linux
STRYX_SKILL=stryx-refactor curl -fsSL https://stryxlabs.com/install-skills.sh | bash
 
Windows · PowerShell
PS> $env:STRYX_SKILL="stryx-refactor"; irm https://stryxlabs.com/install-skills.ps1 | iex
 
All 20 skills (the full library)
curl -fsSL https://stryxlabs.com/install-skills.sh | bash
//05Reach

Free for all use.

Stryx Labs License v1.0. Use Refactor in personal, commercial, internal, and production work. No attribution required.