Skip to content
Development
Agent

smell-catalog

A smell is a surface symptom that usually points to a deeper structural problem. Each entry names the smell, how to spot it, and the canonical behavior-preserving refactoring that addresses it. Apply one at a time, tests green between each.

From plugin
skills
954 skills54 agents

Claude Code

$ npx -y skills add vanara-agents/skills --agent claude-code

Agent definition

smell-catalog.md

Code Smell Catalogue

A smell is a surface symptom that usually points to a deeper structural problem. Each entry names the smell, how to spot it, and the canonical behavior-preserving refactoring that addresses it. Apply one at a time, tests green between each.

Bloaters

Long function

  • **Spot it:** more than ~20–50 lines, multiple levels of abstraction in one body, comments that

section it into "phases".

  • **Fix:** **Extract Function** for each phase; name each by *what* it does, not *how*.

Large class / module

  • **Spot it:** a file past ~800 lines doing several unrelated jobs.
  • **Fix:** **Extract Class / Extract Module** along responsibility lines; move related fields and the

methods that use them together.

Long parameter list

  • **Spot it:** four or more parameters, especially several passed as a group everywhere.
  • **Fix:** **Introduce Parameter Object** or **Preserve Whole Object**.

Primitive obsession

  • **Spot it:** raw strings/ints carrying domain meaning (a `string currency`, a `number cents`).
  • **Fix:** **Replace Primitive with Value Object**; centralize validation in the new type.

Conditional complexity

Deep nesting

  • **Spot it:** arrow-shaped code, 3+ nested `if`s, the happy path buried at the bottom.
  • **Fix:** **Replace Nested Conditional with Guard Clauses**; return/throw early, flatten the rest.

Switch / type-code dispatch

  • **Spot it:** the same `switch` on a type field repeated in several places.
  • **Fix:** **Replace Conditional with Polymorphism** (or a lookup table / strategy map).

Repeated boolean expressions

  • **Spot it:** the same compound condition spelled out multiple times.
  • **Fix:** **Extract Function** with an intention-revealing name (`isEligible(order)`).

Duplication

Duplicated code

  • **Spot it:** the same statements (or near-identical) in two or more places.
  • **Fix:** **Extract Function** and call it; if duplicated across classes, **Pull Up Method**.

Shotgun surgery

  • **Spot it:** one logical change forces edits in many scattered files.
  • **Fix:** **Move Method / Move Field** to gather the responsibility into one place.

Naming and clarity

Mysterious name

  • **Spot it:** `data2`, `tmp`, `doStuff`, single-letter non-loop variables.
  • **Fix:** **Rename** to reveal intent. Cheap, high value, almost always safe with tooling.

Comments compensating for unclear code

  • **Spot it:** a comment explaining *what* a block does.
  • **Fix:** **Extract Function** named after the comment, then delete the comment.

Coupling

Feature envy

  • **Spot it:** a method that reaches into another object's data more than its own.
  • **Fix:** **Move Method** to the class that owns the data.

Message chains / inappropriate intimacy

  • **Spot it:** `a.getB().getC().getD()`; objects knowing each other's internals.
  • **Fix:** **Hide Delegate**; expose intent-level methods instead of chains.

How to use this catalogue

1. Find the smell that matches what you see. 2. Confirm tests cover the code (add characterization tests if not). 3. Apply only the canonical fix, in small steps, re-running tests after each. 4. Stop when the targeted smell is gone — do not chase every smell in the file at once.

Read more
@vanara-agents
Ships withskills

🐒 Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code — free, Apache-2.0, install with one command.

917 skills54 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
9
Star history of vanara-agents/skills on GitHub, a chart by star-history.com

Other agents on skills.

AGENT

AGENT

Agent

Use when designing a new HTTP/GraphQL API or changing an existing one — modeling resources, defining endpoint contracts, choosing…

review-notes

review-notes

Agent

This shows how the api-designer agent reviews a flawed draft. Findings are severity-ranked so the implementer fixes the…

contract-and-openapi

contract-and-openapi

Agent

The contract is the deliverable. Express it as an **OpenAPI 3.1** document so it is human-readable *and* machine-checkable. This…

design-checklist

design-checklist

Agent

Run through this before declaring an API contract done. It is ordered the way you should *design*: resources first, cross-cutting…

pr-comment-template

pr-comment-template

Agent

Copy-paste templates for leaving review comments. Keep each comment to one finding: an anchor, the problem, and the fix.

More agents from other plugins.

a11y-architect
Auto-invoked

a11y-architect

Agent

Accessibility Architect specializing in WCAG 2.2 compliance for Web and Native platforms. Use PROACTIVELY when designing UI…

ecc2w293k
@affaan-m@affaan-mInstall Agent
analyze-pass-impact

analyze-pass-impact

Agent

Analyzes how a specific topic affects a group of compiler passes. Used by the /plan-update skill to parallelize research across…

react3d252k
@facebook@facebookInstall Agent
orchestrator

orchestrator

Agent

- If the user makes a simple request (such as asking for the time) which you can fulfill by running a terminal command (such as…

codex2d135k
@openai@openaiInstall Agent
cavecrew-builder

cavecrew-builder

Agent

Surgical 1-2 file edit. Typo fixes, single-function rewrites, mechanical renames, comment removal, format-preserving tweaks. Hard…

caveman4d119k
@juliusbrussee@juliusbrusseeInstall Agent

Questions about smell-catalog.

Which coding agents can use smell-catalog?
smell-catalog installs in Claude Code and Cursor: each loads subagents from .claude/agents, so copy the file there. Flowy's auto-invocation runs in Claude Code only.