code-decomposition

Enforce SOLID design and clean decomposition for Kotlin functions and classes.

Updated Mar 5, 2026
One-click install
npx skills add https://github.com/Astrumon/Spovishun --skill code-decomposition
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-decomposition
Source: https://github.com/Astrumon/Spovishun/tree/main/skills/code-decomposition
Command: npx skills add https://github.com/Astrumon/Spovishun --skill code-decomposition

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill gives concrete rules and a checklist to prevent large, tightly-coupled, and hard-to-maintain Kotlin code by enforcing SOLID principles, small single-purpose functions, meaningful naming, and clear abstraction boundaries.

Core Features & Use Cases

  • SOLID enforcement: Guidance for Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion applied to Kotlin services, repositories, and command handlers.
  • Function hygiene: Limits on function length, maximum argument count, single level of abstraction, and prohibition of hidden side effects to make code easier to test and review.
  • Anti-pattern avoidance & checklist: Practical warnings (god classes, flag/output arguments, deep nesting) and a self-review checklist to run before commits, useful when implementing commands, refactoring services, or adding new repositories.

Quick Start

When refactoring or adding a Kotlin function, split responsibilities into small functions or services, reduce parameters to data classes, name things clearly, remove hidden side effects, and run the self-review checklist before committing.

Frequently Asked Questions about code-decomposition

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce SOLID principles when refactoring Kotlin code?

Kotlin clean code decomposition enforces function hygiene by limiting function length, restricting arguments to a maximum of three, maintaining one level of abstraction per function, and prohibiting hidden side effects to make code easier to test and review.

What is the best way to avoid god classes and deep nesting in Kotlin?

Avoiding god classes and deep nesting in Kotlin requires applying single-responsibility rules to split services, reducing parameters to data classes, and running a self-review checklist before commits to catch tightly-coupled anti-patterns.

Does this clean code approach work with Kotlin and Ktor projects?

Yes, this clean code decomposition approach is designed for Kotlin and Ktor projects, guiding naming, function size, and abstraction levels when implementing commands, refactoring services, or adding new repositories.

How do I reduce function arguments and hidden side effects in Kotlin?

Reduce Kotlin function arguments by grouping parameters into data classes and eliminate hidden side effects by ensuring functions maintain a single level of abstraction and clear responsibilities, making the code easier to test and review.

When do I need a code review checklist for Kotlin SOLID design?

Use a self-review checklist for Kotlin SOLID design before committing refactored services or new repositories to verify function size limits, argument counts, naming clarity, and single-responsibility boundaries, preventing hard-to-maintain code.