dot_claude/skills/refactor/SKILL.md
Use when improving existing code structure while preserving behavior; trigger on complex functions, deep nesting, duplication, unclear names, or technical debt that does not require changing the design.
npx skillsauth add nijaru/dotfiles 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.
Refactoring changes the shape of existing code without changing external behavior. If the first implementation is complete but should be replaced with a cleaner second attempt, use second-pass. If the current design may be fundamentally wrong, use rewrite.
_new, _old, _v2, or compatibility shims.State the behavior-preservation check, the main structural change, and the verification command/result. If no edit is warranted, say what made the current structure acceptable.
| Excuse | Reality | | :--- | :--- | | "This is working, so structure does not matter." | Working code can still hide bugs and slow future changes. | | "I'll add a wrapper and migrate later." | Compatibility layers become permanent. Change the interface cleanly or do not change it. | | "This needs a rewrite." | If behavior and design stay the same, it is a refactor, not a rewrite. |
development
Use after completing a bug fix, feature, refactor, or tk task when the first implementation taught enough context to replace it with a simpler, cleaner, or more coherent version before finalizing.
development
Use when writing, migrating, or reviewing Zig code across recent stable versions (0.14-0.16), especially to correct stale syntax or stdlib, build.zig, allocator, formatting, or runtime API knowledge.
documentation
Use when reviewing or revising text (prose, docs, commits) to remove AI patterns and improve voice/clarity.
content-media
Use when fetching X/Twitter post content by URL, or searching for recent X posts.