From magic-powers
Use when improving code structure without changing behavior - extract methods, simplify conditionals, reduce duplication, improve naming
npx claudepluginhub kienbui1995/magic-powers --plugin magic-powersThis skill uses the workspace's default tool permissions.
Refactoring improves code structure without changing external behavior. Every refactoring must be backed by passing tests.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Refactoring improves code structure without changing external behavior. Every refactoring must be backed by passing tests.
Core principle: Small, safe, verified steps. Never refactor and add features simultaneously.
1. Ensure tests pass (green baseline)
2. Identify ONE smell
3. Apply ONE refactoring
4. Run tests → must stay green
5. Commit
6. Repeat
| Smell | Refactoring |
|---|---|
| Long method (>20 lines) | Extract Method |
| Deep nesting (>3 levels) | Early return / Guard clauses |
| Duplicated code | Extract shared function/module |
| Primitive obsession | Introduce value object/type |
| Long parameter list (>3) | Introduce parameter object |
| Feature envy | Move method to owning class |
| God class | Extract class by responsibility |
| Magic numbers/strings | Extract named constants |
| Complex conditional | Extract to named boolean / strategy pattern |
| Shotgun surgery | Consolidate into single module |
| Signal | Action |
|---|---|
| Tests failing after refactoring | Revert immediately, smaller step |
| Refactoring + feature in same commit | Split into two commits |
| "While I'm here, let me also..." | Finish current refactoring first |
| No tests exist | Write characterization tests before touching code |