Analyze codebases for anti-patterns, code smells, and quality issues using ast-grep structural pattern matching. Use when reviewing code quality, identifying technical debt, or performing comprehensive code analysis across JavaScript, TypeScript, Python, Vue, React, or other supported languages.
View on GitHublaurigates/claude-plugins
code-quality-plugin
January 24, 2026
Select agents to install to:
npx add-skill https://github.com/laurigates/claude-plugins/blob/main/code-quality-plugin/skills/code-antipatterns-analysis/SKILL.md -a claude-code --skill code-antipatterns-analysisInstallation paths:
.claude/skills/code-antipatterns-analysis/# Code Anti-patterns Analysis
Expert knowledge for systematic detection and analysis of anti-patterns, code smells, and quality issues across codebases using ast-grep and parallel agent delegation.
## Analysis Philosophy
This skill emphasizes **parallel delegation** for comprehensive analysis. Rather than sequentially scanning for issues, launch multiple specialized agents to examine different categories simultaneously, then consolidate findings.
## Analysis Categories
### 1. JavaScript/TypeScript Anti-patterns
**Callback Hell & Async Issues**
```bash
# Nested callbacks (3+ levels)
ast-grep -p '$FUNC($$$, function($$$) { $FUNC2($$$, function($$$) { $$$ }) })' --lang js
# Missing error handling in async
ast-grep -p 'async function $NAME($$$) { $$$ }' --lang js
# Then check if try-catch is present
# Unhandled promise rejection
ast-grep -p '$PROMISE.then($$$)' --lang js
# Without .catch() - use composite rule
```
**Magic Values**
```bash
# Magic numbers in comparisons
ast-grep -p 'if ($VAR > 100)' --lang js
ast-grep -p 'if ($VAR < 50)' --lang js
ast-grep -p 'if ($VAR === 42)' --lang js
# Magic strings
ast-grep -p "if ($VAR === 'admin')" --lang js
```
**Empty Catch Blocks**
```bash
ast-grep -p 'try { $$$ } catch ($E) { }' --lang js
```
**Console Statements (Debug Leftovers)**
```bash
ast-grep -p 'console.log($$$)' --lang js
ast-grep -p 'console.debug($$$)' --lang js
ast-grep -p 'console.warn($$$)' --lang js
```
**var Instead of let/const**
```bash
ast-grep -p 'var $VAR = $$$' --lang js
```
### 2. Vue 3 Anti-patterns
**Props Mutation**
```yaml
# YAML rule for props mutation detection
id: vue-props-mutation
language: JavaScript
message: Avoid mutating props directly
rule:
pattern: props.$PROP = $VALUE
```
```bash
# Direct prop assignment
ast-grep -p 'props.$PROP = $VALUE' --lang js
```
**Missing Keys in v-for**
```bash
# Search in Vue templates
ast-grep -p 'v-for="$ITEM in $LIST"' --lang html
# Check if :key is present nearby
```
**Options API in Compo