Stop shipping smelly code. 120+ named code smells with before/after examples across C, C++, C#, Java, Python, Go, Rust, JavaScript, TypeScript & SQL โ an AI agent skill that improves code quality during both development and code review.
Drop this skill into your AI coding agent and get an expert code reviewer that:
- Identifies code smells by name โ not just "this looks bad"
- Explains why each smell is harmful and what it costs you
- Shows concrete before/after refactoring examples
- Prioritizes findings by severity so you fix the right things first
- Covers 10 languages in one skill โ no separate tools to configure
C ยท C++ ยท C# ยท Java ยท Python ยท Go ยท Rust ยท JavaScript ยท TypeScript ยท SQL
| Category | Examples |
|---|---|
| Naming & Linguistic | Abstract Names, Linguistic Confusion, Comedian Methods, Spelling Mistakes |
| Structure & Complexity | Arrow Code, Long Parameter List, Boolean Trap, Cyclomatic Complexity |
| OOP | God Objects, Shotgun Surgery, Primitive Obsession, Middle Man |
| Functional | Pure Functions, Side Effects, Hidden Assumptions, Premature Memoization |
| Testing | Float Assertions, Over-Mocking, Test Without Assertion, Tests Depending on Dates |
| Error Handling | Crowdstrike Null, Not Sanitized Input, Invalid Id = 9999 |
| Data & Types | Magic Numbers, Mutable Constants, Stringly Typed, Yoda Conditions |
| Security | Hardcoded Credentials, Insecure Random, Open Redirect |
| Concurrency | Race Condition, Global State, New Date() in Business Logic |
| SQL | N+1 Query, SELECT *, God Query, Missing Index |
| Language-Specific | Mutable Default Args (Python), .unwrap() (Rust), async void (C#), == vs === (JS) |
| Severity | Action | |
|---|---|---|
| ๐ด | Critical | Fix before merge โ bugs, crashes, security holes |
| ๐ | Major | Fix this sprint โ maintainability and design debt |
| ๐ก | Minor | Fix when you're in the area |
| ๐ต | Style | Automate with a linter |
This skill uses the Agent Skills open standard โ compatible with Claude Code, OpenAI Codex CLI, and any agent that supports SKILL.md.
# Claude Code โ install from marketplace
/plugin marketplace add barlevysh/code-smells-skill
# Any agent โ clone and copy to your skills directory
git clone https://github.com/barlevysh/code-smells-skill.git
cp -r code-smells ~/.claude/skills/ # Claude Code
cp -r code-smells ~/.codex/skills/ # OpenAI Codex CLIJust ask naturally โ the agent loads the skill automatically when code review is relevant:
Review this function for code smells.
What's wrong with this Python class?
Find all the testing smells in this file.
Explain what Shotgun Surgery is and show me an example in Go.
Each finding is reported as:
### ๐ด Crowdstrike Null
**What it is:** Dereferencing a pointer without checking for null first.
**Why it's harmful:** Causes crashes in production โ responsible for the 2024 CrowdStrike outage.
**Where found:** Line 42, processData()
Before:
int value = data->value; // CRASH if data is NULL
After:
if (data == NULL) { log_error("null data"); return; }
int value = data->value;
code-smells/
โโโ SKILL.md # Master index + workflow
โโโ references/
โโโ smells-naming.md # 13 naming & linguistic smells
โโโ smells-structure.md # 17 structural & complexity smells
โโโ smells-oop.md # 29 OOP smells
โโโ smells-functional.md # 9 functional & pure-code smells
โโโ smells-testing.md # 15 testing smells
โโโ smells-error-handling.md # 15 error handling & data smells
โโโ smells-data.md # Dead code, duplication & paradigm smells
โโโ smells-security.md # 8 security + 4 concurrency smells
โโโ smells-concurrency.md # concurrency & state smells
โโโ smells-sql.md # 11 SQL smells
โโโ smells-language-specific.md # Per-language gotchas
Uses progressive disclosure โ only relevant reference files are loaded per review, keeping context lean.
Linters catch formatting and syntax. This skill catches design problems:
- A linter can't tell you your class has Feature Envy
- A linter won't explain why Shotgun Surgery makes your codebase fragile
- A linter won't show you a before/after refactoring in your own language
- A linter won't prioritize findings by business impact
Found a smell that's missing? PRs welcome.
- Fork the repo
- Add your smell to the appropriate
references/smells-*.mdfile - Follow the existing format: name, severity, languages, definition, harm, before/after
- Update the index in
SKILL.md - Open a PR
MIT