MCPInstall
athola avatar

bloat-detector

Detects codebase bloat via dead code, duplication, complexity, and doc bloat scans. Use when codebase feels large or before a release.

Installs
164
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/athola/claude-night-market --skill bloat-detector
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads bloat-detector automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

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
  • 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

Ecosystem-Level Detection

Patterns that span plugin boundaries or manifest configuration, discovered through ecosystem-wide audits.

alwaysApply Accumulation

Flag plugins with 3+ skills where alwaysApply: true. Each always-on skill injects its full text into every session, creating a baseline token floor before the user types anything. Sum the estimated_tokens fields to report total per-session cost.

Hook Registration Gaps

Compare hooks declared in plugin.json or openpackage.yml against entries in hooks.json. A hook present in hooks.json but absent from the manifest is invisible to the plugin loader and cannot be audited, versioned, or disabled through normal plugin management.

Boilerplate Footer Detection

Scan skill files for identical multi-line text blocks repeated across 10+ files (e.g., generic troubleshooting sections like "Command not found / Permission errors / Unexpected behavior"). These are copy-paste artifacts that inflate token cost without adding skill-specific value.

ToC Bloat in Skills

Skills loaded into model context gain nothing from HTML-style Tables of Contents. Detect ## Table of Contents followed by bulleted anchor-link lists. These waste tokens since the model reads sequentially, not via hyperlinks.

Unregistered Module Subdirectories

Compare files on disk in skills/*/modules/ against the modules: list in each skill's SKILL.md frontmatter. Files that exist on disk but are not listed in the manifest are invisible to progressive loading and may be dead weight or missing from the load path.

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
  • /bloat-scan command - User-facing slash command that invokes this skill; there is no separate bloat-scan skill

Exit Criteria

  • At least one tier of scan (Tier 1, 2, or 3) completed and findings listed per bloat category (Code, AI-Generated, Documentation, Dependencies, Git History)
  • Each finding assigned a confidence level (HIGH/MEDIUM/LOW) and a priority score computed from the formula `(Token_Savings × 0.4) + (Maintenance × 0.3) + (Confidence × 0.2)
    • (Ease × 0.1)`
  • No auto-deletions executed without explicit user approval; every proposed removal documented as DELETE, REFACTOR, CONSOLIDATE, or ARCHIVE per modules/remediation-types.md
  • Ecosystem-level patterns checked (alwaysApply accumulation, hook registration gaps, boilerplate footers, ToC bloat) if the scan target contains plugin directories

FAQ

What does the bloat-detector skill do?

Detects codebase bloat via dead code, duplication, complexity, and doc bloat scans. Use when codebase feels large or before a release.

How do I install bloat-detector?

Run npx skills add https://github.com/athola/claude-night-market --skill bloat-detector in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/bloat-detector/ (personal) or .claude/skills/bloat-detector/ (project).

Which AI agents can use bloat-detector?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is bloat-detector safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains bloat-detector?

It is published by athola in athola/claude-night-market. It has 164 recorded installs.

More from athola/claude-night-market

View all →
athola avatar

project-planning

athola/claude-night-market

Converts a specification into a phased, dependency-ordered implementation plan. Use after specification is complete and before execution begins.

athola avatar

code-quality-principles

athola/claude-night-market

Applies KISS, YAGNI, and SOLID principles for clean code with reduced complexity. Use when refactoring or reviewing code for over-engineering.

athola avatar

slop-detector

athola/claude-night-market

Detects AI-generated writing patterns in prose. Use when reviewing docs for slop, vague language, or identity leaks before publishing.

Docs & Writing183 installs
athola avatar

doc-generator

athola/claude-night-market

Generates or remediates documentation with human-quality writing. Use when creating new docs, rewriting AI-generated content, or applying style profiles.

Docs & Writing162 installs
athola avatar

project-brainstorming

athola/claude-night-market

Guides project ideation via Socratic questioning to produce a validated brief. Use before specification when requirements are unclear.

161 installs
athola avatar

shell-review

athola/claude-night-market

Audits shell scripts for correctness, portability, and common pitfalls. Use when reviewing shell scripts or before committing shell changes.

Popular code quality & workflow skills

View category →
mattpocock avatar

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

mattpocock avatar

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

mattpocock avatar

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

mattpocock avatar

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

mattpocock avatar

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.