Tdd workflows tdd green

From rmyndharis/antigravity-skills · View interactive version

Tdd workflows tdd green is an AI agent skill from the GitHub repository rmyndharis/antigravity-skills. Implement the minimal code needed to make failing tests pass in the TDD green phase.

How to use this skill

Skill file

Green Phase: Simple function

def product_list(request):

products = Product.objects.all()

return JsonResponse({'products': list(products.values())})

Refactor: Class-based view

class ProductListView(View):

def get(self, request):

products = Product.objects.all()

return JsonResponse({'products': list(products.values())})

Refactor: Generic view

class ProductListView(ListView):

model = Product

context_object_name = 'products'


### Express Patterns

**Inline → Middleware → Service Layer:**

// 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)

);

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.