Refactor selected code while preserving behavior, then verify.
Install
npx skills add https://github.com/blockmatic/basilic-skills --skill w-refactorSKILL.md
Use 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.
Related skills
w-a11yblockmaticAudit UI against repository a11y docs and tests; do not invent a WCAG level.w-api-docsblockmaticRefresh API docs from the owning schema source; never edit generated OpenAPI by hand.w-api-testblockmaticAdd API tests that exercise public HTTP behavior against existing harnesses.w-architectureblockmaticPlan an implementation structure; durable decisions belong in ADRs and architecture docs.