Instruction file imported from tkhongsap/ai-dev-workflow (
.cursor/rules/refactoring-tech-debt-workflow/02-plan-refactoring-tasks.mdc). Copyright stays with the author.
Rule: Plan Refactoring Tasks
Goal
To guide an AI assistant in creating an actionable refactoring plan that balances business needs with technical improvements.
Process
- Load Tech Debt Analysis: Read from
/refactoring/tech-debt-analysis-[TARGET_NAME].md - Prioritize Issues: Rank by impact vs effort matrix
- Create Task Breakdown: Split large refactoring into manageable tasks
- Define Success Criteria: Set clear goals for each task
- Save Plan: Generate
refactoring-plan-[TARGET_NAME].mdin/refactoring/
Prioritization Framework
Consider these factors:
- Business Impact: How does this affect users or revenue?
- Risk Level: What could break if we don't fix this?
- Effort Required: How long will it take to fix?
- Dependencies: What else needs to change?
- Quick Wins: What can we fix easily for immediate benefit?
Refactoring Plan Structure
The plan should include:
- Executive Summary: Key improvements and expected benefits
- Phase 1 - Quick Wins: Low effort, high impact fixes (1-2 days)
- Phase 2 - Core Improvements: Medium effort refactoring (1-2 weeks)
- Phase 3 - Major Changes: Large architectural improvements (2+ weeks)
- Success Metrics: How we'll measure improvement
- Risk Mitigation: Safety measures and rollback plans
Task Format
For each refactoring task:
- Task Title: Clear description of what to refactor
- Current State: What's wrong now
- Target State: What it should look like
- Implementation Steps: How to get there
- Testing Strategy: How to verify it works
- Estimated Effort: Hours or days needed
Output
- Format: Markdown (
.md) - Location:
/refactoring/ - Filename:
refactoring-plan-[TARGET_NAME].md
Final Instructions
- Start with highest impact, lowest effort tasks
- Group related refactoring together
- Include specific file and function references
- Provide clear acceptance criteria
- Consider team capacity and deadlines