Game · Spec-Driven Dev · Vanilla JS

Tiny Tamagotchi

A browser virtual pet built spec-first: every behaviour — ticking vitals, the care loop, the sick/evolved state machine, personality quirks — was written as a markdown specification, then translated to vanilla JavaScript on a tiny observer-pattern store. No framework, no canvas, no backend.

Vanilla JS (ESM) Vite Observer store CSS animations Spec-driven Zero deps
tamagotchi/ — live virtual pet
The Tiny Tamagotchi pet with hunger, happiness and energy bars and feed / play / rest buttons
Interactive · feed, play and rest to keep the pet alive against ticking vitals. Open the live pet →

Overview

The point of this one isn't the pet — it's the process. It was built for a spec-driven-development challenge: the rules live in markdown first (mission.md, per-feature requirements.md/feature-plan.md/validation.md), and the code is a faithful translation of those specs. Stats are bounded 0–100, the pet has exactly one evolution and one recovery path, and a delta-time loop keeps the simulation predictable even when the tab is throttled.

What's in it

📉 Ticking vitals

Hunger, happiness and energy drift downward over time on a delta-timed loop, each strictly clamped to 0–100.

🍎 Care actions

Feed, Play and Rest each replenish a specific vital — the only levers the player has against entropy.

🔁 State machine

Defined transitions between Normal, Sick and Evolved, with exactly one recovery path out of sickness.

🎭 Personality

Small textual and visual quirks give the pet character without bloating the scope — faces and lines react to its state.

How it works

The version on this site is the real production build, hosted right here. Open the live pet →