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

Refactor.

Code smell detection, TypeScript migration, dead code removal, pre/post verification gates. Never change behavior, only structure.

//01What it does

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).

//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.