From kernel
Executes safe, test-gated refactoring with behavior-preserving transformations (extract, inline, rename, move, simplify). Runs tests before and after each change, requires JiT tests for untargeted code, and measures complexity reduction.
How this skill is triggered — by the user, by Claude, or both
Slash command
/kernel:refactorThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
<skill id="refactor">
git log for overlapping changesrefactor(scope): description. File must end shorter or justify growth in commit body.<anti_patterns> Large refactors in one commit. Impossible to review or revert. Refactoring without test coverage. You can't verify behavior preservation. Adding features during refactor. Separate concerns, separate commits. Abstracting before you have 3 concrete examples. Wait for patterns to emerge. "While I'm here, I'll also..." No. Separate contract. </anti_patterns>
<on_complete> agentdb write-end '{"skill":"refactor","type":"<extract|inline|rename|simplify>","files_touched":,"tests_status":"green","behavior_changed":false}'
Record what was refactored and verify tests remained green throughout. </on_complete>
npx claudepluginhub ariaxhan/kernel-claude --plugin kernelSafely refactors code with test coverage: writes tests first if absent, plans changes, applies small testable steps, verifies tests/lint/typecheck pass without behavior changes.
Safely refactors code test-first: verifies/writes tests, one structural change at a time, preserves behavior. Use for 'refactor this', 'clean this up', reorganization.
Enforces rigid pre-refactor checklist: read existing code, verify covering tests pass, state goal clearly, validate non-ego motivation, plan smallest first step. Use before restructures, renames, or cleanups.