code-smells-skill

code-smells-skill is a skill for OpenCode from darellchua2/opencode-config-template. It costs 35 tokens per session (4,210 once invoked), scanned C, original, Apache-2.0.

A guide for finding code smells, which are warning signs of design problems rather than direct bugs, and choosing refactoring steps to address them.

In plain words
What is it for?
Use it during code reviews, legacy-code refactoring, cleanup work, standards setup, or teaching developers about design problems.
Why use it?
It helps explain why code is difficult to change or test and turns broad concerns into specific cleanup tasks.

Skill for OpenCode

Written for OpenCode: installed under .opencode/. Also seen: positional $N argument; mentions OpenCode.

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/darellchua2/opencode-config-template/code-smells-skill
Any agent
npx skills add darellchua2/opencode-config-template --skill code-smells-skill
Clone the repo
git clone --depth 1 https://github.com/darellchua2/opencode-config-template

Made for: OpenCode.

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 code-smells-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/code-smells-skill.svg)](https://agentmods.dev/skills/darellchua2/opencode-config-template/code-smells-skill)
Your own site
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/code-smells-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/code-smells-skill.svg" alt="Measured on agentmods" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,210 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.1 $0.00035 $0.04210
Opus 5 $0.00017 $0.02105
Sonnet 5 $0.00007 $0.00842
Haiku 4.5 $0.00003 $0.00421

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

Security

Grade C, and why

code-smells-skill scanned grade C with 1 finding 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 3d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

When protocol is enabled, this skill defaults to `Iterations: 10` (sufficient for typical single-pass workflows). Override with `Iterations: N` for specific tasks. Safety blocks: `.env`, `node_modules/`, `rm -rf`, `git p
opencode_app/.opencode/skills/code-smells-skill/SKILL.md · 603 lines

How it starts

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

What I do

I help you identify and eliminate code smells that make code hard to maintain:

  1. Detect Code Smells: Identify indicators of design problems in your code
  2. Categorize Smells: Classify smells into bloaters, OO abusers, change preventers, dispensables, and couplers
  3. Provide Refactoring Guidance: Show concrete fixes with before/after code examples
  4. Prioritize Fixes: Rank smells by impact and difficulty
  5. Prevent Future Smells: Apply prevention strategies during development
  6. Integrate with SOLID: Show how fixing smells improves SOLID compliance

When to use me

Use this skill when:

  • Code feels "wrong" but you can't articulate why
  • Reviewing code for quality issues
  • Refactoring legacy code
  • Teaching developers to recognize design problems
  • Preparing for a code review
  • Setting up coding standards for a team
  • During code cleanup sprints

Prerequisites

  • Understanding of basic code smells
  • Code to analyze
  • Willingness to refactor
  • Knowledge of refactoring techniques

What Are Code Smells?

Indicators that something MAY be wrong. Not bugs, but design problems that make code hard to understand, change, or test.


The Five Categories

1. Bloaters

Code that has grown too large.

Smell Symptom Refactoring
Long Method > 10 lines Extract Method
Large Class > 50 lines, multiple responsibilities Extract Class
Long Parameter List > 3 parameters Introduce Parameter Object
Data Clumps Same group of variables appear together Extract Class
Primitive Obsession Primitives instead of small objects Wrap in Value Object

2. Object-Orientation Abusers

Misuse of OO principles.

Smell Symptom Refactoring
Switch Statements Type checking, large switch/if-else Replace with Polymorphism
Parallel Inheritance Adding subclass requires adding another Merge Hierarchies
Refused Bequest Subclass doesn't use parent methods Replace Inheritance with Delegation
Alternative Classes Different interfaces, same concept Rename, Extract Superclass

Read the full file on GitHub · 603 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. 3d ago First seen · 603 lines · 35 tokens per session scan C d99d3cfc96eb

Subscribe to this mod's changes

code-smells-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed today), licensed Apache-2.0. It adds 35 tokens to every session and 4,210 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

recipe-front-review

Reviews completed frontend implementation for governing-source compliance, scope economy, repository quality, and security, then applies user-approved React corrections.

shinpr/claude-code-workflows · 29 tokens

brooks-sweep

Full-sweep mode: runs a unified analysis across all quality dimensions — code decay, architecture, tech debt, and test quality — then applies fixes directly to the codebase. Safe changes are auto-applied; risky changes are confirmed before execution. Drawing on twelve classic engineering books. Triggers when: user…

hyhmrright/brooks-lint · 178 tokens

dorodango

Polishes working code through successive quality passes in fresh subagents. Use after tests pass when code needs multi-dimension refinement before release.

athola/claude-night-market · 31 tokens

ring:searching-code

Forensic code search and analysis with optional Chain of Draft (CoD) ultra-concise mode. Five-phase methodology (clarification, planning, execution, analysis, synthesis) with severity assessment. Use for targeted investigation of specific patterns, bugs, or vulnerabilities. Skip for broad architecture mapping (use…

LerianStudio/ring · 74 tokens

ring:exploring-codebases

Exploring a codebase across phases: scopes the target, detects architecture, components, and layers, deep-dives each discovered perspective, then synthesizes findings into actionable guidance with file:line evidence. Use to understand how a feature or system works before planning changes, or to orient on an unfamiliar…

LerianStudio/ring · 91 tokens

ring:planning-codebase-simplification

Planning a whole-codebase simplification: audits a Go/TS codebase for needless abstraction and emits a KILL/REVIEW/KEEP plan plus a ring:running-dev-cycle task array. Plans only — no edits. Detects single-impl interfaces, pass-through shims, translation-free adapters, and dead-code cascade chains under an inverted…

LerianStudio/ring · 105 tokens