agentsclimarketplace

Tdd

Skill arozumenko/wikis/.github/skills/tdd

Test-driven development workflow. Use when the user asks to "write tests first", "TDD", "add test coverage", "test this function", or wants to develop a feature test-first.From its SKILL.md

Install
npx -y skills add arozumenko/wikis --skill tdd

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

  • 6 stars6 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 file declares

Copied from the file, not written here

The file declares its own license as Apache-2.0. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

2.4 KB, as published. Nobody here has run it

Test-Driven Development

Red-green-refactor. Write the test, watch it fail, make it pass, clean up.

Workflow

1. Red — Write a Failing Test

Write the simplest test that describes the desired behavior:

def test_user_can_login_with_valid_credentials():
    result = login("alice", "correct-password")
    assert result.success is True
    assert result.user.name == "alice"

Run it. Confirm it fails for the right reason (missing function, not syntax error).

2. Green — Make It Pass

Write the minimum code to make the test pass. Don't generalize. Don't optimize. Don't clean up. Just make it green.

3. Refactor — Clean Up

Now that tests are green, improve the implementation:

  • Remove duplication
  • Extract clear names
  • Simplify logic

Run tests again after refactoring. Still green? Good. Commit.

Test Quality Rules

  • Test behavior, not implementation. Tests should survive refactoring.
  • One assertion per concept. Multiple assert calls are fine if they verify one logical thing.
  • Descriptive names. test_expired_token_returns_401 not test_auth_3.
  • No mocks unless necessary. Prefer real objects. Mock only external services and I/O.
  • Arrange-Act-Assert structure. Set up, do the thing, check the result.

When to Use TDD

Good fit:

  • Business logic with clear inputs/outputs
  • Bug fixes (write the test that catches the bug first)
  • API endpoints (expected request → expected response)
  • Data transformations and validators

Poor fit:

  • Exploratory/prototype code (write tests after)
  • UI layout (use visual testing)
  • Infrastructure/config (use integration tests)

Framework Detection

Detect the project's test framework from existing files:

# Python
ls pytest.ini pyproject.toml setup.cfg 2>/dev/null | head -1
grep -r "import pytest\|import unittest" tests/ --include="*.py" -l | head -3

# JavaScript/TypeScript
grep -E "jest|vitest|mocha" package.json 2>/dev/null

# Go — built in
ls *_test.go 2>/dev/null

Follow the existing test patterns. Don't introduce a new framework.

Keep looking

Skills are one crate of 627,801. 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.