Prompt-Driven Development: Aligning Ideas, Tests, and Code

We have a Trust problem

AI generated code is not great

On top of that, it is dangerou s

Asking it to fix it is as reliable as the rest of it

Baruch Sadogursky - @jbaru ch × Developer Advocate at large (talk to me!) × Development -> DevOps -> #DPE

shownotes × × × × speaking.jbaru.ch Slides Video All the links!

Software design documents

Software design documents × Write-once × Read-maybe-once × (Mis)understood by humans

So why don’t they work? × Human (mis)understanding × Vague responsibility boundaries

We have a Trust problem (not only with AI)

Next thing you know: It’s a vei n diagram Software I like Software I know really well

But hey, we do have working s oftware sometimes × Good intentions × Professionalism × Tests and QA × End result observation

Until gen AI changed the game × × × × Good intentions Professionalism Tests and QA End result observation

Idea! What if we code in the intent and always verify against it?

Let’s express intent in tests × × × × Instead of SDDs Always up-to-date Generate consensus Parsed by the machine TDD?

What if it (almost) won’t look × × × × × like code? Instead of SDDs Always up-to-date Generate consensus Parsed by the machine Describe behavior instead of tests

What if it (almost) won’t look × × × × × like code? Always up-to-date BDD? Generate consensus Parsed by the machine Describe behavior instead of tests Almost plain English human language

But writing tests first is still a good idea, right?!

Why developers won’t write tes ts first × Developers are solution-biased × We already know how to solve the problem × Legacy code bases

How everything comes togeth er Product managers define what software should do LLM creates specs Specs are reviewed and agreed upon Tests are generated and reviewed Code is written to satisfy the tests -> specs -> design

Why does it work? × × × × × Product managers write text Specs are reviewed by all SDDs are Specs are living docs Everything else is derived from specs Previous steps are protected

PDD is BDD as it meant to be × Define and agree on intent × AI is protected from circular verification × Up-to-date context docs at all times

Rules/Guidelines × Mostly refined by Cascade × The full version covers an existing codebase scenario × Has a link in /docs

New project × Phase 1: Define requirements using the memento pattern × Phase 2: Define test scenarios and specs × Phase 3: Implement tests and business logic

Existing project × Phase 0: Examine code and produce full test coverage × Existing tests are protected

Protection rules × Requirement documents are protected after Phase 1. × If changes are needed, the phase is reset × Test scenarios and specs are protected after Phase 2.

Recovery rules × Source control commits after stages × Requirements changes trigger phase reset and re-alignment × Might convert the project into ”existing” mode

Cascade in Windsurf Pros × Speed × Conversation and reflection × Selectable models Cons × Not IntelliJ IDEA × .windsurfrules system is not ideal

Junie in intellij idea Pros × IntelliJ IDEA × Execution Plan × guidelines.md is better Cons × Speed × Introversion × No chat/reflection mode

Better Rules system? × × × × × Multiple files for different scenarios Flexible actuators File references for reuse Optionally, part of the documentation .cursor/rules for the best implementation ATM

Too much code? × New prompt – new context window × Memento pattern FTW × But what if even the initial context is too large? × Is it the perfect argument for microservices?

Who should fix the code? × Code inspections (linting in VS Code) integration × “Switch from AI generation to tool calling when needed” × Leonid Kuligin – “What is an AI agent? How to develop one?”

Developer productivity

Is it engaging?

Looks like a pretty easy fix…

Are the stops intentional?

Use tools, add guardrails Using IntelliJ IDEA code inspections Physically protect stage assets Machineverify stages compliance

Is it too rigid? × The process feels the opposite of agile × Making changes is a pain × Are there other options?

Use tools, add guardrails Using IntelliJ IDEA code inspections Physically protect stage assets Machineverify stages compliance

(Summary) PDD – BDD finally m a kes sense × Generates consensus × Features are verifiable back to requirements × We can start trusting AI code (🤞) × But there is still work to be done

THANKS! Q&A and Twitter X/Bsky/LinkedIn ads: x @jbaruch x #pdd x speaking.jbaru.ch