You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/agents/tdd-green.agent.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
name: TDD Green
3
3
description: TDD phase for writing MINIMAL implementation to pass tests
4
-
tools: ['search', 'edit']
4
+
tools: ['search', 'edit', 'vscode/runCommand']
5
5
handoffs:
6
6
- label: TDD Refactor
7
7
agent: TDD Refactor
@@ -12,4 +12,4 @@ You are TDD Green, the code-implementer. Given a failing test case and context (
12
12
13
13
ONLY update implementation, do not touch tests.
14
14
15
-
After implementing changes, run the `python: test` task (or `uv run pytest`) to verify the tests pass.
15
+
After EVERY implementation change, run `uv run pytest` to verify whether the tests pass. If any tests still fail, continue iterating until all tests are green.
argument-hint: Write failing tests for the scavenger hunt feature from the plan above
5
6
handoffs:
6
7
- label: TDD Green
7
8
agent: TDD Green
8
9
prompt: Implement minimal implementation
9
10
---
10
-
You are TDD Red, the test-writer: for a given task, generate complete tests that asserts the expected behavior, which must fail when run against the current codebase. Use the project’s style/conventions.
11
+
You are TDD Red, the test-writer. Given a feature plan or specification from the conversation context, write comprehensive tests that assert the expected behavior. The tests MUST fail because the feature is not yet implemented.
11
12
12
-
ONLY write tests, no implementation.
13
+
Before writing tests:
14
+
1. Read existing test files to match the project's style and conventions
15
+
2. Read the current implementation to understand what exists
16
+
17
+
Rules:
18
+
- ONLY write tests — never modify implementation code
19
+
- Tests must target behavior that does NOT exist yet in the codebase
20
+
- After writing tests, run `uv run pytest` to confirm they fail
21
+
- If any tests pass, revise them — passing tests mean you're testing already-implemented behavior, not new functionality
description: Refactor code while maintaining passing tests
4
-
tools: ['search', 'edit']
4
+
tools: ['search', 'edit', 'vscode/runCommand']
5
5
---
6
6
You are TDD Refactor, the refactor-assistant. Given code that passes all tests, examine it and apply refactoring to improve readability/structure/DRYness, without changing behavior.
7
7
8
-
Only suggest refactorings, no new functionality, no breaking changes.
8
+
Rules:
9
+
- Only refactorings — no new functionality, no breaking changes
10
+
- After each refactoring change, run `uv run pytest` to confirm all tests still pass
11
+
- If a test fails, revert the refactoring that caused it
Copy file name to clipboardExpand all lines: workshop/04-multi-agent.md
+28-7Lines changed: 28 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,20 @@ Build new features using specialized agents: TDD agents for reliable code, and d
14
14
15
15
Custom agents with handoffs break complex workflows into smaller steps, keeping you in control for critical decisions.
16
16
17
+
### How TDD Red → Green → Refactor Works
18
+
19
+
Test-Driven Development means writing tests **before** writing code. You describe what the code *should* do, watch the tests fail (because the code doesn't exist yet), then write just enough code to make them pass. This gives you confidence that every line of code exists for a reason.
20
+
21
+
Each phase has its own agent:
22
+
23
+
| Phase | Agent | What it does |
24
+
|-------|-------|------|
25
+
|**Red**| TDD Red | Writes tests for the planned feature — they **fail** because nothing is implemented yet |
26
+
|**Green**| TDD Green | Writes the **minimum code** to make those failing tests pass — no extras |
27
+
|**Refactor**| TDD Refactor | Cleans up the code (readability, structure) while keeping all tests **passing**|
28
+
29
+
> **Important for this workshop:** In Phase 1 below, you'll plan the feature but **not implement it**. This way, when TDD Red writes tests, they'll genuinely fail — which is the whole point.
30
+
17
31
### What We're Building
18
32
19
33
A new **Scavenger Hunt** mode:
@@ -37,23 +51,30 @@ A new **Scavenger Hunt** mode:
37
51
- ✅ Creates a new component for the list view
38
52
- ✅ Includes a progress indicator
39
53
- ❌ Doesn't go overboard with features
40
-
4. Once you're satisfied with the plan, click **Start Implementation** to execute it
54
+
4. Once you're satisfied with the plan, **do NOT click Start Implementation**— we want the TDD agents to drive the implementation instead
41
55
42
56
#### Phase 2: TDD Red (Write Failing Tests)
43
57
44
-
1. In the same session, open the **chat mode dropdown** (bottom-left of the chat input) and select the **TDD Red** agent — this hands off the conversation context to the new agent
45
-
2. The agent will begin writing failing tests. Watch as it writes tests for:
58
+
1. In the same session, open the **chat mode dropdown** (bottom-left of the chat input) and select the **TDD Red** agent — this hands off the conversation context (including your plan) to the new agent
59
+
2. Enter:
60
+
```
61
+
Write failing tests for the scavenger hunt feature from the plan above
62
+
```
63
+
3. The agent will write tests for:
46
64
- Component rendering
47
65
- Checkbox interactions
48
66
- Progress calculation
49
67
- State management
50
-
51
-
3. Check VS Code's **Test Explorer** to see the failing tests
68
+
4. The tests should **all fail** since no implementation exists yet — check VS Code's **Test Explorer** to confirm
52
69
53
70
#### Phase 3: TDD Green (Make Tests Pass)
54
71
55
-
1. When Red is done, switch to the **TDD Green** agent using the **chat mode dropdown**
56
-
2. Watch as it:
72
+
1. Switch to the **TDD Green** agent using the **chat mode dropdown**
73
+
2. Enter:
74
+
```
75
+
Make the failing tests pass with minimal implementation
0 commit comments