Dev.to WebDev 🛠 Dev 👁 2 📖 2 min read

I Built a Haunted Fridge App Spec-First with Kiro — Here's What the Spec Caught

This post was written as part of the Kiroween 2026 hackathon. Every fridge has a graveyard: the spinach that expired while you ordered takeout, the shrimp you swore you'd cook "tomorrow." For Kiroween 2026's Costume Con

This post was written as part of the Kiroween 2026 hackathon.

Every fridge has a graveyard: the spinach that expired while you ordered takeout, the shrimp you swore you'd cook "tomorrow." For Kiroween 2026's Costume Contest, I built Midnight Pantry — a candlelit web app that ranks your fridge ingredients by expiry urgency (Screaming, Moaning, Whispering, Resting), summons recipes that rescue the most urgent ones first, and counts the "souls saved" when you cook instead of binning food.

The costume is functional: each ingredient's candle-glow intensifies with urgency, so the shelf reads at a glance. But the part I want to talk about is how it was built — spec-first, with Kiro — because the spec caught bugs that vibe coding would have shipped.

The spec came before the code

Before writing a line of JavaScript, the project had a .kiro/specs/midnight-pantry/ folder:

  • requirements.md — seven user stories with acceptance criteria ("WHEN an ingredient has 0–1 days left THEN the system SHALL label it Screaming…").
  • design.md — architecture (pure logic in logic.js, rendering in app.js) plus seven correctness properties for the ranking engine.
  • tasks.md — the implementation plan, each task traced to requirement numbers.

Steering docs pinned the rules that usually get re-argued mid-build: "design must encode urgency, not just decorate," "all decision logic lives in logic.js as pure functions," "tests before commits." Those three sentences settled a dozen micro-decisions without debate.

Property-based testing earned its keep

The design doc specified properties like:

  • Ranking soundness: every summoned recipe uses ≥1 pantry ingredient, and a recipe rescuing more urgent ingredients never ranks below one rescuing fewer.
  • Cook conservation: rescued ∪ remaining = original pantry, with no overlap.
  • Normalization invariance: matching gives identical results for "Eggs", " egg ", and "EGGS".

The test suite checks each property over 500 randomized inputs. The first real failure was a gem: my plural-normalization rule protected words ending in "ss" (thinking of "glass"), so the noisy-input generator produced "herbss" and matching broke. No hand-written example would have tried that. The property did.

The hook loop

An agent hook re-runs the suite whenever logic.js or recipes.js changes. That turns the spec's properties from documentation into a guardrail: tweak the ranking, and within seconds you know whether you broke monotonicity.

What spec-first changed, honestly

Compared with vibe coding the same app, the spec cost maybe 40 minutes up front and saved at least two debugging sessions: the ranking order was never "whatever felt right," and the accessibility rule (urgency always in text, not just glow) was decided before the first pixel, not retrofitted. The one thing the spec didn't do was make the app pretty — that took iteration against the steering rule that spooky design must carry information.

The session pass

The final build step is a Kiro session pass: Kiro reads the spec and steering docs and works the remaining tasks — extending the recipe library and adding property tests — with the save-hook re-running the suite on every edit. I'll update this post with what the session actually produced. The spec is the contract; the session is where it gets exercised.

Midnight Pantry is live and open source (MIT): try the demo, read the code, watch the 2:30 demo video. If your fridge is haunted too, stock the shelf and summon something cursed for dinner. 🎃

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.