yandex/city-services-pub/yx-state-fundamentals

Claude Code and agent skill by yandex/city-services-pub

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Apply the yx_state rules to Dart or Flutter code that uses the yx_state package. Trigger in any of these cases: (1) the user names yx_state, StateReadable, StateManagerObserver, StateManagerOverrides, or a StateBuilder, StateListener, StateConsumer or StateSelector widget; (2) the code imports package:yx_state or package:yx_state_flutter; (3) a state update was lost, duplicated or reordered in code built on it. Trigger on StateManager, handle, emit or a strategy name (sequential, restartable, droppable, concurrent) only where they appear as yx_state code - a class extending StateManager, a handle((emit) async {...}) call, a handler: argument - or next to yx_state itself. As bare words about another package they are NOT a trigger: bloc_concurrency uses the same four strategy names, and handle and emit are ordinary Dart. Do NOT apply to general Flutter state management questions about BLoC, Provider, Riverpod or setState when no yx_state code is involved.

Install

npx vskill@latest install yandex/city-services-pub/yx-state-fundamentals

SKILL.md

yx_state: one state object behind an operation queue

A StateManager owns one state object, and every write to it goes through handle. The strategy you pick decides what happens when a second call arrives while the first is still running: queue it, drop it, cancel the previous one, or run both. Only the default, sequential, guarantees order.

Principles (cheat sheet)

Details are in the references below; read the one that matches the question, not all of them.

  1. All logic lives inside `handle((emit) async {...})`. That is what the operation queue governs.
  2. `emit` is only valid inside its own handler. A call that escapes it is a race that debug

catches and release does not - see references/handle.md for what exactly happens and why.

  1. Pick the strategy deliberately. Sequential queues the work, restartable cancels the previous

run, droppable ignores the new call while one is running, concurrent runs everything at once.

  1. Cancellation is cooperative. A cancelled handler keeps running until it checks emit.isDone,

so long operations have to check it.

  1. `close()` is mandatory, and it belongs to whoever owns the manager.
  2. What goes outward is `StateReadable<T>`, the read-only interface.

References index - topic to file

TopicFile
Concepts, kinds of state, strategiesreferences/overview.md
handle and emit rules, cancellation, close()references/handle.md
the Observer, the local hooks, StateManagerOverridesreferences/observer.md
StateBuilder, StateListener, StateSelector, wiring to a DI container, ten antipatternsreferences/flutter_recipes.md

Beyond this skill

This skill covers the package itself. Which state belongs in a manager at all, how managers are coordinated when a feature needs several of them, and where a ViewModel fits are questions about the architecture around the package - they are answered by the yx-architecture skill at https://github.com/yandex/city-services-pub/tree/main/yx_architecture.

The DI and navigation packages of the same stack ship their own skills, yx-scope-fundamentals and yx-navigation-fundamentals. Install them with fvm dart run skills@ get --agent <your agent> when the project depends on those packages.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/yandex/city-services-pub/yx-state-fundamentals/badge)](https://verified-skill.com/skills/yandex/city-services-pub/yx-state-fundamentals)

Something wrong with this skill or its page? Tell us.