clean-code-detect-smells

clean-code-detect-smells is a skill for Claude Code, Codex from helmedeiros/clean-code-skills. It costs 50 tokens per session (952 once invoked), scanned A, original, MIT.

A code-review guide for finding code smells: patterns that suggest deeper design problems even when the code still works.

In plain words
What is it for?
Use it to assess code quality, identify oversized or overly connected code, prepare refactoring plans, and structure code-review feedback.
Why use it?
It helps reveal technical debt and hard-to-change code before those problems make future changes riskier or more expensive.

Skill for Claude CodeCodex

Part of the clean-code-skills plugin — 21 skills, 2 commands shipped together

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.

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

Made for: Claude Code, Codex.

Or install clean-code-skills, the plugin that ships this one along with the rest of its 21 skills, 2 commands.

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 clean-code-detect-smells

README.md
[![agentmods](https://agentmods.dev/badge/skills/helmedeiros/clean-code-skills/clean-code-detect-smells.svg)](https://agentmods.dev/skills/helmedeiros/clean-code-skills/clean-code-detect-smells)
Your own site
<a href="https://agentmods.dev/skills/helmedeiros/clean-code-skills/clean-code-detect-smells"><img src="https://agentmods.dev/badge/skills/helmedeiros/clean-code-skills/clean-code-detect-smells.svg" alt="Measured on agentmods" height="20"></a>
Per session 50 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 952 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00050 $0.00952
Opus 5 $0.00025 $0.00476
Sonnet 5 $0.00010 $0.00190
Haiku 4.5 $0.00005 $0.00095

Measured 5d ago against content hash 7d3211c48ca0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

clean-code-detect-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 5d 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/clean-code-detect-smells/SKILL.md · 98 lines

How it starts

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

Clean Code: Detect Code Smells

Systematically identify code smells — surface indicators of deeper design problems — and prioritize them for refactoring.

When This Skill Applies

  • Reviewing code for quality issues
  • The codebase feels "hard to work with" but the problems are not obvious
  • The user mentions code smells, technical debt, or code quality
  • Preparing a refactoring plan
  • During code review to provide structured feedback

Core Principle

A code smell is a surface indication that usually corresponds to a deeper problem in the system. Smells are not bugs — the code works. But they signal that the design is becoming harder to understand, modify, or extend. Detecting smells early prevents them from compounding into costly structural problems.

Workflow

Step 1: Scan for Bloater Smells

Look for entities that have grown too large: long methods, large classes, long parameter lists, data clumps, primitive obsession.

Step 2: Scan for Coupler Smells

Look for excessive coupling: feature envy, inappropriate intimacy, message chains, middle man.

Step 3: Scan for Change-Prevention Smells

Look for patterns that make changes risky: divergent change (one class changed for many reasons), shotgun surgery (one change touches many classes), parallel inheritance hierarchies.

Step 4: Scan for Dispensable Smells

Look for things that should not exist: dead code, speculative generality, lazy class, duplicate code, unnecessary comments.

Step 5: Prioritize by Impact

Rate each smell by: frequency (how often it occurs), impact (how much it slows development), and effort (how hard it is to fix). Fix high-frequency, high-impact, low-effort smells first.

Detection / Indicators

Bloaters

Smell Detection Rule
Long Method More than 15 lines of logic
Large Class More than 200 lines or 7+ public methods
Long Parameter List More than 3 parameters
Data Clumps Same group of fields appears together in multiple places
Primitive Obsession Using strings, numbers, or booleans instead of value objects

Read the full file on GitHub · 98 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 5d ago First seen · 98 lines · 50 tokens per session scan A 7d3211c48ca0

Subscribe to this mod's changes

clean-code-detect-smells is a skill published in the GitHub repository helmedeiros/clean-code-skills (2 stars, last pushed 6mo ago), licensed MIT. It adds 50 tokens to every session and 952 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

codex-setup

Initialize sd0x-dev-flow infrastructure for Codex CLI and other non-Claude agents. Generates AGENTS.md, installs the commit-msg hook, copies runner scripts. The pre-push gate is opt-in via --with-push-gate. Use when setting up a new project or after updating skills.

sd0xdev/sd0x-harness · 65 tokens

codex-implement

Implement features via Codex exec. Use when: writing new code from specs, implementing features, Codex-driven development. Not for: code review (use codex-code-review), architecture advice (use codex-architect). Output: implemented code + review loop.

sd0xdev/sd0x-harness · 58 tokens

orchestrate

Agent-driven workflow orchestration (v1 report-only). Use when: declaring an intent (audit/research/feature shape) and wanting a planner agent to derive the skill workflow, preview it, and run read-only fanout with fail-closed no-change verification. Not for: executing mutating steps (v1 emits them as…

sd0xdev/sd0x-harness · 107 tokens

recap-doc

Post-development recap document generator. Use when: AI/Codex has implemented a feature and the user needs a guided walkthrough of what changed and why, with blind-spot detection and anticipated questions. Not for: Q&A follow-up (use /recap-ask), technical share-out for teammates (use /tech-brief), or generic code…

sd0xdev/sd0x-harness · 114 tokens

runbook

Generate and update feature release runbooks from existing docs and codebase. Use when: creating operational runbook, release handbook, deployment checklist, pre-release preparation. Not for: incident response (v2), code review (use codex-code-review), architecture design (use architecture).

sd0xdev/sd0x-harness · 59 tokens

test-review

Test coverage review via Codex exec. Use when: reviewing test sufficiency, identifying coverage gaps, test quality audit. Not for: generating tests (use codex-test-gen), code review (use codex-code-review). Output: coverage analysis + gap report.

sd0xdev/sd0x-harness · 56 tokens