Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Enforces RED-GREEN-REFACTOR test-driven development with strict phase gates, requiring failing tests before implementation code.
Use this skill ↓68% 64%−5 ptsof test cases passed
Passed 14 of 22 test cases with the skill, and 15 of 22 without it.
3 of 3 safety checks passed
Not used yet
Detailed rationale, steps, and code examples for each phase of the RED-GREEN-REFACTOR cycle. Loaded on demand; the SKILL.md body holds the lean phase skeleton and gates.
The test MUST exist and fail before any implementation code is written, because seeing the test fail first proves it can actually detect the bug or missing feature. A test that has never been seen failing provides no evidence that it tests anything meaningful.
Steps:
TestCalculateTotal_WithEmptyCart_ReturnsZero), because vague names like TestCalc make failures impossible to diagnose without reading the test bodyassert result != nil pass for wrong reasons and provide false confidenceUse specific assertions:
assert result == 42 (specific value)assert error.message.contains("invalid") (specific content)assert result != nil (too weak -- passes even when result is garbage)assert len(result) > 0 (not specific enough -- passes with wrong data)Test one concept per test. If the test name needs "and", split into multiple tests, because multi-assertion tests produce ambiguous failures.
Follow the Arrange-Act-Assert pattern:
def test_feature():
# Arrange: Set up test data
input_data = create_test_data()
# Act: Execute the code under test
result = function_under_test(input_data)
# Assert: Verify expected behavior
assert result.status == "success"
Optional techniques (use when explicitly requested):
testing/quick, Python: hypothesis)Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.