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.
npx skills add zakariaf/Flutter-Skills --skill error-handling-typed-resultsgit clone --depth 1 https://github.com/zakariaf/Flutter-SkillsWrote 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.
[](https://agentmods.dev/skills/zakariaf/flutter-skills/error-handling-typed-results)<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/error-handling-typed-results"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/error-handling-typed-results/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.
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/error-handling-typed-results"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/error-handling-typed-results.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00216 | $0.03680 |
| Opus 5 | $0.00108 | $0.01840 |
| Sonnet 5 | $0.00043 | $0.00736 |
| Haiku 4.5 | $0.00022 | $0.00368 |
Grade A, and why
error-handling-typed-results 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.
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.
How it starts
The opening of the file, as written. The whole thing — 218 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Error Handling — Typed Results
Recoverable failures are typed values that flow through the layers and are switched on exhaustively; only genuine bugs and unrecoverable states throw, and those are caught once by a global net. Wrapped around both, never-lose-data — transactions, autosave drafts, soft-delete/Undo — is a first-class subsystem, not plumbing. Two tiers, no middle ground.
Read the reference for the task at hand:
references/result-failure-spine.md— theResult/Failuresource, the per-boundary taxonomy, convert-at-boundary, the global net, isolate re-wrapping, and local logging.references/mechanism-selection.md— throw vsassertvsExceptionvs sealed outcome,@useResult, and the runZonedGuarded decision.references/never-lose-data.md— one transaction per mutation, debounced autosave drafts, optimistic soft-delete / Trash / Undo behind one filter.
Run scripts/check-swallowed-catch.sh and scripts/check-softdelete-parity.sh before a PR.
Non-negotiable rules
- Model recoverable failures as values, not exceptions. Anything that fails for a runtime reason the caller must handle — DB error, file/backup I/O, notification scheduling, an expected not-found, invalid input — returns
Result<T, F extends Failure>(sealedOk/Err). Throwing across a layer for an expected failure is a review reject. - Hand-roll one zero-dependency sealed
ResultandFailurein a Flutter-free layer so pure logic and repositories share ONE vocabulary.result_dartis the sanctioned drop-in if you want ready-madeflatMap/mapError/AsyncResult— adopt it wholesale or hand-roll; never mix both. - One sealed
Failurefamily per boundary, each subtype carrying a stablecode+ typed params — NEVER a user-facing or localized string. A baked-in message breaks translation, RTL mirroring, and numeral rendering. Localize from thecodeat the presentation edge. switchfailures exhaustively with NOdefault:/case _:. Sealed exhaustiveness turns "added a new failure" into a compile error until every switch covers it; adefault:silently defeats the only compiler-grade safety net you have.- Convert at the boundary — log first, then return. Wrap each dangerous call once, catch narrowly with an
onclause, log the original error + stack to the local log BEFORE returning the typed failure. APlatformException/SqliteException/FormatExceptionnever leaks past its adapter into a Notifier or widget. - Never swallow.
catch (_) {}, barecatch (e)that discards type/stack, andthrow e(userethrow) are banned — CI greps for them. Never catchErrorsubtypes (StateError,AssertionError): those are bugs, let them crash in debug. - Keep pure logic total — it never throws. Every pure function returns a value for every input; uncertainty is an explicit output (an
outOfRangevariant, a clamped value). Programmer invariants useassert(stripped in release). Async/error handling lives outside pure code, at the boundary seam. - Anything thrown is a bug or unrecoverable state, routed to the global net — never a recoverable failure. Recoverable failures are typed
Resultvalues that never throw across a layer, so they never reach the net. The two handlers (FlutterError.onError+PlatformDispatcher.instance.onError) and their install order are owned byapp-startup-and-bootstrap; this skill owns only the taxonomy of what reaches them. TherunZonedGuarded-only-for-a-crash-SDK decision is inreferences/mechanism-selection.md. - Re-wrap
Isolate.run/computeerrors asResultat the call site. Isolate errors do not hitFlutterError.onError; catch them where you await or they propagate opaquely. - Log locally only. A size-capped rotating file plus a user-initiated "Export diagnostics" affordance. If you ship a crash SDK, that is a deliberate choice with its own zone; otherwise no Crashlytics/Sentry/Firebase.
- Never lose hand-entered data. One
transaction(...)per multi-table mutation (all-or-nothing); persist in-progress form state to a debounceddraftstable; delete viais_deletedsoft-delete behind a single shared filter, with SnackBar Undo. Detail inreferences/never-lose-data.md.
What ships with it
8 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.
- examples/soft_delete_undo.dart 2.7 KB
- examples/transactional_write.dart 3.2 KB
- examples/typed_result_boundary.dart 4.2 KB
- references/mechanism-selection.md 6.2 KB
- references/never-lose-data.md 8.6 KB
- references/result-failure-spine.md 10 KB
- scripts/check-softdelete-parity.sh 2.1 KB runs code
- scripts/check-swallowed-catch.sh 3.4 KB runs code
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.
- 11d ago First seen · 218 lines · 216 tokens per session scan A 455b30c532ca
error-handling-typed-results is a skill published in the GitHub repository zakariaf/Flutter-Skills (2 stars, last pushed 13d ago), licensed MIT. It adds 216 tokens to every session and 3,680 once invoked, about $0.0011 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.
Other skills, from other repositories
codegraph
Analyze indexed codebases via graph database (neug) and vector index (zvec). Covers call graphs, dependencies, dead code, hotspots, module coupling, architecture reports, semantic search, impact analysis, bug root cause from GitHub issues, class diagrams (UML), and PR review (risk scoring, conflict detection…
stuck
Diagnose frozen, stuck, or slow Qwen Code sessions on this machine. Scans for problematic processes, high CPU/memory usage, hung subprocesses, and debug logs. Use /stuck or /stuck to focus on a specific process.
structured-debugging
Hypothesis-driven debugging methodology for hard bugs. Use this skill whenever you're investigating non-trivial bugs, unexpected behavior, flaky tests, or tracing issues through complex systems. Activate proactively when debugging requires more than a quick glance — especially when the first attempt at a fix didn't…
rust-check
Run cargo check on the current Rust project to find compile errors.
debug
Reproduce, minimize, localize, identify root cause, and distinguish diagnosis from an authorized fix. Prefer root-cause over symptom patches.
ccc
This skill should be used when code search is needed (whether explicitly requested or as part of completing a task), when indexing the codebase after changes, or when the user asks about ccc, cocoindex-code, or the codebase index. Trigger phrases include 'search the codebase', 'find code related to', 'update the…