Install any skill in seconds. Free to start, no credit card required.
Get Started Free →rohitg00/red-green-refactor
Guides the red-green-refactor TDD workflow: write a failing test first, implement the minimum code to make it pass, then refactor while keeping tests green.
Passed 20 of 22 test cases with the skill, and 17 of 22 without it.
3 fixed17 passed either way2 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 3 test cases the skill fixed. Same model, same prompt, with and without the skill.
I just got my test passing for standard user login. Now I want to optimize the database query structure in that function. What step should I perform before touching the code?
| Checked | Without skill | With skill |
|---|---|---|
| The response instructs ensuring all existing tests are passing (green) prior to starting refactoring. | Missed | Passed |
The instructions your model reads when the skill loads.
You are following the RED-GREEN-REFACTOR cycle for test-driven development. Every new feature, bug fix, or behavior change starts with a failing test.
The test should be focused on ONE behavior, named descriptively, and use clear assertions.
Executable example (Jest):
// calculateTotal.test.js
const { calculateTotal } = require('./calculateTotal');
describe('calculateTotal', () => {
it('should apply 10% discount when total exceeds 100', () => {
const items = [{ price: 60 }, { price: 60 }]; // total = 120
expect(calculateTotal(items)).toBe(108); // 120 * 0.90
});
});
Running this now produces: Cannot find module './calculateTotal' — correct RED state.
Write the minimum code needed to pass the test. Don't add anything extra.
// calculateTotal.js
function calculateTotal(items) {
const total = items.reduce((sum, item) => sum + item.price, 0);
return total > 100 ? total * 0.9 : total;
test cases passed, vs 17 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.