Skip to content

PlayPets developer guide ​

Overview and audience ​

  • PlayPets is a desktop companion: friends live in a painted yard window and step out onto the desktop to play.
  • It stays open all day. Connect an AI to a friend to chat with it; friends react while a coding agent works.
  • A Tauri v2 app: the page is web code with no build tool (src/), and the backend is Rust (src-tauri/).
  • Runs on macOS, Windows and Linux.
ReaderWhere to read
People who change the code, build integrations or handle releasesThis guide
People who use the appThe user guide on the site and the repository README
Contributors (PRs, check order)CONTRIBUTING
AI agents and review botsAGENTS.md, a short version of these rules
  • The site also shows these documents, unchanged, under its "Developers" tab.

Getting started ​

New here? Read in this order.

  1. Get the tests passing and start the app: Set up a development environment and run the app.
  2. Read the diagram and data flow in Architecture: PlayPets app. Find the component that owns the part you want to change.
  3. Read the standard for the area you change (the standards table under Area map).
    • Page changes almost always touch Page code structure and Multilingual strings.
    • Backend changes almost always touch Backend locks and threads.
  4. Run the checks in the order CONTRIBUTING gives, then open a PR.
  5. Add one line to CHANGELOG.md for any change users can see.

Key concepts ​

  • One app, two windows:
    • The yard window (the main window) and a transparent desktop window on each monitor that has a friend on it, kept a minute after the last one leaves.
    • Both windows draw only the state the backend holds.
  • Commands and notifications:
    • The page calls the backend through a single window.playPets.<command>().
    • On a state change, the backend sends the new state (change) to the yard window, and the part the desktop draws to each desktop window.
    • Things that happen once are sent as events (event), to the windows that act on them.
  • Pets and friends:
    • A pet is a character file: pet.json plus a sprite sheet, in the Codex pet format.
    • A friend is a pet invited into the yard, with a name, a personality, a size and an AI connection.
  • AI connection:
    • Not needed for ordinary movement, games, gardening and collecting.
    • It lets a friend hold an AI conversation.
    • Claude Code and Codex use their signed-in CLIs.
    • Those CLIs draw on subscription allowances and any paid extra usage. A CLI signed in with an API key can incur separate charges.
    • Ollama, OpenAI, xAI (Grok) and OpenAI-compatible servers use HTTP.
    • Local models have no hosted inference fees.
    • Remote services bill through their provider.
    • API keys saved by PlayPets live only in the OS secure storage.
  • Agent integration:
    • playpets hook … or playpets mcp runs the app executable in CLI mode, with no window.
    • CLI mode sends status to the running app through a local HTTP bridge.
    • Node.js is not needed.
  • Strings tables:
    • Text people read lives in two tables: one for the page, one for the backend.
    • Languages: Korean, English, Japanese and Simplified Chinese.
    • Code uses only keys.
  • Lock rule and page redraws:
    • The backend never waits on the main thread while holding the state lock.
    • The page redraws frequently only while something moves.
    • Together they prevent freezes and battery drain.

Area map ​

Pick a document by what you want to know.

What you want to knowDocument
Getting the repo, running tests and starting the app for the first timeSet up a development environment and run the app
Root settings, directory ownership, generated files and common maintenance commandsRepository layout and tooling
How the app is built and what calls whatArchitecture: PlayPets app
How coding agents reach the app; CLI, HTTP and MCP specsArchitecture: coding agent integration
Adding a backend command the page can callAdd a backend command the page calls
Adding, hiding or reordering community discovery linksAdd or change a discovery site
Adding a selectable indoor or outdoor placeAdd a place for friends
Adding a fish, a bug, a flower or a gift, a drawing or an effect, or changing the sceneryAdd to the yard
Planning richer bundled-companion actions while preserving imported pet sheetsCompanion action design
Reproducing seasonal, game, collection and audio review fixturesVisual review
Setting up once: the updater key, the GitHub repository, secrets, the Homebrew tap, winget, signing accountsSet up the repository, keys and store accounts
Store identity, MSIX submission preparation, Apple certificates and notarizationPrepare Microsoft Store and Apple signing
Releasing a new version and distribution channelsRelease a new version
Changing the site (intro, user guide, version pages)Edit and check the website
Changing the site addressChange the site address
Adding a language the app speaksAdd a language
Where to look first when stuckTroubleshooting guide

Read the standard for an area before you change it.

AreaStandard
Page modules, stylesStandard: Page code structure
Backend concurrencyStandard: Backend locks and threads
Strings and translationStandard: Multilingual strings
Draw loops, animation, overlayStandard: Page and backend performance
TestsStandard: Testing
Branches, commits, what never goes in, historyStandard: Commits, branches and history
Signing keys, tokens, certificatesStandard: Managing signing keys and secrets
Pet filesStandard: Pet file format
README, guides and the site's user guideStandard: Writing docs

Procedures for outages and incidents.

SituationProcedure
Updater signing key lost or leakedThe updater signing key is lost or leaked

Deep dives and reference ​

Decision records: why the structure is the way it is. The standards cite them as their basis.

First public release

Design records and research

Records are dated and never rewritten. When two disagree, the later one holds. The five records of 2026-10-11 and 2026-10-12 consolidate that period's design work (decision).

Repository automation

FileWhat it does
.github/workflows/build.ymlbuild job: lint, test, build and E2E on five environments. site job: builds the site, so a dead link fails the PR. Runs for every PR, on main when the crates or this workflow change, and weekly
.github/workflows/release.ymlBuilds every environment from a version tag into a release draft
.github/workflows/distribute.ymlwinget manifest and Homebrew cask from a published release
.github/workflows/pages.ymlBuilds and publishes GitHub Pages when its source or shared inputs change on main
.github/workflows/codeql.ymlCodeQL analysis of the workflows, JavaScript, Python and Rust on every PR, on main and weekly
.github/workflows/security.ymlpnpm run security:check (redacted Git history, dependency audit, RustSec) on every PR, on main and weekly
.github/workflows/store.ymlAfter a release is published: builds and certifies the Microsoft Store MSIX and sends a new submission, while STORE_SUBMISSION_ENABLED is true
.github/workflows/store-retry.ymlBy hand: sends a published release to Partner Center again with main's submission script
.github/workflows/store-api.ymlBy hand: tests the Store API script, then reads the product with the Store credentials after approval
website/The VitePress site. Developer docs are copied from docs/ at build time
packaging/Local distribution builds (macOS dmg; Linux and Windows through Docker)
scripts/Icon generation, release, distribution file generation, CPU measurement, site preparation, screen capture, mascot pets

Common commands

CommandWhat it does
pnpm testRust unit tests and page tests
pnpm run checkLint, unit tests and site build; run E2E separately
pnpm run test:js / test:rustFocused Node / Rust tests
pnpm run build:app / startBuild the normal native executable / run that existing build
pnpm run assets:auditCheck image dimensions and references; save an inventory under ignored scratch/asset-audit/
pnpm run lint / pnpm run formatCheck / tidy code layout (rustfmt, clippy, Oxlint, Oxfmt)
pnpm run test:e2eReal-app E2E
pnpm run measureCPU measurement in five states (macOS, Linux)
pnpm run site:dev / site:buildSite dev server / build (includes dead link check)
pnpm run shots x.y.zReal-app screenshots in every app language (macOS)
pnpm run ogRedraw the four share cards (website/public/og.png in English, og-ko.png, og-ja.png, og-zh-hans.png) and the README banner
pnpm run artRedraw the installer art (list below)
pnpm run dist:mac, dist:windows, dist:linuxLocal distribution files (release/<platform>/)
pnpm run release x.y.zRelease commit and tag
pnpm run iconsEvery icon from assets/icon.png

What pnpm run art redraws:

  • The macOS disk image background: packaging/macos/dmg-background.png.
  • The Windows installer's sidebar and header: packaging/windows/nsis-*.bmp.
  • The English screenshots Linux software centers show: website/public/listing/en/, from the current captures.
  • Where each is used: src-tauri/tauri.conf.json (bundle.macOS.dmg, bundle.windows.nsis, bundle.linux) and packaging/linux/app.playpets.metainfo.xml.

Frequently asked questions ​

Can I change Windows code without checking it on Windows?

  • Check that it compiles with pnpm run dist:windows (Docker).
  • The CI Windows runner runs E2E.
  • For behavior you only see at run time, such as how windows act, say in the PR description that it still needs checking.

Why does the page have no bundler?

  • The browser reads the page's ES modules as they are.
  • With no build step, the file you edit is the file that runs.
  • Tests enforce the module rules instead.
  • Full reasoning: the decision "Page modules run nothing on import…".

Do I need a signing key to develop?

  • No. Tests, E2E and local distribution builds all run without keys.
  • Keys are used only in CI when a maintainer releases.

How do I change a string?

  • Page sentence: edit src/core/strings/<language>.js.
  • Backend sentence: edit src-tauri/src/i18n/<language>.rs.
  • Change every language together. The Korean file is the reference.
  • Rules: the Multilingual strings standard.

Free and open source under the MIT license. Not affiliated with OpenAI; ChatGPT and Codex are trademarks of OpenAI.