enum-driven-state-authoring

Community

Model state with sum types from the start.

Authorjul-sh
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill helps developers avoid common pitfalls in state management by guiding them to model distinct states as sum types (enums with variants) from the initial code design, preventing complex conditional logic and optional field hell.

Core Features & Use Cases

  • Sum Type Modeling: Guides the creation of sum types for entities with distinct modes, phases, or lifecycle states.
  • Avoids Optional Fields: Prevents the use of optional fields that depend on other fields, leading to more robust and predictable code.
  • Use Case: When building a user authentication flow, model states like Guest, LoggedIn, and Suspended as distinct enum variants, each holding only the necessary data for that state, rather than using optional fields on a single User object.

Quick Start

When writing new code, model state as sum types from the start.

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: enum-driven-state-authoring
Download link: https://github.com/jul-sh/dotfiles/archive/main.zip#enum-driven-state-authoring

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 223,000+ vetted skills library on demand.