Skip to content
Development
Command

/refactor

Refactor code for better quality

From plugin
tool-ui
7657 skills5 agents7 commands
Install
$ npx -y skills add assistant-ui/tool-ui --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/refactor

Context preview

What this command does when you run it.

Refactor code for better quality

Command definition

refactor.md
description: Refactor code for better quality

Refactor $ARGUMENTS to improve:

1. **Readability**

  • Clear variable/function names
  • Reduce complexity
  • Extract helper functions
  • Add helpful comments

2. **Maintainability**

  • DRY principle
  • Single responsibility
  • Loose coupling
  • High cohesion

3. **Type Safety**

  • Replace `any` with proper types
  • Add generics where helpful
  • Improve type inference

4. **Modern Patterns**

  • Use modern React patterns
  • Leverage TypeScript features
  • Apply functional programming where appropriate

IMPORTANT: Maintain exact same functionality and API - this is refactoring, not rewriting.

Ships withtool-ui

UI components for AI interfaces

Get the whole plugin