hearth-case-class-rules

Official

Derive case-class type classes quickly and safely.

Authorkubuszok
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Deriving type class instances for Scala case classes often requires boilerplate and repeated patterns. This skill provides structured rules and patterns for automatic derivation using Hearth's CaseClass.parse, supporting both encoder-style field reading and decoder-style construction, while handling existential types and nested structures.

Core Features & Use Cases

  • Encoder-style derivation using CaseClass.parse to read case class fields and derive instances.
  • Decoder-style construction using primaryConstructor and field maps for building instances from decoded fields.
  • Advanced patterns for existential types, LambdaBuilder usage, and cache-aware strategies like nest vs nestInCache.
  • Guidance for dual-path derivation with a runtime flag to support fail-fast vs error-accumulating workflows.
  • Practical use cases include deriving encoders/decoders for ADTs, nested case classes, and mixed field types with minimal boilerplate.

Quick Start

Derive a type class for a sample case class using CaseClass.parse to see encoder/decoder paths.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: hearth-case-class-rules
Download link: https://github.com/kubuszok/kindlings/archive/main.zip#hearth-case-class-rules

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 510,000+ vetted skills library on demand.