Inspiration

Every company has a haunted spreadsheet: an Excel workbook from 2009 whose VBA macros no one dares touch, because the author left years ago and the code is the only thing keeping payroll running. GhostMacro is a séance for those macros — it talks to the dead code and brings it back as a modern web app, line by line, with the receipts.

What it does

GhostMacro is a browser-based VBA resurrection studio. Paste or upload a .bas / .vba file — or pick one of three haunted samples (Expense Tracker, Inventory Manager, Invoice Generator) — and watch the séance: your VBA on the left, clean TypeScript/React on the right, with a line-by-line diff. Press Run the resurrected app and the transpiled logic executes live in your browser: the original MsgBox, InputBox, cell reads and writes all behave the way the macro intended. Uploaded constructs the transpiler doesn't support yet don't fail silently — they get a report naming the exact line and a suggested rewrite.

It's a Frankenstein project in the literal sense: the dead part is real 1990s VBA (Range/Cells, MsgBox, InputBox, worksheet loops); the body is modern TypeScript + React + Vite; the second brain is deterministic parsing with property-based tests; and the skeleton crew is a Kiro Crew background agent that batch-converts a folder of macros and posts a conversion report.

How we built it

  • Spec-first in Kiro: requirements → design → tasks in .kiro/specs/ghostmacro-v1/, with steering files that keep the transpiler's subset honest.
  • A two-stage transpiler: a hand-written VBA lexer/parser producing a typed AST, then a code generator emitting TypeScript with React runtime helpers.
  • Deterministic by design: no LLM in the hot path. Parsing and transpilation are pure functions; property-based tests (Vitest + fast-check) prove round-trip behaviour across the whole input space, not just the examples.
  • Kiro CLI for the repetitive parts: the Crew agent in crew/ was built headless via the kirocrew CLI (see docs/KIRO-USAGE.md §5 for the full honest record).
  • The demo samples are the acceptance test: all three convert end-to-end with zero errors, zero unsupported constructs, zero warnings.

Challenges we ran into

  • VBA's grammar is a haunted house: GoTo labels, On Error Resume Next, Select Case with non-literal patterns, and the Excel object model are all explicitly out of scope — the honest move was to draw the subset boundary early and make the transpiler fail gracefully with a line number, instead of pretending to be a full transpiler.
  • Excel semantics don't map 1:1 to a browser: MsgBox/InputBox had to become an AA-contrast (5.41:1) React UI, and every loop got a 10,000-iteration safety cap so a resurrected macro can't hang the tab.
  • Running code the user pasted into the page: the live preview executes transpiled logic in a sandboxed runner, so the demo is genuinely the transpiled code running — not a mock.

Accomplishments that we're proud of

  • 68/68 tests passing, including 7 fast-check property tests (deterministic transpilation, operator/expression preservation, no-throw on arbitrary, shuffled and truncated input) and hardening tests for empty, oversized, comments-only and GoTo files.
  • Three samples convert end-to-end with zero errors, zero unsupported constructs and zero warnings.
  • A live preview that is genuinely the transpiled logic running — with a 10,000-iteration safety cap on loops — and an AA-contrast (5.41:1) UI.

What we learned

Spec-first beats vibe coding for a transpiler: the spec caught the Range-mapping design decision before any UI existed, and the task file's "tests + build must pass before a task is done" gate kept every phase honest. Property-based testing catches what unit tests miss — determinism and expression preservation across the whole input space, not just the examples.

What's next for GhostMacro

  • Public deployment (Vercel) and this Devpost draft saved early.
  • Demo video (< 3 min, YouTube public), Bonus Blog post, Social Blitz post.
  • Wider VBA subset coverage, driven by the same rule: new construct = spec task + test + README row, or it does not ship.

Built With

Share this project:

Updates

Submission history