bloc

bloc is a skill for Claude Code, Codex from VeryGoodOpenSource/vgv-ai-flutter-plugin. It costs 13 tokens per session (1,614 once invoked), scanned A, original, MIT.

A set of coding rules for managing application state in Flutter and Dart with the BLoC pattern, which keeps business logic separate from screens.

In plain words
What is it for?
Use it when building or testing Flutter features that use Bloc or Cubit, including state classes, event handling, mocks, and page/view separation.
Why use it?
It gives developers consistent ways to structure state, events, tests, and feature responsibilities instead of putting logic directly in widgets.

Skill for Claude CodeCodex

Part of the vgv-ai-flutter-plugin plugin — 15 skills, 1 agent, 3 hooks, 2 MCP servers shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/verygoodopensource/vgv-ai-flutter-plugin/bloc
Any agent
npx skills add VeryGoodOpenSource/vgv-ai-flutter-plugin --skill bloc
Clone the repo
git clone --depth 1 https://github.com/VeryGoodOpenSource/vgv-ai-flutter-plugin

Made for: Claude Code, Codex.

Or install vgv-ai-flutter-plugin, the plugin that ships this one along with the rest of its 15 skills, 1 agent, 3 hooks, 2 MCP servers.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bloc

README.md
[![agentmods](https://agentmods.dev/badge/skills/verygoodopensource/vgv-ai-flutter-plugin/bloc.svg)](https://agentmods.dev/skills/verygoodopensource/vgv-ai-flutter-plugin/bloc)
Your own site
<a href="https://agentmods.dev/skills/verygoodopensource/vgv-ai-flutter-plugin/bloc"><img src="https://agentmods.dev/badge/skills/verygoodopensource/vgv-ai-flutter-plugin/bloc.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,614 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00013 $0.01614
Opus 5 $0.00006 $0.00807
Sonnet 5 $0.00003 $0.00323
Haiku 4.5 $0.00001 $0.00161

Measured 4d ago against content hash 29e14eb350ce, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

bloc scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/bloc/SKILL.md · 219 lines

How it starts

The opening of the file, as written. The whole thing — 219 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bloc

State management library for Dart and Flutter using the BLoC (Business Logic Component) pattern to separate business logic from the presentation layer.


Core Standards

Apply these standards to ALL Bloc/Cubit work:

  • Use blocTest() from package:bloc_test for all Bloc and Cubit tests — never raw test() with manual stream assertions
  • Use package:mocktail for mocking — never package:mockito
  • No bloc-to-bloc direct dependencies — blocs communicate through the UI or shared repositories
  • Page/View separation — Page provides the Bloc/Cubit via BlocProvider, View consumes via BlocBuilder/BlocListener
  • Sealed classes for events and multi-state types — enables exhaustive pattern matching with Dart 3 switch
  • Equatable for all states and events — extend Equatable and override props for value equality
  • Business logic in Bloc/Cubit only — never in widgets, pages, or views
  • Single responsibility — one Bloc/Cubit per feature concern
  • Emit only after async checks — use emit only inside the handler callback

Cubit vs Bloc

Aspect Cubit Bloc
API Functions → emit(state) Events → on<Event>emit(state)
Complexity Low Higher
Traceability Less (no event log) Full (events + transitions)
When to use Simple state, UI-driven logic Complex flows, event-driven, transforms
Testing Call methods, assert states Add events, assert states

Cubit Example

class CounterCubit extends Cubit<int> {
  CounterCubit() : super(0);

  void increment() => emit(state + 1);
  void decrement() => emit(state - 1);
}

Bloc Example

sealed class CounterEvent extends Equatable {
  const CounterEvent();

  @override
  List<Object> get props => [];
}

final class CounterIncrementPressed extends CounterEvent {}
final class CounterDecrementPressed extends CounterEvent {}

class CounterBloc extends Bloc<CounterEvent, int> {
  CounterBloc() : super(0) {
    on<CounterIncrementPressed>((event, emit) => emit(state + 1));
    on<CounterDecrementPressed>((event, emit) => emit(state - 1));
  }
}

Read the full file on GitHub · 219 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 219 lines · 13 tokens per session scan A 29e14eb350ce

Subscribe to this mod's changes

bloc is a skill published in the GitHub repository VeryGoodOpenSource/vgv-ai-flutter-plugin (160 stars, last pushed today), licensed MIT. It adds 13 tokens to every session and 1,614 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.