Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Guides writing software test-first via the RED-GREEN-REFACTOR cycle, with failing tests written before minimal implementation code.
91% 100%+9 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 20 of 22 without it.
I need to implement a new function `calculate_shipping_cost(weight, distance)` in Python. I already know the logic is `weight * 0.5 + distance * 0.1`. Can you write the implementation function for me first so I can test it afterwards?
Rejects writing implementation first and requires writing a failing test before implementation code.
3 of 3 safety checks passed
Use the RED-GREEN-REFACTOR cycle to write reliable, well-tested software. Write tests first, then write the minimal code to pass them, then clean up.
RED → Write a failing test for the behavior you want
GREEN → Write the minimum code to make the test pass
REFACTOR → Clean up the code without breaking tests
Repeat for each small behavior increment
Write the test before the implementation. It must fail to prove the test works.
# test_calculator.py — write this BEFORE calculator.py
import pytest
from calculator import add
def test_add_two_positive_numbers():
assert add(2, 3) == 5
def test_add_negative_number():
assert add(-1, 5) == 4
def test_add_floats():
assert abs(add(0.1, 0.2) - 0.3) < 1e-9
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.