Inspiration

Honestly, I missed out on the physical Tamagotchi craze, but I love the idea of digital companions. The problem is, every virtual pet app eventually becomes a chore. You have to open it, press a "Feed" button, and close it. It feels like work.

I spend 10 hours a day coding. My "game" is GitHub. So I thought: Why can't my code be the food?

I wanted to build something that lives on my second monitor and silently judges my productivity. If I'm shipping code, it thrives. If I'm slacking off, it dies. Necro-Pet is basically my way of gamifying my own burnout prevention.

What it does

It's a desktop app (Electron) that sits on your screen.

  • The Hook: It watches my local git repo. When I run git commit, the pet plays an eating animation and gains XP.
  • The Stakes: It has a "Health Decay" mechanic. If I don't commit code for 48 hours, the pet actually "dies" and turns into a ghost.
  • The Resurrection: To get it back, I have to make a commit with the word "resurrect" in the message.
  • The World: I hooked it up to a real-time weather API. If it's raining at my house, it starts raining in the pet's crypt.

How I built it

This was a solo project, and I had a tight deadline, so I leaned heavily on Kiro to act as my pair programmer.

  • The Logic: I'm not a game dev, so balancing the "XP math" was daunting. I just wrote a Markdown file explaining how I wanted the leveling to work ("Egg -> Larva -> Beast"), and Kiro generated the entire TypeScript logic for me.
  • The Agent Hook: This is my favorite part. I didn't want to bloat the app with git logic. I created a Kiro Agent Hook that intercepts my commits in the terminal. It analyzes the diff (e.g., "deleted 10 lines") and writes a funny "medieval fantasy" log entry to a file. The app just reads that file. It feels like magic.
  • MCP: I used the Model Context Protocol to grab weather data. Instead of writing fetch requests and dealing with API keys, I just told the agent "use the weather tool," and it handled the rest.

Challenges I ran into

The hardest part was the "Infinite Eating Loop." At one point, the pet would save its own stats to a JSON file. The file watcher would see that save, think "Oh, a file changed!", and try to feed the pet again. The pet basically ate itself to death in 5 seconds. I had to rewrite the watcher logic to strictly differentiate between user activity (commits) and app activity (auto-saves).

Accomplishments that I'm proud of

  • It actually works. I've been using it while building it, and seeing the little guy evolve because I fixed a bug gave me a genuine dopamine hit.
  • The Aesthetic. I spent way too much time getting the pixel-art font and the terminal-green glow just right. It feels like a piece of software from a haunted 90s mainframe.

What's next

I want to make it a Desktop Widget so it can live on my taskbar without the window border. I also want to add "Multiplayer Graveyards" so I can see if my friends are keeping their pets alive (or if they're ghosting their projects too).

Built With

Share this project:

Updates