tdd-workflows-tdd-green
Implement the minimal code needed to make failing tests pass in the TDD green phase.
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 when
- Moving from red to green in a TDD cycle
- Implementing minimal behavior to satisfy tests
- You want to keep implementation intentionally simple
## Do not use this skill when
- You are refactoring for design or performance
- Tests are already passing and you need new requirements
- You need a full architectural redesign
## Instructions
1. Review failing tests and identify the smallest fix.
2.Subscribers only
The full skill, its 2 bundled files and every download is included with every paid Complete AI plan.
Details
| Source | community |
|---|---|
| License | — |
| Risk label | critical ("critical" means the skill may run commands or touch files — read before use) |
| Files | SKILL.md, resources/implementation-playbook.md |
| Added | 2026-02-27 |
Related skills
ab-testing
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program.
agent-qa-authoring
Create, edit, validate, and run Agent QA tests, suites, and hooks through MCP or CLI while preserving canonical IDs and schema contracts.
agent-qa-debug-fix
Debug, patch, and verify failed Agent QA runs from MCP evidence, artifacts, logs, and local code without hiding product or infrastructure defects.
agent-qa-result-triage
Triage failed Agent QA runs with MCP evidence, artifacts, logs, fixed failure categories, confidence, and actionable next steps.
android-ui-journey-testing
XML-specified Android UI journey testing, interactive step execution, assertion verification, and JSON outcome reporting.
bats-testing-patterns
Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.
