Exercise setup for the EXACT Coding workshop: EXample-guided, AI-Collaborative & Test-driven Development.
Test-Driven, AI-Assisted Development for Maintainable Code.
This hands-on workshop introduces EXACT Coding -- a pragmatic workflow for AI-assisted development focusing on readability, refactorability, and maintainability. Participants work in pairs and groups of three (driver + two navigators) through short modules with extensive exercises.
- Test-Driven Development (TDD)
- Example Mapping
- Mob/Ensemble Programming
- AI Tools (Claude Code and Cursor)
- EXACT Coding Workflow
Ferdi Ade & Marco Emrich
There are two ways to set up the project: using the Dev Container (recommended) or a local installation.
The repo includes a Dev Container configuration with Node.js, Claude Code, and a restrictive firewall pre-installed.
- Docker
- VS Code with the Dev Containers extension
- Claude Code API key or Portkey configuration (see below)
Option 1: Direct API key -- set the environment variable on your host before opening the container:
export ANTHROPIC_API_KEY="sk-ant-..."Option 2: Portkey proxy -- configure in ~/.claude/settings.json on your host:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.portkey.ai",
"ANTHROPIC_AUTH_TOKEN": "dummy",
"ANTHROPIC_CUSTOM_HEADERS": "x-portkey-api-key: <your-key>"
}
}The container automatically mounts ~/.claude/ from your host, so your settings are available inside the container.
- Open the project folder in VS Code (File -> Open Folder, not as workspace)
- VS Code will prompt: "Reopen in Container" -- click it
- Or manually:
Ctrl+Shift+P-> "Dev Containers: Reopen in Container" - Wait for the container to build (first time takes a few minutes)
After startup, run npm install in the terminal, then verify with the checks below.
- Node.js (v20 or higher)
- npm
- Claude Code (
npm install -g @anthropic-ai/claude-code)
npm installnpm testnpm run test:watchRun the following checks to make sure everything is working (both local and Dev Container).
1. Node.js installed?
node --version
# Expected: v20 or higher (e.g. v24.9.0)2. Claude Code installed and API key configured?
claude -p "respond with: setup ok"
# Expected: "setup ok" (or similar short response)If this hangs or returns an authentication error, your API key is not configured correctly. See the Claude Code docs for setup instructions.
3. Dependencies installed and tests passing?
npm install
npm testExpected test output:
✓ src/example.spec.ts (1 test)
Test Files 1 passed (1)
Tests 1 passed (1)
If all checks pass, you're ready for the workshop!
This repo ships with a preconfigured .claude/ directory that enforces the EXACT Coding workflow when using Claude Code. The configuration consists of Rules, Agents, and Commands.
Rules are loaded automatically into Claude's context at startup. They define the guardrails for the entire session.
| File | Purpose |
|---|---|
tdd.md |
Core TDD workflow -- mandates the use of specialized agents for every TDD phase |
human-in-the-loop.md |
Checkpoint rules -- Claude must stop after every phase (Red, Green, Refactor) and wait for explicit approval |
tdd_with_ts_and_vitest.md |
TypeScript & Vitest conventions (test file naming, imports, test execution) |
Agents are specialized sub-agents that run in an isolated context. Each agent focuses on exactly one TDD phase, preventing context pollution and enforcing discipline.
| Agent | Phase | Description |
|---|---|---|
test-list |
Test List | Creates it.todo() entries for base functionality, ordered simple to complex |
red |
Red | Activates ONE test, makes a prediction (Guessing Game), verifies it fails for the right reason |
green |
Green | Implements the minimal code to make the failing test pass (hardcoded returns are fine!) |
refactor |
Refactor | Applies the Four Rules of Simple Design and calculates APP mass before/after |
code-improvement-scanner |
Review | Analyzes code for readability, performance, and best practice improvements |
Commands are slash commands that can be invoked manually during a Claude Code session (e.g. /red, /green, /refactor). They provide the same functionality as agents but run in the main context instead of an isolated one.
| Command | Usage |
|---|---|
/test-list |
Create a test list with it.todo() entries |
/red |
Enter Red phase -- activate a test and predict the failure |
/green |
Enter Green phase -- write minimal implementation |
/refactor |
Refactor using Simple Design Rules and APP |
/code-review |
Multi-stage code review (Review -> Evaluation -> Conclusion) |
| Agents | Commands | |
|---|---|---|
| Context | Isolated (fresh context per phase) | Shared (main conversation context) |
| Invocation | Automatic (via rules) | Manual (/command-name) |
| Best for | Strict TDD discipline | Quick, interactive use |
The typical EXACT Coding workflow with Claude Code:
- Start -- Claude automatically uses the
test-listagent to createit.todo()entries - Red -- The
redagent activates one test, predicts the failure, verifies it fails - Green -- The
greenagent writes minimal code to make the test pass - Refactor -- The
refactoragent improves the code (naming, duplication, APP mass) - Repeat -- Back to step 2 for the next test
After every phase, Claude stops and asks for approval before continuing (Human-in-the-Loop).