Greenfield flow: what gets created first, second, and so on
The workshop repo hands you a project where the scaffolding, the spec, and the first two requirements already exist — so the hour goes to the workflow, not to plumbing. This page shows the order everything would be created in a true greenfield project driven by spec-first BDD/TDD, using this repo's actual file names. Read it to understand why the repo looks the way it does — and to know the build order when you start your own project from zero.
The files split into two groups: scaffolding you create once and never touch again, and loop artifacts you revisit for every requirement. The production class is deliberately the last file to exist.
build, JUnit 5, Cucumber, AssertJ"] runner["2. RunCucumberTest.java
Cucumber-JUnit bridge, empty suite"] mcp["3. .cursor/mcp.json + mcp-server jar
agent tooling (optional)"] pom --> runner --> mcp end subgraph phase1 [Phase 1 - Spec first, SDD] spec["4. requirements/requirements.json
draft REQ-001: id, story, Given/When/Then criteria, status pending"] validate["validate_spec until valid: true"] refine["refine_requirement until clean: true"] approve{"Human approves wording"} spec --> validate --> refine --> approve end subgraph phase2 [Phase 2 - Executable spec, BDD] feature["5. string_calculator.feature
scenario from acceptance criteria, tagged @REQ-001"] steps["6. StringCalculatorSteps.java
step definitions - reference a class that does not exist yet"] feature --> steps end subgraph phase3 [Phase 3 - Unit level, TDD] unit["7. StringCalculatorTest.java
failing unit test for the same criteria"] end subgraph phase4 [Phase 4 - Red Green Refactor] skeleton["8. StringCalculator.java
empty skeleton - just enough to compile"] red["run_tests -> RED"] impl["simplest implementation"] green["run_tests -> GREEN"] refactor["start_refactor -> cleanup -> run_tests still GREEN"] mark["flip status to implemented in requirements.json"] skeleton --> red --> impl --> green --> refactor --> mark end phase0 --> phase1 approve --> feature steps --> unit unit --> skeleton mark -->|"next requirement: REQ-002..."| spec
The order, file by file
Phase 0 — scaffolding (once, before any behavior exists):
pom.xmlandkata/pom.xml— the build, plus the test dependencies (JUnit 5, Cucumber, AssertJ). The project compiles and runs zero tests.kata/src/test/java/com/davidparry/workshop/kata/RunCucumberTest.java— the bridge that makes Cucumber scenarios run under JUnit. Created once, never changed; with no feature files yet it discovers nothing..cursor/mcp.jsonand themcp-serverjar — the agent tooling. Optional in the sense that the loop works by hand; in this workshop it is what turns the spec into something an agent can be held to.
Phase 1 — the spec is the first meaningful artifact:
requirements/requirements.json— draft REQ-001 with an id, a user story, Given/When/Then acceptance criteria, andstatus: pending. Then the iteration loop from Exercise 1:validate_specuntil"valid": true,refine_requirementuntil"clean": true, and a human approves the wording. Nothing downstream exists until this gate is passed.
Phase 2 — the spec becomes executable (BDD):
kata/src/test/resources/features/string_calculator.feature— the first Gherkin scenario, written from the acceptance criteria and tagged@REQ-001for traceability.kata/src/test/java/com/davidparry/workshop/kata/StringCalculatorSteps.java— step definitions binding the Gherkin to code. They referenceStringCalculator, which does not exist yet.
Phase 3 — the unit level (TDD):
kata/src/test/java/com/davidparry/workshop/kata/StringCalculatorTest.java— a failing JUnit test for the same criteria. Same bar as the scenario, lower altitude.
Phase 4 — RED, GREEN, REFACTOR:
kata/src/main/java/com/davidparry/workshop/kata/StringCalculator.java— created last, and in two moves. First an empty skeleton (anaddthat returns 0 or throws), because until the class exists the tests don't fail — they don't compile, and a compile error is not a RED bar. With the skeleton in place,run_testsshows an honest RED from failing assertions. Then the simplest implementation → GREEN →start_refactor→ cleanup → still GREEN → flip REQ-001 to"status": "implemented"in the spec.
After the first loop
The loop returns to the spec for REQ-002 and every requirement after it. From here on, only four files ever change:
requirements/requirements.json— the next requirement drafted, refined, and later flipped to implementedstring_calculator.feature— scenarios appendedStringCalculatorSteps.java/StringCalculatorTest.java— steps reused or added, unit tests appendedStringCalculator.java— the simplest change that goes green
The poms, the Cucumber runner, and the MCP config are never touched again — which is exactly why this workshop ships them pre-built: they are the part of a greenfield with no lesson in it.
bdd