From codebase-analyzer
Use when evaluating code health, finding bug hotspots, identifying anti-patterns, preparing a quality improvement plan, or assessing technical debt
How this skill is triggered — by the user, by Claude, or both
Slash command
/codebase-analyzer:analyzing-code-qualityThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Identify quality patterns, anti-patterns, complexity hotspots, and risk areas that make code hard to maintain.
Identify quality patterns, anti-patterns, complexity hotspots, and risk areas that make code hard to maintain.
| Anti-Pattern | Detection | Risk |
|---|---|---|
| God class | >500 lines, >15 methods | High |
| Long method | >50 lines | Medium |
| Deep nesting | >4 levels of if/for | High |
| Feature envy | Method uses another class more than its own | Medium |
| Duplicated code | Similar blocks in 3+ files | Medium |
| Missing error handling | try/catch absent around IO | High |
trace-codebase-provenanceanalyze-build-pipelineA file that changes frequently AND has high complexity is a bug factory. A file that changes frequently but is simple is just a configuration hub. The CORRELATION is the insight, not the individual metrics. Use git log --format='%H' --name-only to find high-churn files, then cross-reference with complexity. For churn analysis commands, see _shared/references/git-archaeology-techniques.md.
Code quality degrades from edges inward. Entry points and API handlers are polished. Internal services and data access layers accumulate debt. Check the gradient to find where debt hides. A codebase that is clean at the edges but rotten in the middle has a steeper remediation curve than one with uniform moderate quality.
High churn in auth/security files = unstable security posture. Complexity in data handling = injection risk. Missing error handling in financial calculations = correctness risk. These correlations are not theoretical -- they predict where the next incident originates.
Poor code quality in specific areas may be intentional. A deliberately complex function that could be simple may be obfuscating behavior. Check: is the complexity accidental (incompetence) or deliberate (obfuscation)? Consistent patterns of poor quality in ONE area suggest intent.
Write docs/analysis/code-quality.md using standard contract.
Include: hotspot list, anti-pattern findings, quality score assessment, priority recommendations.
Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
npx claudepluginhub quangphu1912/codebase-analyzer --plugin codebase-analyzer