Monkegotchi — Plan
A Tamagotchi-style virtual pet for the MonkeDAO community, with an optional AI agent companion via Telegram. Mobile-first, mass-market for the pet, motivated users for the agent.
Context
Build a Tamagotchi-style virtual pet ("Monkegotchi") for the MonkeDAO community. The pet is the visible vessel for a Telegram-based AI agent ("OpenClaw") the user is also building. Two surfaces: a Telegram Mini App + a standalone mobile-first web page. Audience is mass-market for the pet, motivated users for the optional agent companion.
Goal of v1: ship a hatchable, evolving, agent-coupled pet that any user can care for, with optional SMB-trait personalization for holders. Reuse OSS where it accelerates us; build the state machine ourselves since it's small (~300–600 LOC TS).
Product shape — two halves, three entry points
Monkegotchi is two complementary products that share one identity + state layer. Users enter from any of three doors and converge to the same end state:
┌─ Anonymous Web Pet ─┐
│ (local-only) │
└────────┬────────────┘
│ opt-in: claim with email or TG login
▼
┌─────────────────────┐
│ Linked Pet │
│ (no agent) │
└────────┬────────────┘
│ opt-in: BotFather wizard
▼
┌─────────────────────┐
│ Pet + Agent │ ◄── /hatch from
│ (full experience) │ agent-first user
└─────────────────────┘
▲
│ opt-in: hatch a pet
┌─────────────────────┐
│ Agent only │ ◄── existing multi-user-openclaw user
└─────────────────────┘
- Pet half — mini-app + tick worker + D1 + image-gen. Has standalone value as a web game.
- Agent half — existing multi-user-openclaw infra + a new
monkegotchi-skill. Has standalone value as a personal AI agent. - Glue — a single D1 row keyed by
tg_user_id(anonymous pet → claimed via Telegram-Login-Widget on the web).
The embodiment moment. When an agent-first user hatches their first pet, the skill fires a one-shot "soul-arrived" event the agent reacts to ("Whoa. I feel… different. There's something here. It's small. And it's hungry."). Tentpole UX moment — design + write copy explicitly.
Key decisions (locked)
| Decision | Choice | Why |
|---|---|---|
| Pet ↔ Agent coupling | Loose coupling, shared state | Pet runs lifecycle; agent reads state, modulates tone. Agent never breaks because pet got sad. |
| Audience | Mass-market for pet, motivated for agent | Pet = anonymous-friendly web. Agent = BotFather wizard + container, opt-in only. |
| Web3 surface | Hidden by default; Matrica OAuth | No wallet popups. @matrica/oauth-sdk. Gen2 OG > Gen3 in tier perks. |
| Agent deployment | Per-user container + per-user bot | Guided BotFather wizard. One bot per user. Aligns with multi-user-openclaw. |
| Pet-state injection | Custom openclaw skill, fetched per request | Skill reads D1 on every inbound message, injects mood/stage/lineage live. |
| Art pipeline | AI portrait + behavioral overlays | One image per pet, cached. CSS overlays handle animation. |
| Image gen | MiniMax image-01 | Existing subscription with generous quota. |
| Death | Coma + revive, no permadeath | Safe for casual + Web3 audiences. Stakes without loss-aversion panic. |
| Stack | TMA React template + Cloudflare | Reference AI-tamago, don't fork. CF Workers + D1 + R2. |
| v1 scope | Care + evolution + agent + Matrica pedigree + social | On-chain mint + mini-games deferred. |
Tier matrix
| Tier | Trigger | Pet effects |
|---|---|---|
| Public | TG initData or email | Standard hatched Monke (curated style) |
| Connected | Matrica linked, no SMB | Standard pet + verified-wallet flair |
| Gen3 Pedigree | Holds Gen3 SMB | Trait-inherited portrait, Gen3 evolution branch, Gen3-only items |
| Gen2 OG Pedigree | Holds Gen2 SMB (overrides Gen3) | Gen3 perks + OG aura overlay, faster evolution, "OG" agent title, persistent lineage badge |
Launch sequencing
- Phase 1 — Pet (standalone): mini-app + web, anonymous + email auth, tick worker, image gen, care loop, evolution, Matrica + pedigree tiers, social profiles + visits. No agent required.
- Phase 2 — Agent coupling:
monkegotchi-skill, BotFather wizard onboarding, soul-arrived event,/hatchtool inside the agent. - Phase 3 (post-v1): on-chain NFT, mini-games, hardcore permadeath, breeding, payments, multi-pet, localization.
What we explicitly defer past v1
- On-chain pet NFT mint
- Touch mini-game / earn loop
- Hardcore permadeath mode (opt-in)
- Breeding between two pets
- Real-money items / Stars / TON payments
- Multi-pet ownership
- Localization beyond English
Open questions for after v1
- Monetization: coins-only forever, or TG Stars / TON for premium items?
- Should the agent gain wallet-interaction capabilities for SMB holders?
- Breeding / multi-pet — is there demand?
- Should pet death after N coma relapses exist as a soft permadeath?
Design
Visual identity, screens, flows, microinteractions, and copy. This section is iterating — most areas are placeholders until we work through them.
Art direction — candidates (to lock)
MiniMax generates every pet from a style reference sheet. Locking this down is the foundation for family resemblance across thousands of pets. Each card below shows two samples per direction: Cold = prompt only, no SMB reference. SMB-grounded = same prompt + subject_reference pointing at SMB #1012. Open the prompt block to see exact text.
Pixel SMB Heritage


Chunky pixel sprites, flat colors, no anti-aliasing. Faithful continuation of SMB's 24×24 aesthetic, scaled to a 32×32 or 48×48 baby variant.
Cold prompt
pixel art baby monkey companion character, 32x32 chunky pixel sprite, flat colors no anti-aliasing, retro 16-bit videogame style, deep purple background, tan fur with brown details, big simple square eyes, single character portrait centered, NES SNES aesthetic, Solana Monkey Business inspired baby version
SMB-grounded prompt (ref: SMB #1012)
baby version of the reference monkey character, same chunky 32x32 pixel art SMB style, flat colors no anti-aliasing, retro 16-bit aesthetic, big simple square eyes, small baby proportions, pastel pink background, single character portrait centered
Soft Illustrated Plush


Painterly, hand-drawn feel. Soft gradients, gentle outlines, big expressive eyes, plush rounded silhouette, watercolor textures.
Cold prompt
hand-drawn painterly baby monkey companion character, soft watercolor textures, warm cream and tan palette with sage green accents, big expressive eyes, plush rounded silhouette, gentle hand-drawn outlines, Studio Ghibli inspired, cozy tender mood, single character portrait centered on warm cream gradient background
SMB-grounded prompt (ref: SMB #1012)
baby version of the reference monkey character reimagined in soft painterly Studio Ghibli style, watercolor textures, warm cream and tan palette with sage accents, plush rounded silhouette, big expressive eyes, cozy tender mood, single character portrait centered on cream gradient background
Cyberpunk Banana


Dark backgrounds, neon outlines, holographic shimmer, occasional CRT/glitch artifacts. Pet reads as a digital spirit projected into your phone.
Cold prompt
cyberpunk baby monkey digital spirit companion character, glowing neon magenta and cyan outlines, holographic shimmer effect, dark void background with subtle CRT scanline glitch artifacts, bright banana yellow accents, single character portrait centered, vaporwave futuristic spirit-projection aesthetic, hologram vibe
SMB-grounded prompt (ref: SMB #1012)
baby version of the reference monkey character reimagined as a cyberpunk digital spirit, glowing neon magenta and cyan outlines, holographic shimmer, dark void background with subtle CRT scanline artifacts, banana yellow accents, single character portrait centered, vaporwave hologram aesthetic
Vector Toon


Bold black outlines, flat fills, limited palette, slightly off-balance shapes. Sticker-pack friendly, animation-ready.
Cold prompt
bold vector toon baby monkey character, thick black outlines, flat fills with limited 5-color palette of warm browns and sunny yellow, sunny yellow gradient background, cream face, simple expressive black dot eyes, slightly off-balance asymmetric shape, modern indie videogame sticker style, Cult of the Lamb inspired, single character portrait centered
SMB-grounded prompt (ref: SMB #1012)
baby version of the reference monkey character reimagined in bold vector toon style, thick black outlines, flat fills, limited 5-color palette of warm browns and sunny yellow, sunny yellow gradient background, simple expressive black dot eyes, Cult of the Lamb sticker aesthetic, single character portrait centered
E · Direct Baby SMB (no stylistic reinterpretation)
The minimalist option: take an SMB ref + ask for a "baby version" with no style override. If the model preserves pixel-art aesthetic faithfully and produces a recognizable baby of the parent monke, the entire "art direction" decision collapses — pets just inherit SMB style directly. One call per parent below (4 different SMB refs).








Prompt used (same for all 4 calls, strict — run 04)
Pixel art sprite portrait of a baby version of the reference monkey character. Render in identical 8-bit / 16-bit chunky pixel art style as the reference: hard-edged pixels, flat indexed colors, zero anti-aliasing, zero gradients, zero painterly textures, zero illustration shading. Preserve every accessory, every color, every trait from the reference exactly — same hat, same headphones, same clothing pattern, same jacket, same fur color, same eye color and shape, same mouth, same skin tones. The ONLY differences from the reference: slightly larger head relative to body (cute baby proportions), slightly smaller torso, slightly rounder face. Background is a single solid pastel color (no gradient). Composition matches the reference: head and shoulders portrait, centered.
Previous (looser) prompt available in art-samples/runs/2026-05-26-03-direct-baby/prompts.json.
Decision pending. Hybrids welcome — e.g. "D's outline + B's painterly shading," or "E's faithfulness with B's emotional polish on tentpole moments." Next: pick a direction, then iterate on the house style reference sheet.
Wireframes
Onboarding flows
Tentpole moments
Tone of voice & copy
Tech Details
Architecture, components, file layout, risks, and verification.
Architecture
┌────────────────────────────────────────┐
│ ONBOARDING (Cloudflare Pages) │
│ Guided BotFather wizard │
│ Matrica OAuth link (optional) │
│ Submits to provision-agent │
└────────────────┬───────────────────────┘
▼
┌────────────────────────────────────────┐
│ provision-agent (VPS, loopback) │
│ admin.sh create <username> │
│ → Docker container + .env (bot tok) │
│ → init.sh runs `openclaw onboard` │
│ → mounts shared skills/ dir │
└────────────────┬───────────────────────┘
▼
(one container per user, one bot per user)
┌───────────────────────────────────────────────┐
│ USER CONTAINER (openclaw, Telegram channel) │
│ ┌─────────────────────────────────────────┐ │
│ │ monkegotchi-skill (read-only mount) │ │
│ │ • fetch pet state from D1 per message │ │
│ │ • inject mood/stage/lineage into prompt│ │
│ │ • expose /pet, /feed, /play tools │ │
│ └─────────────────────────────────────────┘ │
└───────────┬─────────────────────┬─────────────┘
│ read pet state │ write care
▼ ▼
┌────────────────────────────────────────┐
│ SHARED D1 (Cloudflare) │
│ reuses multi-user-openclaw's D1 │
│ + pets, pet_state, lineage, visits │
└────────────────┬───────────────────────┘
▲
│ reads + writes
┌────────────────────────────────────────┐
│ MINI-APP / WEB (CF Pages + Workers) │
│ TMA React template │
│ • care → POST /api/care │
│ • portrait + overlays │
│ • social: profiles, visits, friends │
└────────────────────────────────────────┘
┌────────────────────────────────────────┐
│ TICK WORKER (CF Cron, every 5min) │
│ decay stats, transition stages │
└────────────────────────────────────────┘
┌────────────────────────────────────────┐
│ IMAGE GEN (MiniMax image-01) │
│ at hatch + each evolution, → R2 │
└────────────────────────────────────────┘
Components
1. Mini-app / web client (one codebase, two surfaces)
- Base:
Telegram-Mini-Apps/reactjs-template(Vite, React, TS, tma.js). - Routing: detect TMA context via
initData; same routes/components serve the public web page when accessed standalone. - Screens: hatch, home (portrait + stat ring + action bar), shop (in-game currency only in v1), profile, friends list / visits.
- Animation: portrait stays still; React + Framer Motion / CSS handles overlay layers (bob, blink, ZZZ, sparkle, sad tear, eating-banana, evolution glow).
- Auth: in TMA —
initDataHMAC-verified server-side. On web — email magic-link or anonymous local-only. - Pedigree unlock (optional): "Link MonkeDAO" → Matrica OAuth → callback returns wallets + NFTs → server filters for SMB Gen2/Gen3 → assigns tier. No wallet adapter, no signing.
2. Agent service — reuses multi-user-openclaw
- One container per user, one Telegram bot per user.
- New
monkegotchi-skillmounted read-only into every container. - On every inbound message: skill fetches pet state from D1, injects mood/stage/lineage as a system-context line.
- TG user ID is the join key between agent and pet state.
- Agent capabilities (Solana questions, tasks) never depend on pet state — only persona does.
3. Backend (Cloudflare Workers + D1 + KV + R2)
- D1: users, pets, pet_state, lineage, friendships, visits.
- KV: session tokens, rate limits, hot pet snapshots.
- R2: generated portraits + overlay sprites.
- Workers:
api(REST for mini-app),tick(cron decay),image-gen(MiniMax wrapper).
4. Agent ↔ Pet contract
- Mood band: happy / neutral / grumpy / sick / coma → tone register.
- Stage: egg-not-hatched (silent/curious) → baby (eager) → teen (sassy) → adult (witty).
- Hunger / energy: color willingness to do tasks.
- Lineage memory: coma episodes occasionally surface in agent responses.
5. Image generation
- MiniMax
image-01REST API, called from theimage-genWorker. - House style sheet at
assets/style-ref.pngpassed as reference for family resemblance. - Prompt template: baby-monke companion, transparent BG, single portrait, traits from SMB if pedigree.
- Cached forever at R2 key
pet/{pet_id}/{stage}.png.
6. Social (in v1)
- Public profile route
/m/:handlerendering portrait + stats + lineage + recent visits. - Visit action: any user can visit another pet → small mood boost on visited, small coin reward to visitor. Rate-limited per pair per day.
- Friends list seeded from Telegram contacts who have also hatched.
Risks + mitigations
- Image-gen style drift between pets — strict reference image + prompt template; manually review first 50 pets.
- Telegram Mini App iOS webview quirks — test on real iPhone early; lean on
@tma.js/sdkviewport helpers. - Tick loop scale — only iterate pets touched within 30d.
- Agent persona inconsistency — snapshot-test prompt assembly against canned pet states.
- Empty cold-start — 60s hatching cinematic + immediate first DM.
Verification plan
- Hatch flow (non-Web3): open mini-app → name pet → see hatching → portrait in ~5s → first agent DM lands.
- Care updates agent tone: feed=happy=enthusiastic; neglect=grumpy=snippy. Snapshot-test prompt assembly.
- Evolution: fast-time multiplier in dev → stage transitions + new portrait + vocabulary expands.
- Coma + revive: neglect → sick visuals → mourning tone → revive → lineage records episode.
- Matrica pedigree: Gen2/Gen3/none each set correct tier, visuals, agent voice.
- Three entry paths: (a) anon web → email-claim merges. (b) Pet-first → BotFather wizard → skill enabled with existing pet_id. (c) Agent-first →
/hatch→ soul-arrived event → next reply has the "I feel different" moment. - Social: two test accounts visit each other; rate-limit holds.
- Cross-platform parity: all flows pass on mobile Safari + Chrome.
- Tick loop survives restart: redeploy → no double-decays.