service-boundary-and-native

service-boundary-and-native is a skill for Claude Code from zakariaf/Flutter-Skills. It costs 188 tokens per session (4,215 once invoked), scanned A, original, MIT.

A set of rules for putting platform features and external services behind injectable interfaces. An interface describes what the app can request, while the real implementation is connected at the app's composition root.

In plain words
What is it for?
Use it to structure logging, sharing, remote settings, time access, MethodChannel calls, multiple app flavors, and headless tests.
Why use it?
It keeps feature code independent from SDKs, native channels, and environment details. Tests can use hand-written fakes instead of calling real devices or services.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the flutter plugin — 40 skills shipped together

Good fit Use it to structure logging, sharing, remote settings, time access, MethodChannel calls, multiple app flavors, and headless tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zakariaf/flutter-skills/service-boundary-and-native
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.

Any agent
npx skills add zakariaf/Flutter-Skills --skill service-boundary-and-native
Clone the repo
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills

Made for: Claude Code.

Or install flutter, the plugin that ships this one along with the rest of its 40 skills.

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 service-boundary-and-native

README.md
[![agentmods](https://agentmods.dev/badge/skills/zakariaf/flutter-skills/service-boundary-and-native/github.svg)](https://agentmods.dev/skills/zakariaf/flutter-skills/service-boundary-and-native)
Your own site
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/service-boundary-and-native"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/service-boundary-and-native/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for service-boundary-and-native

Your own site · 80×15
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/service-boundary-and-native"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/service-boundary-and-native.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 188 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,215 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00188 $0.04215
Opus 5 $0.00094 $0.02107
Sonnet 5 $0.00038 $0.00843
Haiku 4.5 $0.00019 $0.00421

Measured 11d ago against content hash 2831477998bc, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

service-boundary-and-native 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 11d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/check-flavor-graph.sh, scripts/check-service-boundaries.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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/service-boundary-and-native/SKILL.md · 228 lines

How it starts

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

Service boundary and native

Every platform capability — reading "now", sharing, logging an event, fetching remote flags, calling a MethodChannel — crosses the app's layers as an injected interface. The interface names value types only; the concrete SDK lives in exactly one class; the composition root (main) wires one live impl; tests wire a deterministic fake. Abstract exactly what cannot run in a test — nothing more. This is the seam that keeps features pure, SDKs swappable, and the whole app testable headlessly.

Read the reference for the task at hand:

  • references/service-interface.md — typed outcomes vs bool/throw, exhaustiveness, @useResult, hand-written env-fakes, the arrow-callback Future-drop hole, single write path.
  • references/native-channels.md — MethodChannel placement, the cross-language contract ownership table, versioned-file-vs-shared_preferences traps, native-fast-path independence, the round-trip integration_test.
  • references/multi-flavor.md — line-for-line composition roots, build flavors over runtime detection, per-flavor plugin pins, the banned-dependency CI graph gate.

Run scripts/check-service-boundaries.sh and scripts/check-flavor-graph.sh before a PR.

Non-negotiable rules

  1. Every side effect is an injected interface, never a concrete SDK at the call site. Features, Notifiers, and repositories depend on the interface; the app imports the real SDK in exactly one live-impl class. WHY: one seam to swap, one place to quarantine platform quirks, zero SDK reach into pure code.
  2. Abstract only what cannot run in flutter test. One interface + one real impl + one fake = justified. One interface + one impl + no fake = delete the interface. WHY: interfaces "for symmetry" are dead weight that hide where the real risk (untestable I/O) is.
  3. Interface signatures reference value types only. Name a DateTime, a domain value object, a sealed outcome — never a plugin type, never a dart:io symbol. WHY: keeps the interface nameable from any layer and the SDK confined to one class.
  4. Every method returns a typed result — failure is control flow, not a swallowed exception. Model a cancel, an empty fetch, an unavailable target as a sealed outcome or Result<T, F extends Failure>, never a thrown-and-forgotten exception. WHY: Dart requires no throws declaration, so an unhandled failure silently vanishes. See error-handling-typed-results for the Result/Failure spine.
  5. The provider throws UnimplementedError until overridden — the provider IS the DI. No get_it, no service locator, no second container, no business logic in the provider body. WHY: a forgotten wiring becomes a loud startup failure instead of silent null data or a live SDK opening at import.
  6. Wire exactly one live impl per interface at the composition root. main (per flavor) is the only place a live SDK is constructed; app.dart and every widget below are wiring-blind. WHY: the composition root is the single seam where the real world is chosen.
  7. Tests install a hand-written fake that honours the contract — fakes over mocks. The fake's failure path must be reachable; a fake that always succeeds is a happy-path lie. implements (not extends) so a new interface method breaks the build. WHY: a passing test must reflect real behaviour, including the failure it exists to guard.
  8. The clock is injected via clockProvider (a Clock from package:clock) — "now" has exactly one source. No DateTime.now() / math.Random() reachable from a view, Notifier, repository, or pure core; feature code reads ref.read(clockProvider).now(), pure core takes a Clock or the ambient clock. Never a bespoke ClockService/SystemClock. WHY: this is what makes date/streak/expiry logic deterministic by overriding with Clock.fixed(...). See value-objects-money-and-units for the injected Clock.
  9. A mutating service feeds the single write path — persist before publish. A service that changes durable state is consumed by a repository method that commits (one transaction) before any state republishes. WHY: a crash mid-flow must never leave "acknowledged but not durable".
  10. Every MethodChannel lives under one lib/native/ directory; nothing else creates one. A channel born inside a widget, repository, or Notifier is a defect regardless of how well it works. WHY: platform channels are the least testable code in the app and must be found in one place.
  11. A cross-language shared format is a versioned contract with one owner per side, edited on both sides in the same commit, and proven by an integration_test. WHY: no compiler, analyzer, or unit test catches a renamed key across the language boundary — only a real round-trip does.

Read the full file on GitHub · 228 lines

Files

What ships with it

7 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. 11d ago First seen · 228 lines · 188 tokens per session scan A 2831477998bc

Subscribe to this mod's changes

service-boundary-and-native is a skill published in the GitHub repository zakariaf/Flutter-Skills (2 stars, last pushed 13d ago), licensed MIT. It adds 188 tokens to every session and 4,215 once invoked, about $0.0009 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-31.

Related

Other skills, from other repositories

common-store-changelog

Generate user-facing release notes for the App Store and Google Play from git history (App Store <=4000 chars, Google Play <=500). Use when generating release notes, app store changelog, play store release, or "what's new" text for a mobile app.

HoangNguyen0403/agent-skills-standard · 60 tokens

android-navigation-3

Install and migrate to Jetpack Navigation 3. Use when implementing Navigation 3 patterns including NavDisplay, NavKey routes, deep links, multiple backstacks, scenes (dialogs, bottom sheets), or migrating from Navigation 2.

HoangNguyen0403/agent-skills-standard · 52 tokens

flutter-auto-route-navigation

Implement typed routing, nested routes, and auth guards using autoroute in Flutter. Use when the task explicitly uses autoroute or its generated router; defer generic deep-link setup and other routing libraries.

HoangNguyen0403/agent-skills-standard · 44 tokens

flutter-dependency-injection

Configure service locator setup using injectable and getit in Flutter. Use when wiring dependency injection with getit or injectable.

HoangNguyen0403/agent-skills-standard · 29 tokens

flutter-getx-state-management

Implement reactive state with GetX controllers, bindings, and observables in Flutter. Use when managing app state with GetxController, Obx, GetBuilder, or dependency lifecycle—not unit tests for existing controllers.

HoangNguyen0403/agent-skills-standard · 48 tokens

accessibility

Audits or remediates Flutter widgets against WCAG 2.2 conformance levels A, AA, or AAA across iOS, Android, Web, macOS, Windows, and Linux, covering Semantics labels and screen reader output under VoiceOver and TalkBack, touch target sizes, dragging alternatives, focus order and keyboard navigation, color contrast…

VeryGoodOpenSource/vgv-ai-flutter-plugin · 119 tokens