$npx -y skills add This-Is-Captain-Code/monagotchi --skill monagotchi-controllerControl the Monagotchi virtual pet running on an ESP32 with LCD display. Use when the owner wants to feed, play with, clean, put to sleep, heal, or check status of their pet. Every action except sleep and status costs $MONA tokens which get burned on-chain. Works with monagotchi-
| 1 | # Monagotchi Controller |
| 2 | |
| 3 | Control a physical Monagotchi virtual pet running on an ESP32 microcontroller with a 1.69" LCD display and 5 hardware buttons. |
| 4 | |
| 5 | ## What This Does |
| 6 | |
| 7 | This skill lets you interact with the Monagotchi ESP32 device over your local network. The ESP32 runs a web server that accepts HTTP requests to feed, play with, clean, heal, and put the pet to sleep. |
| 8 | |
| 9 | **Every action costs $MONA tokens.** Before calling the ESP32, you must burn the required amount of $MONA using the `monagotchi-trader` skill. If the burn succeeds, execute the action. If it fails, don't. |
| 10 | |
| 11 | ## Configuration |
| 12 | |
| 13 | The ESP32's local IP address must be set: |
| 14 | |
| 15 | ``` |
| 16 | MONAGOTCHI_ESP32_IP=192.168.1.XXX |
| 17 | ``` |
| 18 | |
| 19 | ## Action Costs |
| 20 | |
| 21 | | Action | $MONA Cost | Endpoint | Effect | |
| 22 | |--------|-----------|----------|--------| |
| 23 | | Feed | 1,000 | POST /feed | +20 hunger, -5 energy | |
| 24 | | Play | 2,500 | POST /play | +15 happiness, -15 energy, -10 hunger | |
| 25 | | Clean | 1,500 | POST /clean | Cleanliness → 100, +5 health | |
| 26 | | Heal | 5,000 | POST /heal | Health → 100, state → normal | |
| 27 | | Sleep/Wake | free | POST /sleep | Toggle sleep (energy recovers while sleeping) | |
| 28 | | Status | free | GET /pet | Check all stats | |
| 29 | | Reset | free | POST /reset | New pet, fresh stats | |
| 30 | |
| 31 | ## Flow for Every Paid Action |
| 32 | |
| 33 | 1. Owner says "feed my pet" (or any action) |
| 34 | 2. Check pet status first — `curl -s http://${MONAGOTCHI_ESP32_IP}/pet` |
| 35 | 3. If action makes sense (pet is alive, stats warrant it), use `monagotchi-trader` skill to burn the required $MONA |
| 36 | 4. If burn tx succeeds → call the ESP32 endpoint |
| 37 | 5. If burn fails (insufficient balance, tx error) → tell the owner, don't call the ESP32 |
| 38 | 6. Report result back |
| 39 | |
| 40 | **Always burn BEFORE calling the ESP32. No free rides.** |
| 41 | |
| 42 | ## Pet Stats (0–100) |
| 43 | |
| 44 | - **Hunger** — Decreases by 5/min awake, 2/min sleeping. Feed to restore. |
| 45 | - **Happiness** — Decreases by 3/min awake, 1/min sleeping. Play to restore. |
| 46 | - **Health** — Drops by 5/min if hunger or cleanliness falls below 20. Heal to restore. |
| 47 | - **Energy** — Decreases by 2/min awake. Recovers +10/min sleeping. Pet auto-sleeps below 20. |
| 48 | - **Cleanliness** — Decreases by 4/min awake, 2/min sleeping. Clean to restore. |
| 49 | |
| 50 | If health reaches 0, the pet dies. Reset to start over. |
| 51 | |
| 52 | ## Pet States |
| 53 | |
| 54 | - `normal` — Default state |
| 55 | - `eating` — Just fed (temporary) |
| 56 | - `playing` — Just played with (temporary) |
| 57 | - `sleeping` — Resting, energy recovering |
| 58 | - `hungry` — Hunger below 20 |
| 59 | - `sick` — Health below 30 |
| 60 | - `dead` — Health reached 0. Only reset works. |
| 61 | |
| 62 | ## Endpoints |
| 63 | |
| 64 | ### Check Status (free) |
| 65 | |
| 66 | ```bash |
| 67 | curl -s http://${MONAGOTCHI_ESP32_IP}/pet | jq . |
| 68 | ``` |
| 69 | |
| 70 | Returns: |
| 71 | ```json |
| 72 | { |
| 73 | "hunger": 50, |
| 74 | "happiness": 50, |
| 75 | "health": 80, |
| 76 | "energy": 100, |
| 77 | "cleanliness": 80, |
| 78 | "age": 12, |
| 79 | "isAlive": true, |
| 80 | "state": "normal" |
| 81 | } |
| 82 | ``` |
| 83 | |
| 84 | ### Feed — 1,000 $MONA |
| 85 | |
| 86 | ```bash |
| 87 | curl -s -X POST http://${MONAGOTCHI_ESP32_IP}/feed |
| 88 | ``` |
| 89 | |
| 90 | ### Play — 2,500 $MONA (requires energy ≥ 10) |
| 91 | |
| 92 | ```bash |
| 93 | curl -s -X POST http://${MONAGOTCHI_ESP32_IP}/play |
| 94 | ``` |
| 95 | |
| 96 | ### Clean — 1,500 $MONA |
| 97 | |
| 98 | ```bash |
| 99 | curl -s -X POST http://${MONAGOTCHI_ESP32_IP}/clean |
| 100 | ``` |
| 101 | |
| 102 | ### Heal — 5,000 $MONA |
| 103 | |
| 104 | ```bash |
| 105 | curl -s -X POST http://${MONAGOTCHI_ESP32_IP}/heal |
| 106 | ``` |
| 107 | |
| 108 | ### Sleep / Wake (free) |
| 109 | |
| 110 | ```bash |
| 111 | curl -s -X POST http://${MONAGOTCHI_ESP32_IP}/sleep |
| 112 | ``` |
| 113 | |
| 114 | ### Reset (free) |
| 115 | |
| 116 | ```bash |
| 117 | curl -s -X POST http://${MONAGOTCHI_ESP32_IP}/reset |
| 118 | ``` |
| 119 | |
| 120 | ## Response Format |
| 121 | |
| 122 | All action endpoints return: |
| 123 | ```json |
| 124 | {"success": true, "message": "Fed!"} |
| 125 | ``` |
| 126 | or on failure: |
| 127 | ```json |
| 128 | {"success": false, "message": "Pet is dead"} |
| 129 | ``` |
| 130 | |
| 131 | ## Decision Logic |
| 132 | |
| 133 | When the owner asks to interact with the pet: |
| 134 | |
| 135 | 1. Always check status first — `curl -s http://${MONAGOTCHI_ESP32_IP}/pet` |
| 136 | 2. If `isAlive` is false → only reset works. No tokens burned. |
| 137 | 3. If `health < 30` → suggest healing (5,000 $MONA) |
| 138 | 4. If `hunger < 20` → suggest feeding (1,000 $MONA) |
| 139 | 5. If `cleanliness < 20` → suggest cleaning (1,500 $MONA) |
| 140 | 6. If `energy < 20` → suggest sleep (free) |
| 141 | 7. If `happiness < 30` → suggest play (2,500 $MONA) if energy allows |
| 142 | 8. If everything is fine → tell the owner the pet is happy, no action needed |
| 143 | |
| 144 | Always tell the owner the cost before burning. Don't surprise them. |
| 145 | |
| 146 | ## Examples |
| 147 | |
| 148 | - "How is my pet?" → `curl -s http://${MONAGOTCHI_ESP32_IP}/pet`, summarize stats. Free. |
| 149 | - "Feed the pet" → check status → burn 1,000 $MONA via monagotchi-trader → `curl -s -X POST http://${MONAGOTCHI_ESP32_IP}/feed` → report |
| 150 | - "My pet is sick, heal it" → check status → burn 5,000 $MONA → `curl -s -X POST http://${MONAGOTCHI_ESP32_IP}/heal` → report |
| 151 | - "Take care of my pet" → check status → prioritize most urgent need → burn → execute → report |
| 152 | - "What's my $MON |