React Native Best Practices
vercel-labs/openreview
A prioritized rule set for React Native and Expo apps covering list performance, animation, navigation, UI patterns, state, rendering, monorepos and configuration.
A skill your agent uses when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or choosing between Cubit…
$ npx skills add evanca/flutter-ai-rules --skill bloc -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install evanca/flutter-ai-rules bloc --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/evanca/flutter-ai-rules.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/bloc .claude/skills/bloc && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "bloc" agent skill from https://github.com/evanca/flutter-ai-rules/tree/main/skills/bloc into .claude/skills/bloc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/evanca/flutter-ai-rules/tree/main/skills/blocType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add evanca/flutter-ai-rules --skill bloc -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install evanca/flutter-ai-rules bloc --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/evanca/flutter-ai-rules.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/bloc .agents/skills/bloc && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "bloc" agent skill from https://github.com/evanca/flutter-ai-rules/tree/main/skills/bloc into .agents/skills/bloc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add evanca/flutter-ai-rules --skill bloc -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install evanca/flutter-ai-rules bloc --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/evanca/flutter-ai-rules.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/bloc .cursor/skills/bloc && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "bloc" agent skill from https://github.com/evanca/flutter-ai-rules/tree/main/skills/bloc into .cursor/skills/bloc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/evanca/flutter-ai-rules.git --path skills/bloc--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add evanca/flutter-ai-rules --skill bloc -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install evanca/flutter-ai-rules bloc --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/evanca/flutter-ai-rules.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/bloc .gemini/skills/bloc && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "bloc" agent skill from https://github.com/evanca/flutter-ai-rules/tree/main/skills/bloc into .gemini/skills/bloc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install evanca/flutter-ai-rules blocInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add evanca/flutter-ai-rules --skill bloc -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/evanca/flutter-ai-rules.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/bloc .github/skills/bloc && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "bloc" agent skill from https://github.com/evanca/flutter-ai-rules/tree/main/skills/bloc into .github/skills/bloc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add evanca/flutter-ai-rules --skill bloc -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install evanca/flutter-ai-rules bloc --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/evanca/flutter-ai-rules.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/bloc .opencode/skills/bloc && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "bloc" agent skill from https://github.com/evanca/flutter-ai-rules/tree/main/skills/bloc into .opencode/skills/bloc/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "bloc", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
blocA skill your agent uses when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or choosing between Cubit…
Bloc is an agent skill from evanca/flutter-ai-rules. Use when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or choosing between Cubit and Bloc.
Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Mobile, covering Cross-platform mobile apps. The repository describes itself as: Flutter AI Skills and Rules for Claude, Codex, Cursor, and Other AI-Powered IDEs. The licence is MIT.
9 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 7b9cce2. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are dart).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
pub.devgithub.comFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Bloc loads about 2.8k tokens when it runs. Until then it costs about 48 tokens; SKILL.md has 677 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from evanca/flutter-ai-rules at commit 7b9cce2, republished under its MIT licence (© evanca). 677 words, ~2,787 tokens.
.claude/skills/bloc/SKILL.md (or your agent's skills folder).Design, implement, and test state management using the bloc and flutter_bloc libraries.
Use this skill when:
BlocBuilder, BlocListener, BlocConsumer, or BlocProvider in the widget tree.| Situation | Use |
|---|---|
| Simple state, no events needed | Cubit |
| Complex flows, event traceability needed | Bloc |
| Advanced event processing (debounce, throttle) | Bloc with event transformers |
Default to Cubit. Refactor to Bloc only when requirements grow.
LoginButtonPressed, UserProfileLoaded.BlocSubject + optional noun + verb.BlocSubjectStarted (e.g., AuthenticationStarted).BlocSubjectEvent.BlocSubjectState.BlocSubject + Initial | InProgress | Success | Failure.LoginInitial, LoginInProgress, LoginSuccess, LoginFailure.BlocSubjectState + BlocSubjectStatus enum (initial, loading, success, failure).switch is desired.@immutable
sealed class LoginState extends Equatable {
const LoginState();
}
final class LoginInitial extends LoginState {
@override
List<Object?> get props => [];
}
final class LoginInProgress extends LoginState {
@override
List<Object?> get props => [];
}
final class LoginSuccess extends LoginState {
const LoginSuccess(this.user);
final User user;
@override
List<Object?> get props => [user];
}
final class LoginFailure extends LoginState {
const LoginFailure(this.message);
final String message;
@override
List<Object?> get props => [message];
}Handle all states exhaustively in the UI:
switch (state) {
case LoginInitial(): ...
case LoginInProgress(): ...
case LoginSuccess(:final user): ...
case LoginFailure(:final message): ...
}enum LoginStatus { initial, loading, success, failure }
@immutable
class LoginState extends Equatable {
const LoginState({
this.status = LoginStatus.initial,
this.user,
this.errorMessage,
});
final LoginStatus status;
final User? user;
final String? errorMessage;
LoginState copyWith({
LoginStatus? status,
User? user,
String? errorMessage,
}) {
return LoginState(
status: status ?? this.status,
user: user ?? this.user,
errorMessage: errorMessage ?? this.errorMessage,
);
}
@override
List<Object?> get props => [status, user, errorMessage];
}Equatable and pass all relevant fields to props.List/Map properties with List.of/Map.of inside props.@immutable.class LoginCubit extends Cubit<LoginState> {
LoginCubit(this._authRepository) : super(const LoginState());
final AuthRepository _authRepository;
Future<void> login(String email, String password) async {
emit(state.copyWith(status: LoginStatus.loading));
try {
final user = await _authRepository.login(email, password);
emit(state.copyWith(status: LoginStatus.success, user: user));
} catch (e) {
emit(state.copyWith(status: LoginStatus.failure, errorMessage: e.toString()));
}
}
}Rules:
emit inside the Cubit/Bloc.void or Future<void> only.storage in a HydratedCubit, pass it as a named parameter: super(initialState, storage: storage).sealed class LoginEvent {}
final class LoginSubmitted extends LoginEvent {
LoginSubmitted({required this.email, required this.password});
final String email;
final String password;
}
class LoginBloc extends Bloc<LoginEvent, LoginState> {
LoginBloc(this._authRepository) : super(LoginInitial()) {
on<LoginSubmitted>(_onLoginSubmitted);
}
final AuthRepository _authRepository;
Future<void> _onLoginSubmitted(
LoginSubmitted event,
Emitter<LoginState> emit,
) async {
emit(LoginInProgress());
try {
final user = await _authRepository.login(event.email, event.password);
emit(LoginSuccess(user));
} catch (e) {
emit(LoginFailure(e.toString()));
}
}
}Rules:
bloc.add(Event()), not custom public methods._onEventName).Three layers — each must stay in its own boundary:
Presentation → Business Logic (Cubit/Bloc) → Data (Repository → DataProvider)Rules:
BlocListener in the UI to bridge blocs.BlocObserver in main.dart.| Widget | Use |
|---|---|
BlocProvider | Provide a bloc to a subtree |
MultiBlocProvider | Provide multiple blocs without nesting |
BlocBuilder | Rebuild UI on state change |
BlocListener | Side effects only (navigation, dialogs, snackbars) |
MultiBlocListener | Listen to multiple blocs without nesting |
BlocConsumer | Rebuild UI + side effects together |
BlocSelector | Rebuild only when a selected slice of state changes |
RepositoryProvider | Provide a repository to the widget tree |
MultiRepositoryProvider | Provide multiple repositories without nesting |
BlocProvider(
create: (context) => LoginCubit(context.read<AuthRepository>()),
child: LoginView(),
);
BlocBuilder<LoginCubit, LoginState>(
builder: (context, state) {
return switch (state.status) {
LoginStatus.loading => const CircularProgressIndicator(),
LoginStatus.success => const HomeView(),
LoginStatus.failure => Text(state.errorMessage ?? 'Error'),
LoginStatus.initial => const LoginForm(),
};
},
);
BlocListener<LoginCubit, LoginState>(
listener: (context, state) {
if (state.status == LoginStatus.failure) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(state.errorMessage ?? 'Login failed')),
);
}
},
child: LoginForm(),
);Rules:
context.read<T>() in callbacks (not in build).context.watch<T>() in build only when necessary; prefer BlocBuilder.context.watch or context.select at the root of build — scope with Builder.Use bloc_test package. Mock repositories with mocktail.
import 'package:bloc_test/bloc_test.dart';
import 'package:mocktail/mocktail.dart';
import 'package:test/test.dart';
class MockAuthRepository extends Mock implements AuthRepository {}
void main() {
group('LoginCubit', () {
late AuthRepository authRepository;
late LoginCubit loginCubit;
setUp(() {
authRepository = MockAuthRepository();
loginCubit = LoginCubit(authRepository);
});
tearDown(() => loginCubit.close());
test('initial state should be LoginState with status initial', () {
expect(loginCubit.state, const LoginState());
});
blocTest<LoginCubit, LoginState>(
'should emit [loading, success] when login succeeds',
build: () {
when(() => authRepository.login(any(), any()))
.thenAnswer((_) async => fakeUser);
return loginCubit;
},
act: (cubit) => cubit.login('email@test.com', 'password'),
expect: () => [
const LoginState(status: LoginStatus.loading),
LoginState(status: LoginStatus.success, user: fakeUser),
],
);
blocTest<LoginCubit, LoginState>(
'should emit [loading, failure] when login throws',
build: () {
when(() => authRepository.login(any(), any()))
.thenThrow(Exception('error'));
return loginCubit;
},
act: (cubit) => cubit.login('email@test.com', 'wrong'),
expect: () => [
const LoginState(status: LoginStatus.loading),
isA<LoginState>().having((s) => s.status, 'status', LoginStatus.failure),
],
);
});
}Rules:
tearDown(() => cubit.close()).blocTest for state emission assertions.group() named after the class under test.registerFallbackValue(MyEvent()).| Pitfall | Fix |
|---|---|
| Emitting the same state instance twice | Always create a new state object; bloc ignores duplicate emissions via ==. |
Calling context.watch inside callbacks | Use context.read in callbacks; watch is only valid inside build. |
Forgetting Equatable props | Add every field to props; missing fields cause silent state update bugs. |
| Mutable state fields | Keep state @immutable; use copyWith or new sealed subclass instances. |
| Business logic in widgets | Move all logic into the Cubit/Bloc; widgets only dispatch events or call methods. |
// BAD — mutating state in-place
state.items.add(newItem);
emit(state);
// GOOD — emit a new state with copied list
emit(state.copyWith(items: [...state.items, newItem]));© evanca, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/bloc of evanca/flutter-ai-rules.
Open the folder on GitHubat commit 7b9cce2
Bloc next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Bloc this skillevanca/flutter-ai-rules | 649 | — | ~2.8k | Automated safety check: Pass | MIT | |
| React Native Best Practicesvercel-labs/openreview | 1.7k | 17 repos | ~1.1k | Automated safety check: Pass | MIT | |
| Compose Multiplatform Patternsmonta-app/ocpp-emulator | 180 | 5 repos | ~2k | Automated safety check: Pass | Apache-2.0 | |
| Creating Reanimated Animationsgluestack/gluestack-ui | 5.3k | — | ~2.4k | Automated safety check: Pass | None | |
| Uni-app Components and APIsfeige996/unibest | 2.3k | — | ~1.6k | Automated safety check: Pass | MIT | |
| Add Flutter Docusaurus Localematthiasn/lotti | 1.2k | — | ~1.2k | Automated safety check: Pass | GPL-3.0 |
vercel-labs/openreview
A prioritized rule set for React Native and Expo apps covering list performance, animation, navigation, UI patterns, state, rendering, monorepos and configuration.
monta-app/ocpp-emulator
Compose Multiplatform and Jetpack Compose patterns for KMP projects — state management, navigation, theming, performance, and platform-specific UI.
gluestack/gluestack-ui
Generate React Native Reanimated animation code for React Native apps.
feige996/unibest
Gives per-component and per-API examples, reference specs and compatibility notes for building cross-platform uni-app apps, mirroring the official documentation.
matthiasn/lotti
Add, complete, or audit a locale across a Flutter application's ARB catalogs and a localized Docusaurus manual, including generated localization code, locale selectors, native platform declarations…
aldefy/compose-skill
Guides Jetpack Compose and Compose Multiplatform work across Android, Desktop, iOS and web, plus Android TV, Material 3 motion, paging, navigation and design-to-code.
evanca/flutter-ai-rules
A skill your agent uses when asked to review a PR, MR, branch, or diff, audit changed files, or check code quality.
evanca/flutter-ai-rules
A skill your agent uses when building AI agents in Dart, implementing Genkit flows or tools, integrating LLMs into Dart or Flutter applications, or using Genkit Dart plugins.
evanca/flutter-ai-rules
A skill your agent uses when generating or editing images from Flutter/Dart with Firebase AI Logic and a Gemini image model (Nano Banana), making the first call work, choosing Gemini Developer API…
evanca/flutter-ai-rules
A skill your agent uses when building any Flutter screen or component to choose responsive Row, Column, Expanded, Flexible, and Spacer layouts before fixed-size or coordinate-based alternatives.
evanca/flutter-ai-rules
A skill your agent uses when creating a feature, designing folder structure, adding repositories/services/view models, wiring dependency injection, or deciding which layer owns logic.
evanca/flutter-ai-rules
A skill your agent uses when writing switch statements, refactoring if-else chains, creating data classes, choosing records vs classes, destructuring values, or modernizing pre-Dart-3 code.
Categories
A skill your agent uses when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or choosing between Cubit…. Bloc is an agent skill from evanca/flutter-ai-rules. Use when creating a Cubit or Bloc, modeling state with sealed classes or status enums, wiring BlocBuilder/BlocListener/BlocProvider, writing bloc tests, or choosing between Cubit and Bloc.
Bloc fits situations like: creating a Cubit; modeling state with sealed classes; wiring BlocBuilder/BlocListener/BlocProvider; writing bloc tests.
Run `npx skills add evanca/flutter-ai-rules --skill bloc -a claude-code`. Or copy the skill folder (skills/bloc in evanca/flutter-ai-rules) into .claude/skills/bloc in your project. Claude Code loads it when a task matches its description.
Run `npx skills add evanca/flutter-ai-rules --skill bloc -a codex`. Or copy the skill folder (skills/bloc in evanca/flutter-ai-rules) into .agents/skills/bloc in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add evanca/flutter-ai-rules --skill bloc -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/bloc, .gemini/skills/bloc, .github/skills/bloc and .opencode/skills/bloc in your project.
SKILL.md names no scripts, command-line tools or credentials: Bloc is instructions for the agent only.
SKILL.md names 2 domains. As links in the text: pub.dev and github.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Bloc is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Bloc: React Native Best Practices (vercel-labs/openreview, 1.7k stars), Compose Multiplatform Patterns (monta-app/ocpp-emulator, 180 stars), Creating Reanimated Animations (gluestack/gluestack-ui, 5.3k stars) and Uni-app Components and APIs (feige996/unibest, 2.3k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
evanca (a GitHub user) maintains it in evanca/flutter-ai-rules, which has 649 GitHub stars. The repository holds 37 skills in this directory. The repository was last updated on September 14, 2026.
Source: evanca/flutter-ai-rules on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.