fp-oo-kotlin

Apply functional programming and object-oriented patterns to Kotlin domain models.

1|Updated Mar 14, 2026
One-click install
npx skills add https://github.com/agnaldo4j/kanban-vision-api-kt --skill fp-oo-kotlin
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fp-oo-kotlin
Source: https://github.com/agnaldo4j/kanban-vision-api-kt/tree/main/.claude/skills/fp-oo-kotlin
Command: npx skills add https://github.com/agnaldo4j/kanban-vision-api-kt --skill fp-oo-kotlin

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of balancing architectural flexibility with code predictability by providing a unified approach to combining Object-Oriented and Functional Programming paradigms in Kotlin.

Core Features & Use Cases

  • Paradigm Synergy: Provides guidance on using OO for architectural boundaries and FP for domain logic and data transformation.
  • Error Handling: Implements robust, type-safe error handling using Arrow-kt Either and Raise instead of traditional exceptions.
  • Domain Modeling: Offers techniques for Algebraic Data Types (ADTs) and Optics to ensure illegal states are unrepresentable and complex data structures are easily managed.

Quick Start

Use the fp-oo-kotlin skill to refactor the current domain model by applying functional purity and type-safe error handling.

Frequently Asked Questions about fp-oo-kotlin

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

FAQPage Schema
How do I combine functional programming and object-oriented design patterns in Kotlin domain models?

Combining functional programming and object-oriented design in Kotlin involves using OO for architectural boundaries and FP for pure domain logic. This approach enforces separation of effects, ensuring predictable data transformation and robust architectural consistency.

What is the best way to handle errors type-safely in Kotlin without using traditional exceptions?

Type-safe error handling in Kotlin is achieved using the Arrow-kt library, specifically its Either and Raise constructs. This replaces traditional exceptions with functional paradigms, enforcing compile-time error management and making illegal states unrepresentable.

How do I model domain data in Kotlin to make illegal states unrepresentable?

Modeling domain data to make illegal states unrepresentable in Kotlin is done using Algebraic Data Types (ADTs). This technique restricts invalid state combinations at the type level, ensuring robust domain modeling and predictable functional purity.

Does Arrow-kt work well with clean architecture and domain-driven design in Kotlin?

Arrow-kt works effectively with clean architecture and domain-driven design in Kotlin by providing functional constructs like Optics and Either. It facilitates architectural consistency by enforcing separation of effects and robust domain modeling techniques.

How do I refactor an existing Kotlin architecture to enforce separation of effects?

Refactoring Kotlin architectures to enforce separation of effects involves applying functional purity to domain logic while maintaining object-oriented boundaries. This ensures architectural consistency and separates data transformation from side effects.

When should I use Arrow-kt Optics for managing complex data structures in Kotlin?

Arrow-kt Optics should be used for managing complex nested data structures in Kotlin domain models. They provide a functional way to access and modify deeply nested objects safely, complementing algebraic data types and robust domain modeling techniques.