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
You are TDD Green, the code-implementer. Given a failing test case and context (existing codebase or module), write the minimal code change needed so that the test passes — no extra features.
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.
9
9
10
-
ONLY write tests, no implementation.
10
+
ONLY write tests, no implementation. You DO NOT RUN tests or verify they fail.
Copy file name to clipboardExpand all lines: workshop/04-multi-agent.md
+15-17Lines changed: 15 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,34 +4,32 @@
4
4
5
5
---
6
6
7
-
## Task 1: Agent Hooks — Test Gate for TDD Green
7
+
## Task 1: Agent Hooks — Test Gate
8
8
9
-
[Agent hooks](https://code.visualstudio.com/docs/copilot/customization/hooks) execute shell commands at key lifecycle points during agent sessions. We'll add a **Stop hook**to TDD Green so it can't stop until all tests pass.
9
+
[Agent hooks](https://code.visualstudio.com/docs/copilot/customization/hooks) execute shell commands at key lifecycle points during agent sessions. We'll add a workspace-scoped **Stop hook**that gates *every* agent — no agent can finish until all tests pass.
10
10
11
11
**Steps:**
12
12
13
-
1. Open `.github/agents/tdd-green.agent.md`
14
-
2. Prompt`Add a agent-scoped stop hook to tdd-green that checks if tests all passed`
15
-
3.In `.github/agents/tdd-green.agent.md` the hook should be defined in the YAML frontmatter.
13
+
1. Open the `.github/hooks/` folder
14
+
2. Prompt: *Add an agenthook that runs the tests and blocks the agent from finishing if any test fails*
15
+
3.The hook should be a JSON file in `.github/hooks/` (e.g. `stop-test-gate.json`), not inside any single agent file.
16
16
17
-
✅ **Result:**TDD Green now has a safety net — it will keep working until all tests pass before handing back control.
17
+
✅ **Result:**Every agent now has a safety net — it will keep working until all tests pass before handing back control.
18
18
19
19
---
20
20
21
21
## Task 2: New Bingo Pattern (TDD-Driven)
22
22
23
-
Use the TDD to add a "Four Corners" bingo pattern. The hooks you set up will enforce TDD discipline on both sides — Red must produce failing tests, Green must make them pass.
23
+
Use the TDD agent to add a "Four Corners" bingo pattern. The workspace stop hook you set up will enforce test discipline — every agent must leave tests passing before it hands back control.
24
24
25
25
**Steps:**
26
26
27
-
1. First, add a stop hook to TDD Red — open `.github/agents/tdd-red.agent.md` and prompt:
28
-
*Add a stop hook that runs the tests and verifies at least one test is failing — TDD Red isn't done until it has written a genuinely failing test*
29
-
2. New chat with agent: `TDD`
30
-
3.*Add a "Four Corners" bingo win pattern — all four corner squares (top-left, top-right, bottom-left, bottom-right) must be marked*
31
-
4. Watch TDD orchestrate:
32
-
-**TDD Red** writes failing tests for Four Corners detection — hook fires on stop, keeps it going if tests aren't actually failing
27
+
1. New chat with agent: `TDD`
28
+
2.*Add a "Four Corners" bingo win pattern — all four corner squares (top-left, top-right, bottom-left, bottom-right) must be marked*
29
+
3. Watch TDD orchestrate:
30
+
-**TDD Red** writes failing tests for Four Corners detection
33
31
- Review the new tests in VS Code's test runner
34
-
-**TDD Green** implements the minimal code to pass — hook fires on stop, keeps it going if tests fail
32
+
-**TDD Green** implements the minimal code to pass — stop hook fires, keeps it going if tests fail
35
33
-**TDD Refactor** cleans up the implementation
36
34
- Click on any sub-agent while it runs to see its context and instructions
37
35
4. Review the summary of changes
@@ -48,11 +46,11 @@ Inspect what happened under the hood — did the hook fire? How did agents commu
48
46
49
47
1. Verify the hook loads: open the **GitHub Copilot Chat Hooks** output channel (Output panel → channel dropdown)
50
48
2. Open Agent Debug Logs: gear icon (⚙️) in Chat view → **Show Agent Debug Logs**
51
-
3.**Logs view:** filter for hook execution events during TDD Green
49
+
3.**Logs view:** filter for hook execution events during the TDD cycle
52
50
4.**Agent Flow Chart:** visualize the TDD → Red → Green → Refactor orchestration
53
51
5.**Summary view:** review total tool calls and token usage
54
52
55
-
**Bonus:** Click the ✨ sparkle icon to attach debug events to a new chat, then ask: `/troubleshoot did the Stop hook fire during TDD Green?`
53
+
**Bonus:** Click the ✨ sparkle icon to attach debug events to a new chat, then ask: `/troubleshoot did the Stop hook fire during the TDD cycle?`
56
54
57
55
✅ **Result:** Full observability into multi-agent orchestration and hook execution.
58
56
@@ -104,7 +102,7 @@ Combine MCP, custom workflows, and subagent isolation in an agent for powerful w
104
102
## ✅ Part 4 Complete!
105
103
106
104
You've learned how to:
107
-
- Add agent hooks to enforce quality gates (Stop hook on TDD Green)
105
+
- Add workspace-scoped agent hooks to enforce quality gates (Stop hook on all agents)
108
106
- Use TDD to orchestrate Red → Green → Refactor automatically
109
107
- Inspect agent behavior with Agent Debug Logs and Flow Charts
110
108
- Use design-first agents for UI-driven development
0 commit comments