2.2 KiB
2.2 KiB
Frontend Systematic Audit & Cleanup Plan
Goal
Perform a comprehensive audit and cleanup of the frontend/ directory to remove shadowing, duplicates, corruption (appending), and dead code.
Phase 1: Discovery (READ-ONLY)
I will conduct a comprehensive scan of the frontend/ directory to build an accurate inventory.
- File Shadowing Audit: Scan for files with overlapping names but different extensions (e.g.,
.jsvs.ts,.jsxvs.tsx) that cause build-time shadowing. - Implementation Duplicate Audit: Use content searching to find identical or near-identical function/class definitions across different files.
- Corruption Check: Scan files for duplicate symbol declarations (identifying where code was incorrectly appended rather than replaced).
- Dependency/Import Audit: Cross-reference
package.jsonwith actual imports to identify unused packages and orphaned imports in code. - Slop Identification: Locate commented-out blocks, unused variables, and dead functions.
Phase 2: Categorization (PLANNING)
I will create a structured todo list (FRONTEND_CLEANUP_TODO.md) with the following categories:
[DELETE]: Conflicting or redundant files (e.g.,client.js).[REPAIR]: Corrupted files that must be completely overwritten to remove duplicates.[CLEAN]: Files requiring removal of unused imports, variables, or dead code.[REFACTOR]: Files requiring naming or pattern consistency fixes.
Phase 3: Systematic Execution (IMPLEMENTATION)
I will execute the cleanup in this order to maintain stability:
- File Purge: Remove all files in the
[DELETE]category first to resolve shadowing. - File Repair: Use full-file rewrites for files in the
[REPAIR]category. - Slop Removal: Systematic pass through files in the
[CLEAN]category. - Verification:
- Run
npm installto ensure dependency integrity. - Run all existing tests (
npm test) and the reproduction test to confirm functionality. - Check for build errors/linting issues.
- Run
Notes
- This plan will be updated and tracked via
FRONTEND_CLEANUP_TODO.md. - No changes will be made until the Phase 2 Todo list is reviewed and approved.