Agent skill

Dart Test Fundamentals

by kevmoo in kevmoo/dash_skills

Core concepts and best practices for package:test. An agent skill from kevmoo/dash_skills.

Apache-2.0Auto-check passedMobile

Install Dart Test Fundamentals

skills CLI
$ npx skills add kevmoo/dash_skills --skill dart-test-fundamentals -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install kevmoo/dash_skills dart-test-fundamentals --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/kevmoo/dash_skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dart-test-fundamentals .claude/skills/dart-test-fundamentals && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dart-test-fundamentals
GitHub stars
147
Token cost
~1.8k tokens
SKILL.md length
741 words
Files
2
Skills in repo
12
Repo updated
First seen
Licence
Apache-2.0

At a glance

Core concepts and best practices for package:test. An agent skill from kevmoo/dash_skills.

  • Works in 6 steps: Test Structure (test and group) → Lifecycle Methods (setUp, tearDown) → Cleaning Up Resources → …
  • Tasks that involve Cross-platform mobile apps
  • SKILL.md covers When to use this skill, Discovery, Core Concepts and Common commands, plus 1 more section
  • Calls dart

What it does

Dart Test Fundamentals is an agent skill from kevmoo/dash_skills. Core concepts and best practices for package:test. Covers test, group, lifecycle methods (setUp, tearDown), and configuration (darttest.yaml).

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files (for example `evals/evals.json`).

It sits in Mobile, covering Cross-platform mobile apps. It works with Dart. The repository describes itself as: Agent Skills for Dart and Flutter ecosytem. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Cross-platform mobile apps

Example prompts

  • “/dart-test-fundamentals”

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Test Structure (test and group)
  2. Lifecycle Methods (setUp, tearDown)
  3. Cleaning Up Resources
  4. Configuration (dart_test.yaml)
  5. File Naming
  6. Test Design, Seams & Real Test Doubles

What it can do on your machine

Read from SKILL.md and the folder at commit 397a703. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dart

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dart Test Fundamentals loads about 1.8k tokens when it runs. Until then it costs about 45 tokens; SKILL.md has 741 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~45
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from kevmoo/dash_skills at commit 397a703, republished under its Apache-2.0 licence (© kevmoo). 741 words, ~1,818 tokens.

Download SKILL.mdSave it as .claude/skills/dart-test-fundamentals/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
dart-test-fundamentals
description
Core concepts and best practices for `package:test`. Covers `test`, `group`, lifecycle methods (`setUp`, `tearDown`), and configuration (`dart_test.yaml`).
license
Apache-2.0
key_features
Package test core concepts, Test lifecycle (setUp, tearDown), dart_test.yaml configuration

Dart Test Fundamentals

When to use this skill

Use this skill when:

  • Writing new test files.
  • Structuring test suites with group.
  • Configuring test execution via dart_test.yaml.
  • Understanding test lifecycle methods.
When NOT to use (Abstention Guardrails)

Do NOT apply this skill or refactor existing tests when:

  • Legacy Single-Group Churn: Do NOT remove or reformat existing group hierarchies in untouched existing tests unless explicitly asked, as this causes unwanted diff churn.
  • Alternative Assertion Frameworks: The package has migrated to package:checks or a specialized testing framework; do not revert tests back to legacy package:matcher idioms.
  • Trivial Tests with Zero Setup: Simple standalone tests with no shared state or resources do not need group, setUp, or addTearDown. Do not add ceremonial wrapper boilerplate.

Discovery

To find candidates for improving test structure:

try-finally Cleanup

Search for tests that use try-finally for cleanup instead of addTearDown:

  • Regex: \bfinally\s*\{ (Check if this is used for resource cleanup inside a test).

Core Concepts

1. Test Structure (test and group)
  • test: The fundamental unit of testing.

    dart
    test('description', () {
      // assertions
    });
  • group: Used to organize tests into logical blocks.

    • Groups can be nested.
    • Descriptions are concatenated (e.g., "Group Description Test Description").
    • Helps scope setUp and tearDown calls.
    • Naming: Use PascalCase for groups that correspond to a class name (e.g., group('MyClient', ...)).
    • Avoid Single Groups: Do not wrap all tests in a file with a single group call if it's the only one.
      • NOTE: DO NOT remove groups when doing a cleanup on existing code you didn't create unless explicitly asked to. This can cause a LOT of churn in the DIFF that most engineers won't want!
  • Naming Tests test('test name here',:

    • Avoid redundant "test" prefixes. Use group instead.
    • Include the expected behavior or outcome in the description (e.g., 'throws StateError' or 'adds API key to URL').
    • Descriptions should read well when concatenated with their group name.
  • Named Parameters Placement:

    • For test and group calls, place named parameters (e.g., testOn, timeout, skip) immediately after the description string, before the callback closure. This improves readability by keeping the test logic last.
      dart
      test('description', testOn: 'vm', () {
        // assertions
      });
2. Lifecycle Methods (setUp, tearDown)
  • setUp: Runs before every test in the current group (and nested groups).
  • tearDown: Runs after every test in the current group.
  • setUpAll: Runs once before any test in the group.
  • tearDownAll: Runs once after all tests in the group.

Best Practice:

  • Use setUp for resetting state to ensure test isolation.
  • Avoid sharing mutable state between tests without resetting it.
3. Cleaning Up Resources
  • To clean up resources created WITHIN the test body, consider using addTearDown instead of a try-finally block.

Avoid:

dart
test('can create and delete a file', () {
  final file = File('temp.txt');
  try {
    file.writeAsStringSync('hello');
    expect(file.readAsStringSync(), 'hello');
  } finally {
    if (file.existsSync()) file.deleteSync();
  }
});

Prefer:

dart
test('can create and delete a file', () {
  final file = File('temp.txt');
  // Register teardown immediately after resource creation intent
  addTearDown(() {
    if (file.existsSync()) file.deleteSync();
  });

  file.writeAsStringSync('hello');
  expect(file.readAsStringSync(), 'hello');
});
4. Configuration (dart_test.yaml)

The dart_test.yaml file configures the test runner. Common configurations include:

Show full SKILL.md (301 more words)Show less
Platforms

Define where tests run (vm, chrome, node).

yaml
platforms:
  - vm
  - chrome
Tags

Categorize tests to run specific subsets.

yaml
tags:
  integration:
    timeout: 2x

Usage in code:

dart
@Tags(['integration'])
import 'package:test/test.dart';

Running tags: dart test --tags integration

Timeouts

Set default timeouts for tests.

yaml
timeouts:
  2x # Double the default timeout
5. File Naming
  • Test files must end in _test.dart to be picked up by the test runner.
  • Place tests in the test/ directory.
6. Test Design, Seams & Real Test Doubles
  • Test Seams (lib/<pkg>.dart vs. lib/src/):
    • Import package:<pkg>/<pkg>.dart for package-level and integration tests, keeping lib/<pkg>.dart exports strictly scoped to public consumers.
    • Import package:<pkg>/src/<subsystem>.dart directly when unit-testing an internal deep module (e.g., an unexported parser, state machine, or data structure with a simple interface and rich behavior), while testing thin single-caller helpers through their owning module's entrypoint.
  • Real Implementations & First-Party Fakes (Real -> Fake -> Stub):
    • Exercise real dependencies and first-party fakes so tests fail when production contracts change: use package:test_descriptor (d.sandbox, d.dir, d.file) or Directory.systemTemp.createTempSync() for filesystem I/O, in-memory stores or loopback HttpServer instances for services, package:http/testing.dart (MockClient) for HTTP, and hand-written fakes/stubs for custom interfaces.
    • Run browser, DOM, and JS/Wasm interop tests on a real browser runtime (@TestOn('browser')).
  • Behavioral & Execution-Driven Assertions:
    • Boundary & Consumer Behavior: Test the observable outputs and boundary conditions of functions that consume constants and models (e.g., validate('a' * 280) vs. validate('a' * 281)) against concrete expected values.
    • Direct Execution & Rendering: Verify runtime behavior, control flow, and UI/CLI output by invoking functions or rendering components directly. Use raw file-text reads (readAsStringSync()) specifically for static README.md --help drift checks, BUILD / pubspec.yaml metadata sync, and codegen fixtures.

Common commands

  • dart test: Run all tests.
  • dart test test/path/to/file_test.dart: Run a specific file.
  • dart test --name "substring": Run tests matching a description.

dart-test-fundamentals is the core skill for structuring and configuring tests. For writing assertions within those tests, refer to:

© kevmoo, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in skills/dart-test-fundamentals of kevmoo/dash_skills.

  • SKILL.md
  • evals/evals.json

Open the folder on GitHubat commit 397a703

Compare with similar skills

Dart Test Fundamentals next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dart Test Fundamentals compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dart Test Fundamentals this skillkevmoo/dash_skills147—~1.8kAutomated safety check: PassApache-2.0
Fjson Dart Bean GeneratorK3vinb5/unyo-app664—~2.2kAutomated safety check: PassBSD-3-Clause
Flutter Riverpod State Managementandrewyng/context-hub14k—~1.1kAutomated safety check: PassMIT
BlocVeryGoodOpenSource/vgv-ai-flutter-plugin170—~2kAutomated safety check: PassMIT
Flutter Dart Code Reviewaffaan-m/ECC277k2 repos~5.8kAutomated safety check: NotesMIT
Signals for Flutterrodydavis/signals.dart819—~1.9kAutomated safety check: PassApache-2.0

Similar skills

  • Generate Dart bean classes from JSON and regenerate serialization helpers using the fjson CLI.

    664 GitHub stars~2.2k tokensUpdated 4 mo ago
    MobileAuto-check passed
  • Guides Flutter state management with Riverpod: choosing provider types, wiring ConsumerWidgets, handling async state and lifecycle, and overriding providers in tests.

    14k GitHub stars~1.1k tokensUpdated 4 mo ago
    MobileAuto-check passed
  • Bloc

    VeryGoodOpenSource/vgv-ai-flutter-plugin

    Best practices for Bloc state management in Flutter/Dart, covering Cubit versus Bloc, event and state naming, sealed classes with Equatable, the Page/View split with BlocProvider, BlocBuilder…

    170 GitHub stars~2k tokensUpdated 5 days ago
    MobileAuto-check passed
  • Library-agnostic Flutter/Dart code review checklist covering widget best practices, state management patterns (BLoC, Riverpod, Provider, GetX, MobX, Signals), Dart idioms, performance…

    277k GitHub starsUsed in 2 repos~5.8k tokens
    MobileAuto-check: notes
  • Signals for Flutter

    rodydavis/signals.dart

    Reference for the signals_flutter package: reactive signals, computed values, effects, async signals and collection signals bound to Flutter widgets.

    819 GitHub stars~1.9k tokensUpdated 27 days ago
    MobileAuto-check passed
  • Taskflow

    MelbourneDeveloper/dart_node

    Build and run the full TaskFlow demo stack (Express backend + React frontend + mobile)

    113 GitHub stars~327 tokensUpdated 27 days ago
    MobileAuto-check: notes

More from kevmoo/dash_skills

All 12 skills in this repo
  • Dart Test Coverage

    kevmoo/dash_skills

    Understand and improve test coverage in a Dart package. An agent skill from kevmoo/dash_skills.

    147 GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check passed
  • Profile Dart Code

    kevmoo/dash_skills

    Profile Dart command-line applications using the VM Service protocol to capture CPU samples and identify performance bottlenecks.

    147 GitHub stars~1.1k tokensUpdated 2 days ago
    Auto-check passed
  • Dart Best Practices

    kevmoo/dash_skills

    General best practices for Dart development. An agent skill from kevmoo/dash_skills.

    147 GitHub stars~709 tokensUpdated 2 days ago
    Auto-check passed
  • Dart Doc Validation

    kevmoo/dash_skills

    Best practices for validating Dart documentation comments. An agent skill from kevmoo/dash_skills.

    147 GitHub stars~822 tokensUpdated 2 days ago
    Auto-check passed
  • Dart Long Lines

    kevmoo/dash_skills

    Guidelines for handling long lines in Dart code to adhere to the 80-column rule.

    147 GitHub stars~1k tokensUpdated 2 days ago
    Auto-check passed
  • Dart Matcher Best Practices

    kevmoo/dash_skills

    Best practices for using expect and package:matcher. An agent skill from kevmoo/dash_skills.

    147 GitHub stars~1.6k tokensUpdated 2 days ago
    Auto-check passed

Works with

Categories

Questions about Dart Test Fundamentals

What does Dart Test Fundamentals do?

Core concepts and best practices for package:test. An agent skill from kevmoo/dash_skills. Dart Test Fundamentals is an agent skill from kevmoo/dash_skills. Core concepts and best practices for package:test.

When should I use Dart Test Fundamentals?

Dart Test Fundamentals fits situations like: tasks that involve Cross-platform mobile apps.

How do I install Dart Test Fundamentals in Claude Code?

Run `npx skills add kevmoo/dash_skills --skill dart-test-fundamentals -a claude-code`. Or copy the skill folder (skills/dart-test-fundamentals in kevmoo/dash_skills) into .claude/skills/dart-test-fundamentals in your project. Claude Code loads it when a task matches its description.

How do I install Dart Test Fundamentals in Codex?

Run `npx skills add kevmoo/dash_skills --skill dart-test-fundamentals -a codex`. Or copy the skill folder (skills/dart-test-fundamentals in kevmoo/dash_skills) into .agents/skills/dart-test-fundamentals in your project. Codex loads it when a task matches its description.

Can I use Dart Test Fundamentals in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add kevmoo/dash_skills --skill dart-test-fundamentals -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dart-test-fundamentals, .gemini/skills/dart-test-fundamentals, .github/skills/dart-test-fundamentals and .opencode/skills/dart-test-fundamentals in your project.

What does Dart Test Fundamentals need to run?

Going by SKILL.md and its folder, Dart Test Fundamentals needs the command-line tools its instructions call (dart).

Does Dart Test Fundamentals access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dart Test Fundamentals safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Dart Test Fundamentals use?

Dart Test Fundamentals is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dart Test Fundamentals use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dart Test Fundamentals?

Skills that share tags, products or a category with Dart Test Fundamentals: Fjson Dart Bean Generator (K3vinb5/unyo-app, 664 stars), Flutter Riverpod State Management (andrewyng/context-hub, 14k stars), Bloc (VeryGoodOpenSource/vgv-ai-flutter-plugin, 170 stars) and Flutter Dart Code Review (affaan-m/ECC, 277k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dart Test Fundamentals?

kevmoo (a GitHub user) maintains it in kevmoo/dash_skills, which has 147 GitHub stars. The repository holds 12 skills in this directory. The repository was last updated on October 8, 2026.

Source: kevmoo/dash_skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.