dart-add-unit-test

dart-add-unit-test is a skill for Claude Code, Codex from sutchan/Agent-Skills-Hub. It costs 39 tokens per session (1,067 once invoked), scanned A, a copy of dart-add-unit-test, MIT.

A guide to writing tests for Dart and Flutter applications. Tests are small checks that verify whether code behaves as expected.

In plain words
What is it for?
Use it to organize test files, write unit and widget tests with Dart's testing libraries, group related cases, and run checks against your application.
Why use it?
It gives test files a predictable structure and explains how to check normal results, errors, and asynchronous code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to organize test files, write unit and widget tests with Dart's testing libraries, group related cases, and run checks against your application.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sutchan/agent-skills-hub/dart-add-unit-test
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 sutchan/Agent-Skills-Hub --skill dart-add-unit-test
Clone the repo
git clone --depth 1 https://github.com/sutchan/Agent-Skills-Hub

Made for: Claude Code, Codex.

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 dart-add-unit-test

README.md
[![agentmods](https://agentmods.dev/badge/skills/sutchan/agent-skills-hub/dart-add-unit-test/github.svg)](https://agentmods.dev/skills/sutchan/agent-skills-hub/dart-add-unit-test)
Your own site
<a href="https://agentmods.dev/skills/sutchan/agent-skills-hub/dart-add-unit-test"><img src="https://agentmods.dev/badge/skills/sutchan/agent-skills-hub/dart-add-unit-test/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 dart-add-unit-test

Your own site · 80×15
<a href="https://agentmods.dev/skills/sutchan/agent-skills-hub/dart-add-unit-test"><img src="https://agentmods.dev/badge/skills/sutchan/agent-skills-hub/dart-add-unit-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,067 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 91% copy Near-identical to another mod 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.00039 $0.01067
Opus 5 $0.00019 $0.00534
Sonnet 5 $0.00008 $0.00213
Haiku 4.5 $0.00004 $0.00107

Measured yesterday against content hash 02428fa20c2c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

dart-add-unit-test 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 yesterday.

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.

Origin

This is a copy

91% identical to dart-add-unit-test — 0 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.

skills/dart-add-unit-test/SKILL.md · 123 lines

How it starts

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

Testing Dart and Flutter Applications

Contents

Structuring Test Files

Organize test files to mirror the lib directory structure to maintain predictability.

  • Place all test code within the test directory at the root of the package.
  • Append _test.dart to the end of all test file names (e.g., lib/src/utils.dart should be tested in test/src/utils_test.dart).
  • If writing integration tests, place them in an integration_test directory at the root of the package.

Writing Tests

Utilize package:test as the standard testing library for Dart applications.

  • Import package:test/test.dart (or package:flutter_test/flutter_test.dart for Flutter).
  • Group related tests using the group() function to provide shared context.
  • Define individual test cases using the test() function.
  • Validate outcomes using the expect() function alongside matchers (e.g., equals(), isTrue, throwsA()).
  • Write asynchronous tests using standard async/await syntax. The test runner automatically waits for the Future to complete.
  • Manage test setup and teardown using setUp() and tearDown() callbacks.
  • If testing code that relies on dependency injection, use package:mockito alongside package:test to generate mock objects, configure fixed scenarios, and verify interactions.

Executing Tests

Select the appropriate test runner based on the project type and test location.

  • If working on a pure Dart project, execute tests using the dart test command.
  • If working on a Flutter project, execute tests using the flutter test command.
  • If running integration tests, explicitly specify the directory path, as the default runner ignores it: dart test integration_test or flutter test integration_test.

Test Implementation Workflow

Follow this sequential workflow when implementing new test suites. Copy the checklist to track your progress.

Read the full file on GitHub · 123 lines

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. yesterday Changed · -4 lines · +16 tokens per session 02428fa20c2c
  2. 7d ago First seen · 127 lines · 23 tokens per session scan A 87fdd081d9ed

Subscribe to this mod's changes

dart-add-unit-test is a skill published in the GitHub repository sutchan/Agent-Skills-Hub (2 stars, last pushed yesterday), licensed MIT. It adds 39 tokens to every session and 1,067 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to dart-add-unit-test, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

raw-sql-querybuilder-testing-patterns

Guides Go services that use database/sql directly with a lightweight in-house query builder (not an ORM like GORM or a codegen tool like sqlc), including how to make repositories unit-testable via mock-generated interfaces. Use when writing or reviewing a repository method built on database/sql, adding a new…

shennawardana23/skillme · 87 tokens

tdd-workflow

Runs the full TDD workflow for a TypeScript/JavaScript feature — user journeys to test cases, unit tests (Jest/Vitest + Testing Library), API/integration tests, Playwright E2E, and a coverage gate wired into CI. Use when building a Next.js/React/Node feature end to end, not just a single unit test, or when asked to…

shennawardana23/skillme · 92 tokens

test-generation

Generates comprehensive unit, table-driven, and concurrency tests for a given function or module — happy paths, error paths, boundary values, and mocked dependencies — following Go and TypeScript idioms. Use when a function or file needs test coverage, a bug fix needs a regression test, or existing tests only cover…

shennawardana23/skillme · 69 tokens

zsh-script-writer

Write and test Zsh scripts following project coding standards with ShellSpec BDD testing. Use when the user wants to: (1) create a new Zsh script, (2) write or fix ShellSpec tests for Zsh scripts, (3) review Zsh code for best practices, (4) add error handling or dependency checking to shell scripts, (5) implement API…

jim60105/copilot-prompt · 122 tokens

test-driven-development

Use when implementing any feature or bugfix, before writing implementation code.

obra/superpowers · 17 tokens

nunit

Write, run, or repair .NET tests that use NUnit. Use when a repo uses NUnit, [Test], [TestCase], [TestFixture], or NUnit3TestAdapter for VSTest or Microsoft.Testing.Platform execution. USE FOR: writing or reviewing NUnit tests; using [Test], [TestCase], [TestFixture], [SetUp], [TearDown] attributes; configuring…

managedcode/dotnet-skills · 146 tokens