Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

codeprobe-code-smellscodeprobe 代码气味

Agent Skill

codeprobe-code-smells 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

198

周安装

8

GitHub Stars

2

下载量

62
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:codeprobe-code-smells(codeprobe 代码气味)
来源仓库:https://github.com/nishilbhave/codeprobe-claude
仓库路径:skills/codeprobe-code-smells
安装命令:
npx skills add https://github.com/nishilbhave/codeprobe-claude --skill codeprobe-code-smells
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/nishilbhave/codeprobe-claude --skill codeprobe-code-smells

简介

codeprobe-code-smells 识别代码异味与反模式,涵盖冗余项、对象导向滥用等六大类。

  • 适用于重构前的质量评估,帮助发现 Long Method、Feature Envy 等问题。
  • 按影响程度分级提示,聚焦可维护性与可扩展性优化方向。
  • 安装前应核实是否具备足够权限扫描项目代码并生成分析报告。
  • 建议优先处理高优先级项,避免在不必要的地方引入过度设计。

SKILL.md

Standalone Mode

If invoked directly (not via the orchestrator), you must first:

  1. Read ../codeprobe/shared-preamble.md for the output contract, execution modes, and constraints.
  2. Load applicable reference files from ../codeprobe/references/ based on the project's tech stack.
  3. Default to full mode unless the user specifies otherwise.

Code Smells & Anti-Pattern Detector

Domain Scope

This sub-skill detects code smells and anti-patterns organized into these categories:

  1. Bloaters — Long Method, Large Class, Data Clumps, Primitive Obsession
  2. Object-Orientation Abusers — Feature Envy, Inappropriate Intimacy, Refused Bequest
  3. Change Preventers — Shotgun Surgery, Divergent Change
  4. Dispensables — Dead Code, Speculative Generality, Middle Man
  5. Couplers — Temporal Coupling
  6. Readability — Magic Numbers, Boolean Blindness, Deep Nesting

What It Does NOT Flag

  • Generated code — Migrations, compiled output, vendor directories (vendor/, node_modules/, dist/, build/, .next/), and auto-generated files (e.g., GraphQL codegen, Prisma client).
  • Test files with long setup methods — Test context is different; long setUp() or beforeEach() methods arranging test data are expected and acceptable.
  • Configuration files with many entries — A config file with 50 key-value pairs is not a "Large Class" smell.
  • Data migration files — These are procedural by nature and often contain long methods.
  • Third-party code checked into the repository (e.g., vendored libraries).
  • Structural issues already flagged by codeprobe-solid or codeprobe-architecture — Large classes may also be flagged as SRP violations or god objects. This sub-skill should still detect and report them, but the orchestrator will deduplicate overlapping findings at the same location.

Detection Instructions

Configurable Thresholds

Before analysis, check for a .codeprobe-config.json file in the project root. If present, load the severity_overrides section to adjust these defaults:

ThresholdConfig KeyDefault
Long Method LOC limitlong_method_loc30
Large Class LOC limitlarge_class_loc300
Deep Nesting max levelsdeep_nesting_max3

Bloaters

ID PrefixSmellSignalHow to DetectDefault ThresholdSeverity
SMELLLong MethodFunction/method exceeds LOC thresholdCount lines in each function/method body (excluding blank lines and single-line comments). Compare against long_method_loc threshold. For methods 2x over threshold, escalate to major.> 30 LOCMinor
SMELLLarge ClassClass exceeds LOC thresholdCount total lines in each class definition. Compare against large_class_loc threshold. For classes 2x over threshold, escalate to major (if not already major). Never escalate to critical — large classes are a maintainability concern, not a production defect.> 300 LOCMajor
SMELLData ClumpsSame 3+ params passed together in 3+ placesSearch for function/method signatures. Identify groups of 3+ parameters that appear together in 3+ different function signatures or call sites. These should be extracted into a parameter object or value object.3+ params, 3+ occurrencesMinor
SMELLPrimitive ObsessionString/int used where a value object is warrantedLook for string/integer variables representing domain concepts: email addresses (validated by regex inline), money amounts (numeric + currency passed separately), phone numbers, status strings compared in multiple places, ZIP codes, UUIDs passed as plain strings through multiple layers.Pattern recognitionMinor

Object-Orientation Abusers

ID PrefixSmellSignalHow to DetectDefault ThresholdSeverity
SMELLFeature EnvyMethod accesses another object's data 3x+ more than its ownCount how many times a method references $other->property or other.property versus $this->property or this.property (or self.). If external references outnumber internal ones by 3x or more, the method likely belongs in the other class.3+ external accessesMinor
SMELLInappropriate IntimacyClass accessing another's private/protected internalsSearch for reflection-based access (setAccessible(true), __get, __set magic methods accessing protected fields), friend class patterns, or direct access to properties that are conventionally private (prefixed with _ in Python/JS).Any occurrenceMajor
SMELLRefused BequestSubclass inherits but doesn't use most of parent's methodsExamine subclasses: if the parent has N public methods and the subclass overrides fewer than 30% of them while also not calling super/parent:: for most, this suggests the subclass doesn't truly need the inheritance relationship.Unused majority of parent methodsMinor

Change Preventers

ID PrefixSmellSignalHow to DetectDefault ThresholdSeverity
SMELLShotgun SurgeryChanging one concept requires edits in 5+ filesSearch for a single concept (e.g., a field name, a status value, a business rule) that appears across many files. If the same constant, column name, or business term appears in 5+ files without being centralized behind a single source of truth, flag it.5+ files for one conceptMajor
SMELLDivergent ChangeOne class modified for 3+ unrelated reasonsExamine large classes (> 200 LOC). Check whether the methods cluster around distinct, unrelated concerns. If a single class handles user authentication, email formatting, AND report generation, it has divergent change — any of those 3 areas changing forces this class to change.3+ distinct concernsMajor

Dispensables

ID PrefixSmellSignalHow to DetectDefault ThresholdSeverity
SMELLDead CodeUnreachable branches, unused imports, commented-out code blocksSearch for: (1) import/use/require statements for symbols never referenced elsewhere in the file, (2) commented-out code blocks (3+ consecutive commented lines that contain code syntax, not documentation), (3) functions/methods never called from anywhere in the codebase (use Grep across the project), (4) if (false) or if (0) blocks, unreachable code after unconditional return/throw/exit.Any occurrenceMinor
SMELLSpeculative GeneralityAbstractions/interfaces with only one implementation and no foreseeable secondSearch for interfaces, abstract classes, or generic type parameters that have exactly one concrete implementation. If the abstraction does not appear in a DI container config or test mock, and the domain doesn't suggest future variants, flag it as premature abstraction.Single implementationSuggestion
SMELLMiddle ManClass that only delegates to another class with no added logicLook for classes where every method simply calls the same method on an injected dependency and returns the result, with no added logic, validation, transformation, or error handling. The class adds an unnecessary indirection layer.Pure delegation in all methodsMinor

Couplers

ID PrefixSmellSignalHow to DetectDefault ThresholdSeverity
SMELLTemporal CouplingMethods must be called in specific order but nothing enforces itLook for patterns where: (1) method A must be called before method B but there's no compile-time or runtime check, (2) init()/setup() must be called before process() but the class allows process() to be called first, (3) sequential method calls with shared mutable state where reordering would cause bugs. Check for comments like "must call X first" or "call after Y".Implicit ordering dependencyMajor

Readability

ID PrefixSmellSignalHow to DetectDefault ThresholdSeverity
SMELLMagic NumbersHardcoded numeric/string literals without named constants in business logicSearch for numeric literals (other than 0, 1, -1) and string literals used in conditionals, calculations, or business logic. Flag values like 86400, 3.14159, "pending", 0.15 that appear in logic paths without a named constant. Exclude: array indices, loop bounds of 0/1, common math constants in math libraries.Any in logic pathsMinor
SMELLBoolean BlindnessMethod with 2+ boolean paramsSearch for function/method signatures with 2 or more bool/boolean parameters. Call sites like process(true, false, true) are unreadable. Suggest using named parameters, enums, or option objects instead.2+ boolean parametersMinor
SMELLDeep NestingIndentation levels exceed thresholdCount nesting depth in each function: each if, for, while, foreach, switch, try, match that is nested inside another adds a level. Flag when nesting exceeds deep_nesting_max threshold. Suggest early returns, guard clauses, or method extraction.> 3 levelsMinor

ID Prefix & Fix Prompt Examples

All findings use the SMELL- prefix, numbered sequentially: SMELL-001, SMELL-002, etc.

Fix Prompt Examples

  • "Extract lines 45-90 of UserService@register into a private method validateAndNormalizeInput() — the method is 120 LOC doing 3 unrelated things: input validation (lines 45-65), data normalization (lines 66-80), and persistence (lines 81-90). Keep persistence in register() and extract the other two concerns."
  • "Replace the magic number 86400 at line 55 of app/Services/CacheService.php with a named constant SECONDS_PER_DAY = 86400 defined at the top of the class."
  • "Refactor processOrder(bool $isExpress, bool $requiresSignature, bool $isFragile) in OrderProcessor.php (line 30) to accept a ShippingOptions value object instead of 3 boolean parameters. Create a ShippingOptions class with named properties."
  • "Remove the commented-out code block at lines 88-105 of PaymentGateway.php — this is dead code from a previous implementation. If needed later, it can be recovered from version control."
  • "In ReportGenerator.php, the generate() method at line 20 is 95 LOC. Extract the data-fetching logic (lines 25-50) into fetchReportData() and the formatting logic (lines 51-85) into formatReport(). The generate() method should orchestrate these two steps."

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

33.43%
按下载量换算21

Claude

30.17%
按下载量换算19

Cursor

17.04%
按下载量换算11

Gemini CLI

9.36%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills