{"data":{"slug":"discovered-15b724525e91a1143503f26c67080b05d32c5e86929e7c14","title":"Code Smells","summary":"Identify and address 12 common code smells using a vocabulary derived from Martin Fowler's *Refactoring*, aiding in code quality reviews, pull request assessments, or determining if code is clean.","url":"https:\/\/skillshunter.net\/skills\/discovered-15b724525e91a1143503f26c67080b05d32c5e86929e7c14","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/discovered-15b724525e91a1143503f26c67080b05d32c5e86929e7c14","markdown_url":"https:\/\/skillshunter.net\/skills\/discovered-15b724525e91a1143503f26c67080b05d32c5e86929e7c14.md","download_url":"https:\/\/skillshunter.net\/skills\/discovered-15b724525e91a1143503f26c67080b05d32c5e86929e7c14\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before applying the code smell review, ensure that the project's house standards (e.g., `CLAUDE.md`, `AGENTS.md`, lint config, or style guide) are followed. If a file is marked as 'small edits only,' treat any flagged smell as a note, not a reason for restructuring.","instructions":"---\nname: code-smells\ndescription: A 12-smell review vocabulary, named warning signs from Fowler's Refactoring, each with its fix. Use when reviewing code quality, judging a diff or pull request, or asked whether code is clean.\nmetadata:\n  source: https:\/\/github.com\/mattpocock\/skills (code-review, the smell list)\n  license: MIT\n  pinned: \"2026-11-28. Smell list adapted from mattpocock\/skills code-review, after Fowler, Refactoring ch. 3. Wording is ours.\"\n  adapted_by: \"DevTribe Labs, MIT. https:\/\/github.com\/DevDadTribe\/toolbox\"\n---\n\n# Code smells: 12 guide words for reviews\n\n*The smell names come from Martin Fowler's book* Refactoring *(chapter 3). The idea of a short\nlist for agent reviews comes from the `code-review` skill in\n[mattpocock\/skills](https:\/\/github.com\/mattpocock\/skills). This text is our own.*\n\nName the smell in the finding, for example \"possible Feature Envy at `<file:line>`\", so every\nagent and every model reports in the same words.\n\nThree rules bind the list:\n\n1. **The project overrides.** A written house standard (your `CLAUDE.md`, `AGENTS.md`, lint\n   config or style guide) always wins. Where it endorses something this list would flag, do\n   not report the smell. If the project marks a file as \"small edits only\", a smell there is a\n   note, never a reason to restructure it.\n2. **Always a judgment call.** A smell is a labelled heuristic, never a hard violation.\n3. **Skip what tooling enforces** (linters, type checkers, formatters, pre-commit hooks).\n\nEach smell: **what it is, then how to fix it**.\n\n- **Mysterious Name**: a name that hides what it does or holds. Fix: rename it. If no honest name comes, the design is murky.\n- **Duplicated Code**: the same logic shape in more than one place. Fix: extract the shared shape and call it from both.\n- **Feature Envy**: a method that reaches into another object's data more than its own. Fix: move the method onto the data it envies.\n- **Data Clumps**: the same few fields or parameters that always travel together. Fix: bundle them into one type and pass that.\n- **Primitive Obsession**: a raw string or number that stands in for a domain concept. Fix: give the concept its own small type.\n- **Repeated Switches**: the same if\/switch cascade on the same type in several places. Fix: one shared map, or polymorphism.\n- **Shotgun Surgery**: one logical change forces scattered edits across many files. Fix: gather what changes together into one module.\n- **Divergent Change**: one file edited for several unrelated reasons. Fix: split it so each module changes for one reason.\n- **Speculative Generality**: abstraction, parameters or hooks for needs nobody has. Fix: delete it, and inline until a real need shows.\n- **Message Chains**: long `a.b().c().d()` walks the caller should not know about. Fix: hide the walk behind one method on the first object.\n- **Middle Man**: a layer that mostly passes calls on. Fix: cut it and call the real target directly.\n- **Refused Bequest**: a subclass or implementer that ignores or overrides most of what it inherits. Fix: drop the inheritance and compose instead.\n\n---\n\n*`code-smells` from [DevDad's Toolbox](https:\/\/github.com\/DevDadTribe\/toolbox). MIT. Adapted from mattpocock\/skills.*\n","use_cases":["Reviewing code quality in pull requests","Assessing code cleanliness during code reviews","Identifying potential refactoring opportunities"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/DevDadTribe\/toolbox\/blob\/5f44c242b6e4997ebc34dec7202932c4aa6701f6\/skills\/code-smells\/SKILL.md","source_commit":"5f44c242b6e4997ebc34dec7202932c4aa6701f6","license":null,"version":null,"listing_approved_at":"2026-11-29","created_at":"2026-11-28T18:41:41.000000Z","updated_at":"2026-11-29T10:53:02.000000Z","seo_title":"Code Smells Review Vocabulary","seo_description":"Use a 12-item code smell checklist derived from Martin Fowler's Refactoring to improve code quality during reviews and pull requests.","seo_keywords":["code smells","code review","refactoring","code quality","Martin Fowler"]}}