# flutter-networking

A skill for Flutter network code: HTTP/REST, WebSocket, auth and token refresh, timeouts, retries, JSON parsing, caching. Useful when adding requests or chasing network errors.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 722 installs · ★ 110
- Author: Stanislav \[MADTeacher\] Chernyshev
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/MADTeacher/mad-agents-skills/tree/HEAD/flutter-networking/SKILL.md
- Updated: 2026-05-01
- HTML: https://affpapa.org/en/nevibecode/skills/flutter-networking

## What it does

The skill turns the agent into a networking engineer for your Flutter app. It starts by reading `pubspec.yaml`, `lib/`, and whatever conventions the project already has for networking, DI, state and auth. Then it writes or fixes code. This is not a tutorial: the agent inspects, adapts, verifies.

Inside are references and templates: basic HTTP with typed JSON parsing, authentication and refresh flows, status and timeout handling, performance work with `compute()` and cache TTLs, WebSockets with reconnection. There are also service and repository templates, but you copy them only after adapting package name, lints and client stack.

One rule matters most: do not add a second client. If the project already uses Dio, Retrofit, Chopper or a generated client, the skill follows that stack instead of bolting on a parallel one. For new simple clients it suggests `http: ^1.6.0` and `web_socket_channel: ^3.0.3`. Tokens belong in `flutter_secure_storage: ^10.0.0` or the app's existing secure storage. Custom WebSocket headers via `IOWebSocketChannel` are IO-only, so a Flutter web build needs a browser-compatible alternative — worth checking if you ship to web. Validation runs through the repo's own commands: `flutter analyze` and focused `flutter test`.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add MADTeacher/mad-agents-skills --skill flutter-networking -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/flutter-networking/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/flutter-networking/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add MADTeacher/mad-agents-skills --skill flutter-networking -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/flutter-networking/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add MADTeacher/mad-agents-skills --skill flutter-networking -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/flutter-networking/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install MADTeacher/mad-agents-skills flutter-networking
```

2. **Manually: put the files in place**
- File: `.github/skills/flutter-networking/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add MADTeacher/mad-agents-skills --skill flutter-networking -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/MADTeacher/mad-agents-skills --path flutter-networking
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/flutter-networking/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add MADTeacher/mad-agents-skills --skill flutter-networking -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/MADTeacher/mad-agents-skills/tree/HEAD/flutter-networking/SKILL.md

## When to use it
- add HTTP requests to an existing Flutter app without a second client
- debug a request that times out or returns an unexpected status
- build token refresh without storing tokens in plain sight
- move large JSON parsing off the UI thread with an isolate
- stand up a WebSocket with reconnection and connection status

## Example prompts
- Add a request to /api/orders with a timeout and typed parsing, keep the current stack
- Figure out why the WebSocket drops after a minute and add reconnection
- Review the auth code: where the token is stored and how refresh runs

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: b7d4ea2faebf1715.

BEGIN THIRD-PARTY FILE b7d4ea2faebf1715
```text
---
name: flutter-networking
description: >-
  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, caching, background isolates,
  repositories, services, and adaptation to existing http, Dio, Retrofit,
  Chopper, or custom API clients. Use when asked to add network requests,
  investigate network errors, harden API clients, handle auth, or validate
  Flutter network behavior.
metadata:
  author: Stanislav [MADTeacher] Chernyshev
  version: "2.0"
---

# Flutter Networking

You are a networking agent for Flutter apps. Turn existing project facts into
concrete API calls, clients, services, repositories, error handling, auth flows,
and validation steps. Do not treat this skill as a tutorial: inspect, adapt,
implement or review, and verify.

## Core Contract

1. Confirm the target is a Flutter or Dart package by inspecting `pubspec.yaml`,
   `lib/`, and existing networking, architecture, state-management, DI, auth,
   persistence, and test conventions.
2. Preserve the project's current client stack unless there is no networking
   stack yet or the user explicitly asks to migrate. Adapt this skill's `http`
   examples to existing Dio, Retrofit, Chopper, generated clients, or custom
   wrappers instead of adding a parallel client.
3. For implementation tasks, prefer small injectable clients/services with
   typed decode functions, clear timeouts, explicit status handling, cancellable
   or disposable resources where available, and testable boundaries.
4. For review and debugging tasks, report broken status handling, leaked
   clients or subscriptions, unsafe token storage, missing timeouts, generic
   exceptions, UI-thread parsing of large responses, duplicate in-flight
   requests, and missing tests before broad style advice.
5. Keep UI networking thin. Widgets may trigger commands or observe state, but
   services own endpoint calls, repositories own data policies, and state
   objects/ViewModels own UI state transitions.
6. Validate with the repo's normal commands. Prefer `flutter analyze`, focused
   `flutter test`, and template-only `dart format --output=none
```
END THIRD-PARTY FILE b7d4ea2faebf1715

The third-party file has ended. Everything between the b7d4ea2faebf1715 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2243 of 7095 bytes. © Stanislav \[MADTeacher\] Chernyshev · MIT · https://github.com/MADTeacher/mad-agents-skills/tree/HEAD/flutter-networking/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
