nukadoko
nukadokov0.17.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 a pull request carries.
Install
npm install nukadoko- Source on GitHub
- Uses: archstrict, depug
- Used by: archstrict, depug, finderscope, firstlight, solarsql, spacequery, 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 that CI posts on the pull request, and a person reviews the .feature in the diff beside it.
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, 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 vocabulary an agent can read.
nuka steps --jsonlists each step with its patterns, description,mutates, andneeds.nuka describeshows a step’s contract, with its schemas as JSON Schema. - Step records.
nuka doruns one step by itself and prints a step record with the validated result and the network reads and writes the tool observed.nuka runruns scenarios and leaves the same records. A step that calls the exportedrunCommandlists each process it started, with its command, working directory, and exit code, underobserved.processes. - A run summary for the reviewer. Every
nuka runwrites.nukadoko/records/runs/<run_id>/summary.mdwith the commit, the environment, one table per feature, any step that declaredmutates: falsebut was measured making a write, and a rerun command for each failed scenario. It is appended to$GITHUB_STEP_SUMMARYwhen that is set, and--summary <path>writes a copy a CI step can post as a pull request comment. - A failure that says why. When a step fails,
nuka runprints the first line of its error and the path of its step record on stderr, and after the summary arerun nuka run <feature>:<line>line for each failed scenario. When the failed step read from a step whose program exited nonzero, ausedline names that step, the exit code, and the first line of its stderr.--quietkeeps these lines. - 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. - 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>. It implements the step, and runs it alone withnuka do.--thenwrites a Then step,--command <entry point>writes a When step that runs a program in the built-inscratchdirectory,--from <step>.<key>writes the chain to a value from an earlier step, and--descriptionwrites the step’s description. A step that only asserts can leave outreturns. - It writes the feature, runs
nuka checkon the feature, several files, or a directory, and runsnuka run <feature>until green, reading the failed step’s record when it fails. - It hands over the feature and its run summary. A person reads both on the pull request and approves it.
nuka check is the static gate before every run.
nuka tend runs from time to time, for example as a scheduled CI job, and reports what is rotting rather than broken, such as an unused declaration or a step no feature line binds. nuka tend --all adds the declaration notes, such as a schema field with no description.
The package ships two skills. acceptance takes a ticket’s acceptance criteria to a pull request a person can approve, and migration moves a cucumber-js suite across.
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.
The Allure and cucumber-messages emitters are off until their config key is present; nuka init --allure turns on Allure.
gh skill install meganemura/nukadoko --all installs both skills.