Refactoring Guide Prompts
Prompts for safe and systematic code refactoring
Category:prompts
Type:prompt
Difficulty:advanced
productivity
testing
advanced
Description
Prompts to guide code refactoring while maintaining functionality. Covers identifying refactoring opportunities, planning changes, ensuring test coverage, and validating behavior preservation.
Content
Resource Content
# Refactoring Guide Prompt Help me refactor this code: ``` [Paste code to refactor] ``` **Goals:** - [ ] Improve readability - [ ] Reduce complexity - [ ] Better separation of concerns - [ ] Improve testability - [ ] Remove duplication **Constraints:** - Must maintain existing API/interface - Tests must continue to pass - No new dependencies without justification Please provide: 1. Analysis of current issues 2. Step-by-step refactoring plan 3. Refactored code 4. Explanation of changes 5. Potential risks and mitigations
Rate This Resource
0
Help others discover great resources
Statistics
0
Stars
0
Copies
428
Days ago
163
Views
Claude Code Guides
How Claude Code separates planning, coordination, and delegated execution
Agents and Plan Mode
Understand the difference between the main thread, plan mode, coordinator behavior, and constrained sub-agents.
When Claude Code should align first and when it should just work
Plan Mode vs Direct Execution
Use plan mode for non-trivial tasks that need decision clarity; use direct execution for bounded requests where the path is already clear.
Related Resources
⚡
Code Review Prompts
Structured prompts for thorough code reviews
⚡
Debugging Assistant Prompts
Systematic prompts for debugging complex issues
✓
GitHub MCP Server
GitHub API integration for Claude with repository management capabilities
15,000
✓
Filesystem MCP Server
Secure file system access with configurable permissions and sandboxing
15,000