This directory contains detailed refactoring plans for improving the codebase. Each document outlines specific improvements, implementation strategies, and progress tracking.
Refactoring plans serve to:
- Document planned improvements before implementation
- Track progress on ongoing refactoring work
- Provide context for reviewers and future maintainers
- Align team on technical improvements
- Preserve decisions and rationale
See active-refactorings.md for the current list of ongoing refactoring work.
See completed-refactorings.md for the complete history of finished refactoring work.
docs/refactors/
├── README.md # This file - refactoring process documentation
├── TEMPLATE.md # Template for creating new refactoring plans
├── active-refactorings.md # Index of ongoing refactoring work
├── completed-refactorings.md # Historical record of completed refactorings
└── plans/ # Directory containing detailed refactoring plan documents
Meta-Documentation (at root):
README.md- Explains the refactoring process and conventionsTEMPLATE.md- Template for creating new refactoring plan documentsactive-refactorings.md- Index of current ongoing refactoring workcompleted-refactorings.md- Historical record of finished refactorings
Refactoring Plan Documents (plans/ subdirectory):
- Each active refactoring has a detailed plan document in
plans/ - These contain the full implementation details, progress tracking, and technical specifications
- When refactoring is complete, the plan document is typically deleted or archived
File Management Process:
- New refactoring: Create plan document in
plans/, add entry toactive-refactorings.mdwith status 📋 Planning - Start work: Update status to 🚧 In Progress in
active-refactorings.md - Complete work: Move entry from
active-refactorings.mdtocompleted-refactorings.md - Cleanup: Delete the detailed plan document from
plans/(work is now in git history)
Each refactoring plan follows this structure:
- Overview: Summary of goals and scope
- Progress Tracking: Current status and completion metrics
- Phased Proposals: Organized by impact and effort
- Implementation Details: Code examples and checklists
- Timeline: Estimated duration and sprint planning
- Review Process: Approval and completion criteria
- 📋 Planning - Document created, awaiting review and approval
- 🚧 In Progress - Implementation has started
- ✅ Completed - All proposals implemented and merged
- ⏸️ Paused - Work temporarily suspended
- ❌ Cancelled - Plan was abandoned or superseded
- Identify area needing refactoring
- Create detailed plan document in this directory
- Organize proposals by impact/effort ratio
- Add implementation checklists and timeline
- Add entry to active-refactorings.md with status 📋 Planning
- Team reviews plan for technical feasibility
- Validate alignment with project principles
- Approve or request modifications
- Set implementation timeline
- Update status to 🚧 In Progress in active-refactorings.md
- Create tracking issue (optional)
- Create feature branch
- Implement proposals in priority order
- Update progress in plan document
- Run tests and linters after each change
- Final verification of all changes
- Update plan document status to ✅ Completed
- Move refactoring entry from active-refactorings.md to completed-refactorings.md
- Delete the refactoring plan document (or archive if needed for reference)
- Create pull request
- Merge after review approval
Create a plan when:
- ✅ Changes affect multiple functions or modules
- ✅ Multiple improvements should be coordinated
- ✅ Work will span multiple sessions or PRs
- ✅ Team alignment is needed before starting
- ✅ Changes require careful sequencing
Skip a formal plan for:
- ❌ Single-function improvements
- ❌ Obvious bug fixes
- ❌ Trivial style changes
- ❌ Urgent hotfixes
Good refactoring plans:
- ✅ Prioritize by impact/effort - Quick wins first
- ✅ Include code examples - Show before/after
- ✅ Provide checklists - Track implementation steps
- ✅ Document rationale - Explain why, not just what
- ✅ Set realistic timelines - Based on team capacity
- ✅ Align with principles - Support project goals
Update progress regularly:
- After each proposal: Mark as completed
- Weekly: Update summary metrics
- Phase completion: Update phase status
- Issues/blockers: Document in plan
- Development Principles - Core principles guiding refactoring
- Contributing Guidelines - General contribution process
- Error Handling Guide - Error handling standards
- Testing Conventions - Testing best practices
- Start with high-level goals before diving into details
- Group related changes into logical phases
- Estimate conservatively - refactoring often takes longer than expected
- Get early feedback on the plan structure
- Keep it updated as implementation progresses
- Read the entire plan before starting work
- Follow the phase order unless there's a strong reason not to
- Update progress after completing each proposal
- Run tests frequently to catch issues early
- Ask questions if anything is unclear
- Check alignment with project principles
- Validate priorities - are high-impact items first?
- Verify feasibility - can this actually be done?
- Suggest improvements - what's missing?
- Approve clearly - signal when implementation can begin
- Open a GitHub issue with label
refactoring - Reference specific plan documents
- Tag relevant maintainers
Last Updated: October 10, 2025