Implement the minimal code needed to make failing tests pass in the TDD green phase.
Add this skill
npx mdskills install sickn33/tdd-workflows-tdd-greenClear TDD green phase guidance with concrete examples, but lacks actionable agent instructions
1---2name: tdd-workflows-tdd-green3description: Implement the minimal code needed to make failing tests pass in the TDD green phase.4---56# Green Phase: Simple function7def product_list(request):8 products = Product.objects.all()9 return JsonResponse({'products': list(products.values())})1011# Refactor: Class-based view12class ProductListView(View):13 def get(self, request):14 products = Product.objects.all()15 return JsonResponse({'products': list(products.values())})1617# Refactor: Generic view18class ProductListView(ListView):19 model = Product20 context_object_name = 'products'21```2223### Express Patterns2425**Inline → Middleware → Service Layer:**26```javascript27// Green Phase: Inline logic28app.post('/api/users', (req, res) => {29 const user = { id: Date.now(), ...req.body };30 users.push(user);31 res.json(user);32});3334// Refactor: Extract middleware35app.post('/api/users', validateUser, (req, res) => {36 const user = userService.create(req.body);37 res.json(user);38});3940// Refactor: Full layering41app.post('/api/users',42 validateUser,43 asyncHandler(userController.create)44);45```4647## Use this skill when4849- Moving from red to green in a TDD cycle50- Implementing minimal behavior to satisfy tests51- You want to keep implementation intentionally simple5253## Do not use this skill when5455- You are refactoring for design or performance56- Tests are already passing and you need new requirements57- You need a full architectural redesign5859## Instructions60611. Review failing tests and identify the smallest fix.622. Implement the minimal change to pass the next test.633. Run tests after each change to confirm progress.644. Record shortcuts or debt for the refactor phase.6566## Safety6768- Avoid bypassing tests to make them pass.69- Keep changes scoped to the failing behavior only.7071## Resources7273- `resources/implementation-playbook.md` for detailed patterns and examples.74
Full transparency — inspect the skill content before installing.