python-state-success

Implements consistency model and binding constructs for mutable state in Python.

Updated Jul 15, 2026
One-click install
npx skills add https://github.com/kyzobuild/kyzo-python --skill python-state-success-kyzobuild
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python-state-success
Source: https://github.com/kyzobuild/kyzo-python/tree/main/cursor/skills/python-state-success
Command: npx skills add https://github.com/kyzobuild/kyzo-python --skill python-state-success-kyzobuild

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Python codebases often scatter mutable state and transport clients across managers, engines, and module-level globals, making state evolution untraceable and domain logic unverifiable. This Skill enforces a single convergence point for live state and clients. ## Core Features & Use Cases - Consistency Model Construct: Defines the one unfrozen Pydantic BaseModel per context where clients and proven state fields converge, with state evolution by re-pointing fields to newly constructed facts. - Binding Construct: Provides a connect method that wires constructed transport clients into the consistency model without owning domain logic or decisions. - Use Case: When building a trading position tracker, use this Skill to model PositionState as a discriminated union, hold it in a single PositionConsistencyModel with bus and ledger clients, and wire everything through a PositionBinding connect method instead of writing a manager class. ## Quick Start Ask the AI to apply the python-state-success rules to design a consistency model and binding for your context before writing any class that holds a socket, database client, or mutable field.

Frequently Asked Questions about python-state-success

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

FAQPage Schema
How do I manage mutable state in a Pydantic-based Python architecture?▼

Mutable state belongs in exactly one unfrozen BaseModel per context, called the consistency model, with arbitrary_types_allowed enabled. State evolves by re-pointing fields to newly constructed proven values, never by mutating contents in place.

Where should transport clients like sockets and database connections live in Python?▼

Transport clients live as fields on the single consistency model of a context, constructed elsewhere and passed in. Module-level clients and clients scattered across classes are forbidden because they escape the one node allowed to hold them.

What is the difference between a consistency model and a binding?▼

The consistency model holds live clients and proven state and exposes verbs that evolve state. The binding only has a connect method that receives constructed clients and opening state, performs connection or subscription setup, and returns the constructed consistency model.

Can I use isinstance or match statements inside a consistency model?▼

No, match, if/elif, and isinstance are forbidden inside the consistency model. Variant differences are read from the union value through same-named derivations, and the checker narrows the discriminated union instead of branching.

When should I avoid writing a manager or engine class in Python?▼

Avoid managers and engines whenever they hold domain logic with a technology name and no proof obligation. Their sequencing belongs to the construction graph, their state belongs in the consistency model, and their wiring belongs in the binding.