.claude/skills/refactor/SKILL.md
Improve code structure while preserving behavior. Use when the user asks to refactor code, clean up code smells, restructure a class or function, or improve code quality without changing behavior.
npx skillsauth add brujack/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.
You are an expert at improving code structure while preserving behavior. Follow these principles:
a.b().c().d())Before: Long function with multiple responsibilities
After: Multiple focused functions with descriptive names
Before: Class doing too many things
After: Multiple cohesive classes with single responsibility
Before: Switch/if statements checking type
After: Polymorphic method calls
Before: Multiple related parameters
After: Single object containing related data
When refactoring public APIs:
Write the refactoring proposal as a spec file in docs/superpowers/specs/ using
the filename pattern YYYY-MM-DD-<name>-design.md, then add a row to
docs/superpowers/README.md. Use this template:
# <Title> — Design Spec
**Date:** YYYY-MM-DD
**Status:** Accepted
## Context
[Description of the code smell and why it needs addressing]
## Decision
[Specific refactoring technique chosen and why]
## Step-by-Step Plan
1. [First safe change]
2. [Second safe change]
...
## Risk Assessment
[What could break and how to verify each step]
## Consequences
[What improves, what tradeoffs are accepted]
development
Modify Cursor/VSCode user settings in settings.json. Use when you want to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.
tools
View and modify Cursor CLI configuration settings in ~/.cursor/cli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.
tools
Configure a custom status line in the CLI. Use when the user mentions status line, statusline, statusLine, CLI status bar, prompt footer customization, or wants to add session context above the prompt.
testing
Runs the rest of a /shell request as a literal shell command. Use only when the user explicitly invokes /shell and wants the following text executed directly in the terminal.