|
| 1 | +--- |
| 2 | +id: TASK-019 |
| 3 | +type: cleanup |
| 4 | +priority: high |
| 5 | +status: done |
| 6 | +--- |
| 7 | + |
| 8 | +# Repository Structure Cleanup and Organization |
| 9 | + |
| 10 | +## Description |
| 11 | +The repository root directory contains numerous files that need to be properly organized, moved to appropriate locations, or removed if unnecessary. This creates maintenance challenges, makes the repository harder to navigate, and can cause confusion for new contributors. A comprehensive cleanup is needed to ensure a clean, organized repository structure that follows best practices. |
| 12 | + |
| 13 | +## Acceptance Criteria |
| 14 | +- [x] Audit all files in the repository root directory |
| 15 | +- [x] Categorize each file as: |
| 16 | + - Essential to be in root |
| 17 | + - Needs to be moved to appropriate subdirectory |
| 18 | + - Temporary/generated (should be removed and added to .gitignore) |
| 19 | + - Obsolete/unused (should be deleted) |
| 20 | +- [x] Move configuration files to a `config` directory where appropriate |
| 21 | +- [x] Ensure all temporary files are properly added to .gitignore |
| 22 | +- [x] Consolidate test-related files to the `tests` directory |
| 23 | +- [x] Move scripts to the `scripts` directory |
| 24 | +- [x] Update documentation to reflect the new structure |
| 25 | +- [x] Ensure no functionality is broken by the reorganization |
| 26 | +- [x] Create a clear README section on repository structure |
| 27 | + |
| 28 | +## Files to Assess (Preliminary List) |
| 29 | +- `.coverage` files (likely temporary, should be in .gitignore) |
| 30 | +- `.cursor` directory (IDE-specific, evaluate if needed) |
| 31 | +- `.docker` directory (evaluate purpose and location) |
| 32 | +- `.files-db-mcp` directory (evaluate if this should be in .gitignore) |
| 33 | +- `CLAUDE.md` (determine purpose, might need a better location) |
| 34 | +- `claude_mcp_server.py` (assess if it should be in src) |
| 35 | +- `claude_mcp_test_summary.md` (likely belongs in test documentation) |
| 36 | +- `conversation_summary.md` (determine purpose and appropriate location) |
| 37 | +- `coverage.xml` (add to .gitignore, is a generated file) |
| 38 | +- `coverage_html` directory (add to .gitignore, is a generated directory) |
| 39 | +- `server.log` (should be in .gitignore) |
| 40 | +- `test_mcp.py` (should be in the tests directory) |
| 41 | +- `test-coverage-message.txt` (determine purpose, might belong in tests) |
| 42 | + |
| 43 | +## Implementation Details |
| 44 | + |
| 45 | +1. **Root Directory Assessment** |
| 46 | + - Determine which files are essential in root: |
| 47 | + - `README.md`, `LICENSE`, `pyproject.toml` typically belong in root |
| 48 | + - Configuration files like `.gitignore`, `.dockerignore` should stay in root |
| 49 | + - `Dockerfile`, `docker-compose.yml` are conventionally kept in root |
| 50 | + - Installation scripts and runners (`install.sh`, `run.sh`, `setup.sh`) often are kept in root for convenience |
| 51 | + |
| 52 | + - Identify files to be moved: |
| 53 | + - Python code files should be in `src` or appropriate module directories |
| 54 | + - Test files should be in `tests` |
| 55 | + - Documentation should be in `docs` |
| 56 | + - Helper scripts should be in `scripts` |
| 57 | + |
| 58 | + - Identify files to be added to .gitignore: |
| 59 | + - Generated files (`.coverage`, `coverage.xml`, `*.log`, etc.) |
| 60 | + - IDE-specific directories (`.vscode`, `.idea`, etc.) |
| 61 | + - Local environment files that shouldn't be shared |
| 62 | + |
| 63 | +2. **Directory Structure Recommendations** |
| 64 | + - Consider creating: |
| 65 | + - `config/` for configuration files that don't need to be in root |
| 66 | + - `tools/` for development and maintenance tools |
| 67 | + - `examples/` for example usage patterns |
| 68 | + - Ensure tests are properly organized by test type (unit, integration) |
| 69 | + |
| 70 | +3. **Cleanup Process** |
| 71 | + - Create proper backups before moving/deleting files |
| 72 | + - Implement changes incrementally, with testing after each significant change |
| 73 | + - Update import paths in code after moving Python files |
| 74 | + - Ensure CI/CD pipeline still works after reorganization |
| 75 | + |
| 76 | +## Testing Approach |
| 77 | +After reorganization, verify: |
| 78 | +- All tests still pass |
| 79 | +- Application can be built and run |
| 80 | +- Installation scripts still work |
| 81 | +- Documentation is accurate and up-to-date |
| 82 | +- CI/CD pipeline functions as expected |
| 83 | + |
| 84 | +## Related Tasks |
| 85 | +- TASK-015: Create CI/CD pipeline with Docker (might need updates after reorganization) |
| 86 | +- TASK-011: Comprehensive documentation (will need updates to reflect new structure) |
| 87 | +- TASK-018: Prepare v0.1.0 Beta Release (this cleanup should be completed before release) |
| 88 | + |
| 89 | +## Notes |
| 90 | +This task is critical for both maintainability and the upcoming beta release. A well-organized repository is essential for project longevity and contributor onboarding. The cleanup should focus on making the repository structure intuitive and aligned with Python project best practices. |
0 commit comments