nukadoko
nukadokov0.25.0MIT
Typed step contracts for Gherkin, so a scenario can be told wrong before it runs. Every execution leaves a step record the tool measured rather than the agent reported, and every run a Markdown summary that is the run's evidence.
Install
npm install nukadoko- Source on GitHub
- Uses: archstrict, depug
- Used by: archstrict, depug, finderscope, firstlight, polylinedb, portful, runtag, solarsql, spacequery, stow, stryker-agent-reporter
nukadoko runs Gherkin scenarios under typed step contracts and writes a step record for every execution.
Implementations are generated now, and the criteria that check them have to stay fixed.
The acceptance criteria stay in the language of the people who set them.
Everything between those sentences and the system under test is typed, checked before execution, and reviewable in a diff.
The tool measures each step record itself, so nobody has to trust an agent’s account of the run.
Every run ends in a Markdown run summary, and the run is the evidence: these scenarios ran at this commit, under these conditions. A person reads the .feature and that summary, and where the approval is recorded stays outside nukadoko.
Features
Section titled “Features”- Wrong before it runs.
nuka checkreads every feature file and step file and reports problems such as an undefined step, a duplicate pattern, an ambiguous step, afrombinding in the wrong order, a Then bound to a step that runs code, or a step that needs Playwright the project has not installed.nuka check --codeslists every finding code.nuka runperforms the same check before it executes anything and stops on an error;--no-checkskips it. - A Then declares claims instead of code. A typed Then names the value it reads, how it compares it, and where the expected value comes from, which is the sentence unless the step says otherwise. nukadoko does the comparing, and a broken claim prints both values and where each came from, such as
"Hello, Ada!" (from:run-greet@5.stdout as text) equal "Hi, Ada!" (sentence:text). - Step records.
nuka doruns one step by itself and prints a step record with the validated result.nuka runruns scenarios and leaves the same records. Each HTTP request a step sends lands in the record’shttp.jsonl, and a step that calls the exportedrunCommandlists each process it started underobserved.processes. WebSocket frames land inwebsocket.jsonl,measureMcp(transport)adds the step’s MCP calls, and a program that writes execution events adds what it did inside the step. - nukadoko starts the program.
nukadoko.program.tsdescribes the program under test withdefineProgram. nukadoko builds and prepares it, starts it on a free port for each run, waits until it answers, sends every step’s requests there, and stops it after the scenarios. - A run summary as evidence. Every
nuka runwrites.nukadoko/runs/<run_id>/summary.md: a verdict table per criterion and environment, a Claims section with every claim and its outcome, the commit, and a rerun command for each failed scenario. It is appended to$GITHUB_STEP_SUMMARYwhen that is set.nuka run --base <ref>says which criteria are new, changed, unchanged, or removed since the base, and whether each new or changed one failed against the base’s code.nuka report --format markdown|allure|messagesrenders a finished run from its run directory alone, and--out <path>writes the summary a CI step posts as a pull request comment. - A way in for an existing suite. Switching one import from
@cucumber/cucumbertonukadoko/compatkeeps a cucumber-js suite running while nukadoko records its steps. Each step can then move todefineStepon its own.
How an agent uses it
Section titled “How an agent uses it”An agent can complete the whole loop without help.
- It discovers the vocabulary with
nuka steps --json. - It reads a contract with
nuka describe, with its schemas as JSON Schema. - It runs one step with
nuka do, reads the step record, and chooses the next call. - When the vocabulary lacks an operation, it adds a step with
nuka scaffold <name> --pattern "<line>", or, when the feature comes first, writes one stub for each undefined line withnuka scaffold --feature <file>.--command <entry point>writes a When step that runs a program in the built-inscratchdirectory,--request "<METHOD> <path>"writes one that calls the program’s URL, and--then --from <step>.<key>writes a Then step whose claim compares that value with the sentence. - It writes the feature, runs
nuka checkon the feature, several files, or a directory, and runsnuka run <feature>until green. When a scenario fails, stderr names the step, its error, its step record, and thenuka run <feature>:<line>that reruns it. - It hands over the feature and its run summary for a person to review.
nuka check is the static gate before every run.
With no target it also adds notes on what is rotting rather than broken, such as a from declaration nothing exercises, a pattern no feature binds, or a schema field with no description. A note never changes the exit code, and --fail-on <code> turns one into a failing exit code.
nuka run --tag "not @ios" runs only the scenarios whose tags match, and nuka run --step pauses after each step so an agent can walk one scenario with a person.
The package ships two skills. nukadoko takes a requirement to a scenario and the run that is its evidence, for a person to review, and nukadoko-verification puts scenarios under a project’s verification skill as the proof layer of its feature map.
Getting started
Section titled “Getting started”nukadoko needs Node 22.18 or later on the 22 line, or 23.6 or later: the releases that run a .ts file without a flag. It loads the config and the step files with Node’s own type stripping, so it installs no TypeScript loader of its own.
npm install -D nukadokonpx nuka initnpx nuka scaffold run-greet --pattern "I run greet with {name:string}" --command src/cli.tsnuka init sets up a CLI or API project.
It writes nukadoko.config.ts and features/steps/, adds .nukadoko/ to .gitignore, adds the steps and the config to the include of tsconfig.json, and adds a test:scenarios script that runs nuka run, so npm run test:scenarios is the one command a person or CI runs. With no target, nuka run checks featuresDir and then executes it.
The scaffold line writes a When step that runs the program src/cli.ts and returns its exitCode, stdout, and stderr.
nukadoko installs no browser: Playwright is an optional peer dependency, needed only by a step that uses page or request.
nuka run writes no Allure results or cucumber-messages stream; nuka report renders them from a finished run, and nuka init --allure writes allurerc.mjs for Allure.
gh skill install meganemura/nukadoko --all installs both skills, and nuka skill path prints the directory of the copy that matches the installed version.