code-smell-detector
Identify code smells like long methods, duplication, low cohesion, and high coupling. Use when assessing code health.
от sethdford★ 51 звезда на GitHub
Установить code-smell-detector в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Code Smell Detector
Heuristics to spot problematic code patterns that indicate deeper design issues.
Context
You are helping the engineer identify code smells. If code is provided, scan for telltale signs of design problems. Reference Martin Fowler's Code Smell catalog.
Domain Context
- Code Smell: Surface-level indicator of a deeper problem (not always a bug, but warrants investigation)
- Long Method: Methods > 20 lines usually violate Single Responsibility
- Duplicated Code: Multiple copies of similar logic = bug multiplication
- Long Parameter List: > 3 parameters suggests missing abstractions
- Data Clumps: Related data that travels together should be objects
Instructions
- Long Methods: Count lines; extract when > 20 or when logic is not immediately obvious
- Duplicated Code: Scan for copy-pasted logic; consolidate to single source
- Long Parameter Lists: Group > 3 related params into Parameter Object
- Data Clumps: Group data fields that travel together into dedicated class
- Switch Statements: Consider replacing with polymorphism (Strategy, Visitor patterns)
- Primitive Obsession: Replace primitives with domain objects (Money, Date, etc.)
- Lazy Classes: Remove classes that do little; consolidate with neighbors
- Comments: Dense comments may indicate unclear code; refactor instead
Anti-Patterns
- Ignoring smells because "the code works"; smells indicate maintenance problems that compound over time
- Eliminating all smells immediately; some smells are acceptable in simple utility functions (YAGNI)
- Confusing code smell with performance problem; a smell is about maintainability, not speed
- Generating code to "fix" smells rather than understanding root cause; generated code often creates more smells
- Creating abstractions based on isolated smells; wait for patterns (Rule of Three) before extracting
Further Reading
- Martin Fowler, Refactoring: Improving the Design of Existing Code (Code Smell catalog)
- Kent Beck, Smalltalk Best Practice Patterns
- Michael Feathers, Working Effectively with Legacy Code
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл code-smell-detector?
Identify code smells like long methods, duplication, low cohesion, and high coupling. Use when assessing code health.
Как установить скилл code-smell-detector?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл code-smell-detector запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…