Skip to content

a5c-ai/babysitter / library/specializations/code-migration-modernization/skills/code-smell-detector

code-smell-detector

Verified

Automated detection of code smells and anti-patterns to identify refactoring opportunities

FileKindSize
README.mdmarkdown1.7 KB
SKILL.mdskill md3.5 KB
# 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)
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 implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
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 alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall