Table of Contents
Bloat Detector
Systematically detect and eliminate codebase bloat through progressive analysis tiers.
Bloat Categories
| Category |
Examples |
| Code |
Dead code, God classes, Lava flow, duplication |
| AI-Generated |
Tab-completion bloat, vibe coding, hallucinated deps |
| Documentation |
Redundancy, verbosity, stale content, slop |
| Dependencies |
Unused imports, dependency bloat, phantom packages |
| Git History |
Stale files, low-churn code, massive single commits |
Quick Start
Tier 1: Quick Scan (2-5 min, no tools)
/bloat-scan
Detects: Large files, stale code, old TODOs, commented blocks, basic duplication
Tier 2: Targeted Analysis (10-20 min, optional tools)
/bloat-scan --level 2 --focus code # or docs, deps
Adds: Static analysis (Vulture/Knip), git churn hotspots, doc similarity
Tier 3: Deep Audit (30-60 min, full tooling)
/bloat-scan --level 3 --report audit.md
Adds: Cross-file redundancy, dependency graphs, readability metrics
When To Use
| Do |
Don't |
| Context usage > 30% |
Active feature development |
| Quarterly maintenance |
Time-sensitive bugs |
| Pre-release cleanup |
Codebase < 1000 lines |
| Before major refactoring |
Tools unavailable (Tier 2/3) |
When NOT To Use
- Active feature development
- Time-sensitive bugs
- Codebase < 1000 lines
Confidence Levels
| Level |
Confidence |
Action |
| HIGH |
90-100% |
Safe to remove |
| MEDIUM |
70-89% |
Review first |
| LOW |
50-69% |
Investigate |
Prioritization
Priority = (Token_Savings × 0.4) + (Maintenance × 0.3) + (Confidence × 0.2) + (Ease × 0.1)
Module Architecture
Tier 1 (always available):
- See
modules/quick-scan.md - Heuristics, no tools
- See
modules/git-history-analysis.md - Staleness, churn, vibe coding signatures
- See
modules/growth-analysis.md - Growth velocity, forecasts, threshold alerts
Tier 2 (optional tools):
- See
modules/code-bloat-patterns.md - Anti-patterns (God class, Lava flow)
- See
modules/ai-generated-bloat.md - AI-specific patterns (Tab bloat, hallucinations)
- See
modules/documentation-bloat.md - Redundancy, readability, slop detection
- See
modules/static-analysis-integration.md - Vulture, Knip
Shared:
- See
modules/remediation-types.md - DELETE, REFACTOR, CONSOLIDATE, ARCHIVE
Auto-Exclusions
Always excludes: .venv, __pycache__, .git, node_modules, dist, build, vendor
Also respects: .gitignore, .bloat-ignore
Safety
- Never auto-delete - all changes require approval
- Dry-run support -
--dry-run for previews
- Backup branches - created before bulk changes
Related
bloat-auditor agent - Executes scans
unbloat-remediator agent - Safe remediation
context-optimization skill - MECW principles
1---2name: bloat-detector3description: 'Detect codebase bloat through progressive analysis: dead code, duplication,4 complexity, documentation bloat. Use when context usage high, quarterly maintenance,5 pre-release cleanup, before refactoring. Do not use when active feature development,6 time-sensitive bugs, codebase < 1000 lines.'7category: conservation8tags:9- bloat10- cleanup11- static-analysis12- technical-debt13- optimization14tools:15- Bash16- Grep17- Glob18- Read19modules:20- quick-scan21- git-history-analysis22- growth-analysis23- code-bloat-patterns24- ai-generated-bloat25- documentation-bloat26- static-analysis-integration27- remediation-types28progressive_loading: true29estimated_tokens: 40030metadata:31 source: https://skillmd.com/skills/micsapp/bloat-detector32---3334## Table of Contents3536- [Bloat Categories](#bloat-categories)37- [Quick Start](#quick-start)38- [When to Use](#when-to-use)39- [Confidence Levels](#confidence-levels)40- [Prioritization](#prioritization)41- [Module Architecture](#module-architecture)42- [Safety](#safety)4344# Bloat Detector4546Systematically detect and eliminate codebase bloat through progressive analysis tiers.4748## Bloat Categories4950| Category | Examples |51|----------|----------|52| **Code** | Dead code, God classes, Lava flow, duplication |53| **AI-Generated** | Tab-completion bloat, vibe coding, hallucinated deps |54| **Documentation** | Redundancy, verbosity, stale content, slop |55| **Dependencies** | Unused imports, dependency bloat, phantom packages |56| **Git History** | Stale files, low-churn code, massive single commits |5758## Quick Start5960### Tier 1: Quick Scan (2-5 min, no tools)61```bash62/bloat-scan63```64Detects: Large files, stale code, old TODOs, commented blocks, basic duplication6566### Tier 2: Targeted Analysis (10-20 min, optional tools)67```bash68/bloat-scan --level 2 --focus code # or docs, deps69```70Adds: Static analysis (Vulture/Knip), git churn hotspots, doc similarity7172### Tier 3: Deep Audit (30-60 min, full tooling)73```bash74/bloat-scan --level 3 --report audit.md75```76Adds: Cross-file redundancy, dependency graphs, readability metrics7778## When To Use7980| Do | Don't |81|----|-------|82| Context usage > 30% | Active feature development |83| Quarterly maintenance | Time-sensitive bugs |84| Pre-release cleanup | Codebase < 1000 lines |85| Before major refactoring | Tools unavailable (Tier 2/3) |8687## When NOT To Use8889- Active feature development90- Time-sensitive bugs91- Codebase < 1000 lines9293## Confidence Levels9495| Level | Confidence | Action |96|-------|------------|--------|97| HIGH | 90-100% | Safe to remove |98| MEDIUM | 70-89% | Review first |99| LOW | 50-69% | Investigate |100101## Prioritization102103```104Priority = (Token_Savings × 0.4) + (Maintenance × 0.3) + (Confidence × 0.2) + (Ease × 0.1)105```106107## Module Architecture108109**Tier 1** (always available):110- See `modules/quick-scan.md` - Heuristics, no tools111- See `modules/git-history-analysis.md` - Staleness, churn, vibe coding signatures112- See `modules/growth-analysis.md` - Growth velocity, forecasts, threshold alerts113114**Tier 2** (optional tools):115- See `modules/code-bloat-patterns.md` - Anti-patterns (God class, Lava flow)116- See `modules/ai-generated-bloat.md` - AI-specific patterns (Tab bloat, hallucinations)117- See `modules/documentation-bloat.md` - Redundancy, readability, slop detection118- See `modules/static-analysis-integration.md` - Vulture, Knip119120**Shared**:121- See `modules/remediation-types.md` - DELETE, REFACTOR, CONSOLIDATE, ARCHIVE122123## Auto-Exclusions124125Always excludes: `.venv`, `__pycache__`, `.git`, `node_modules`, `dist`, `build`, `vendor`126127Also respects: `.gitignore`, `.bloat-ignore`128129## Safety130131- **Never auto-delete** - all changes require approval132- **Dry-run support** - `--dry-run` for previews133- **Backup branches** - created before bulk changes134135## Related136137- `bloat-auditor` agent - Executes scans138- `unbloat-remediator` agent - Safe remediation139- `context-optimization` skill - MECW principles