CtrlK
BlogDocsLog inGet started
Tessl Logo

dart-use-pattern-matching

Applies Dart 3 pattern matching, switch expressions, and destructuring idiomatically to validate data schemas, handle algebraic data types, and decompose control flow. Use when refactoring complex if-else chains, parsing polymorphic JSON or API responses, destructuring Lists, URI/path segments, String.split() tokens, Records, or Maps, or enforcing exhaustiveness on sealed classes. Don't use for simple boolean conditions, single-variable type promotion (use `is`), or basic collection filtering.

68

Quality

85%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide

SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Quality

Content

70%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

A strong, largely actionable reference with excellent workflow feedback loops and genuinely valuable anti-pattern guidance. Its weaknesses are a padded language-spec syntax section and two references to an examples/json_patterns.dart file that is absent from the bundle.

Suggestions

Remove or drastically compress the 'Core Pattern Implementations' section — it restates Dart 3 language semantics Claude already knows; keep only the non-obvious rules (map patterns use containsKey semantics, list patterns match exact length unless a rest element is used).

Fix the broken references: either include the promised examples/json_patterns.dart (with the tagged ApiResponse and processUserPayload implementations) or replace those references with self-contained inline examples.

Move the full pattern-by-pattern syntax listing into a separate reference file (one level deep) so SKILL.md stays a lean overview plus judgment-based guidance.

DimensionReasoningScore

Conciseness

The Pragmatic Balance and Feedback Loop sections earn their tokens (e.g., the containsKey/omitted-key vs explicit-null semantics is genuinely non-obvious), but 'Core Pattern Implementations' restates the Dart language spec Claude already knows ('Throws if the value does not match the type', 'Matches any value and discards it'). Mostly efficient with a clearly trimmable section — matches anchor 3, not 4, because the language-spec restatement is a substantive chunk of padding rather than a minor instance.

3 / 5

Actionability

Prefer/Avoid code pairs are executable and specific, and 'Run analyzer: Execute dart analyze' with the exact compiler message to look for is concrete. Not 5: two Examples sections promise an executable implementation at examples/json_patterns.dart, which does not exist in the bundle — copy-paste-ready coverage of the JSON cases is therefore incomplete.

4 / 5

Workflow Clarity

A copyable task checklist plus two explicit feedback loops (analyzer error → add missing arm → re-validate; runtime omitted-key vs explicit-null verification) matches the top anchor: explicit validation steps, error-recovery loops, and a checklist for a complex process. Not 4: the checkpoints are explicit commands and verifications, not implicit.

5 / 5

Progressive Disclosure

Good structure (contents list, clear section headers), but no bundle files exist while the body references a nonexistent examples/json_patterns.dart twice, and ~40 lines of language-spec syntax reference are inlined that belong in a separate reference file. Matches anchor 3 — structure present, but content that should be separate is inline and a reference does not resolve; not 4 because a broken referenced path is more than a minor organization gap.

3 / 5

Total

15

/

20

Passed

Description

100%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

An exemplary description: concrete capabilities, comprehensive natural trigger terms including synonyms, explicit use/don't-use boundaries, and a distinct Dart 3 niche. Third person throughout with no fluff.

DimensionReasoningScore

Specificity

Lists multiple specific concrete actions — 'validate data schemas', 'handle algebraic data types', 'decompose control flow', 'parsing polymorphic JSON or API responses', 'enforcing exhaustiveness on sealed classes' — with comprehensive coverage across validation, ADT handling, and destructuring targets.

5 / 5

Completeness

Explicitly answers both 'what' (applies Dart 3 pattern matching, switch expressions, and destructuring to validate data schemas...) and 'when' (an enumerated 'Use when...' clause with concrete trigger phrases), and adds a 'Don't use for...' boundary clause that exceeds the anchor-5 example.

5 / 5

Trigger Term Quality

Comprehensive natural trigger terms with synonyms: 'pattern matching', 'switch expressions', 'destructuring', 'refactoring complex if-else chains', 'URI/path segments', 'String.split() tokens', 'Records', 'Maps', 'sealed classes', plus negative triggers ('simple boolean conditions', 'single-variable type promotion'). No common variations are missing for this domain.

5 / 5

Distinctiveness Conflict Risk

Occupies a clear Dart 3-specific niche (sealed classes, Records, switch expressions, exhaustiveness) with negative triggers distinguishing it from plain `is` type promotion and basic filtering — minimal conflict risk with other skills.

5 / 5

Total

20

/

20

Passed

Validation

87%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 14 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

metadata_version

'metadata.version' is missing

Warning

relative_links

Relative link issues: 2 missing

Warning

Total

14

/

16

Passed

Repository
flutter/agent-plugins
Reviewed

Table of Contents

Is this your skill?

If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.