Get the FREE Ultimate OpenClaw Setup Guide →

bloat-detector

Scanned
npx machina-cli add skill athola/claude-night-market/bloat-detector --openclaw
Files (1)
SKILL.md
3.7 KB

Table of Contents

Bloat Detector

Systematically detect and eliminate codebase bloat through progressive analysis tiers.

Bloat Categories

CategoryExamples
CodeDead code, God classes, Lava flow, duplication
AI-GeneratedTab-completion bloat, vibe coding, hallucinated deps
DocumentationRedundancy, verbosity, stale content, slop
DependenciesUnused imports, dependency bloat, phantom packages
Git HistoryStale 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

DoDon't
Context usage > 30%Active feature development
Quarterly maintenanceTime-sensitive bugs
Pre-release cleanupCodebase < 1000 lines
Before major refactoringTools unavailable (Tier 2/3)

When NOT To Use

  • Active feature development
  • Time-sensitive bugs
  • Codebase < 1000 lines

Confidence Levels

LevelConfidenceAction
HIGH90-100%Safe to remove
MEDIUM70-89%Review first
LOW50-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

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

Source

git clone https://github.com/athola/claude-night-market/blob/master/plugins/conserve/skills/bloat-detector/SKILL.mdView on GitHub

Overview

Bloat-detector systematically finds and eliminates codebase bloat across multiple tiers, focusing on dead code, duplication, complexity, and documentation bloat. It helps teams trim unnecessary artifacts to improve maintainability and future refactoring readiness.

How This Skill Works

It employs progressive loading of analysis tiers: Tier 1 quick scan, Tier 2 targeted analysis with static analysis and git churn data, and Tier 3 deep audit with cross-file redundancy and readability metrics. It integrates with common tools (Bash, Grep, Glob, Read) and supports module-based remediation workflows.

When to Use It

  • Context usage > 30%
  • Quarterly maintenance
  • Pre-release cleanup
  • Before major refactoring
  • Codebase < 1000 lines

Quick Start

  1. Step 1: /bloat-scan
  2. Step 2: /bloat-scan --level 2 --focus code
  3. Step 3: /bloat-scan --level 3 --report audit.md

Best Practices

  • Run Tier 1 quick scan first to surface large files, stale code, basic duplication, and dead code indicators
  • Proceed to Tier 2 targeted analysis with static analysis (Vulture/Knip) and git churn hotspots
  • Use Tier 3 deep audit for cross-file redundancy and readability metrics when tools are available
  • Always perform a dry run and respect auto-exclusions (.venv, __pycache__, .git, node_modules, dist, build, vendor)
  • Follow remediation guidance (DELETE, REFACTOR, CONSOLIDATE, ARCHIVE) from the remediation-types module

Example Use Cases

  • Cleaning a legacy app with a large amount of dead code and God classes
  • Reducing dependency bloat and unused imports in a monorepo
  • Identifying AI-generated bloat patterns such as tab-completion bloat and hallucinated deps
  • Reducing documentation bloat by removing redundancy and verbose content
  • Pre-refactor cleanup to lower churn and improve readability before major changes

Frequently Asked Questions

Add this skill to your agents

Related Skills

Sponsor this space

Reach thousands of developers