yandex/city-services-pub/yx-scope-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_scope rules when working with Dart or Flutter code that uses the yx_scope dependency injection package. Trigger in any of these cases: (1) the user names yx_scope, ScopeContainer, ScopeHolder, ChildScopeContainer, DataScopeContainer, ScopeModule, Dep, AsyncDep, ScopeProvider, ScopeBuilder or ScopeListener; (2) the code imports package:yx_scope or package:yx_scope_flutter; (3) the user asks how to wire dependencies, scopes or their lifetimes in an app built on this package. Do NOT apply to general dependency injection questions about get_it, provider, riverpod or injectable when no yx_scope code is involved.

Install

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

SKILL.md

yx_scope: dependency injection without code generation

Scopes are groups of dependencies that share a lifetime. A container declares the graph, a holder creates and drops it, and nothing is static or generated.

Principles (cheat sheet)

Details are in the references below; read one file, not all three.

  1. A `Dep` never leaves its container. It is lazy, unique inside the container, and read through

.get. What leaves the container is a public scope interface, not the deps themselves.

  1. A separate scope needs start and end conditions of its own. If the lifetime matches the parent

exactly, the answer is a ScopeModule, not a new scope.

  1. A child depends on a parent interface, never on the parent container class. That is what keeps

a scope replaceable and testable.

  1. Async dependencies are initialized in order. Declare them with asyncDep or rawAsyncDep and

list them in initializeQueue; a missing entry means the dep is never initialized.

  1. Scopes create the UI, not the other way round. A container exists independently of the widget

tree, and widgets subscribe to a scope that already exists.

  1. In production use `BaseScopeHolder` with an interface, not ScopeHolder<Container>. The short

form belongs to getting-started examples.

References index - topic to file

TopicFile
Concepts, kinds of scopes, when a scope is justifiedreferences/overview.md
Scope and parent interfaces, BaseScopeHolder, async dependencies, holder patternsreferences/advanced.md
ScopeProvider, ScopeBuilder, ScopeListener, recipes, the linter, ten antipatternsreferences/flutter_recipes.md

Beyond this skill

This skill covers the package itself. How a scope fits into the layers of an application, where an Interactor belongs, and what an embeddable feature module exposes to its host are described by the yx-architecture skill. Install it from https://github.com/yandex/city-services-pub/tree/main/yx_architecture when that context is needed.

The state management and navigation packages of the same stack ship their own skills, yx-state-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, 100 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-scope-fundamentals/badge)](https://verified-skill.com/skills/yandex/city-services-pub/yx-scope-fundamentals)

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