agentleFS
rafaelghifrafaelghif/antigravity-agents-core/.agents/skills/tdd/SKILL.md

tdd

Skill6 starsChanged 16 days agoMITView on GitHub

Drives multi-language behavioral changes (TS/JS, Dart/Flutter, Go, Python, Rust) through Red-Green-Refactor at public module seams with complete production behavior, performance checks, and zero test tampering. Use when building features test-first or writing unit, widget, or integration tests.

193 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use capture-learning-tools, design-frontend-dev 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.
  • The-Vibe-CompanySkill

    capture-learning-tools

    Turn technical conversations, bugs, CI failures, review comments,

    Also in 5 projects that use this

  • The-Vibe-CompanySkill

    design-frontend-dev

    Clean Impeccable frontend design skill. Use when the user wants to

    Also in 5 projects that use this

  • jaydubya818Skill

    figure-it-out

    Use when novel or multi-phase work needs an auditable workflow and no narrower playbook fits.

    Also in 66 projects that use this

  • shiwenbin1617Skill

    ketchup-video

    Catch the user up like /ketchup, with a short subtitled video of slides for what happened and the waiting calls as text under it. Use for /ketchup-video.

    Also in 24 projects that use this

  • simo97Skill

    request-refactor-plan

    Use this skill when user wants to create a refactor plan.

    Also in 47 projects that use this

  • jaydubya818Skill

    principle-minimize-reader-load

    Apply when layers, wrappers, or hidden state make simple behavior hard to follow.

    Also in 57 projects that use this

  • +3 more from The-Vibe-Company
  • +2 more from jaydubya818

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 189 edited versions we read keep these.

  • 1

    Distinctive

    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:

    RED: Write one failing test named after the observable capability.

    line 21
  2. Distinctive:

    REFACTOR: Remove duplication, reuse shared UI/helpers, flatten nesting with guard clauses, and re-run the test suite to stay green.

    line 23
  3. Very specific:

    Verify tests cover: happy path, N-1/N/N+1 boundaries, empty/null/malformed inputs, unauthorized/cross-tenant access (401/403/404), …

    line 27

“Common” is measured: kept by at least 6 in 10 of the 189 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

Test-Driven Development (Multi-Language Public Seams)

Execute strict Red → Green → Refactor at public module seams so tests validate observable contracts and survive internal refactoring. Consult references/stack-test-patterns.md and examples/tdd-seam-example.md.

Decision tree

  1. Does the planned test reach into private methods, internal state fields, or internal helper call counts?
    • Yes → Rewrite the test to invoke only the public seam (API route, CLI, exported function/use-case, or rendered widget/DOM role) and assert observable outputs or errors.
    • No → Proceed to step 2.
  2. Does the module mix pure domain logic with external I/O (DB, HTTP, storage, clock)?
    • Yes → Keep pure rules isolated for zero-mock unit tests; test adapters separately at their integration seam with outer-boundary fakes only.
    • No → Run the Red → Green → Refactor loop below.

Cycle

  1. RED: Write one failing test named after the observable capability. Run the repo's real test runner (npm test, flutter test, dart test, go test ./..., pytest, cargo test) and confirm it fails for the expected behavioral reason.
  2. GREEN: Implement the smallest complete production behavior—never a happy-path stub. Include real boundary parsing, authorization, config/logging seams, error wrapping, disposal, and optimal complexity. Never .skip, skip: true, weaken assertions, or mock the System-Under-Test.
  3. REFACTOR: Remove duplication, reuse shared UI/helpers, flatten nesting with guard clauses, and re-run the test suite to stay green.

Mandatory coverage floor

Verify tests cover: happy path, N-1/N/N+1 boundaries, empty/null/malformed inputs, unauthorized/cross-tenant access (401/403/404), duplicate idempotency (if mutating), and at least one external failure/timeout case.

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.