Architecture Patterns
KartikLabhshetwar/better-shot
Deep dive into software architecture for macOS. An agent skill from KartikLabhshetwar/better-shot.
Detect software architecture bad smells, algorithmic complexity hotspots, and anti-patterns in a codebase.
$ npx skills add smallnest/goal-workflow --skill smell -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install smallnest/goal-workflow smell --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/smallnest/goal-workflow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/smell .claude/skills/smell && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "smell" agent skill from https://github.com/smallnest/goal-workflow/tree/master/skills/smell into .claude/skills/smell/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "smell", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/smallnest/goal-workflow/tree/master/skills/smellType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add smallnest/goal-workflow --skill smell -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install smallnest/goal-workflow smell --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/smallnest/goal-workflow.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/smell .agents/skills/smell && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "smell" agent skill from https://github.com/smallnest/goal-workflow/tree/master/skills/smell into .agents/skills/smell/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "smell", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add smallnest/goal-workflow --skill smell -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install smallnest/goal-workflow smell --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/smallnest/goal-workflow.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/smell .cursor/skills/smell && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "smell" agent skill from https://github.com/smallnest/goal-workflow/tree/master/skills/smell into .cursor/skills/smell/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "smell", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/smallnest/goal-workflow.git --path skills/smell--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add smallnest/goal-workflow --skill smell -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install smallnest/goal-workflow smell --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/smallnest/goal-workflow.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/smell .gemini/skills/smell && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "smell" agent skill from https://github.com/smallnest/goal-workflow/tree/master/skills/smell into .gemini/skills/smell/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "smell", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install smallnest/goal-workflow smellInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add smallnest/goal-workflow --skill smell -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/smallnest/goal-workflow.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/smell .github/skills/smell && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "smell" agent skill from https://github.com/smallnest/goal-workflow/tree/master/skills/smell into .github/skills/smell/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "smell", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add smallnest/goal-workflow --skill smell -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install smallnest/goal-workflow smell --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/smallnest/goal-workflow.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/smell .opencode/skills/smell && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "smell" agent skill from https://github.com/smallnest/goal-workflow/tree/master/skills/smell into .opencode/skills/smell/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "smell", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
smellDetect software architecture bad smells, algorithmic complexity hotspots, and anti-patterns in a codebase.
Smell is an agent skill from smallnest/goal-workflow. 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, 代码坏味道, 架构坏味道, 反模式, 找出坏味道, 复杂度分析.
Its SKILL.md is about 10k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `README.md` and `test-prompts.json`).
It sits in Development, covering Refactoring, Software architecture and Design patterns. The repository describes itself as: AI-driven development workflow with /prd, /goal, /review-it and /ship-it skills. The licence is MIT.
4 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit b06ab3c. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gitFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Smell loads about 10k tokens when it runs. Until then it costs about 101 tokens; SKILL.md has 4,446 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from smallnest/goal-workflow at commit b06ab3c, republished under its MIT licence (© smallnest). 4,446 words, ~10,361 tokens.
.claude/skills/smell/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.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).
find, grep, and Agent (Explore subagent) to gather candidate signals and evidencetasks/smell-report-[timestamp].mdAsk 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.
Use the Explore subagent (Agent with subagent_type: "Explore") to scan the codebase for architectural patterns and anti-patterns. Run multiple parallel explorations:
Run these in parallel to gather evidence efficiently:
Heuristics are candidate signals, not findings. A line-count, nesting, naming, or Big-O match must be validated against the code's responsibility, callers, change history, workload, and intentional constraints. Do not assign severity from a threshold alone.
| Category | Smell | Detection Heuristic |
|---|---|---|
| Architecture | Big Ball of Mud | No clear directory structure; everything in root or one flat folder; no separation of concerns |
| Architecture | Violated Layer Boundaries | Inner layers importing outer layers; infrastructure code in domain/core layer |
| Architecture | Missing Architecture | No src/, lib/, core/ separation; SQL inline with UI code; HTTP handlers mixed with business logic |
| Architecture | Distributed Monolith | Microservices sharing a database; services that can't deploy independently |
| Architecture | Anemic Domain Model | Model/entity classes with only getters/setters and no behavior; all logic in services |
| Architecture | CQRS Without Need | Separate read/write models for simple CRUD; unnecessary complexity |
| Architecture | Over-Layered Architecture | Excessive layers/tiers that add pass-through code with no real value |
| Architecture | Over-Abstraction | So many indirections/interfaces/generics that you get lost following the code |
| Architecture | Futuristic Architecture | Speculative flexibility for requirements that may never come (predicting the future) |
| Architecture | Technology-Enthusiast Architecture | Shiny/unproven tech adopted in production because it's new, not because it fits |
| Architecture | Overkill Architecture | Heavyweight architecture/tech thrown at a simple problem |
| Architecture | Cloud/Visio Architecture | Diagrams disconnected from the actual code and runtime reality |
| Coupling | Circular Dependencies | Module A imports B, B imports A; detected via import graph analysis |
| Coupling | Content Coupling | One module directly accesses another's internal/private members |
| Coupling | Common Coupling | Excessive global variables/shared mutable state; singleton abuse |
| Coupling | Stamp Coupling | Passing large data structures when only a few fields are needed |
| Cohesion | God Object | Single class/module > 500 lines; > 20 public methods; handles unrelated concerns |
| Cohesion | Shotgun Surgery | A single change requires touching 5+ files across unrelated modules |
| Cohesion | Feature Envy | Method calls foreign class methods more than its own class methods |
| Cohesion | Data Clumps | Same group of 3+ parameters appearing together in multiple method signatures |
| Design | Leaky Abstractions | Implementation details (DB queries, HTTP calls) exposed through interfaces |
| Design | Static Cling | Excessive use of static methods; static state that prevents testability |
| Design | Service Locator Abuse | DI container passed around instead of proper constructor injection |
| Design | Violated SOLID | SRP violations, OCP violations (switch/if-else chains on types), ISP violations (fat interfaces) |
| Design | Switch Statements | Same switch/if-else chain on a type code appearing in multiple places; should be polymorphism |
| Design | Refused Bequest | Subclass inherits methods/fields it doesn't use or overrides them to throw/no-op |
| Design | Alternative Classes w/ Different Interfaces | Two classes do the same thing but have differently-named methods |
| Design | Parallel Inheritance Hierarchies | Creating a subclass in one hierarchy forces a matching subclass in another |
| Design | Speculative Generality | Unused abstract classes, hooks, params, or generics "for future needs" (YAGNI) |
| Design | Incomplete Library Class | Wrapping/patching a third-party class because it lacks needed methods |
| Cohesion | Divergent Change | One module changed for many unrelated reasons (opposite of Shotgun Surgery) |
| Cohesion | Data Class | Class with only fields + getters/setters, no behavior (anemic data bag) |
| Cohesion | Lazy Class | Class/module that does too little to justify its existence |
| Coupling | Inappropriate Intimacy | Two classes access each other's private/internal parts too much |
| Coupling | Message Chains | Long call chains a.getB().getC().getD() (Law of Demeter violation) |
| Coupling | Middle Man | Class that only delegates every call to another class |
| Code | Temporary Field | Instance field set/used only in certain circumstances, empty otherwise |
| Code | Duplicated Code | Identical/similar logic appearing in 3+ places; copy-paste patterns |
| Code | Long Method | Methods > 50 lines; deep nesting (> 3 levels) |
| Code | Long Parameter List | Methods with > 4 parameters |
| Code | Primitive Obsession | Using strings/ints instead of domain types (e.g., string email instead of Email type) |
| Code | Magic Numbers/Strings | Hardcoded literals without named constants |
| Code | Comments as Deodorant | Excessive comments explaining bad code instead of refactoring |
| Code | Dead Code | Unused imports, unreachable code, commented-out blocks |
| Testing | No Tests | Modules with zero test coverage |
| Testing | Test-Implementation Coupling | Tests that assert internal implementation details instead of behavior |
| Testing | Slow Tests | Tests doing real I/O, database calls, network requests without mocking |
| Naming | Vague Names | Manager, Handler, Processor, Helper, Util, Service, Data, Info used excessively without context |
| Naming | Inconsistent Naming | Snake_case and camelCase mixed; different patterns for same concept |
| Readability | Deep Nesting (Arrow Anti-Pattern) | Loops/conditionals nested > 3 levels deep; rightward-drifting "arrow" shape hard to trace |
| Complexity | Nested Loops (O(n^2)+) | Loop inside loop; forEach inside for; map inside map; nested iteration suggesting polynomial complexity |
| Complexity | Repeated Linear Scan | includes()/indexOf()/.find() inside a loop; O(n*m) membership check on list instead of Set/Map |
| Complexity | Sort-in-Loop | .sort() or sorted() called inside iterative code; repeated O(n log n) when sort-once suffices |
| Complexity | N+1 Query Pattern | Database/API/HTTP call inside a loop; fetch/query/execute/findMany per iteration instead of batch |
| Complexity | Render-Path Recompute | .filter().map().sort() chains in component render body; expensive transforms without memoization |
| Complexity | Pairwise Comparison | Nested iteration comparing every element with every other; O(n^2) when sort+two-pointer would be O(n log n) |
| Complexity | Unnecessary Recompute | Same expensive computation repeated without caching; missing useMemo/memo/lazy eval |
| Complexity | Wrong Data Structure | Array used where Set/Map would give O(1) lookup; List where Queue/Heap/Stack is natural fit |
Process every candidate in three stages:
Count findings by independent root cause, never by the number of principles they implicate. Use one Primary principle and optional Related principles. SOLID is an umbrella label; use SRP, OCP, or DIP as the primary label when the evidence supports a specific lens, without also creating a separate SOLID finding.
| Principle | Confirming evidence | Common false positive / constraint |
|---|---|---|
| SOLID | A design problem spans multiple SOLID lenses or no narrower lens is reliable | Do not duplicate a specific SRP/OCP/DIP finding |
| DRY | The same business rule or knowledge must change in multiple places | Similar syntax that is expected to evolve independently |
| KISS | Extra layers, indirection, or machinery add cost without observable leverage | A small abstraction that removes real complexity |
| YAGNI | Unused extension points, parameters, adapters, or speculative requirements | A tested seam required by an existing boundary or change |
| SRP | Multiple independent reasons to change, supported by responsibilities or change history | File size or method count alone |
| Open/Closed (OCP) | Adding a known variant repeatedly modifies stable branching logic | One simple, local conditional |
| Dependency Inversion (DIP) | High-level policy directly depends on concrete infrastructure, harming replacement or testing | Adding an interface for a single stable implementation |
| Composition | Inheritance causes unwanted coupling, refused behavior, or inseparable variation axes | Replacing every valid inheritance relationship mechanically |
| Separation of Concerns | Business policy, I/O, presentation, or persistence concerns leak across boundaries | A deliberately thin boundary adapter |
| Fail Fast | Invalid input, state, or dependency propagates until a distant operation fails | Intentional aggregation, retry, or deferred validation semantics |
| Measure First | A performance, scale, or optimization claim lacks a baseline or representative workload | Static complexity reported as a measured bottleneck |
For each confirmed finding, record evidence strength (Measured, Observed, or Inferred) separately from confidence (High, Medium, or Low/Candidate). Evidence strength does not imply severity.
Generate the report in this structure:
# Architecture Smell Report
**Project:** [project-name]
**Scope:** [scope description]
**Date:** [date]
**Analyzer:** smell skill (Ducc)
---
## Executive Summary
[2-3 paragraph summary of confirmed findings only: architectural style detected, overall health assessment, and top 3-5 critical issues. Mention candidates separately.]
---
## 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]
### Candidates Requiring Measurement
[Static candidates whose runtime impact, change frequency, or workload is not yet established. These do not count toward severity totals.]
---
## 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 and relevant callers]
- **Confidence:** [High/Medium]
- **Evidence strength:** [Measured/Observed/Inferred]
- **Failure or change scenario:** [Concrete scenario]
- **Primary principle:** [Most specific principle]
- **Related principles:** [Explanatory only; do not count separately]
- **Description:** [What was found and why it's a problem]
- **Evidence:** [Code, dependency, history, or measurement]
- **Measured/observed impact:** [Reach, frequency, consequence, or baseline]
- **Recommendation:** [Smallest justified refactoring]
- **Verification:** [How to prove behavior and impact]
---
## 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
Count only deduplicated confirmed findings by their primary category. Related principles and candidates do not affect these totals.
| 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
Order work by impact, confidence, dependency sequence, and verification cost—not by principle count or smell name. Put only high-confidence, verifiable findings in Immediate Actions; for candidates, recommend the next measurement instead of a rewrite.
### 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]
### Long-Term (3-12 Months)
1. [Architectural transformation 1]
2. [Architectural transformation 2]
---
## Appendix: Anti-Pattern Reference
[A condensed reference of anti-patterns checked, with brief descriptions]Save the report to tasks/smell-report-[YYYY-MM-DD-HHmm].md and present a brief summary to the user.
This section documents the architectural anti-patterns and bad smells the skill knows about.
The most common de-facto architecture. A haphazardly structured, sprawling system with no perceivable architecture. Characterized by:
Microservices that must be deployed together. Symptoms:
Domain objects with only getters/setters (data bags), all logic in services. Violates:
A class that knows too much or does too much. Characteristics:
500 lines or > 20 public methods
Abstractions that expose implementation details. Signs:
SaveToPostgres, FetchFromRedis)Excessive use of static methods/state. Problems:
Using a service locator instead of dependency injection. Issues:
In layered architectures:
Applying CQRS to simple CRUD. Signs:
In Vertical Slice Architecture:
A set of architecture-level anti-patterns describing over- and under-engineering. The common thread: architecture disconnected from real needs and reality. The opposite extreme (too little architecture) is equally a smell.
"Layers on layers on layers." Adding tiers beyond what the problem needs:
Abstraction piled on until the code is impossible to follow:
Solution built for imagined future requirements that no one can actually predict:
New/shiny technology put into production because the architect liked it:
A simple problem solved with a disproportionate amount of architecture and technology:
"Architecture" that exists only in nice diagrams, disconnected from the code and runtime reality:
Note on the opposite extreme: total lack of architecture (no boundaries, no structure) is equally a smell — see Big Ball of Mud and Missing Architecture. Both under- and over-engineering are failures.
Module A → Module B → Module A. Detected via:
One module directly modifying another's internal state. Signs:
friend/package-private abuseMultiple modules depending on shared global mutable state:
CurrentUser static property)Passing entire data structures when only a few fields needed:
A single change requires modifications across many files:
A method that uses another class's methods more than its own:
other.foo(), other.bar(), other.baz() with few self-callsSame group of fields appearing together in multiple places:
(street, city, zip) appearing in 5 method signaturesOne module/class is repeatedly changed for many unrelated reasons (the opposite of Shotgun Surgery):
Two classes are too entangled with each other's internals:
Long navigation chains like a.getB().getC().getD().doThing():
A class that delegates almost all of its work to another class:
Every time you add a subclass to one hierarchy, you must add one to another:
Shape/ShapeRenderer, Employee/EmployeePermission growing in lockstepUsing primitives instead of domain types:
string for Email, PhoneNumber, URLint for Money, Age, Quantitydecimal without Currency contextif (status == 3) instead of if (status == Status.COMPLETED)Loops and conditionals nested so deeply the code drifts rightward into an "arrow" shape:
if { if { for { if { ... } } } } — hard to trace which conditions hold at any pointA class that is only fields plus getters/setters, with no meaningful behavior:
A class/module that no longer does enough to justify its existence:
Abstractions, hooks, parameters, or generics added for hypothetical future needs:
An instance field that is only set/used in certain circumstances and empty otherwise:
A static complexity pattern is a candidate, not proof of a bottleneck. Apply Measure First:
For every complexity candidate, state what to measure, when it becomes a finding, and when not to flag it. Keep the Big-O analysis and correctness checks below, but do not infer severity from syntax alone.
Two or more loops nested inside each other, producing polynomial complexity.
for/while inside another for/while; forEach/map inside forEach/map; loop containing another loop (any depth)A database query, API call, or I/O operation inside a loop body.
fetch()/axios()/query()/execute()/findMany()/findOne()/findUnique()/select()/where() inside any loop constructSELECT * FROM x WHERE id IN (...) then join in memoryinclude / preload / DataLoaderLinear search (includes, indexOf, .find, in_array) inside a loop, where a Set/Map would give O(1) lookup.
.includes() / .indexOf() / .find() / .findIndex() / in_array() / contains() inside a loop bodySet (for membership) or Map (for key→value lookup) once before the loopSorting inside a loop body, repeating O(n log n) work unnecessarily.
.sort() / sorted() / sort() inside any iterative blockExpensive data transformation (filter→map→sort chains) inside UI component render bodies, recomputed on every render.
.filter().map().sort().reduce() chains inside React/Vue/Svelte component function bodies; inside function Component() or const Component = () => in JSX/TSXuseMemo / computed / derived with correct dependency arraysComparing every element with every other element using double-nested iteration.
Same pure computation repeated with same inputs without caching.
lru_cache/memoize/useMemo as appropriateUsing a suboptimal data structure for the access pattern.
shift()/pop(0) (O(n) per dequeue) → should use proper QueueUse the canonical matrix in Step 3 as the reporting contract. These design checks refine candidate detection; they do not create one finding per principle.
SOLID/LSP.SOLID/ISP.Repeated switch/if-else chains that branch on a type code or enum:
A subclass inherits methods/fields it doesn't need:
Two classes perform the same role but expose differently-named methods:
sort() vs arrange(), getUser() vs fetchUser() for interchangeable classesA third-party/library class lacks methods you need and can't be modified:
Other refactoring.guru smells are documented in their thematic sections above: Divergent Change, Data Class, Lazy Class, Speculative Generality, Temporary Field, Parallel Inheritance Hierarchies, Inappropriate Intimacy, Message Chains, and Middle Man.
| Scenario | Handling |
|---|---|
| User doesn't specify scope | Default to recent changes (git diff) for repos > 200 files, full analysis otherwise |
| Project has no clear architecture | Report "Big Ball of Mud" with evidence, recommend incremental refactoring |
| Empty/monorepo project | Report that architecture analysis requires code; ask user to specify module |
| Language not supported | Report general structural observations; note language-specific checks are limited |
| Report file path conflicts | Append -2, -3, etc. to filename |
| User wants a quick check | Run only Critical-level scans, skip Code and Naming categories |
| User wants only one category | Focus analysis on that category, skip others |
🔍 Architecture Smell Analysis Complete
Project: goal-workflow
Style: Modular Monolith (with some layering violations)
Files Analyzed: 47
Health: 🟡 Fair
Critical: 3 | Warnings: 6 | Suggestions: 9
🔴 Critical Issues:
1. Anemic Domain Model — `models/` classes have only getters/setters,
all logic in `services/`. Violates DDD Rich Domain Model principle.
2. N+1 Query Pattern — `services/order.ts:142` fetches user per order in loop;
should batch-load users by IDs (O(n*m) → O(n+m)).
3. Static Cling — `util/ApiClient.ts` uses all static methods,
making consumer code untestable.
🟡 Warnings:
1. God Object — `services/workflow.ts` at 847 lines handles too many concerns
2. Nested Loop O(n^2) — `analytics.ts:89` pairwise comparison of events;
sort+two-pointer would be O(n log n)
3. Leaky Abstraction — `repositories/user.ts` exposes MongoDB query syntax
4. Duplicated Code — validation logic duplicated across 4 controllers
5. Circular Dependency — `auth` ↔ `user` modules depend on each other
6. Magic Numbers — ~23 hardcoded values without named constants
Full report: tasks/smell-report-2026-05-27-1530.md© smallnest, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files in skills/smell of smallnest/goal-workflow.
Open the folder on GitHubat commit b06ab3c
We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders. This page covers the copy in smallnest/goal-workflow, which our catalogue first saw on October 7, 2026.
Smell next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Smell this skillsmallnest/goal-workflow | 290 | — | ~10k | Automated safety check: Pass | MIT | |
| Architecture PatternsKartikLabhshetwar/better-shot | 2.4k | 2 repos | ~1.4k | Automated safety check: Pass | Custom licence | |
| Solidramziddin/solid-skills | 606 | — | ~2.7k | Automated safety check: Pass | None | |
| Brooks Audithyhmrright/brooks-lint | 1.5k | 1 repos | ~537 | Automated safety check: Pass | MIT | |
| Py Rigmudrii/hermesd | 118 | — | ~6.3k | Automated safety check: Pass | MIT | |
| Omni DevGulajavaMinistudio/Mayukai-Theme | 139 | — | ~736 | Automated safety check: Pass | MIT |
KartikLabhshetwar/better-shot
Deep dive into software architecture for macOS. An agent skill from KartikLabhshetwar/better-shot.
ramziddin/solid-skills
A skill your agent uses when writing code, implementing features, refactoring, planning architecture, designing systems, reviewing code, or debugging.
hyhmrright/brooks-lint
Architecture audit that maps module dependencies, checks layering integrity, and flags structural decay across a codebase, drawing on twelve classic engineering books.
mudrii/hermesd
A skill your agent uses when building, reviewing, or refactoring Python code that requires strong maintainability discipline: SRP, DRY, OCP, explicit dependency injection, TDD/ATDD workflow, strict…
GulajavaMinistudio/Mayukai-Theme
Omni-expert principal software architect. An agent skill from GulajavaMinistudio/Mayukai-Theme.
hyhmrright/brooks-lint
PR code review that surfaces decay risks, design smells, and maintainability issues with concrete Symptom → Source → Consequence → Remedy findings, drawing on twelve classic engineering books.
smallnest/goal-workflow
Illustrate an article (Markdown, HTML, etc.) with animated-style icons from itshover.com/icons.
smallnest/goal-workflow
Graph engineering for parallel task execution: convert a task, PRD, SPEC, or issue set into a dependency graph (DAG), layer it into supersteps, then implement each independent node concurrently with…
smallnest/goal-workflow
Generate a Phase-2 Walkthrough artifact (walkthrough.md) once implementation and verification are complete.
smallnest/goal-workflow
为任意项目生成 UML 图、架构图和流程图。分析代码库后让用户选择要生成的图表类型,使用 architecture-diagram skill 渲染为 HTML+SVG,保存到 docs/ 目录。适用于任何软件项目的文档可视化。
smallnest/goal-workflow
Reverse-engineer a SPEC document from an existing project. An agent skill from smallnest/goal-workflow.
smallnest/goal-workflow
A skill your agent uses when turning a requirement, spec, or feature brief into a single self-contained HTML design document in a fixed house style — one styled HTML page with a table-of-contents…
Categories
Detect software architecture bad smells, algorithmic complexity hotspots, and anti-patterns in a codebase. Smell is an agent skill from smallnest/goal-workflow. Detect software architecture bad smells, algorithmic complexity hotspots, and anti-patterns in a codebase.
Smell fits situations like: architecture smell; find anti-patterns; detect bad smells; complexity analysis.
Run `npx skills add smallnest/goal-workflow --skill smell -a claude-code`. Or copy the skill folder (skills/smell in smallnest/goal-workflow) into .claude/skills/smell in your project. Claude Code loads it when a task matches its description.
Run `npx skills add smallnest/goal-workflow --skill smell -a codex`. Or copy the skill folder (skills/smell in smallnest/goal-workflow) into .agents/skills/smell in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add smallnest/goal-workflow --skill smell -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/smell, .gemini/skills/smell, .github/skills/smell and .opencode/skills/smell in your project.
Going by SKILL.md and its folder, Smell needs the command-line tools its instructions call (git).
SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Smell is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 10k tokens (SKILL.md is roughly 41k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Smell: Architecture Patterns (KartikLabhshetwar/better-shot, 2.4k stars), Solid (ramziddin/solid-skills, 606 stars), Brooks Audit (hyhmrright/brooks-lint, 1.5k stars) and Py Rig (mudrii/hermesd, 118 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
smallnest (a GitHub user) maintains it in smallnest/goal-workflow, which has 290 GitHub stars. The repository holds 20 skills in this directory. The repository was last updated on September 13, 2026.
Source: smallnest/goal-workflow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.