posts/the-gherkin-is-the-thing-you-keepentry #004
Discovery is the skill, executable specs are the output
Discovery is the skill. The Gherkin is what it leaves behind.
Discovery is the skill. The Gherkin is what it leaves behind.
I built a repo whose only job is to turn a conversation into a working prototype in about an hour. The code in it is disposable. The part I care about is the Gherkin it produces.
If you stop reading the code, what do you hold on to?
I've been moving from reading agent output line by line to verifying it from the outside. That leaves an awkward question. If the code is no longer the thing I read, what do I hold on to?
My answer is an executable specification: plain-language scenarios that describe what the user is trying to achieve, run against the real system, and go red when the behaviour breaks.
None of this is new. Gherkin has been around for years. What changed is that an agent can now do the tedious work on both sides of it, turning a messy conversation into scenarios and turning scenarios into working software. That moves the scarce skill somewhere else, and I'll get to where.
How the repo works
It started as an experiment. I wanted to see whether I could build a workflow for figuring something out live, in the room with a client or product owner. The flow is simple:
- I talk to the customer about their workflow and paste the transcript, or my rough notes, into the repo.
- A skill turns that into a small Gherkin feature file, plus the assumptions it made and the questions to take back to the customer.
- Agents build it in stages. One designs a GraphQL contract. Backend and frontend builders work in parallel, each with its own reviewer. Another agent writes the Cucumber steps.
- The result shows up in the browser within a minute or two, next to a live report of which scenarios pass.
The UI and Cucumber both talk to the backend only through GraphQL, so the scenarios use the same door the screen does.
The skill has opinions. Scenarios are declarative, so they say what the user achieves, never which button they click. They use the customer's own words. And every scenario is tagged @heard if the customer said it, or @assumed if the model inferred it. That one tag does a lot of work in the room.
It also keeps the first slice thin. At most three scenarios get built. The rest wait in the file until someone says they matter.
Two chances for the client to say no
Here is a scenario from the repo:
Scenario: The assistant being unavailable is shown, not a crash
Given the assistant is unavailable
When a team member asks the assistant "When does the office open?"
Then the team member is told "The assistant is unavailable right now. Please try again."
A client can argue with that. They don't need to know what a mutation is. They can say that's not what should happen when the assistant is down, and now the disagreement is on the table before anything is hardened.
The prototype is their second chance. Some people can't tell whether the rules are right until they see a screen. Others read the rules and spot the gap straight away. With both in front of them, a miss in one has a decent chance of showing up in the other.
This is also my answer to the obvious objection. If the spec is the source of truth, how do I know it captured what the client meant? I don't, until they react to something real. The prototype is how I find out.
Making green mean something
If the Gherkin is what I keep, a green run has to mean the behaviour works. Three rules in the repo try to make that true.
The AI is faked in tests. The app calls a real model, but the tests never do. A scenario says what the assistant will answer, for example Given the assistant will answer "The office opens at 9am.", and the test checks what the system does with it. The same goes for failure: Given the assistant is unavailable. A scenario that depends on a model's exact words isn't a rule. It's a hope.
Coverage gates sit at 100 percent for the backend and the frontend, and agents are told never to lower a gate or exclude a file to get green.
Reviewers try to break things. After a builder finishes, a separate reviewer breaks the code in a throwaway worktree and expects the scenarios to go red. If they stay green, the scenario wasn't testing anything, and it goes back.
What surprised me
How quickly it came together.
I could watch the Gherkin appear, then watch a working prototype follow it, and the setup was far easier than I expected. That's a bit of a mind bend, and I keep waiting for the catch.
I haven't found one yet. As far as I can tell, nothing stops a prototype mode like this from being a normal way to start a project.
Prototype mode, then real mode
This is the part I haven't built yet, so treat it as a bet.
The repo is in prototype mode. It optimises for speed and is allowed to be rough. I'd like it to have a second mode. You tell the app it's no longer a prototype, and the Gherkin and the GraphQL contract stay exactly where they are while everything underneath gets hardened: linters, security checks, proper error handling, the gates a real product needs. An engineer reviews that work. The scenarios the client already approved are the definition of done.
I think it could also work against an app that already exists, not only a new one. Gherkin doesn't care what's underneath. I haven't tried that.
Discovery is the skill
If agents build the thing and the spec says what the thing is, the human work moves to the conversation before any of that.
Mapping out the workflow. Asking what happens when it goes wrong. Noticing where the client says "usually" and means three different things. That is the job now, whether you're talking to a client or just to yourself about a product you want to build.
You don't even have to speak Gherkin on the call. A model is good at pulling structure out of a conversation, as long as the conversation went far enough to contain it. Your part is to keep prodding until all the content is there. Then you read the Gherkin, look at the UI, and decide whether to make it real.
I think this becomes one of the most important skills for engineers. It's also the one that tooling is least likely to hand you.
Where I could be wrong
This is a prediction, and I could be wrong in a few places.
A tidy Gherkin file can hide a bad assumption. The @assumed tag helps, but only if someone reads it. Prototype mode to real mode might not be as smooth as I'm picturing, because throwaway code has a habit of becoming the product. And not everything reduces to a scenario. Performance, security and data migration don't fit neatly into plain-language rules.
I'll write again once I've tried the second mode. For now, the thing I keep is the Gherkin. If you think I've got this wrong, I'd like to hear it.