detect-code-smells

detect-code-smells is a skill for Claude Code, Codex from mickeyyaya/refactoring-skills. It costs 37 tokens per session (2,324 once invoked), scanned A, original, MIT.

A guide to code smells: visible signs that code is becoming difficult to understand, test, or change. A smell is not necessarily a bug, but it can point to deeper design problems.

In plain words
What is it for?
Use it during code review or before refactoring to spot long methods, oversized classes, repeated data, overly long parameter lists, and complicated conditional logic.
Why use it?
It helps identify structural problems before refactoring, especially when one module has grown too large, logic is copied, or small changes require editing unrelated parts of the codebase.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it during code review or before refactoring to spot long methods…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/mickeyyaya/refactoring-skills/detect-code-smells
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add mickeyyaya/refactoring-skills --skill detect-code-smells
Clone the repo
git clone --depth 1 https://github.com/mickeyyaya/refactoring-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for detect-code-smells

README.md
[![agentmods](https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/detect-code-smells.svg)](https://agentmods.dev/skills/mickeyyaya/refactoring-skills/detect-code-smells)
Your own site
<a href="https://agentmods.dev/skills/mickeyyaya/refactoring-skills/detect-code-smells"><img src="https://agentmods.dev/badge/skills/mickeyyaya/refactoring-skills/detect-code-smells.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,324 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.02324
Opus 5 $0.00018 $0.01162
Sonnet 5 $0.00007 $0.00465
Haiku 4.5 $0.00004 $0.00232

Measured 6d ago against content hash 1863b581f729, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

detect-code-smells scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/detect-code-smells/SKILL.md · 192 lines

How it starts

The opening of the file, as written. The whole thing — 192 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Detect Code Smells

Overview

Code smells are surface indicators of deeper structural problems. They don't cause bugs directly but signal design weaknesses that slow development and increase bug risk. Detecting smells is the first step before applying targeted refactoring.

When to Use

  • Code review reveals hard-to-read or hard-to-change sections
  • A class or method has grown significantly over time
  • Adding a feature requires touching many unrelated files
  • Copy-pasted logic across the codebase
  • Tests are brittle or hard to write for a module

Quick Reference

Category Smell Key Symptom Primary Fix (Skill)
Bloaters Long Method Method > 20 lines doing multiple things refactor-composing-methods
Bloaters Large Class Too many fields/methods/lines refactor-moving-features
Bloaters Primitive Obsession Primitives instead of small objects refactor-organizing-data
Bloaters Long Parameter List 4+ parameters refactor-simplifying-method-calls
Bloaters Data Clumps Same variables appear together repeatedly refactor-organizing-data
OO Abusers Switch Statements Complex switch/if-else on type codes refactor-simplifying-conditionals
OO Abusers Temporary Field Fields only set in certain circumstances refactor-organizing-data
OO Abusers Refused Bequest Subclass uses little of parent's interface refactor-generalization
OO Abusers Alternative Classes w/ Different Interfaces Same thing, different method names refactor-generalization
Change Preventers Divergent Change One class changed for many different reasons refactor-moving-features
Change Preventers Shotgun Surgery One change requires edits across many classes refactor-moving-features
Change Preventers Parallel Inheritance Hierarchies Adding subclass in one hierarchy requires another refactor-generalization
Dispensables Comments (excessive) Code needs extensive comments to be understood refactor-composing-methods
Dispensables Duplicate Code Identical or similar code in multiple places refactor-composing-methods
Dispensables Lazy Class Class does too little to justify existence refactor-moving-features
Dispensables Data Class Only fields and getters/setters, no behavior refactor-organizing-data
Dispensables Dead Code Unreachable or unused code refactor-composing-methods
Dispensables Speculative Generality Unused abstractions "just in case" refactor-generalization
Couplers Feature Envy Method uses another class's data more than its own refactor-moving-features
Couplers Inappropriate Intimacy Classes access each other's internals excessively refactor-moving-features
Couplers Message Chains a.getB().getC().getD() chains refactor-moving-features
Couplers Middle Man Class delegates most work to another class refactor-moving-features
Couplers Incomplete Library Class Library doesn't provide needed functionality refactor-moving-features

Read the full file on GitHub · 192 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 192 lines · 37 tokens per session scan A 1863b581f729

Subscribe to this mod's changes

detect-code-smells is a skill published in the GitHub repository mickeyyaya/refactoring-skills (6 stars, last pushed 5mo ago), licensed MIT. It adds 37 tokens to every session and 2,324 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.