agentleFS
aaziraniaazirani/flutter_agentify/.agents/skills/testing/SKILL.md

testing

Skill0 starsChanged 4 days agoMITView on GitHub

Which kind of test to write for which kind of change, and the helpers this repo gives you. Use when adding or changing an action, repository, screen, assistant behavior or database migration, or when a test fails.

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use bundle-dependency-prs, update-library-template and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • MicrosoftSkill

    bundle-dependency-prs

    Fix broken dependency update PRs and aggregate the ones that work into one PR.

    Also in 7 projects that use this

  • MicrosoftSkill

    update-library-template

    Merges the latest Library.Template into this repo (at position of HEAD) and resolves conflicts.

    Also in 7 projects that use this

  • zetaloopSkill

    assign-copilot

    Assigns a GitHub issue to the Copilot coding agent, optionally specifying a custom agent. Use this when asked to assign an issue to Copilot or delegate an issue to CCA.

    Also in 3 projects that use this

  • NVIDIA-NeMoSkill

    build-and-dependency

    Dev environment setup for Megatron Bridge — container-based development, uv package management, lockfile regeneration, adding dependencies, Slurm container usage, and common build pitfalls.

    Also in 3 projects that use this

  • timmo001Skill

    changeset-scope

    Keep all scoped code work contained to the user-defined changeset. Use for implementation, fixes, diagnosis, refactoring, cleanup, and review when explicit instructions, named files, diffs, branches, pull requests, or injected work scopes define the boundary.

    Also in 3 projects that use this

  • JetBrainsSkill

    module-dependencies

    Add or modify IntelliJ module dependencies in `.iml` files.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 175 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Don't load this for running the whole gate and reading its output.

    line 8
  2. Very specific:

    Every change comes with the smallest test that would have failed without it.

    line 12
  3. Very specific:

    Run one file while working: flutter test test/actions/set_language_test.dart.

    line 37

“Common” is measured: kept by at least 6 in 10 of the 175 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Testing

Don't load this for running the whole gate and reading its output; see verify.

Rule

Every change comes with the smallest test that would have failed without it. Every action has test/actions/<action_name>_test.dart. Enforced by test/ai/parity_test.dart, which fails when an action has no test file.

Why

The assistant and the UI call the same code, so a test at the action covers both. Tests must not need a network, a real model or the person's data.

How

ChangeTestModel to copy
An actionCall it through a registry over an in-memory database; assert on stored data and the receipttest/actions/create_item_test.dart, helper test/support/actions_harness.dart: ActionsHarness().call(name, json) runs as the assistant, failsWith(code) matches a failure
A repository or DAODrift on NativeDatabase.memory()test/data/repositories/drift_items_repository_test.dart
A screenWidget test with the app's localization, theme and fake servicestest/presentation/home/home_screen_test.dart, helper test/support/test_app.dart (pumpTestApp)
Assistant behavior across screensFull app with a scripted model: pumpFullApp, openAssistant, sendToAssistanttest/ai/assistant_flow_test.dart
A database changeMigration test from the previous versionThe to_v<N>_test.dart template in storing-data
A route's screen summaryTable testtest/ai/screen_contexts_test.dart
TranslationsKey-count testtest/i18n/translations_test.dart

Details:

  • Scripted model: ScriptedProvider and ScriptedStep.text(...), ScriptedStep.toolCalls([...]) from package:flutter_agentify_core/testing.dart replace the model. Never call a real one.
  • Fakes: test/support/fakes.dart has FakeItemsRepository; the in-memory settings and secret stores are in lib/data/repositories/.
  • Migrations: test/generated_migrations/ is generated; never edit it. A new schema version needs a to_v<N>_test.dart (storing-data).
  • SQLite from plain Dart: database tests run on the machine's SQLite library. On Windows, sqlite3.dll must be on the PATH for them to run.
  • Packages have their own tests (packages/flutter_agentify_core/test/); run them from the package folder with dart test. App tests run with flutter test.
  • Run one file while working: flutter test test/actions/set_language_test.dart.

Anti-patterns

  • A widget test that checks an item was created by tapping, instead of testing the action and then the screen showing it.
  • A test that reads a real key or calls a real server.
  • A test that passes because it asserts nothing about the result (only "does not throw").
  • Deleting or loosening a test to turn the gate green.
  • Editing a generated migration schema to make a migration test pass.

Verification

  • flutter test for the app; tool/check.sh for all four test suites plus the parity test (see verify).
  • A new action: dart run tool/action.dart --write-reference too, or the parity test reports a stale reference.

Related skills

  • actions — the shape of an action under test
  • storing-data — migrations and their tests
  • model-providers — scripted providers versus real ones
  • verify — running everything

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.