smallnest/pigo/smell

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Detect software architecture bad smells, algorithmic complexity hotspots, and anti-patterns in a codebase. Produces a detailed markdown report identifying violations of architectural principles, design patterns, code quality, and performance complexity. Triggers on: smell, code smell, architecture smell, find anti-patterns, detect bad smells, complexity analysis, 代码坏味道, 架构坏味道, 反模式, 找出坏味道, 复杂度分析.

Install

npx vskill@latest install smallnest/pigo/smell

SKILL.md

Smell — Architecture Bad Smell Detector

Analyze a codebase to find violations of software architecture principles, anti-patterns, code "bad smells," and algorithmic complexity hotspots. Produce a comprehensive, actionable markdown report.

Knowledge base: This skill encodes architectural patterns, anti-patterns, code smells, and algorithmic complexity heuristics drawn from industry research and practice, including the classic code smells catalog by Martin Fowler / Kent Beck (as organized on refactoring.guru: Bloaters, Object-Orientation Abusers, Change Preventers, Dispensables, Couplers).


The Job

  1. Understand the scope — ask what part of the project to analyze (full project, specific module, or recent changes)
  2. Scan the codebase using find, grep, and Agent (Explore subagent) to gather evidence
  3. Identify architectural smells and anti-patterns
  4. Generate a detailed markdown report saved to tasks/smell-report-[timestamp].md
  5. Present a summary of findings to the user

Step 1: Scope Clarification

Ask the user:

What scope should I analyze?
A. Entire project (thorough, may take time)
B. Specific module/directory: [please specify]
C. Only recently changed files (git diff)
D. Only architectural-level issues (skip low-level code smells)

If the user doesn't specify, default to option A for small projects (< 100 files) or C for large projects.


Step 2: Evidence Gathering

Use the Explore subagent (Agent with subagent_type: "Explore") to scan the codebase for architectural patterns and anti-patterns. Run multiple parallel explorations:

Exploration Commands

Run these in parallel to gather evidence efficiently:

  1. Project Structure Scan: Map the directory tree, identify the architectural style (layered, modular monolith, microservices, etc.)
  2. Dependency Analysis: Find import/include patterns, check for circular dependencies, identify coupling hotspots
  3. Module/Component Scan: Identify God Objects (files > 500 lines), check cohesion, check single responsibility violations
  4. Pattern Detection: Look for known anti-pattern signatures (static cling, service locator abuse, leaky abstractions)
  5. Testing Scan: Check test coverage patterns, test file locations, test-to-code ratios
  6. Naming & Clarity Scan: Flag misleading names, overly generic names (Manager, Helper, Util), inconsistent naming conventions
  7. Complexity Scan: Detect algorithmic complexity hotspots — nested loops, N+1 queries, repeated scans, sort-in-loop, expensive recomputation in render paths
Key Heuristics
CategorySmellDetection Heuristic
ArchitectureBig Ball of MudNo clear directory structure; everything in root or one flat folder; no separation of concerns
ArchitectureViolated Layer BoundariesInner layers importing outer layers; infrastructure code in domain/core layer
ArchitectureMissing ArchitectureNo src/, lib/, core/ separation; SQL inline with UI code; HTTP handlers mixed with business logic
ArchitectureDistributed MonolithMicroservices sharing a database; services that can't deploy independently
ArchitectureAnemic Domain ModelModel/entity classes with only getters/setters and no behavior; all logic in services
ArchitectureCQRS Without NeedSeparate read/write models for simple CRUD; unnecessary complexity
ArchitectureOver-Layered ArchitectureExcessive layers/tiers that add pass-through code with no real value
ArchitectureOver-AbstractionSo many indirections/interfaces/generics that you get lost following the code
ArchitectureFuturistic ArchitectureSpeculative flexibility for requirements that may never come (predicting the future)
ArchitectureTechnology-Enthusiast ArchitectureShiny/unproven tech adopted in production because it's new, not because it fits
ArchitectureOverkill ArchitectureHeavyweight architecture/tech thrown at a simple problem
ArchitectureCloud/Visio ArchitectureDiagrams disconnected from the actual code and runtime reality
CouplingCircular DependenciesModule A imports B, B imports A; detected via import graph analysis
CouplingContent CouplingOne module directly accesses another's internal/private members
CouplingCommon CouplingExcessive global variables/shared mutable state; singleton abuse
CouplingStamp CouplingPassing large data structures when only a few fields are needed
CohesionGod ObjectSingle class/module > 500 lines; > 20 public methods; handles unrelated concerns
CohesionShotgun SurgeryA single change requires touching 5+ files across unrelated modules
CohesionFeature EnvyMethod calls foreign class methods more than its own class methods
CohesionData ClumpsSame group of 3+ parameters appearing together in multiple method signatures
DesignLeaky AbstractionsImplementation details (DB queries, HTTP calls) exposed through interfaces
DesignStatic ClingExcessive use of static methods; static state that prevents testability
DesignService Locator AbuseDI container passed around instead of proper constructor injection
DesignViolated SOLIDSRP violations, OCP violations (switch/if-else chains on types), ISP violations (fat interfaces)
DesignSwitch StatementsSame switch/if-else chain on a type code appearing in multiple places; should be polymorphism
DesignRefused BequestSubclass inherits methods/fields it doesn't use or overrides them to throw/no-op
DesignAlternative Classes w/ Different InterfacesTwo classes do the same thing but have differently-named methods
DesignParallel Inheritance HierarchiesCreating a subclass in one hierarchy forces a matching subclass in another
DesignSpeculative GeneralityUnused abstract classes, hooks, params, or generics "for future needs" (YAGNI)
DesignIncomplete Library ClassWrapping/patching a third-party class because it lacks needed methods
CohesionDivergent ChangeOne module changed for many unrelated reasons (opposite of Shotgun Surgery)
CohesionData ClassClass with only fields + getters/setters, no behavior (anemic data bag)
CohesionLazy ClassClass/module that does too little to justify its existence
CouplingInappropriate IntimacyTwo classes access each other's private/internal parts too much
CouplingMessage ChainsLong call chains a.getB().getC().getD() (Law of Demeter violation)
CouplingMiddle ManClass that only delegates every call to another class
CodeTemporary FieldInstance field set/used only in certain circumstances, empty otherwise
CodeDuplicated CodeIdentical/similar logic appearing in 3+ places; copy-paste patterns
CodeLong MethodMethods > 50 lines; deep nesting (> 3 levels)
CodeLong Parameter ListMethods with > 4 parameters
CodePrimitive ObsessionUsing strings/ints instead of domain types (e.g., string email instead of Email type)
CodeMagic Numbers/StringsHardcoded literals without named constants
CodeComments as DeodorantExcessive comments explaining bad code instead of refactoring
CodeDead CodeUnused imports, unreachable code, commented-out blocks
TestingNo TestsModules with zero test coverage
TestingTest-Implementation CouplingTests that assert internal implementation details instead of behavior
TestingSlow TestsTests doing real I/O, database calls, network requests without mocking
NamingVague NamesManager, Handler, Processor, Helper, Util, Service, Data, Info used excessively without context
NamingInconsistent NamingSnake_case and camelCase mixed; different patterns for same concept
ReadabilityDeep Nesting (Arrow Anti-Pattern)Loops/conditionals nested > 3 levels deep; rightward-drifting "arrow" shape hard to trace
ComplexityNested Loops (O(n^2)+)Loop inside loop; forEach inside for; map inside map; nested iteration suggesting polynomial complexity
ComplexityRepeated Linear Scanincludes()/indexOf()/.find() inside a loop; O(n*m) membership check on list instead of Set/Map
ComplexitySort-in-Loop.sort() or sorted() called inside iterative code; repeated O(n log n) when sort-once suffices
ComplexityN+1 Query PatternDatabase/API/HTTP call inside a loop; fetch/query/execute/findMany per iteration instead of batch
ComplexityRender-Path Recompute.filter().map().sort() chains in component render body; expensive transforms without memoization
ComplexityPairwise ComparisonNested iteration comparing every element with every other; O(n^2) when sort+two-pointer would be O(n log n)
ComplexityUnnecessary RecomputeSame expensive computation repeated without caching; missing useMemo/memo/lazy eval
ComplexityWrong Data StructureArray used where Set/Map would give O(1) lookup; List where Queue/Heap/Stack is natural fit

Step 3: Report Generation

Generate the report in this structure:

markdown
# Architecture Smell Report
**Project:** [project-name]
**Scope:** [scope description]
**Date:** [date]
**Analyzer:** smell skill (Ducc)
---
## Executive Summary
[2-3 paragraph summary: architectural style detected, overall health assessment, and top 3-5 critical issues]
---
## Architectural Style Detected
[Identify the architectural style: Layered, Modular Monolith, Microservices, Hexagonal, Clean Architecture, or Big Ball of Mud]
### Style Expectations vs. Reality
| Expectation | Reality | Status |
|-------------|---------|--------|
| [e.g., Clear layer separation] | [what was found] | ✅/⚠️/🔴 |
---
## Findings by Category
### 🔴 Critical Issues (Must Fix)
[Issues that fundamentally undermine architecture]
### 🟡 Warnings (Should Fix)
[Issues that degrade maintainability but don't block function]
### 🔵 Suggestions (Nice to Fix)
[Minor improvements that would increase quality]
---
## Detailed Findings
### Finding #1: [Title]
-**Category:** [Architecture/Coupling/Cohesion/Design/Code/Testing/Naming/Complexity]
-**Severity:** 🔴 Critical / 🟡 Warning / 🔵 Suggestion
-**Anti-Pattern:** [Name of anti-pattern]
-**Location:** [file:line references]
-**Principle Violated:** [SOLID/DRY/KISS/etc.]
-**Description:** [What was found and why it's a problem]
-**Evidence:** [Code snippet or structure description]
-**Recommendation:** [Specific fix, with refactoring approach]
---
## Dependency Graph Analysis
[Summary of module dependencies, circular dependencies found, coupling hotspots]
---
## Module Health Scorecard
| Module | Lines | God Object Risk | Coupling | Cohesion | Test Coverage | Health |
|--------|-------|----------------|----------|----------|---------------|--------|
| [name] | [N] | [Low/Med/High] | [Low/Med/High] | [Low/Med/High] | [% or N/A] | 🟢/🟡/🔴 |
---
## Smell Distribution
| Category | Count | Critical | Warning | Suggestion |
|----------|-------|----------|---------|------------|
| Architecture | [N] | [N] | [N] | [N] |
| Coupling | [N] | [N] | [N] | [N] |
| Cohesion | [N] | [N] | [N] | [N] |
| Design | [N] | [N] | [N] | [N] |
| Code | [N] | [N] | [N] | [N] |
| Testing | [N] | [N] | [N] | [N] |
| Naming | [N] | [N] | [N] | [N] |
| Complexity | [N] | [N] | [N] | [N] |
---
## Refactoring Roadmap
### Immediate Actions (This Sprint)
1.[Actionable fix 1]
2.[Actionable fix 2]
### Short-Term (1-3 Months)
1.[Structural improvement 1]
2.[Structural improvement 2]

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
458
Repository forks
63
7-day trend score
31

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/smallnest/pigo/smell/badge)](https://verified-skill.com/skills/smallnest/pigo/smell)

Something wrong with this skill or its page? Tell us.