Agent skill

Flutter Startup Network Blocking

by divinevideo in divinevideo/divine-mobile

Fix slow Flutter app startup caused by blocking network operations during initialization.

MPL-2.0Auto-check passedMobile

Install Flutter Startup Network Blocking

skills CLI
$ npx skills add divinevideo/divine-mobile --skill flutter-startup-network-blocking -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install divinevideo/divine-mobile flutter-startup-network-blocking --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/flutter-startup-network-blocking .claude/skills/flutter-startup-network-blocking && rm -rf skills-src

Use ~/.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/

Facts

Skill name
flutter-startup-network-blocking
GitHub stars
265
Token cost
~1.2k tokens
SKILL.md length
313 words
Files
1
Skills in repo
103
Repo updated
First seen
Licence
MPL-2.0

At a glance

Fix slow Flutter app startup caused by blocking network operations during initialization.

  • Works in 4 steps: Identify Blocking Operations → Convert Sequential to Parallel → Defer Non-Critical Service Initialization → …
  • App takes several seconds to show first frame
  • SKILL.md covers Problem, Context / Trigger Conditions, Solution and Verification, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Flutter Startup Network Blocking is an agent skill from divinevideo/divine-mobile. Fix slow Flutter app startup caused by blocking network operations during initialization. Use when: (1) App takes several seconds to show first frame, (2) Startup logs show sequential network operations (WebSocket connections, API calls), (3) Services initialize during startup that aren't needed until user authenticates. Covers: converting sequential network ops to parallel with Future.wait(), deferring service initialization until actually needed (lazy init), and identifying blocking operations in…

Its SKILL.md is about 1.2k 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 and Realtime and WebSockets. It works with Flutter. The licence is MPL-2.0.

When your agent uses it

  • App takes several seconds to show first frame
  • Startup logs show sequential network operations (WebSocket connections
  • Services initialize during startup that arent needed until user authenticates

Example prompts

  • “/flutter-startup-network-blocking”

Workflow steps

4 steps, taken from the step headings in SKILL.md.

  1. Identify Blocking Operations
  2. Convert Sequential to Parallel
  3. Defer Non-Critical Service Initialization
  4. Use Provider Dependencies for Lazy Init

What it can do on your machine

Read from SKILL.md and the folder at commit 8d5fbf2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    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.

  • Runs code

    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.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.flutter.dev
    • api.dart.dev
    • riverpod.dev

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Flutter Startup Network Blocking loads about 1.2k tokens when it runs. Until then it costs about 144 tokens; SKILL.md has 313 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~144
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

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.

Safety

Auto-check passed

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.

SKILL.md

The full file from divinevideo/divine-mobile at commit 8d5fbf2, republished under its MPL-2.0 licence (© divinevideo). 313 words, ~1,223 tokens.

Download SKILL.mdSave it as .claude/skills/flutter-startup-network-blocking/SKILL.md (or your agent's skills folder).
name
flutter-startup-network-blocking
description
Fix slow Flutter app startup caused by blocking network operations during initialization. Use when: (1) App takes several seconds to show first frame, (2) Startup logs show sequential network operations (WebSocket connections, API calls), (3) Services initialize during startup that aren't needed until user authenticates. Covers: converting sequential network ops to parallel with Future.wait(), deferring service initialization until actually needed (lazy init), and identifying blocking operations in Riverpod/provider initialization chains.
author
Claude Code
version
1.0.0
date
2026-02-01

Flutter Startup Network Blocking

Problem

Flutter app startup is slow because network operations (WebSocket connections, API calls, service initialization) run sequentially during the initialization phase, blocking the first frame from rendering. With multiple relay/server connections, worst-case startup time becomes O(n × timeout) instead of O(max timeout).

Context / Trigger Conditions

  • App takes 3+ seconds to show first frame on fresh launch
  • Startup logs show sequential "connecting to relay X... connecting to relay Y..."
  • Services that require authentication initialize even for unauthenticated users
  • _initializeCoreServices() or similar contains multiple awaited network operations
  • Riverpod providers eagerly initialize network-dependent services in their build() method

Solution

1. Identify Blocking Operations

Look for sequential awaits in startup code:

dart
// BAD: Sequential - each connection blocks the next
for (final url in relays) {
  await connectToRelay(url);  // Blocks startup!
}
2. Convert Sequential to Parallel

Use Future.wait() to run all connections simultaneously:

dart
// GOOD: Parallel - all connections run at once
final results = await Future.wait(
  relays.map((url) async {
    final success = await connectToRelay(url);
    return MapEntry(url, success);
  }),
);
3. Defer Non-Critical Service Initialization

Move network-dependent services out of the critical startup path:

Before (blocking startup):

dart
Future<void> _initializeCoreServices(ProviderContainer container) async {
  await container.read(authServiceProvider).initialize();
  await container.read(nostrServiceProvider).initialize();  // BLOCKS for relay connections!
  await container.read(otherServiceProvider).initialize();
}

After (lazy initialization):

dart
Future<void> _initializeCoreServices(ProviderContainer container) async {
  // NOTE: NostrService initializes lazily when user authenticates
  await container.read(authServiceProvider).initialize();
  await container.read(seenVideosServiceProvider).initialize();
  // NostrService NOT initialized here - happens when auth state changes
}
4. Use Provider Dependencies for Lazy Init

Let Riverpod handle lazy initialization through provider dependencies:

dart
@riverpod
NostrClient nostrClient(NostrClientRef ref) {
  final authService = ref.watch(authServiceProvider);

  // Only creates client when auth state is ready
  if (!authService.isAuthenticated) {
    return NostrClient.disconnected();
  }

  // Initialize lazily when actually needed
  final client = NostrClient(relays: authService.userRelays);
  Future.microtask(() => client.initialize());
  return client;
}

Verification

  1. Check startup logs for "First frame rendered in Xms" - should be < 2000ms
  2. Verify network operations happen AFTER first frame timestamp in logs
  3. For unauthenticated users, relay connections should NOT appear in startup logs

Example

Startup improvement achieved:

  • Before: First frame at 3500ms+ (waiting for 5 relays × ~700ms each)
  • After: First frame at 1426ms (parallel connections happen post-frame)

Log pattern showing fix working:

[18:15:17.538] First frame rendered in 1426ms
[18:15:17.556] Creating NostrClient...  // AFTER first frame!

Notes

  • This pattern applies to any async initialization, not just WebSockets
  • Consider timeout handling when parallelizing - use Future.wait with error handling
  • For critical services, use a loading screen rather than blocking the main thread
  • Profile with Flutter DevTools Timeline to identify other startup bottlenecks
  • Remember that Future.wait() fails fast by default - use try/catch inside the map if you want partial success
  • Splash screen with async initialization
  • Riverpod AsyncNotifier for lazy-loaded state
  • Background service initialization after first frame

References

© divinevideo, MPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/flutter-startup-network-blocking of divinevideo/divine-mobile.

Open the folder on GitHubat commit 8d5fbf2

Compare with similar skills

Flutter Startup Network Blocking 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.

Flutter Startup Network Blocking compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Flutter Startup Network Blocking this skilldivinevideo/divine-mobile265—~1.2kAutomated safety check: PassMPL-2.0
Flutter NetworkingMADTeacher/mad-agents-skills110—~1.8kAutomated safety check: PassMIT
Asyncredux Abort Dispatchmarcglasberg/async_redux238—~2.3kAutomated safety check: PassCustom licence
Nitro Fetchmargelo/react-native-skills175—~1.5kAutomated safety check: PassMIT
Layered ArchitectureVeryGoodOpenSource/vgv-ai-flutter-plugin169—~4.6kAutomated safety check: PassMIT
Lunora Realtimeanolilab/lunora283—~2.4kAutomated safety check: PassCustom licence

Similar skills

  • Flutter Networking

    MADTeacher/mad-agents-skills

    Implement, fix, debug, review, or refactor Flutter networking code for HTTP/REST APIs, WebSocket realtime flows, authentication and token refresh, request headers, timeouts, retries, JSON parsing…

    110 GitHub stars~1.8k tokensUpdated 5 mo ago
    MobileAuto-check passed
  • Asyncredux Abort Dispatch

    marcglasberg/async_redux

    Stops an AsyncRedux (Flutter) action from dispatching. An agent skill from marcglasberg/async_redux.

    238 GitHub stars~2.3k tokensUpdated yesterday
    MobileAuto-check passed
  • Nitro Fetch

    margelo/react-native-skills

    Fast native networking primitives for React Native built on Nitro Modules — react-native-nitro-fetch, react-native-nitro-websockets, and react-native-nitro-text-decoder.

    175 GitHub stars~1.5k tokensUpdated 1 mo ago
    MobileAuto-check passed
  • Layered Architecture

    VeryGoodOpenSource/vgv-ai-flutter-plugin

    VGV layered monorepo architecture in Flutter: four layers Data, Repository, Business Logic, and Presentation, unidirectional dependency rules, and model transformation across layers.

    169 GitHub stars~4.6k tokensUpdated yesterday
    MobileAuto-check passed
  • Lunora Realtime

    anolilab/lunora

    Wires Lunora's live data into a client. An agent skill from anolilab/lunora.

    283 GitHub stars~2.4k tokensUpdated today
    MobileAuto-check passed
  • Flutter Caching Data

    btwld/superdeck

    Implements caching strategies for Flutter apps to improve performance and offline support.

    129 GitHub stars~2k tokensUpdated 9 days ago
    MobileAuto-check passed

More from divinevideo/divine-mobile

All 103 skills in this repo
  • Fix ArgoCD ExternalSecret deployment failing with "namespace X is not permitted in project Y".

    265 GitHub stars~931 tokensUpdated today
    Auto-check passed
  • Art Direct

    divinevideo/divine-mobile

    Art direction for any content — reads text, PDF, Word, HTML, PPT, then proposes 2-3 creative directions with photography style, mood, and visual language.

    265 GitHub stars~4.8k tokensUpdated today
    Auto-check passed
  • Async Await Null Race Condition

    divinevideo/divine-mobile

    Fix "Null check operator used on a null value" errors when an object is set to null during an async await.

    265 GitHub stars~881 tokensUpdated today
    Auto-check passed
  • AWS V4 Signing Custom Headers Gcs

    divinevideo/divine-mobile

    Add custom metadata headers (x-amz-meta-) to AWS v4 signed requests for GCS S3-compatible API.

    265 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Bash Herestring Newline Secrets

    divinevideo/divine-mobile

    Fix password/secret authentication failures caused by trailing newlines when creating Google Cloud secrets (or similar) with bash here-strings.

    265 GitHub stars~791 tokensUpdated today
    Auto-check passed
  • Fix silent video/media processing failures caused by URL extraction code that filters on file extensions (.mp4, .webm, .webp).

    265 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Works with

Questions about Flutter Startup Network Blocking

What does Flutter Startup Network Blocking do?

Fix slow Flutter app startup caused by blocking network operations during initialization. Flutter Startup Network Blocking is an agent skill from divinevideo/divine-mobile. Fix slow Flutter app startup caused by blocking network operations during initialization.

When should I use Flutter Startup Network Blocking?

Flutter Startup Network Blocking fits situations like: app takes several seconds to show first frame; startup logs show sequential network operations (WebSocket connections; services initialize during startup that arent needed until user authenticates.

How do I install Flutter Startup Network Blocking in Claude Code?

Run `npx skills add divinevideo/divine-mobile --skill flutter-startup-network-blocking -a claude-code`. Or copy the skill folder (.agents/skills/flutter-startup-network-blocking in divinevideo/divine-mobile) into .claude/skills/flutter-startup-network-blocking in your project. Claude Code loads it when a task matches its description.

How do I install Flutter Startup Network Blocking in Codex?

Run `npx skills add divinevideo/divine-mobile --skill flutter-startup-network-blocking -a codex`. Or copy the skill folder (.agents/skills/flutter-startup-network-blocking in divinevideo/divine-mobile) into .agents/skills/flutter-startup-network-blocking in your project. Codex loads it when a task matches its description.

Can I use Flutter Startup Network Blocking in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add divinevideo/divine-mobile --skill flutter-startup-network-blocking -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/flutter-startup-network-blocking, .gemini/skills/flutter-startup-network-blocking, .github/skills/flutter-startup-network-blocking and .opencode/skills/flutter-startup-network-blocking in your project.

What does Flutter Startup Network Blocking need to run?

SKILL.md names no scripts, command-line tools or credentials: Flutter Startup Network Blocking is instructions for the agent only.

Does Flutter Startup Network Blocking access the network?

SKILL.md names 3 domains. As links in the text: docs.flutter.dev, api.dart.dev and riverpod.dev. This is read from the text; nothing was executed.

Is Flutter Startup Network Blocking safe to install?

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.

What licence does Flutter Startup Network Blocking use?

Flutter Startup Network Blocking is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Flutter Startup Network Blocking use?

About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Flutter Startup Network Blocking?

Skills that share tags, products or a category with Flutter Startup Network Blocking: Flutter Networking (MADTeacher/mad-agents-skills, 110 stars), Asyncredux Abort Dispatch (marcglasberg/async_redux, 238 stars), Nitro Fetch (margelo/react-native-skills, 175 stars) and Layered Architecture (VeryGoodOpenSource/vgv-ai-flutter-plugin, 169 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Flutter Startup Network Blocking?

divinevideo (a GitHub organization) maintains it in divinevideo/divine-mobile, which has 265 GitHub stars. The repository holds 103 skills in this directory. The repository was last updated on October 7, 2026.

Source: divinevideo/divine-mobile on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.