.claude/skills/refactor/SKILL.md
Refactor code using Martin Fowler's patterns. Improves readability, moves behavior closer to data, removes unnecessary abstractions.
npx skillsauth add rakovi4/continue-example refactorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Spawns refactor-agent for code improvements.
/refactor # Analyze current code for smells
/refactor Email # Create Email value object
/refactor UserService # Refactor specific file
.claude/agents/refactor-agent.md.claude/templates/refactoring/.claude/templates/refactoring/)scan-checklist.md - Mandatory structural + judgment scan checklistvalue-object.md - Replace primitive with value objectreplace-string-with-enum.md - Replace string constants with domain enumcomputed-field.md - Remove persisted field, replace with computed methodtest-base-class.md - Extract shared test setupfactory-method.md - Replace constructor with factoryencapsulate-conditional.md - Move conditionals to data classparameterize-helper.md - Add parameters to test helpersinline-test-params.md - Simplify test→statement data flowreplace-map-with-dto.md - Replace Map.of() with typed DTOrest-response-dto.md - Wrap in REST DTO for snake_case conversionmove-to-data.md - Move behavior, serialization, factories to data ownersimplify-expressions.md - Static imports, method references, inline variablesflatten-control-flow.md - Flatten conditionals, Optional patterns, child delegationextract-method.md - Named computations, guards, long method decompositionextract-class.md - Split large class by concern, extract superclass for shared infraadapter-query.md - Extract typed AdapterQuery for Specification/CriteriaQuery logicsubselect-read-model.md - Consolidate multiple repositories into single query with ORM relationships.claude/templates/refactoring/)extract-component.md - Extract JSX block into field/section componentextract-shared-ui.md - Move reusable component to app/components/ui/extract-test-fixture.md - Extract MSW response fixtures, stub helpers, assertion helperstesting
Run use-case module tests quickly. Use when user wants to run use-case tests or mentions /test-usecase command.
development
Generate BDD test specifications for story in 6 categories (API, UI, Load, Infrastructure, Security, Integration). Use when user wants to create test cases or mentions /test-spec command.
testing
Review tests to replace loose validation (contains, isNotNull, isNotEmpty) with strict validation (isEqualTo on parsed fields). Use when user wants to improve test assertions or mentions /test-review command.
development
Run frontend tests. Use when user wants to run frontend unit tests or mentions /test-frontend command.