In short: Dr. Kiro, a Kiro custom agent, runs experiments on an undocumented system through an MCP lab bench and writes the system's Kiro spec from the results. One skeleton (the agent, the bench and the notebook) runs two very different applications: an OpenFOAM wind tunnel and a MuJoCo robot. Then a second agent gets only the spec: on a robot we had secretly changed, it reached the target in 3 of 3 runs with the new spec, and in 0 of 3 with the old spec or with none.

What it is

Kiro can read your code, but not what only shows up when you run a system. Ask an AI to spec a robot or a simulator nobody has documented, and every line comes back in the same confident WHEN … SHALL … requirements voice, with nothing to separate what was tested from what was guessed. So we turned spec-driven development around: here, the experiment writes and corrects the spec.

Three parts, built in Kiro:

  • Dr. Kiro, a Kiro custom agent that studies an undocumented system and writes its spec from experiments: predictions in requirements.md, rules in design.md, the experiment plan in tasks.md.
  • The lab bench, an MCP server with four tools. It is Dr. Kiro's only way to touch the system, and it enforces two rules: no prediction, no run; no evidence, no validated.
  • The Lab Notebook, a website built from the bench's hash-chained, sealed records, showing every prediction, every trial and every struck-through rule.

They form one skeleton, used for two very different systems: a 2D wind tunnel (OpenFOAM) and a stitched-together robot body with five unlabeled wires (MuJoCo).

One experiment, in five steps:

  1. Dr. Kiro gets the robot: five unlabeled wires (channels c0 to c4), no manual.
  2. It adds a line to tasks.md and writes a numeric prediction into requirements.md: a travelling wave across the wires will move the robot more than 0.20 m forward. The bench refuses to run anything until a prediction is on record.
  3. The bench runs the simulator and records the result. The robot went 0.20 m backwards.
  4. The rule stays in design.md, never erased: its row is marked rejected and names its replacement, and the notebook shows it struck through.
  5. At the end, what comes out is an ordinary Kiro spec and the notebook. A second Kiro agent that never saw the experiments can start from that spec alone.

That miss in the notebook: the prediction was more than 0.2 m forward, the robot went back and turned; the rule R4 is struck through and rewritten as R5, checked by the bench

Four status words, checked by the bench. validated: every cited prediction hit, and at least one hit was on a new combination or outside the range already tried. observed: seen, with no miss, but only where it had already been tried. partly: some hits, some misses. rejected: a prediction missed; the rule names the one that replaces it. If a word claims more than the record shows, the bench refuses to end the session.

No peeking at the answer. The simulator's code and model files sit in the same repository, but Dr. Kiro never sees them. It works inside one folder and has no shell; a Kiro hook refuses any file access outside that folder, and an automatic check keeps the model's own part names out of everything Dr. Kiro reads. Like a subject in a blind test, it can learn about this system only from its experiments.

Dr. Kiro works through the bench and gets back numbers and pictures only; the simulator's model files stay sealed, and a hook blocks the shortcut to them

What happened when we ran it

All numbers come from the sealed records in the repository.

1. The original robot (body-2). Like that backwards wave, most first guesses failed: 13 of 24 predictions missed, and 8 of 14 rules ended rejected, each paired with its replacement. The rule that held: hold wire c1 steady while wire c3 runs a fast sine wave, 0.75 m forward. Twice Dr. Kiro marked a rule validated with hits only inside the range it had already tried; twice the bench refused to end the session until the word became observed.

The notebook's highlight for the original robot: the miss and the best gait as moving photos, 0.75 m best, 11 of 24 predictions right, 8 rules rejected, and the best distance after each trial

2. The twist: we took a tyre off and told no one (body-3). Wire c1 had been driving that wheel; now it spun in the air. Starting from a blank notebook, Dr. Kiro found a new crawl with c2 and c3 together: 0.27 m at best, 12 of 16 predictions right.

The robot before and after the tyre driven by wire c1 was removed

3. The test: hand the spec to someone who never saw the experiments. A second Kiro agent, the reader, got one spec and one task on the changed robot: crawl ahead by 0.3 to 0.5 m, past Dr. Kiro's own best, keeping within 0.2 m of the start line and 20° of the start heading. It never saw Dr. Kiro's experiments; it had the spec, the bench, and up to 12 trials per run. Each condition got 3 runs, and the bench judged pass or fail against ranges committed before the runs.

The reader's task and results: 0 of 3 with the old spec, 3 of 3 with the new one, 0 of 3 with no spec

In all three runs with the old spec, the reader named the c1 rules it would rely on, and never reached the target. With the new spec, it met all three bounds in all three runs, first within 5 to 7 of its 12 trials.

4. The same skeleton, another world: the wind tunnel (wt-004). The same bench and notebook, with OpenFOAM behind a different adapter. Dr. Kiro is given four knobs (aspect ratio, corner rounding, a splitter plate, angle) and never the solver setup. Rounded corners and a long splitter plate stopped the vortex shedding, and the drag coefficient fell from 1.55 to 0.99. 16 of 17 predictions came true; the one miss keeps its rule partly.

The wind tunnel's highlight: the square body shedding vortices, the quiet body with rounded corners and a splitter plate, best drag coefficient 0.993, 16 of 17 predictions, and the best drag after each trial

What we do not claim: these are rules for these two simulators and conditions, from one to three sessions per lab and three reader runs per condition: a demonstration of the loop, not a benchmark.

One skeleton, two applications

One shared skeleton (Dr. Kiro, the bench, the notebook builder, the reader) and the two applications made from it

The skeleton (Dr. Kiro's agent, steering and hooks; the bench; the notebook builder; the reader) is shared without change. Each application adds only its hidden simulator model, a two-method adapter (declaration() and run_trial()), its lab folder (made by bench-make-lab) and a notebook look. One application drives five wires with signals over time in MuJoCo; the other sets four static knobs for an OpenFOAM solver in Docker; their adapters are 460 and 1,157 lines of Python. The whole contract is two methods:

class Adapter(Protocol):
    def declaration(self) -> Declaration: ...  # knobs, measurements, picture, budget, goal
    def run_trial(self, inputs: ComputedInputs, seed: int) -> TrialResult | TrialFailure: ...

A third lab starts from that contract (bench/src/bench/adapter.py) and the smallest working adapter (bench/src/bench/fake/adapter.py, 98 lines), then bench-make-lab makes its lab folder.

How it uses Kiro

A fresh session sealed in the Kiro IDE: hooks, steering and the bench MCP server on the left; every line of `tasks.md` ticked; the live notebook; Dr. Kiro's summary

Inside the product

  • Custom agent + MCP. Dr. Kiro has no shell. Its only tools are its lab files and the bench's four MCP tools (register_hypothesis, run_experiment, record_verdict, end_session). Writing "forbidden" in a prompt only made Kiro ask for permission; the rules had to live in the instrument.
  • Kiro CLI. The reader is a second Kiro custom agent, run with Kiro CLI: it gets one spec, one task and the bench, never Dr. Kiro's experiments.
  • Hooks. In each lab, two hooks log every call and a third refuses any call outside the lab.
  • Steering. Two steering files in each lab (method.md, workflow.md) set Dr. Kiro's loop: one task line per experiment, a numeric prediction before every run, a refuted rule kept as rejected, never deleted.
  • Specs as output. Dr. Kiro's result is a Kiro spec, with tasks.md as its experiment plan: one line per experiment, added before the run, ticked after it. The video shows this in a fresh Kiro IDE session (Claude Haiku 5.5): twelve experiments, 34 of 40 trials, about eight minutes; the bench refused the first attempt to end, two rules were corrected, and the session sealed.

Building it

  • Kiro Web, then the Kiro IDE. Most of the build started remotely in Kiro Web. Parts that needed MuJoCo, Docker or a picture renderer moved to the Kiro IDE on a Mac, with a steering file and a status file carrying the state across.
  • Specs as input, after a chat. The bench, both adapters, the agents and the notebook were first built by Kiro from seven specs under .kiro/specs/. We talked each part through in an ordinary chat first and opened the spec after: a spec written cold was hard to change later. Unlike vibe coding, each spec stopped where a human had to decide, and the decision stayed written in it.
  • Quick Spec. The live notebook view was one requirement added to a finished spec; Quick Spec turned it into design and tasks in about 10 minutes.
  • Property-based tests from the spec tasks. We enabled them for the rules the whole claim rests on: any changed byte of a record fails verification, a planted word from the hidden model is caught by the blind scan in every generated case, and run files survive a round trip. One property stopped a Run all by finding an error in a requirement, not in the code: the wind tunnel's mean lift had to be within 1% of the true mean, but a window holding part of a cycle is off by up to amplitude / (π · frequency · window length). Kiro did not weaken the test or edit the requirement; it stopped with three options, and the requirement was rewritten.
  • Steering: method in steering, rules in the instrument. Steering holds the method; anything that must hold is enforced by the bench or a hook, because a prompt only asks. Kiro also wrote steering for itself: when one of its sub-agents retried a refused command by another route, Kiro added "a refused command is a stop", and the next sub-agent stopped and reported.

Challenges

  • Keeping Dr. Kiro blind. The scan blocks the hidden model's own words wherever Dr. Kiro or the reader could see them. It caught ordinary words too: a solver keyword made grad forbidden, and the scan stopped the word "grades" on the front page.
  • A test the record already answers is no test. Our first tasks for the reader were already met by trials in the record; the reader's task check now refuses such a task.
  • One bench server per Kiro window. Kiro keeps the MCP server running across chats, so a second session was not seen until Kiro restarted. The server now follows the lab's current session on every call.

Impact and what's next

Specs go stale when systems change. On our changed robot, an outdated spec was no better than none: 0 of 3 either way, while the spec rewritten by experiment passed 3 of 3.

Any team with a system that changed or was never documented, such as a test rig after a part swap, an in-house simulator or a legacy service behind a test harness, can plug in a two-method adapter and get a spec that shows which lines held under test. Because the output is a standard Kiro spec backed by a hash-chained record, the next engineer or agent can build on tested behaviour instead of guesses.

The rules it enforces are those of a good lab notebook: write the prediction before the run, never erase a wrong line, seal every page. Any R&D team whose experiments a program can run, such as simulation studies, design comparisons or instrument characterization, could keep such a notebook with an agent doing the experimenting.

  • When a system changes, send the affected rules back to the bench: which still hold, and which are struck out?
  • Ask Dr. Kiro to rewrite its rule table after every verdict, so the notebook shows each rule struck out when it happened.

Try it

  • Video: https://youtu.be/NlJjpljgRmU
  • Repository: github.com/marcosanyo/dr-kiro-lab-notebook (no login). The specs Dr. Kiro wrote are in discovered/. Build the notebook locally with sh scripts/view-notebook.sh; check a sealed record with (cd bench && uv run bench-verify ../sessions/body-lab/body-3); run Dr. Kiro in your own Kiro IDE with sh scripts/try-lab.sh start.

Built With

Share this project:

Updates