Loading projects...
Loading projects...
# DFS based repository cleaninge engine Autonomous Repository Maintenance and Dead Component Elimination Engine. GitHub-Cleaner-Go is a production-grade automation tool that systematically traverses GitHub repositories, performs static import analysis on React codebases, identifies and removes unused UI components, validates builds post-cleanup, and commits the results without human intervention. Built for developers managing large React ecosystems where component bloat accumulates across repositories. The tool functions as an autonomous maintenance agent, reducing technical debt through programmatic dead-code elimination. ## Latest Check - Runtime: 16m 1.22s - Concurrency: 10 workers - Repositories scanned: 148 --- ## Architecture ``` +------------------------------------------------------------------------------------------+ | GitHub-Cleaner-Go Engine | +------------------+---------------------------+-------------------------------------------+ | Repository | Static Analysis | Build and Commit | | Orchestration | Pipeline | Pipeline | +------------------+---------------------------+-------------------------------------------+ | - GitHub API | - Regex Import Scan | - npm install | | - SSH Clone | - Source Graph Build | - Production Build | | - DFS Traversal | - Dead-Component ID | - Git Commit | | - Concurrent | - File Deletion | - Local Cleanup | | (5 workers) | | | +------------------+---------------------------+-------------------------------------------+ | Observability Layer | | Prometheus Metrics (:2112) + Structured JSON Logging | +------------------------------------------------------------------------------------------+ ``` The system operates as a three-stage pipeline: **repository orchestration**, **static analysis and dead-component elimination**, and **build verification and commit**. Repositories are processed concurrently (up to 5 at a time) via a goroutine pool with channel-based rate limiting. --- ## Core Features - **Autonomous Repository Discovery** - Fetches all repositories from a GitHub account via the REST API (up to 100 repos per request). - **Concurrent Processing** - Processes up to 5 repositories simultaneously using goroutines with channel-based semaphore limiting. - **Recursive Filesystem Traversal** - Walks directory trees (DFS) to locate React projects with `components/ui` directory structures. - **Regex-Based Static Import Analysis** - Scans `.ts`, `.tsx`, `.js`, `.jsx` files for import statements referencing `components/ui/*` components. - **Dead Component Elimination** - Compares used components against filesystem entries; removes orphaned components. - **Build Validation** - Executes `npm install --legacy-peer-deps && npm run build` to verify post-cleanup integrity. - **Prometheus Metrics** - Exposes real-time metrics including active workers, repos processed, clone/build durations, files deleted, and failure counters. - **Structured JSON Logging** - All operations logged with `slog` in JSON format with consistent attribute structure. - **Git Automation** - Automatically commits cleanup changes with standardized commit messages. - **Ephemeral Repository Lifecycle** - Clones, processes, and destroys local repository copies leaving no residual artifacts. --- ## Technical Workflow
A Go utility for cleaning unused UI components from React repositories