Skip to content
All templates

Slash Commands · Slash Command

/refactor - Refactoring Command

Custom slash command for targeted refactoring

refactorcommandcleanup
Template content
Analyze the specified file or function for refactoring opportunities.

Look for:
1. Functions that are too long (>30 lines)
2. Duplicated logic that could be extracted
3. Complex conditionals that could be simplified
4. Missing type safety
5. Dead code that can be removed

Apply refactorings one at a time. Explain each change briefly.
Ensure all existing tests still pass after each change.

Use this template in the editor

Open PromptEditor.io to customize this template, save it, and inject it into any AI chat.

Open the editor