agentleFS
ZAidBinAsifZAidBinAsif/flutter-ai-starter/.cursor/skills/implement-tdd/SKILL.md

implement-tdd

Skill0 starsChanged 5 months agoMITView on GitHub

Test-driven development with red-green-refactor vertical slices for Flutter/Dart

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Follow .cursor/rules/testing.mdc for required coverage.

    line 8
  2. Distinctive:

    Do not write all tests then all implementation.

    line 21
  3. Very specific:

    Read context/ and docs/DECISIONS.md for domain vocabulary and ADRs.

    line 32
  4. Distinctive:

    Only after GREEN. Extract duplication.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Test-Driven Development

Follow .cursor/rules/testing.mdc for required coverage. All new/changed code needs tests.

Philosophy

Tests verify behavior through public interfaces, not implementation details.

  • Good: "ViewModel shows error when repository returns network failure"
  • Bad: testing private methods, mocking internal collaborators, asserting private fields

See tests.md for Flutter/Dart examples and mocking.md for fake vs Mockito guidance.

Anti-pattern: horizontal slices

Do not write all tests then all implementation.

WRONG:  RED test1..5  →  GREEN impl1..5
RIGHT:  RED test1 → GREEN impl1 → RED test2 → GREEN impl2 → ...

Workflow

1. Planning

Read context/ and docs/DECISIONS.md for domain vocabulary and ADRs.

Before code:

  • Confirm public interfaces and behaviors to test (prioritize with user if unclear)
  • List behaviors — not implementation steps
  • Get user approval on the plan when scope is large

2. Tracer bullet

RED:   one test, one behavior → fails
GREEN: minimal code → passes

3. Incremental loop

One test at a time. Only enough code to pass the current test. No speculative features.

4. Refactor

Only after GREEN. Extract duplication; run tests after each refactor step. Never refactor while RED.

Per-cycle checklist

[ ] Test describes observable behavior
[ ] Test uses public API only
[ ] Test would survive internal refactor
[ ] Code is minimal for this test
[ ] Matching test type from testing.mdc table (unit / widget / golden)

Flutter specifics

LayerTDD entry point
RepositoryUnit test with Mockito dio/Supabase client
ViewModelUnit test with fake repository
Widget / screenWidget test; golden for design-system
Critical flowintegration_test after unit/widget green

Chain grind-until-green when the slice is done.

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.