DEV Community

Cover image for NeoCard: Resurrecting HyperCard 1987 Offline with Kiro CLI
Mentari Rahman
Mentari Rahman

Posted on

NeoCard: Resurrecting HyperCard 1987 Offline with Kiro CLI

Written by Mentari Rahman on December 4, 2026, for the Kiroween Hackathon 2026 (Resurrection track).

NeoCard is an open source offline web app studio built with Kiro CLI that recreates Apple HyperCard from 1987 and compiles interactive card stacks into a standalone HTML app backed by 168 passing Vitest tests. Every exported file preserves 512x342 black and white pixel artwork, square wave browser audio, and branching logic without requiring a server, user account, or internet connection.

Back in 1987, Apple bundled HyperCard free with every Macintosh so teachers, writers, and creators could ship software simply by linking cards together on a screen. Today, releasing even a tiny interactive tool usually pulls in cloud hosting bills, databases, login flows, and ongoing maintenance. I created NeoCard during the Kiroween Hackathon 2026 to restore that immediate build loop on the modern web.

Key Takeaways

  • NeoCard turns 512x342 card stacks into one offline HTML document locked with a SHA-256 CSP hash and default-src 'none'.
  • Pure TypeScript executes user actions without eval(), verified by 10 Vitest suites totaling 168 tests.
  • Combining Kiro CLI spec driven development, Kiro agent hooks, and a custom Model Context Protocol server prevented late regressions.

What is NeoCard and how does it compare to HyperCard?

NeoCard is a web native card studio styled after Macintosh System 6 that replaces proprietary binary stacks with validated JSON schemas and deterministic HTML export. Creators design in a Classic 1987 black on white palette or toggle Ghostly Modern dark mode while keeping every standalone HTML app portable across desktop and mobile browsers.

Feature Apple HyperCard (1987) Typical Modern Web App NeoCard (2026)
Runtime environment Classic Mac OS only Cloud hosting and server APIs Any browser, online or offline
Scripting model Arbitrary HyperTalk scripts Arbitrary JavaScript bundles Closed action schema without eval()
Distribution output Binary .stack file Hosted bundle or SaaS URL Standalone offline .html document
Artwork pipeline MacPaint tools and dithering External asset build steps Integrated 1 bit canvas and Atkinson dither

Rather than rewriting an entire Macintosh emulator, NeoCard recreates what actually made HyperCard productive: fixed card geometry (512x342), visual drawing right next to layout controls, and instant movement from editing into live play.

How can an offline web app run safely without eval()?

NeoCard keeps user stacks safe by routing every button click, text check, and card jump through a closed declarative action switch written in pure TypeScript (packages/engine/src/engine.ts). Because zero eval(), new Function(), or innerHTML calls appear anywhere in the runtime, opening an untrusted HTML stack straight from disk cannot inject arbitrary scripts.

Instead of storing executable JavaScript snippets inside card buttons, each trigger stores structured JSON actions defined against schema version neocard/1. Checking a terminal password inside the built in Manor of 1987 stack uses this schema format:

{
  "do": "goToCardIf",
  "fieldId": "pw",
  "op": "eq",
  "value": "atkinson",
  "cardId": "secret",
  "elseCardId": "denied"
}
Enter fullscreen mode Exit fullscreen mode

On the export layer (packages/exporter/src/export.ts), exportStack() bundles the prebuilt runtime.iife.js, inline CSS, and JSON stack payload into one deterministic HTML file, pinning the single inline <script> tag with its computed SHA-256 hash inside the document Content Security Policy:

default-src 'none'; script-src 'sha256-...'; style-src 'unsafe-inline'; img-src data:; base-uri 'none'; form-action 'none'
Enter fullscreen mode Exit fullscreen mode

Without 'unsafe-eval', the browser engine itself refuses eval() or Function() calls, while default-src 'none' blocks every outbound network request even inside an active online browser. Every export runs identically over file:// as it does inside the live studio.

How does NeoCard recreate Bill Atkinson 1 bit dithering?

NeoCard converts local photos directly inside your browser using Bill Atkinson error diffusion (packages/paint/src/dither.ts), spreading quantization error across six neighboring pixels instead of every surrounding pixel. Nothing uploads to a remote API, and bright highlights stay clean rather than turning muddy.

Floyd-Steinberg dithering diffuses 100 percent of rounding error across four neighbors, which often leaves flat gray midtones speckled with dark dots on coarse 512x342 displays. In atkinsonStep(), each pixel snaps to pure black (0) or white (255), then passes only six eighths (6/8) of the error forward across fixed offsets ([1,0], [2,0], [-1,1], [0,1], [1,1], [0,2]). Deliberately dropping the remaining two eighths produces sharp contrast and crisp white backgrounds around portraits and skies.

NeoCard Studio Photo to 1 bit dialog applying Bill Atkinson error diffusion dithering in Edit mode

One honest constraint here is storage size. Each painted card picture is stored as a clean 1 bit bitmap array (roughly 29 KB per painted card) inside the JSON payload rather than a compressed binary blob, keeping the parser simple while making art heavy stacks land around a few hundred kilobytes.

How did Kiro CLI spec driven development prevent regressions?

Using Kiro CLI spec driven development together with automated verification hooks kept security and offline guarantees verified continuously rather than waiting for late manual debugging. Across NeoCard's seven TypeScript packages (schema, engine, paint, exporter, samples, mcp, and apps/studio), four structured layers inside .kiro/ held the build steady.

I will admit that pausing to write structured specs before building buttons felt slow during the first couple of hours. Once the Kiro agent hooks started running automatically in the background, however, the time saved became clear:

  1. Steering documents inside .kiro/steering/ (product.md, architecture.md, and aesthetic-1bit.md) carried constraints into every Kiro CLI session: authentic 512x342 proportions, 1 bit bitmap rendering, offline portability, and zero dynamic code execution.
  2. Five feature specs inside .kiro/specs/ (stack-engine, paint-dither, exporter, neocard-mcp, and studio) documented edge cases across requirements.md, design.md, and tasks.md upfront. Defining numeric field parsing, rounding rules, and CSP hashing inside specs prevented shortcuts when implementing the studio UI.
  3. A PostFileSave hook in .kiro/hooks/vitest-on-edit.json automatically executed npx vitest run --reporter=dot whenever TypeScript files inside packages/ or apps/studio/src/lib/ changed. Every save immediately verified all 10 Vitest suites totaling 168 passing tests, including static AST checks inside no-dynamic-code.test.ts.
  4. Wiring a custom stdio server implementing the Model Context Protocol (neocard-mcp via .kiro/settings/mcp.json) confirmed that agent tooling and interactive editors could share the exact same validation pipeline.

How does the custom neocard-mcp server build apps over stdio?

The neocard-mcp server exposes five deterministic Model Context Protocol tools (scaffold_stack, validate_stack, describe_stack, list_samples, and export_stack) over standard input and output so Kiro CLI generates verified standalone HTML applications directly from schema templates.

During Kiroween Hackathon 2026 development, invoking neocard-mcp inside Kiro CLI followed four direct steps:

  1. Run scaffold_stack to assemble valid neocard/1 cards, buttons, hidden score fields, and goToCardIf triggers from a specification prompt.
  2. Inspect link targets automatically through validate_stack, catching broken card transitions or orphaned rooms before compiling HTML.
  3. Preview readable card summaries using describe_stack.
  4. Output one standalone file through export_stack, producing the dark theme fourth example stack examples/halloween-escape.html (playable offline from disk).

What can you test inside NeoCard Studio right now?

NeoCard opens directly into three built in applications alongside MacPaint pixel tools, local photo conversion, Card Map graph checking, and Web Audio 880 Hz square wave audio cues.

NeoCard Card Map dialog verifying 12 linked cards and zero broken links inside Manor of 1987

  • Manor of 1987 gives players a 12 card mystery game featuring traveler name interpolation, a password terminal (atkinson), inventory items, courage tracking, and an encounter inside the cellar that triggers Ghostly Modern mode.
  • GrimLedger Mini builds on seven years I spent writing about personal finance, tallying monthly, yearly, and five year zombie subscription bleed locally and generating a copyable cancellation letter.
  • Offline Science Lab presents a five question science quiz designed to work inside classrooms without internet access.
  • Edit Mode and Card Map let creators paint with 12 classic 1 bit patterns, convert photos locally via Atkinson dithering, and verify across every card edge that zero broken links or unreachable cards exist before clicking Export Offline HTML.

Frequently asked questions about NeoCard

Does an exported NeoCard HTML file really work without internet?

Yes. Exporting bundles the compiled runtime, inline styles, Web Audio square wave oscillator (880 Hz), bitmap artwork, and validated JSON data into one HTML file pinned with default-src 'none'. Opening the downloaded file locally via file:// with Wi-Fi off runs every card and button identically.

Where can I inspect the source code and Kiro CLI setup?

All seven workspace packages, the MIT license, the Halloween Escape MCP export, and all 20 .kiro/ specification, steering, hook, and MCP files live publicly at github.com/mentari92/neocard.

Can anyone try NeoCard without installing tools?

Yes. Visit neocard.mentarich.com in any modern browser to play all three built in stacks, test Bill Atkinson dithering, or export your own standalone offline web app without creating an account.

Top comments (0)