a5c-ai/babysitter / library/specializations/code-migration-modernization/skills/code-smell-detector
code-smell-detector
VerifiedAutomated detection of code smells and anti-patterns to identify refactoring opportunities
README.md
View on GitHub# Code Smell Detector Skill
## Overview
The Code Smell Detector skill provides automated detection of code smells and anti-patterns. It identifies refactoring opportunities and helps prioritize technical debt remediation.
## Quick Start
### Prerequisites
- Node.js 18+
- Optional: SonarQube, PMD, ESLint, Designite
### Basic Usage
1. **Configure detection rules**
```json
{
"thresholds": {
"methodLength": 30,
"classSize": 500,
"parameterCount": 5,
"complexity": 10
}
}
```
2. **Run detection**
```bash
# The skill auto-detects smells based on language
```
3. **Review findings**
- Check smell reports by category
- Review hotspot analysis
- Follow refactoring suggestions
## Features
### Smell Categories
| Category | Examples | Severity |
|----------|----------|----------|
| Bloaters | Long Method, Large Class | High |
| Object-Orientation | Feature Envy, Refused Bequest | Medium |
| Change Preventers | Divergent Change, Shotgun Surgery | High |
| Dispensables | Dead Code, Speculative Generality | Low |
| Couplers | Inappropriate Intimacy | Medium |
### Detection Methods
- AST-based pattern matching
- Metrics threshold analysis
- Heuristic pattern detection
- Cross-reference analysis
## Configuration
```json
{
"enabledSmells": {
"longMethod": true,
"largeClass": true,
"featureEnvy": true,
"godClass": true
},
"thresholds": {
"methodLength": 30,
"classSize": 500
},
"excludePaths": ["test/", "vendor/"]
}
```
## Related Documentation
- [SKILL.md](./SKILL.md) - Full skill specification
- [Refactoring Guru - Code Smells](https://refactoring.guru/refactoring/smells)
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |