Project Reorganization Workflow
Overview
Complete workflow for reorganizing a CODITECT project to production standards. Ensures safe, reversible restructuring with full documentation and validation.
Prerequisites
- Git repository initialized
- CODITECT framework available
- Write access to repository
Workflow Phases
Phase 1: Analysis (30-60 min)
Objective: Understand current state and identify issues.
Steps
-
Run Structure Analysis
/agent project-structure-analyzer "Complete analysis of project structure"
# Or
python H.P.004-SCRIPTS/analyze-project-structure.py --verbose -
Review Analysis Report
- Current score and grade
- Issues by severity
- Stray files list
- Missing READMEs
-
Check Naming Conventions
/naming-check
# Or
python H.P.004-SCRIPTS/enforce-naming-conventions.py -
Identify Blocking Issues
- Critical issues (must fix)
- High priority items
- Dependencies between fixes
-
Document Current State
- Screenshot/export analysis report
- Record baseline metrics
- Note any special considerations
Deliverables
- Analysis report generated
- Current score recorded
- Issues categorized by priority
- Baseline metrics documented
Phase 2: Planning (30-45 min)
Objective: Create comprehensive reorganization plan.
Steps
-
Create Plans Directory
mkdir -p docs/reorganization-plans -
Generate Master Plan
/organize --plan -
Create Per-Directory Plans
- Root directory plan
- docs/ plan
- H.P.004-SCRIPTS/ plan
- Other directories as needed
-
Review and Prioritize
- Order by dependency
- Identify quick wins
- Flag risky operations
Deliverables
- MASTER-REORGANIZATION-PLAN.md created
- Per-directory PLAN.md files created
- TASKLIST.md with checkboxes
- Execution order defined
Phase 3: Execution (2-3 hours)
Objective: Execute reorganization safely.
Steps
-
Create Backup
git checkout -b backup/pre-reorganization
git push origin backup/pre-reorganization
git checkout main
git checkout -b reorganization/$(date +%Y%m%d) -
Execute P0 (Critical) Plans
/organize --execute
# Or manually:
git mv source destination -
Validate After Each Phase
python H.P.005-HOOKS/post-reorganization-validate.py -
Generate Missing READMEs
/readme-gen --missing --recursive -
Fix Naming Violations
/naming-check --fix -
Commit Checkpoints
git add -A
git commit -m "reorg: [Phase description]"
Deliverables
- Backup branch created
- All file moves completed
- READMEs generated
- Naming fixed
- Commits created
Phase 4: Validation (30-45 min)
Objective: Verify reorganization success.
Steps
-
Run Production Audit
/production-audit
# Or
python H.P.004-SCRIPTS/production-readiness-check.py --report -
Verify Score Improvement
- Compare to baseline
- Confirm no regressions
- Document improvements
-
Check Cross-References
python H.P.005-HOOKS/post-reorganization-validate.py --strict -
Final Review and Merge
git add -A
git commit -m "reorg: Complete project reorganization
Score: XX → YY
Grade: X → Y
- Moved XX files
- Generated XX READMEs
- Fixed XX naming violations"
git checkout main
git merge reorganization/$(date +%Y%m%d)
git push
Deliverables
- Final audit score ≥80
- No blocking issues
- All validations pass
- Changes merged to main
Rollback Procedure
If issues occur during reorganization:
Quick Rollback
git checkout backup/pre-reorganization
Partial Rollback
git checkout main -- path/to/restore
Full Reset
git checkout main
git branch -D reorganization/YYYYMMDD
git reset --hard backup/pre-reorganization
Success Criteria
| Metric | Minimum | Target |
|---|---|---|
| Score | 80/100 | 95/100 |
| README Coverage | 80% | 95% |
| Naming Compliance | 95% | 100% |
| Blocking Issues | 0 | 0 |
| Stray Files | 0 | 0 |
Agents Used
| Agent | Phase | Purpose |
|---|---|---|
project-structure-analyzer | Analysis | Structure analysis |
file-reorganization-orchestrator | Execution | Coordinate moves |
readme-generator | Execution | Create READMEs |
naming-convention-enforcer | Execution | Fix naming |
production-readiness-auditor | Validation | Final audit |
Commands Used
| Command | Phase | Purpose |
|---|---|---|
/organize | All | Main organization command |
/structure | Analysis | View structure |
/readme-gen | Execution | Generate READMEs |
/naming-check | Execution | Check/fix naming |
/production-audit | Validation | Final audit |
Related Workflows
Version: 1.0.0 Created: 2026-01-02 Author: CODITECT Core Team