This post was written as part of the Kiroween 2026 hackathon (Resurrection category).
Somewhere in production there is a jQuery plugin from 2011 that calculates shipping costs. Nobody remembers why it rounds the way it does, there are no tests, and everyone is afraid to touch it.
You can paste it into a chat with a language model and get back clean TypeScript in seconds. The code will look modern. But you can't tell whether it still behaves like the old one.
That gap is what we built Lazarus to close.
- Live app: lazarus.jgcamiloaga.me (no sign-in needed to try the samples)
- Code: github.com/LIUNKS/lazarus
What Lazarus does
Lazarus turns legacy JavaScript (ES3, ES5/jQuery, legacy Node) into strict TypeScript in four stages:
- The Morgue. You import a file, or open one of three sample "corpses" without signing in.
- The Hex Scanner. A deterministic AST analyzer built on
acornfinds six "curses" and reports the exact line of each: global pollution,varhoisting, implicit coercion, callback hell,eval, and prototype pollution. No language model is involved here, so the same source always gives the same findings. - The Séance Chamber. A model extracts the business logic into a spec: requirements in EARS notation, a design, and input/output invariants. You approve the spec before anything is generated.
- The Laboratory. The model writes the TypeScript module and a
fast-checkproperty test. Then Lazarus runs the legacy function and the modern one on the same 1,000 generated inputs and compares the results.
The result reads "Verified behavioral equivalence across 1,000 generated inputs." We never call it a proof. It is empirical evidence: the inputs that were not generated were not checked. When the two versions disagree, Lazarus shows the input where they differ.
How we used Kiro
We built the whole project in Kiro IDE. Four features shaped how we worked.
Specs instead of one long conversation
Lazarus is 11 specs, each with requirements.md, design.md, and tasks.md. The verifier, the sandbox, the verification route, and the UI are separate specs, and we built them in dependency order. Every task cites the requirements it implements, and every design lists numbered correctness properties that become property tests.
Small specs changed how we reviewed work. We reviewed decisions before code existed instead of fixing code after it broke. Each tasks.md starts with Preconditions and a Scope section, and the agent respected them.
At one point, three slow tests from the sandbox spec started timing out while we finished a different spec. That spec forbade changes to the sandbox package. The agent wrote the problem down in the task notes instead of patching it in place, and the fix shipped as its own pull request.
Steering that loads only when it matters
We kept only three steering files always on: product, tech stack, and repository structure. The others load by file pattern:
- database and execution-safety rules when Kiro touches
db/orpackages/, - test conventions for test files,
- spec execution rules for
.kiro/specs/.
Less unrelated context meant more consistent work. The agent checked the docs of the installed library version before using an API, wrote Row Level Security policies the way we asked, and did one task at a time.
Hooks for the rules that must never break
A steering file is advice. A hook is a check. Our guard-sensitive-writes hook runs before every file write. It blocks edits to a database migration that was already applied and server secrets in client code. It also asks for confirmation before words like "guaranteed" or "100%" land in a user-facing file. Other hooks run the scanner tests on save, run lint and tests after each spec task, and print the progress of every spec when a session starts.
An MCP server that the product also uses
The Hex Scanner is a library and also an MCP server with two tools, scan_ast_curses and extract_function_signatures. Kiro uses it while we develop, and the web app's /api/scan route uses the same code. The agent and the product report the same findings for the same file.
Bug 1: a property test is only as good as the way it calls your code
This is the bug we learned the most from, and no property test found it. We found it by looking at a real import:
function calculateShipping(weightKg, zone, isExpress) { ... } Our test contract had a single comparison helper, assertEquivalent(input), which called both functions with one argument. For this function, the whole generated input landed in weightKg, and zone and isExpress were undefined. Both versions could agree on a meaningless result like NaN, and the run could report equivalence without ever exercising the real logic.
No user saw a false result, because live verification of imported code is switched off in production. But the lesson stuck: a passing property test says nothing if the generated inputs never reach the parameters that matter.
We fixed it through a new spec:
- A second helper,
assertEquivalentArgs(args), spreads one generated value into each parameter. - Both test runners now refuse the one-argument call for a function that declares two or more parameters. That run ends with an error, never with a verdict.
- The generator receives the parameter names, and a static check rejects a one-argument test for such functions.
return fc.property( fc.tuple(fc.double({ min: 0, max: 100, noNaN: true }), fc.constantFrom('local', 'national', 'international'), fc.boolean()), (args) => { assertEquivalentArgs(args); } ); While adding the static check, we found the same bug in our own shared test fixture: it tested calc(a, b) with one argument, and the tests had passed with it for eight days.
The spec added four correctness properties as property tests. For example: "a modern version that ignores its last parameter must fail", run for functions with two to four parameters.
Bug 2: it works on my machine, and the file trace says why not
Signed-in users can run a sample live. On Vercel, that button answered "The isolated environment is not available right now." Locally, everything passed.
The first problem was that we couldn't see the cause: the code caught the loading error and discarded it. We added a log line with the error name and code. The next failure in production printed:
{"event":"sandbox_load_failed","errorName":"SyntaxError","errorCode":null} A SyntaxError from code that runs fine locally pointed at packaging. Vercel ships each route with only the files listed in its Next.js file trace (route.js.nft.json). We rebuilt that bundle in an empty folder, using only the traced files and links, and got the same error:
The requested module 'pure-rand/generator/congruential32' does not provide an export named 'congruential32' pure-rand, a dependency of fast-check, is a CommonJS package whose ESM build is marked by a tiny file, lib/esm/package.json, containing {"type":"module"}. The trace shipped the ESM files but not that marker, so Node.js read them in the wrong module format. Adding the marker to outputFileTracingIncludes fixed it. In the rebuilt bundle, all three samples passed 1,000 inputs each.
There was a second bug in the same path. The app cached the loaded sandbox for the life of the server process, including a failed load, so a single failure made every later request on that instance fail. The cache now drops a failed load and tries again on the next request.
What we would tell another team
- Write the spec first, even for a bug fix. The multi-parameter fix touched three packages. The spec kept the change additive, so the three samples behave exactly as before.
- Turn your most important rules into hooks. Steering guides the agent. Hooks stop it.
- Check how your property tests call the code. Generated inputs are only useful if they reach every parameter.
- When it works locally and fails in production, rebuild what production ships. For Next.js on Vercel, that means the file trace.
Try it
Open lazarus.jgcamiloaga.me and pick a sample corpse. You can read the curses, the extracted spec, the TypeScript, and the property test without signing in. Sign in with GitHub to import your own legacy file, or to run a sample live on 1,000 new inputs.
The full Kiro write-up, with a link to every artifact, is in docs/kiro-usage.md.
Built with Kiro by Franco Johan Perez Melgarejo, Johann Gudwig Camiloaga Cuenca, and Yaren Anderson Melgarejo Cuenca, students at Universidad Tecnológica del Perú (UTP), for the Kiroween 2026 hackathon.