tdd/tdd-workflows-tdd-green/SKILL.md
Implement the minimal code needed to make failing tests pass in the TDD green phase.
npx skillsauth add caobingsheng/skills tdd-workflows-tdd-greenInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
def product_list(request): products = Product.objects.all() return JsonResponse({'products': list(products.values())})
class ProductListView(View): def get(self, request): products = Product.objects.all() return JsonResponse({'products': list(products.values())})
class ProductListView(ListView): model = Product context_object_name = 'products'
### Express Patterns
**Inline → Middleware → Service Layer:**
```javascript
// Green Phase: Inline logic
app.post('/api/users', (req, res) => {
const user = { id: Date.now(), ...req.body };
users.push(user);
res.json(user);
});
// Refactor: Extract middleware
app.post('/api/users', validateUser, (req, res) => {
const user = userService.create(req.body);
res.json(user);
});
// Refactor: Full layering
app.post('/api/users',
validateUser,
asyncHandler(userController.create)
);
resources/implementation-playbook.md for detailed patterns and examples.development
Use when working with tdd workflows tdd refactor
testing
Generate failing tests for the TDD red phase to define expected behavior and edge cases.
tools
Use when working with tdd workflows tdd cycle
development
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.