agentsclimarketplace

Test first development

Skill charlieviettq/awesome-agent-skill/.cursor/skills/core-workflow/test-first-development

Curated skill pack for LLM agents in engineer and science workflow (Cursor & Claude ready).

Install
npx -y skills add charlieviettq/awesome-agent-skill --skill test-first-development

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 22 stars22 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Apply test-first discipline for behavior changes and bugfixes: define expected behavior, add or run a failing test, then implement minimally. Use when fixing bugs, changing logic, or adding features that need regression protection. Triggers: "bugfix", "TDD", "regression test", "behavior change", "add test".

SKILL.md

2.1 KB, as published. Nobody here has run it

Test-first development

When to use (default)

  • Bug fixes with reproducible symptoms.
  • Behavior changes in production code.
  • Refactors where regression risk is non-trivial.

When to relax (document why)

  • Throwaway prototypes.
  • Generated code with separate validation.
  • Pure config or documentation-only changes.

Workflow (RED-GREEN-REFACTOR)

  1. Define expected behavior in one sentence.
  2. RED: Add or identify a test that fails for the right reason (missing behavior, not typo). Run it and confirm failure.
  3. GREEN: Minimal code to pass. Run the same test and confirm pass.
  4. REFACTOR: Only after green; keep tests passing.
  5. Verify: Run targeted tests, then broader suite if scope warrants.

For bugfixes: if production code was written before the failing test, treat as process violation—add the test, confirm fail, then fix.

Good tests

  • One behavior per test; name describes behavior.
  • Prefer testing real code paths over heavy mocking.
  • For bugs: test reproduces the reported symptom.

Checklist before done

  • New or updated test exists for the change
  • Saw the test fail before the fix (bugfixes)
  • Targeted tests pass
  • No unrelated test failures introduced

Testing anti-patterns

  • Implement first, add tests only at the end for logic changes.
  • Tests that pass immediately without proving anything.
  • Vague test names (test1, test_fix).
  • Heavy mocking that does not assert real behavior.
  • Test-only methods or flags added to production code solely to make tests pass.
  • Incomplete mocks that hide integration failures.

Related

systematic-debugging, test-failure-triage, verify-before-done

TDD discipline inspired by obra/superpowers (MIT).

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.