ApiliumHub
Back to browse

refactor-patterns

ApiliumApiliumv1.0.320500
officialplatinum (7/8)Clean scan

Code smell detection, SOLID principles, GoF patterns, health scoring

Install

mayros skill install refactor-patterns
mayros skill install [email protected]

README

@apilium/refactor-patterns

Detect code smells and suggest refactoring patterns using GoF design patterns and SOLID principles.

Installation

mayros skill install @apilium/refactor-patterns

Usage

Detect Code Smells

Ask Mayros to analyze your code for smells:

Analyze src/services/ for code smells and suggest refactoring patterns.

The skill detects smells from Martin Fowler's catalog:

  • Critical: God Class, Duplicate Code
  • High: Long Method, Feature Envy, Switch Statements
  • Medium: Data Clumps, Primitive Obsession, Long Parameter List, Message Chains
  • Low: Lazy Class, Speculative Generality, Parallel Inheritance

Pattern Suggestions

Each smell maps to a specific refactoring technique or GoF pattern:

  • God Class --> Extract Class (Single Responsibility)
  • Switch Statements --> Strategy Pattern (Open/Closed)
  • Feature Envy --> Move Method
  • Data Clumps --> Extract Parameter Object
  • Long Parameter List --> Builder Pattern

SOLID Analysis

Every suggestion references which SOLID principle is violated and how the recommended pattern addresses it.

Health Score

The skill computes a health score from 0 to 100 based on the number and severity of detected smells. Critical smells deduct 15 points, high smells deduct 10, medium deduct 5, and low deduct 2.

Semantic Predicates

PredicateDescription
refactor:smell_detectedAsserted for each smell found
refactor:pattern_suggestedAsserted for each refactoring recommendation
refactor:historyQuery for previous refactoring analysis

License

MIT

Versions

v1.0.3Feb 27, 2026
v1.0.2Feb 27, 2026
v1.0.1Feb 27, 2026
v1.0.0Feb 27, 2026

Comments

Sign in to leave a comment.

Loading comments...