Skip to content
Skillpedia
Testing48k · #4321

tdd-workflows-tdd-green

Helps your agent write the minimum code to make failing tests pass. This is done in the 'green' phase of TDD.

What it does

This tool helps write the minimum code needed to make a failing test pass. It focuses on solving the immediate problem so tests start working again.

When to use it

  • ✓When a code test fails and you need to fix it quickly.
  • ✓When starting a new feature and the first step is to make a test pass.
  • ✓To implement only the essentials so the code works as expected.

Example of what to ask your AI

“My product list test is failing, generate the minimal code to make it pass.”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tdd-workflows-tdd-green/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/tdd-workflows-tdd-green/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool analyzes the smallest code change that satisfies a broken test. It implements this small fix and checks if the test now passes, without adding unnecessary complexity.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill tdd-workflows-tdd-green

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/tdd-workflows-tdd-green/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

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:**
```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)
);

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. Implement the minimal change to pass the next test.
  3. Run tests after each change to confirm progress.
  4. Record shortcuts or debt for the refactor phase.

Safety

  • Avoid bypassing tests to make them pass.
  • Keep changes scoped to the failing behavior only.

Resources

  • resources/implementation-playbook.md for detailed patterns and examples.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
FAQ

What does 'green phase' mean in TDD?

In TDD (Test-Driven Development), the 'green phase' is when all code tests are passing.

Why is it important to write minimal code?

Writing minimal code avoids unnecessary complexity and ensures you are solving the exact problem the test points to, making future maintenance easier.

When should I stop using this tool?

You should stop when tests are passing and you need to add new features, or if the goal is to improve the overall code design rather than just fixing a test.

Details

Original description by the author

Implement the minimal code needed to make failing tests pass in the TDD green phase.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#4321
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills