kotlin-delegation

Explain and demonstrate Kotlin delegation patterns with Android examples.

1|1|Updated Feb 5, 2026
One-click install
npx skills add https://github.com/maichanchinh/claude-skills --skill kotlin-delegation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kotlin-delegation
Source: https://github.com/maichanchinh/claude-skills/tree/main/skills/kotlin-delegation
Command: npx skills add https://github.com/maichanchinh/claude-skills --skill kotlin-delegation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies complex Kotlin code by leveraging delegation patterns, making your code more concise, reusable, and maintainable.

Core Features & Use Cases

  • Property Delegation: Implement lazy, observable, vetoable, and custom delegates for efficient property management.
  • Interface Delegation: Achieve composition over inheritance and reuse logic across classes.
  • Use Case: Streamline Android development by using view binding delegates, managing SharedPreferences with custom delegates, or implementing observable patterns for UI state updates.

Quick Start

Use the kotlin-delegation skill to demonstrate the lazy initialization pattern with an example.

Frequently Asked Questions about kotlin-delegation

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

FAQPage Schema
How do I use Kotlin property delegation to manage lazy initialization and observable state?

Interface delegation in Kotlin enables composition over inheritance by forwarding interface implementations to other objects, letting you reuse logic across classes without rigid inheritance hierarchies.

How do I create a custom delegate for SharedPreferences in Android?

Creating a custom delegate for SharedPreferences involves implementing the property delegation contract to abstract read and write operations, streamlining preference management in Android projects.

Can I use Kotlin delegation patterns for Android view binding?

Kotlin delegation patterns support Android view binding by using custom property delegates to initialize and manage view references, resulting in cleaner and more maintainable Activity or Fragment code.

What is interface delegation in Kotlin and when should I use it over inheritance?

Interface delegation in Kotlin enables composition over inheritance by forwarding interface implementations to other objects, letting you reuse logic across classes without rigid inheritance hierarchies.

How does map delegation work for dynamic property handling in Kotlin?

Map delegation works by routing property accessors to a map's key-value pairs, enabling dynamic property handling and simplifying tasks like parsing JSON or database rows into Kotlin objects.