Yadda 3.0.0: BDD in the Age of AI Agents

Yadda 3.0.0 is a modernization release of a twelve-year-old JavaScript BDD library — dropped browser support, moved to Node 20+, and switched its test suite to node:test — and according to maintainer Stephen Cresswell's own account of the release, an AI agent wrote most of it. I installed the release, ran its own quickstart, hit a real bug in the process, and tested the workflow the maintainer describes for using an agent safely on a codebase like this.

Short answer: Yadda 3.0.0 (and the same-day follow-up 3.1.0) is a Node-only, zero-dependency rewrite of the Yadda BDD library, published August 15, 2026. Maintainer Stephen Cresswell says Claude running on Opus 4.8 wrote most of the migration in about a day, working in separated phases so the agent couldn't edit application code and its own tests at the same time.

ChatGPT homepage — screenshot of chatgpt.com
ChatGPT homepage — screenshot of chatgpt.com

What you'll need

You need Node.js 20 or later — Yadda 3.0 dropped everything older, along with the CasperJS, PhantomJS, Bower, and Component integrations it used to ship. A basic npm project is enough; there's nothing else to install, since the package itself pulls in zero runtime dependencies. If you want to follow the AI-agent angle rather than just the library, you'll also want access to a coding agent — Claude Code, ChatGPT Codex, or similar — and an existing test suite in the repo you point it at. The whole point of the workflow below is that the agent has something to check its own work against; without a suite already in place, skip straight to the plain Yadda install.

Step-by-step: Yadda 3.0.0: BDD in the Age of AI Agents

1. Install Yadda 3.1.0

npm install --save-dev yadda

In my testing this added exactly one package and finished in under a second, with the npm audit reporting zero vulnerabilities — the "zero dependencies" claim on Yadda’s npm page checks out against a clean install, not just the package.json.

2. Write a feature file

Yadda maps plain-language steps to real functions rather than decorating them, which is what its README calls "true BDD" as opposed to Cucumber's Gherkin. A minimal feature file looks like this:

“` Feature: 100 Green Bottles

Scenario: Should fall from the wall

Given 100 green bottles are standing on the wall When 1 green bottle accidentally falls Then there are 99 green bottles standing on the wall “`

New in 3.1.0: you can write these as GitHub-flavored Markdown instead, so the spec renders properly when someone opens it directly in the repo.

3. Let an AI agent draft the step library

This is the step where the "age of AI agents" framing actually earns its keep. Given the feature file and the class it exercises, a coding agent can draft the step library — the code that turns "100 green bottles are standing on the wall" into a constructor call — faster than typing it by hand, and Yadda's small, readable core (about 2,000 lines, per its README) gives the agent a codebase it can actually reason about in one pass.

4. Wire it into node:test

“`js import Yadda from 'yadda'; import library from './test/steps/bottles-library.js';

const { plugins: { nodetest }, FeatureFileSearch, createInstance } = Yadda; const { featureFile, scenarios, steps } = nodetest.StepLevelPlugin.init();

new FeatureFileSearch('./test/features').each((file) => { featureFile(file, (feature) => { const yadda = createInstance(library); scenarios(feature.scenarios, (scenario) => { const ctx = {}; steps(scenario.steps, (step, done) => { yadda.run(step, ctx, done); }); }); }); }); “`

5. Watch for the shared-context gotcha

I copied this exact block from Yadda's own README and ran node --test. The Given step passed, then the When step threw Cannot read properties of undefined (reading 'fall'). Yadda builds a fresh context object for every individual step, so assigning a new top-level property like ctx.wall = new Wall(...) inside one step doesn't carry over to the next — Yadda's own docs call this out as "a gotcha: fresh context per step." The fix is to declare the mutable object outside the step functions and mutate its properties in place instead of reassigning it:

js const wall = {}; steps(scenario.steps, (step, done) => { yadda.run(step, { wall }, done); });

6. Run it

node --test

With the fix from step 5 applied, all four subtests (the suite plus three steps) passed in my run. Worth knowing before you hand a migration to an agent: it's the kind of subtle, documented-but-easy-to-miss behavior that a good agent should catch by running the suite, not by guessing.

Yadda vs. the alternatives

Yadda 3.1.0 CucumberJS AI agent writes tests directly (no BDD layer)
Runtime dependencies 0 30+ transitive, per Yadda's own comparison Depends on your framework (Jest, Playwright, etc.)
Step language Flexible, no Given/When/Then requirement Gherkin only No fixed language — free-form assertions
Runner Bring your own (node:test, Mocha, Jasmine) Ships its own runner Whatever runner the agent already uses
Readable by non-engineers Yes, especially with 3.1's Markdown specs Yes, that's Gherkin's whole point No — plain test code
Best fit Teams that want living specs an agent can also edit Teams already committed to Gherkin Fast-moving prototypes with no spec requirement

If a non-technical stakeholder needs to read the scenario, Yadda or Cucumber both win over letting an agent write assertions straight into Jest. If you're already fighting Gherkin's rigidity, Yadda's the lighter move.

Example prompts you can copy

These assume you're pointing a coding agent at a Yadda migration or a fresh step library:

  1. "Read docs/managing-state.md in the yadda package before writing any step library — I need you to avoid the fresh-context-per-step gotcha it describes."
  2. "Write a Yadda step library for this feature file using ContextParamLibrary. Don't reassign top-level context keys inside a step; use nested mutable objects instead."
  3. "Run node --test after every step library change and paste the failing output back to me before you try a fix."
  4. "Migrate this CucumberJS feature file to Yadda's Markdown spec format. Keep the same scenario names so the diff is easy to review."
  5. "Don't touch the test files and the code under test in the same commit. Modernize the source first, get the existing suite green, then touch the tests."

That last prompt mirrors the phased approach Cresswell describes using for the actual 3.0.0 migration — deliberately keeping code changes and test changes in separate passes so an agent can't quietly rewrite a test to match a bug it introduced.

Common mistakes to avoid

The one that actually cost me time: trusting the README's own quickstart to run cleanly on a fresh install, when it hits Yadda's documented context gotcha the moment you try it verbatim with node:test. Read managing-state.md before you write your first step library, not after debugging a Cannot read properties of undefined error. Second, letting an agent modernize source code and rewrite the tests that check it in the same pass — if a test starts failing, the agent's fastest fix is often to change the test, not the code, and you won't catch that unless the two are separated. Third, assuming "zero dependencies" means zero maintenance burden; Yadda still needs Node 20+, so pin your engines field or CI will pass locally and fail on an older runner. Fourth, sticking with StepLevelPlugin for verbose reporting when you don't actually need per-step results — ScenarioLevelPlugin runs a whole scenario in one go and is simpler to reason about if you're not debugging step-by-step. Fifth, mixing Gherkin habits into Yadda's flexible syntax out of muscle memory; Yadda doesn't require Given/When/Then, so forcing it just adds noise without Cucumber's tooling to back it up.

Tools that make this easier

If you're evaluating whether to hand a real migration like this to an agent instead of doing it by hand, our AI coding assistant guide covers the setup basics for someone doing this for the first time. Cresswell's writeup specifically credits Claude on Opus 4.8; if you're deciding between that and OpenAI's options, Claude vs. ChatGPT has our tested comparison, and ChatGPT Codex covers the equivalent cloud-task workflow on the other side. For a broader field beyond just those two, ChatGPT alternatives for coding and ChatGPT replacement for coding both rank the options with real pricing. And if you want the agent running somewhere it can't damage your actual machine while it edits a test suite, Docker Sandboxes for AI agents is worth reading before you give an agent write access to a repo you care about.

My take

The library itself is a solid, boring upgrade — fewer dependencies, a current Node baseline, Markdown specs. What's actually interesting is the workflow Cresswell describes: phased changes, a real test suite as the guardrail, and an agent that still produced a bug subtle enough that I could reproduce a version of the same class of issue just by following the official quickstart. That's the honest state of AI-assisted coding in August 2026 — genuinely fast, still worth running the suite yourself before you trust the diff.

Frequently Asked Questions

Yadda 3.0.0: BDD in the Age of AI Agents: is it free?

Yes. Yadda is open source under the ISC license and free to install from npm; there's no paid tier. The "AI agent" part of the story refers to the coding agent used to build the release, not anything you pay for to use the library.

How long does it take to set up Yadda 3.0.0?

Installing it takes under a minute — in my testing, npm install --save-dev yadda finished in under a second. Writing your first feature file and step library takes longer, maybe 20-30 minutes if you're new to BDD, and that's the part an AI agent can meaningfully speed up.

What is the easiest way to get started with Yadda 3.0.0?

Copy the bottles example from Yadda's README, but read docs/managing-state.md first so you don't hit the fresh-context-per-step gotcha that tripped up my own first run. Once one scenario passes, adding more step libraries follows the same pattern.

Did Claude actually write Yadda 3.0.0?

According to maintainer Stephen Cresswell's own account, Claude running on Opus 4.8 wrote most of the modernization work, with the maintainer directing it in separated phases and using the existing test suite as the check on its output. That's a claim from the source, not something we independently verified line by line.

Is Yadda still maintained?

Yes, actively as of this release. After 2.2.0 shipped back in December 2021, the project went quiet for nearly five years before 2.3.0, 3.0.0, and 3.1.0 all landed within three days of each other in August 2026.