implement-state-machine

Configure a UI state machine for screen models and navigation.

219|41|Updated Feb 21, 2024
One-click install
npx skills add https://github.com/proto-at-block/bitkey --skill implement-state-machine
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implement-state-machine
Source: https://github.com/proto-at-block/bitkey/tree/main/app/ai-rules/skills/implement-state-machine
Command: npx skills add https://github.com/proto-at-block/bitkey --skill implement-state-machine

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

UI development often requires mapping screens to a predictable, testable state machine to manage navigation, loading, and error handling across platforms.

Core Features & Use Cases

  • Type 1: simple UI state flows with a single screen
  • Type 2: multi-step flows with loading and error states, navigation, and screen transitions
  • Reuse existing ScreenModel patterns and write tests with state machine helpers

Quick Start

Choose a pattern (Type 1 or Type 2), create minimal Props, implement the model() function, and add tests with state machine helpers.

Frequently Asked Questions about implement-state-machine

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

FAQPage Schema
How do I implement a UI state machine for multi-step navigation in Kotlin Compose?

To implement a UI state machine for multi-step navigation, apply Type 2 patterns to manage loading states, errors, and screen transitions across Android and iOS. You configure minimal Props and implement the model function to drive the presentation layer.

What is the difference between Type 1 and Type 2 UI state machine patterns?

Type 1 patterns handle simple UI state flows confined to a single screen, while Type 2 patterns manage complex multi-step flows that include loading indicators, error handling, and multi-step navigation transitions across platforms.

How do I test UI navigation and state machine flows in Kotlin?

You test UI navigation and state machine flows by utilizing provided state machine helpers to verify screen transitions and state changes. This allows you to validate loading, error, and multi-step navigation logic independently of the UI layer.

Can I use existing ScreenModel patterns when building a UI state machine?

Yes, you can reuse existing ScreenModel patterns when building a UI state machine. The implementation integrates directly with your current architecture to drive screen models and the presentation layer without requiring a complete rewrite.

How do I manage loading and error states for Android and iOS screen flows?

You manage loading and error states for Android and iOS screen flows by configuring a Type 2 state machine. This approach applies predictable state transitions and handles errors uniformly across existing cross-platform navigation patterns.