TDD Green Phase Agent
Second stage of the TDD workflow: writes the smallest amount of code that makes the current failing test pass, without touching the test itself.
Overview
The middle stage of the TDD trio, picking up after TDD Red and handing off to TDD Refactor. Its instructions are blunt about the goal: get to green as fast as possible, and defer code quality to the refactor phase.
How it works
- It writes just enough code to satisfy the current failing test, starting with hard-coded returns from issue examples when that's the fastest path to green.
- It implements only what the current issue asks for; anything mentioned in comments as a future enhancement stays out of scope for this pass.
- Duplication and rough design are accepted temporarily, on the understanding the refactor phase will clean them up.
- It runs the entire test suite, not just the new test, to confirm nothing else broke.
- The test written in the Red phase should not need to change here.
Examples
"Make the failing email-validation test pass with the simplest
implementation you can."
Installation
You need VS Code with the GitHub Copilot extension. Consider installing TDD Red and TDD Refactor alongside it, they're meant to be used together.
- Create the agents folder and download the file into your repo:
mkdir -p .github/agents curl -o .github/agents/tdd-green.agent.md \ https://raw.githubusercontent.com/github/awesome-copilot/main/agents/tdd-green.agent.md - Reload VS Code, or open a new Copilot Chat; custom agents under
.github/agents/are picked up automatically. - Pick this agent from the mode picker in Copilot Chat once you have a failing test, and confirm it writes only enough code to pass it.
Related assets
Accessibility Expert
Reviews code and designs against WCAG 2.1/2.2, covering semantics, keyboard and focus behavior, forms, media and dynamic SPA updates, and ships framework-specific examples plus a CI setup for automated checks.
Address Comments Agent
Works through pull request review comments one at a time: applies the minimal fix for each, pushes back on comments that don't make sense, adds test coverage, and commits with a descriptive message before moving to the next comment.
ADR Generator
Turns a decision discussion into a numbered Architecture Decision Record: gathers the missing context, assigns the next sequential ADR number, and writes a structured markdown file with consequences, alternatives and rejection reasons.