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 sutchan/Agent-Skills-Hub --skill dart-use-pattern-matchinggit clone --depth 1 https://github.com/sutchan/Agent-Skills-HubWrote 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/sutchan/agent-skills-hub/dart-use-pattern-matching)<a href="https://agentmods.dev/skills/sutchan/agent-skills-hub/dart-use-pattern-matching"><img src="https://agentmods.dev/badge/skills/sutchan/agent-skills-hub/dart-use-pattern-matching/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/sutchan/agent-skills-hub/dart-use-pattern-matching"><img src="https://agentmods.dev/badge/skills/sutchan/agent-skills-hub/dart-use-pattern-matching.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.00020 | $0.03256 |
| Opus 5.5 | $0.00008 | $0.01302 |
| Sonnet 5.5 | $0.00004 | $0.00651 |
| Haiku 4.5 | $0.00002 | $0.00326 |
Grade A, and why
dart-use-pattern-matching 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 1mo 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.
This is a copy
94% identical to dart-use-pattern-matching — 18 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 269 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Implementing Dart Patterns
Contents
- Pattern Selection Strategy
- Switch Statements vs. Expressions
- Core Pattern Implementations
- Pragmatic Balance & Anti-Patterns
- Workflows
- Examples
Pattern Selection Strategy
Apply specific pattern types based on the data structure and desired outcome. Follow these conditional guidelines:
- If validating and extracting from deserialized data (e.g., JSON): Use Map, List, and Object patterns to validate schema structure and destructure properties in a single step.
- If inspecting URL/path segments (
uri.pathSegments,p.split(path)) orString.split()tokens: Use List patterns with rest elements (['api', 'comments', ...],['assets', ...final rest],[..., final parent, _]) instead of manual.lengthchecks,.first,.skip(1), orlength - Nindex arithmetic. - If handling polymorphic payloads or responses: Use
switchexpressions over map discriminant keys to deserialize intosealedclass hierarchies. - If handling multiple return values: Use Record patterns to destructure fields directly into local variables.
- If unpacking multiple fields from an object or
MapEntry: Use Object patterns (final Spec(:field1, :field2!) = spec;,for (final MapEntry(:key, :value) in map.entries)) when promoting nullable properties or unpacking 3+ fields used across multiple statements, rather than for single-call passthroughs. - If executing type-specific behavior (Algebraic Data Types): Use Object patterns combined with
sealedclasses to ensure exhaustiveness. - If matching numeric ranges or conditions: Use Relational (
>=,<=) and Logical-and (&&) patterns within switch arms. - If multiple cases share logic: Use Logical-or (
||) patterns to share a single case body or guard clause. - If ignoring specific values: Use the Wildcard pattern (
_) or a non-matching Rest element (...) in collections.
What ships with it
1 file 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.
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.
- 1mo ago Changed · +20 lines c880640f2a95
- 1mo ago Changed · +1 lines 4d5b51402c3e
- 1mo ago Changed · +101 lines · +6 tokens per session 0c6655b96312
- 2mo ago Changed · -4 lines · -6 tokens per session 39d71b585417
- 2mo ago First seen · 151 lines · 20 tokens per session scan A b993c9a2ad29
dart-use-pattern-matching is a skill published in the GitHub repository sutchan/Agent-Skills-Hub (3 stars, last pushed 6d ago), licensed MIT. It adds 20 tokens to every session and 3,256 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 94% identical to dart-use-pattern-matching, differing in 18 lines, and is treated as a copy.
dart-use-pattern-matching compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| dart-use-pattern-matchingsutchan/Agent-Skills-Hub | Skill | 3 | 6d ago | MIT | A | 20 | Claude Code, Codex |
| clairicsvngoku/coding-agents-skills | Skill | 12 | 21d ago | MIT | A | 80 | Claude Code, Codex |
| php-codeigniter-patternsshennawardana23/skillme | Skill | 4 | 1mo ago | Apache-2.0 | A | 78 | Claude Code |
| adk-go-agent-buildershennawardana23/skillme | Skill | 4 | 1mo ago | Apache-2.0 | A | 100 | Claude Code |
| go-expertshennawardana23/skillme | Skill | 4 | 1mo ago | Apache-2.0 | A | 107 | Claude Code |
| golang-concurrencyshennawardana23/skillme | Skill | 4 | 1mo ago | Apache-2.0 | A | 151 | Claude Code |
| golang-contextshennawardana23/skillme | Skill | 4 | 1mo ago | Apache-2.0 | A | 123 | Claude Code |