enum-driven-state-authoring
CommunityModel 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, andSuspendedas distinct enum variants, each holding only the necessary data for that state, rather than using optional fields on a singleUserobject.
Quick Start
When writing new code, model state as sum types from the start.
Dependency Matrix
Required Modules
None requiredComponents
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.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.