Skip to content

Commit 75abf67

Browse files
committed
updates to TDD instructions and agents
1 parent eea1571 commit 75abf67

6 files changed

Lines changed: 50 additions & 17 deletions

File tree

.github/agents/pixel-jam.agent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ Implement UI elements from the provided plan through small, focused iterations w
1919
- Work only on UI-facing layers (layout, styling, components, states).
2020

2121
## Approach
22-
- Make sure dev server task is running and browser preview is open.
22+
- Make sure the `python: run` dev server task is running (uvicorn on port 8000).
2323
- Prioritize clarity, responsiveness, and visual alignment with intent.
2424
- Break down the iterative design steps into small, manageable #tool:todo items.
25-
- After each step, make sure the build task is OK, then use Playwright to visually review components and interactions.
25+
- After each step, use Playwright to visually review components and interactions.
2626
- Keep tracking decisions and findings in the design spec file.
2727
- PAUSE for user feedback after each completed iteration.
2828

.github/agents/tdd-green.agent.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: TDD Green
33
description: TDD phase for writing MINIMAL implementation to pass tests
4-
tools: ['search', 'edit']
4+
tools: ['search', 'edit', 'vscode/runCommand']
55
handoffs:
66
- label: TDD Refactor
77
agent: TDD Refactor
@@ -12,4 +12,4 @@ You are TDD Green, the code-implementer. Given a failing test case and context (
1212

1313
ONLY update implementation, do not touch tests.
1414

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.

.github/agents/tdd-red.agent.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
---
22
name: TDD Red
33
description: TDD phase for writing FAILING tests
4-
tools: ['read', 'edit', 'search']
4+
tools: ['read', 'edit', 'search', 'vscode/runCommand']
5+
argument-hint: Write failing tests for the scavenger hunt feature from the plan above
56
handoffs:
67
- label: TDD Green
78
agent: TDD Green
89
prompt: Implement minimal implementation
910
---
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.
1112

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
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
---
22
name: TDD Refactor
33
description: Refactor code while maintaining passing tests
4-
tools: ['search', 'edit']
4+
tools: ['search', 'edit', 'vscode/runCommand']
55
---
66
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.
77

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

.github/agents/ui-review.agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ tools: ['search', 'github/*', 'playwright/*', 'search/usages', 'read/problems',
77

88
Your goal is to do an in-depth UI review of a website using Playwright and scope potential fixes.
99

10-
Assume the dev server is running as task and check those first.
10+
Assume the `python: run` dev server task is running (uvicorn on port 8000) — check that first.
1111

1212
If the #tool:agent/runSubagent tool is available you MUST orchestrate Playwright the first pass and deep dives as subagents.
1313

workshop/04-multi-agent.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,20 @@ Build new features using specialized agents: TDD agents for reliable code, and d
1414

1515
Custom agents with handoffs break complex workflows into smaller steps, keeping you in control for critical decisions.
1616

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+
1731
### What We're Building
1832

1933
A new **Scavenger Hunt** mode:
@@ -37,23 +51,30 @@ A new **Scavenger Hunt** mode:
3751
- ✅ Creates a new component for the list view
3852
- ✅ Includes a progress indicator
3953
- ❌ 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
4155

4256
#### Phase 2: TDD Red (Write Failing Tests)
4357

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:
4664
- Component rendering
4765
- Checkbox interactions
4866
- Progress calculation
4967
- 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
5269

5370
#### Phase 3: TDD Green (Make Tests Pass)
5471

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
76+
```
77+
3. Watch as it:
5778
- Implements the minimum code to pass tests
5879
- Runs tests after each change
5980
- Iterates until all tests pass

0 commit comments

Comments
 (0)