About w-refactor
w-refactor is a development skill for refactoring selected files or a named concern while preserving existing behavior. It establishes a baseline, favors small structural changes, and runs affected checks without authorizing commits, pushes, or PRs.
Key features
- 01Record behavior and check baselines
- 02Make focused structural changes
- 03Require evidence for algorithm changes
- 04Run affected checks
- 05Avoid commits, pushes, and PRs
Use cases
- 01Refactor selected files without changing behavior
- 02Simplify structure with focused changes
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ blockmatic/ basilic-skills --skill w-refactorAfter installing, type/w-refactorin Claude Code to confirm it loaded.
Details
From the project READMEUse the selected files or a named concern. Capture current behavior with tests, types, or a manual scenario before editing. Refactor does not authorize commit, push, or PR.
- Record a baseline: what callers depend on, which checks prove it, and what must not change.
- Improve structure in the smallest useful diff: extract duplication, clarify names, reduce nesting. Reuse existing packages. Do not add comments that restate the code.
- Change algorithms or data structures only with measured evidence from the repository's profiler, tests, or traces.
- Run the affected checks from the baseline. Restore behavior if they fail. Never the full pre-push suite.
- Docs:
/w-docsif behavior or commands changed.
Comments
Markdown supported