The 5D Framework · Phase 04
Develop
Implement to the Gherkin spec — feature by feature, test-backed.
With the rules set and the target designed, autonomous agents implement the approved scenarios on the modern stack. The Gherkin scenarios from Discover are the spec — the contract every implementation must satisfy — so the output is verified against them at each step, not just generated and hoped for.
How a feature gets built
- 1
Sequence the approved scenarios
Repave orders the scenarios you approved by dependency, so features are built in a sensible sequence rather than all at once.
- 2
Ground each scenario in legacy evidence
Before writing code, the agent reads the exact legacy files and line ranges each scenario's @code-ref points to — so the rewrite reflects real behavior, not assumptions.
- 3
Implement to the Gherkin spec
The Gherkin scenarios are the contract. Agents build each feature on the modern stack so that every scenario is satisfied — the spec, not the prompt, defines what “done” means.
- 4
Prove it with BDD tests
Each scenario becomes an executable Cucumber test that drives the full stack — real browser → API → database — so passing tests mean the behavior actually matches the spec, end to end.
- 5
Review against every artifact
The implementation is checked back against the Gherkin contract, the UI prototype, the API spec, and your DB policy. Anything that drifts is handed back to the agent to fix.
- 6
Merge only when green
Each feature is built in its own isolated git worktree and merges to the modern branch only when the full suite passes — with an automatic fix pass if it doesn't.
In the app
Output
Modern code that satisfies the Gherkin spec, proven by passing BDD tests
Why it de-risks
Behavior is pinned to the Gherkin scenarios and verified by BDD tests at every step; features are built in isolation and nothing merges until the suite is green — so the rewrite can't silently drift from the spec.