agentleFS
Poorgramer-ZackPoorgramer-Zack/dart-expert-skills/skills/bloc-signals/SKILL.md

bloc-signals

Skill7 starsChanged 8 months agoMITView on GitHub

Implement, review, test, and migrate Dart and Flutter code that uses BlocSignal (bloc_signals, bloc_signals_flutter, bloc_signals_test), the BLoC-style API built on signals. Use this when the code imports package:bloc_signals, extends BlocSignal or CubitSignal, uses BlocSignalProvider, BlocSignalBuilder, BlocSignalListener, or context.select, or when the user asks how BlocSignal differs from flutter_bloc or wants to move from BLoC to synchronous signal-based state.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the consumer project's pubspec.yaml and pubspec.lock to find the bloc_signals version.

    line 15
  2. Very specific:

    Check every type and member you plan to use against the installed source (package:bloc_signals/...).

    line 16
  3. Distinctive:

    Read the matching reference below, then make the smallest change that keeps behavior.

    line 17
  4. Very specific:

    Read raw values with stateValue (or value) inside methods and handlers.

    line 30
  5. Very specific:

    Never create an effect or computed inside build.

    line 33
  6. Very specific:

    Run flutter analyze and the nearest tests.

    line 43

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

BlocSignal

BlocSignal keeps the BLoC event model (events in, state out) on top of Rody Davis's signals v7 primitives. Its updates are synchronous: emit changes state immediately, with no stream and no microtask. It is young and its API can change, so verify against the installed package source before editing code.

Start from the installed package

  1. Read the consumer project's pubspec.yaml and pubspec.lock to find the bloc_signals version.
  2. Check every type and member you plan to use against the installed source (package:bloc_signals/...). Do not assume parity with package:bloc or Riverpod.
  3. Read the matching reference below, then make the smallest change that keeps behavior.

Route the task

  • references/core.md: BlocSignal, CubitSignal, on<E>, emit, createEffect, equality, and close.
  • references/flutter.md: BlocSignalProvider, BlocSignalBuilder, BlocSignalListener, BlocSignalConsumer, BlocSignalSelector, and context.value/state/select.
  • references/testing.md: blocSignalTest, synchronous assertions, and widget tests.
  • references/migration-from-bloc.md: moving from flutter_bloc / bloc to BlocSignal, and the differences that break code.

Contracts to preserve

  • Constructors take named initialState:. Write : super(initialState: 0), not : super(0).
  • emit is synchronous, and it skips a value equal to the current state.
  • add returns void. Synchronous handlers finish before add returns.
  • close() is idempotent, disposes effects created with createEffect, and drops events after closure.
  • Read raw values with stateValue (or value) inside methods and handlers. state returns a ReadonlySignal for reactive bindings.
  • BlocSignalProvider(create:) is lazy by default and owns its bloc. BlocSignalProvider.value does not own it.
  • context.watch<T>() tracks provider replacement, not state changes. Use BlocSignalBuilder to rebuild on state.
  • Never create an effect or computed inside build. Give it an explicit owner and a disposal path.
  • A global BlocSignalObserver is a single slot. Compose observers instead of replacing them.

Packages

  • bloc_signals: core (pure Dart).
  • bloc_signals_flutter: Flutter providers, builders, listeners, selectors.
  • bloc_signals_test: blocSignalTest helpers.
  • Optional: bloc_signals_lint, bloc_signals_hydrate, bloc_signals_replay, bloc_signals_riverpod, bloc_signals_devtools, bloc_signals_jaspr.

Validation

Run flutter analyze and the nearest tests. The examples in these references were compiled and tested against bloc_signals 1.7.0, bloc_signals_flutter 1.5.0, and bloc_signals_test 1.0.3.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.