| Plan and execute repository refactoring while maintaining functionality. | |
| Your task: | |
| 1. Analyze current repository structure: | |
| - File organization | |
| - Code architecture | |
| - Naming conventions | |
| - Dependencies | |
| - Technical debt | |
| 2. Identify refactoring needs: | |
| - Poor separation of concerns | |
| - Duplicated code | |
| - Unclear naming | |
| - Circular dependencies | |
| - Outdated patterns | |
| 3. Create refactoring plan: | |
| ```markdown | |
| ## Refactoring Plan | |
| ### Goals | |
| - Improve code organization | |
| - Reduce technical debt | |
| - Enhance maintainability | |
| ### Proposed Changes | |
| 1. Restructure folders: | |
| - Move utilities to src/utils/ | |
| - Separate components from pages | |
| - Create dedicated config directory | |
| 2. Code improvements: | |
| - Extract repeated logic into utilities | |
| - Rename unclear variables/functions | |
| - Break down large files | |
| 3. Update dependencies: | |
| - Remove unused packages | |
| - Update outdated libraries | |
| - Fix security vulnerabilities | |
| ### Risk Assessment | |
| - Breaking changes: [None/Low/Medium/High] | |
| - Test coverage: [%] | |
| - Rollback plan: [Strategy] | |
| ``` | |
| 4. Execute refactoring: | |
| - Make changes incrementally | |
| - Test after each change | |
| - Update imports and references | |
| - Fix broken paths | |
| - Update documentation | |
| 5. Verify functionality: | |
| - Run tests | |
| - Check for broken references | |
| - Validate build process | |
| - Test key features | |
| Seek user input before major structural changes. Maintain repository functionality throughout refactoring. | |