---
title: "Code smell"
url: "https://sarthakmishra.com/skills/code-smell"
description: "Clean up a feature, diff or repository with this agent skill. Confirm problems, remove dead code and duplication, then check affected behavior."
image: "https://sarthakmishra.com/og-images/skills/code-smell.webp"
---

[View HTML](https://sarthakmishra.com/skills/code-smell) · [Site index](https://sarthakmishra.com/llms.txt)

# Code smell

Find technical debt, verify it and fix it within a clear scope.

```bash
pnpm dlx skills add SarthakMishra/skills --skill code-smell
```

Use `/code-smell` in Claude Code or `$code-smell` in Codex. [Read the skill](https://github.com/SarthakMishra/skills/blob/main/skills/engineering/code-smell/SKILL.md).

Use it to clean up a feature, changes since a commit, or a whole repository. Name the directories or comparison point and the behavior to preserve. This workflow applies fixes.

## Example prompts

```text
/code-smell Simplify src/checkout. Remove duplicated rules and unnecessary abstractions, and verify error handling without changing intended behavior.
```

```text
$code-smell Clean up code smells introduced since origin/main, including affected callers. Verify each suspected issue before fixing it.
```

## How it works

The agent checks the code’s current behavior, then looks for dead code, duplicated rules, unnecessary abstractions and state problems within the agreed scope. It investigates suspected issues before changing them.

It fixes confirmed problems, removes the code they replace and checks the callers affected by each change. The summary explains the meaningful edits and which checks passed or failed.

## Works well with

- [React guide](https://sarthakmishra.com/skills/react-guide) for React state and rendering.
- [TypeScript guide](https://sarthakmishra.com/skills/ts-guide) for types that retain information and reject invalid calls.
- [Commit](https://sarthakmishra.com/skills/commit) to record completed, checked changes.

See the [source and adaptation notes](https://github.com/SarthakMishra/skills/tree/main/skills/engineering/code-smell#source).

## Structured data

```json
{
  "@context": "https://schema.org",
  "@graph": [
    {
      "@type": "WebSite",
      "@id": "https://sarthakmishra.com/#website",
      "url": "https://sarthakmishra.com/",
      "name": "Sarthak Mishra",
      "publisher": {
        "@id": "https://sarthakmishra.com/#person"
      },
      "inLanguage": "en"
    },
    {
      "@type": "Person",
      "@id": "https://sarthakmishra.com/#person",
      "name": "Sarthak Mishra",
      "url": "https://sarthakmishra.com/about",
      "jobTitle": "Design Engineer",
      "image": "https://sarthakmishra.com/og-images/sarthak-mishra.webp",
      "sameAs": [
        "https://github.com/SarthakMishra",
        "https://www.linkedin.com/in/itssarthakmishra/",
        "https://x.com/MishraMishry"
      ]
    },
    {
      "@type": "WebPage",
      "@id": "https://sarthakmishra.com/skills/code-smell#webpage",
      "url": "https://sarthakmishra.com/skills/code-smell",
      "name": "Code Cleanup Agent Skill - Sarthak Mishra",
      "description": "Clean up a feature, diff or repository with this agent skill. Confirm problems, remove dead code and duplication, then check affected behavior.",
      "inLanguage": "en",
      "isPartOf": {
        "@id": "https://sarthakmishra.com/#website"
      },
      "about": {
        "@id": "https://sarthakmishra.com/#person"
      }
    }
  ]
}
```
